Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
splash.c
Go to the documentation of this file.
1/* The still screen (SPLASH_FILE) */
2
3#include "menus/title.h"
4
5/* Draws the still screen at its fade (the European version has a picture for each
6 group of languages) */
8 SpriteDrawer sprite;
9#if VERSION_EU || VERSION_JP
10 /* the screen has a frame per group of languages */
11 s32 frame = 0;
12
13 switch (LANGUAGE) {
14 case 0:
15 case 1:
16 case 2:
17 frame = 0;
18 break;
19 case 3:
20 case 6:
21 frame = 2;
22 break;
23 case 4:
24 frame = 3;
25 break;
26 case 5:
27 frame = 1;
28 break;
29 }
30#endif
31
32 initSpriteDrawer(&sprite);
34 sprite.setTexture(0x280, 0);
35 sprite.setClutRow(task->fade);
36#if VERSION_US
37 sprite.draw(FILE_CACHE.getEntry(SPLASH_SPRITES), 0, 0, 0);
38#elif VERSION_EU || VERSION_JP
39 sprite.draw(FILE_CACHE.getEntry(SPLASH_SPRITES), frame, 0, 0);
40#endif
41}
42
43/* The still screen's task: fades it in, waits 2 seconds, then for Start or five
44 minutes, fades it out and a second later goes on to MODE_OPENING */
46 switch (task->state) {
47 case TASK_INIT:
48 default:
49 task->nextState(task);
50 task->fade = 15;
51 task->timer = 0;
52 SOUND.stopAll();
53 break;
54 case TASK_RUN:
55 switch (task->substate) {
56 case 0:
57 default:
58 if (task->timer >= 2) {
59 task->timer -= 2;
60 if (--task->fade <= 0) {
61 task->setSubstate(task, 1);
62 task->timer = 0;
63 }
64 }
65 break;
66 case 1:
67 if (task->timer >= 120) {
68 task->nextSubstate(task);
69 task->timer = 0;
70 }
71 break;
72 case 2:
74 task->timer = 18000;
75 }
76 if (task->timer >= 18000) {
77 task->nextSubstate(task);
78 task->timer = 0;
79 }
80 break;
81 case 3:
82 if (task->timer >= 2) {
83 task->timer -= 2;
84 if (++task->fade >= 15) {
85 task->nextSubstate(task);
86 task->timer = 0;
87 }
88 }
89 break;
90 case 4:
91 if (task->timer >= 60) {
92 task->nextSubstate(task);
93 task->timer = 0;
94 }
95 break;
96 case 5:
98 task->setState(task, TASK_KILL);
99 break;
100 }
101 task->timer += GFX.funcs.getFrameTime();
103 break;
104 case TASK_DONE:
105 case TASK_KILL:
106 break;
107 }
108}
109
110/* Creates the still screen (task) */
signed int s32
Definition common.h:11
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
s32 LANGUAGE
The European version's settings, in the small data (.sdata) between file/file_table....
Definition eu_settings.c:13
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define MODE_OPENING
STDWTITL's first movie.
Definition game_state.h:439
#define PAD_START
Definition pad.h:21
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
Definition pad.h:140
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
SplashTask * STDWTITL_startSplashTask(void)
Creates the still screen (task)
Definition splash.c:111
void STDWTITL_tickSplash(SplashTask *task)
The still screen's task: fades it in, waits 2 seconds, then for Start or five minutes,...
Definition splash.c:45
void STDWTITL_drawSplash(SplashTask *task)
Draws the still screen at its fade (the European version has a picture for each group of languages)
Definition splash.c:7
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
void(* requestMode)(s32 mode, s32 arg)
Definition game_state.h:21
GameFuncs funcs
Definition game_state.h:582
s32(* getFrameTime)(void)
Definition gfx.h:32
GfxFuncs funcs
Definition gfx.h:77
void(* stopAll)(void)
Definition sound.h:194
Mode 12.
Definition title.h:72
void(* nextState)(struct SplashTask *task)
Definition title.h:73
s16 fade
sprite frame: 15 is black, 0 fully visible
Definition title.h:74
s16 timer
Definition title.h:75
void(* setSubstate)(struct SplashTask *task, s32 substate)
Definition title.h:73
s32 substate
Definition title.h:73
void(* setState)(struct SplashTask *task, s32 state)
Definition title.h:73
void(* nextSubstate)(struct SplashTask *task)
Definition title.h:73
s32 state
Definition title.h:73
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
Definition gfx.h:223
void(* setLayerId)()
(id, depth)
Definition gfx.h:244
void(* setClutRow)()
(row)
Definition gfx.h:247
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
STDWTITL.PRO: the title screen, the opening movies and a notice screen.
#define SPLASH_SPRITES
Definition title.h:41
#define STDWTITL_SPLASH_LAYER
Draw layers of the screens.
Definition title.h:29