Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
country_select.c
Go to the documentation of this file.
2
4RECT CNTY_SEL_vramRect = {0, 0, 1024, 512};
5/* A little larger than the screen */
6RECT CNTY_SEL_fadeRect = {0, -15, 320, 260};
7
8/* Sprite frames of the chosen option once Start is pressed */
10 {8, 4}, {9, 4}, {10, 4}, {11, 30}, {0xFF, 999},
11};
12
13/* Opening (0) and closing (1) tweens of each panel's scale */
15 {10, 0x1000, 0},
16 {5, 0, 0x1000},
17};
19 {10, 0x1000, 0},
20 {5, 0, 0x1000},
21};
23 {10, 0x1000, 0},
24 {5, 0, 0x1000},
25};
26
27#if VERSION_EU
28/* The language of each option */
29u8 CNTY_SEL_languages[] = {2, 3, 5, 4, 6, 1, 0};
30#endif
31
32/* The mode's root task: once the sound bank is loaded, sets up the display and the layer,
33 uploads the images, creates the screen's controller and starts the music; stops the
34 music when killed */
36 TimLoader loader;
37 Layer *layer;
38
39 switch (task->state) {
40 case TASK_INIT:
41 default:
42 /* Wait for the sound bank requested by CNTY_SEL_start */
43 if (SOUND.isLoading() == 0) {
44 /* Free every draw layer, get two 0xA000-byte primitive buffers
45 and a 320x240 display */
46 GFX.funcs.reset();
49 /* Upload the images to VRAM from (640, 0), their CLUTs from (0, 496) */
50 initTimLoader(&loader);
51 loader.setImagePos(0x280, 0);
52 loader.setClutPos(0, 0x1F0);
54 /* A full-screen layer cleared to dark gray */
56 layer->setBgColor(layer, 0x1F, 0x1F, 0x1F);
57 *menu = CNTY_SEL_startMenuTask();
58 task->nextState(task);
60 }
61 break;
62 case TASK_RUN:
63 case TASK_DONE:
64 break;
65 case TASK_KILL:
67 break;
68 }
69}
70
71/* The mode's entry point (MODE_ENTRY_POINTS): clears VRAM, starts the root task and
72 loads the screen's sound bank */
74 Task *task;
75
76 ClearImage2(&CNTY_SEL_vramRect, 0, 0, 0);
77 task = createTask(CNTY_SEL_tickScreen, sizeof(Task), sizeof(CountryMenuTask *));
79 return task;
80}
81
82/* Draws the background, moved diagonally by half its scroll */
84 SpriteDrawer sprite;
85 s32 offset;
86
87 initSpriteDrawer(&sprite);
88 sprite.setLayerId(CNTY_SEL_LAYER, 1);
89 sprite.setTexture(0x280, 0);
90 /* The background repeats every 96 pixels */
91 offset = (s16)((s16)(task->scroll / 2) % 96);
93}
94
95/* How dark the fade-out is on its frame `time`: 0 to 255 over 30 frames */
97 if (time >= 30) {
98 return 255;
99 }
100 return time * 255 / 30;
101}
102
103/* Darkens the whole screen by level (0 to 255, 255 is black) */
106 u_long *ot = layer->getOtEntry(layer, 0);
107 POLY_F4 *poly = GFX.funcs.getPrim();
108 DR_TPAGE *mode;
109
110 setlen(poly, 5);
111 poly->r0 = poly->g0 = poly->b0 = level;
112 setcode(poly, 0x2A); /* semi-transparent POLY_F4 */
113 poly->x0 = CNTY_SEL_fadeRect.x;
114 poly->x1 = CNTY_SEL_fadeRect.x + CNTY_SEL_fadeRect.w;
115 poly->x2 = CNTY_SEL_fadeRect.x;
116 poly->x3 = CNTY_SEL_fadeRect.x + CNTY_SEL_fadeRect.w;
117 poly->y0 = CNTY_SEL_fadeRect.y;
118 poly->y1 = CNTY_SEL_fadeRect.y;
119 poly->y2 = CNTY_SEL_fadeRect.y + CNTY_SEL_fadeRect.h;
120 poly->y3 = CNTY_SEL_fadeRect.y + CNTY_SEL_fadeRect.h;
121 /* the texture page packet goes right after the polygon */
122 mode = (DR_TPAGE *)(poly + 1);
123 addPrim(ot, poly);
124 /* Blending mode 2: subtract the polygon's color from the screen */
125 setDrawTPage(mode, 0, 1, getTPage(0, 2, 320, 0));
126 addPrim(ot, mode);
127 GFX.funcs.setPrim(mode + 1);
128}
129
130/* The background's task: scrolls and draws it; when done, keeps it scrolling while the
131 screen fades to black over 30 frames, then ends */
133 switch (task->state) {
134 case TASK_INIT:
135 default:
136 task->nextState(task);
137 task->scroll = 0;
138 break;
139 case TASK_RUN:
140 task->scroll = (s16)(task->scroll + 1) % 192;
142 break;
143 case TASK_DONE:
144 if (task->substate == 0) {
145 task->fade = 0;
146 task->substate = 1;
147 }
148 task->scroll = (s16)(task->scroll + 1) % 192;
151 if (task->fade >= 30) {
152 task->setState(task, TASK_KILL);
153 }
154 break;
155 case TASK_KILL:
156 break;
157 }
158}
159
160/* Creates the scrolling background (task) */
164
165/* Advances anim by the frames elapsed and returns the frame to show (0xFF at the end) */
167 AnimFrame *frame = &frames[anim->index];
168 s32 elapsed = GFX.funcs.getFrameTime();
169
170 if (elapsed > 4) {
171 elapsed = 4;
172 }
173 if (depth == 0) {
174 anim->timer -= elapsed;
175 }
176 if (anim->timer <= 0) {
177 frame++;
178 anim->index++;
179 anim->timer += frame->duration;
180 if (frame->frame == 0xFF) {
181 return 0xFF;
182 }
183 /* Skip the frames that were shorter than the time elapsed */
184 CNTY_SEL_stepAnimation(anim, frames, depth + 1);
185 }
186 return frame->frame;
187}
188
189/* Draws the highlighted option, in the colors of the CLUT row of its current frame */
191 SpriteDrawer sprite;
192
193 initSpriteDrawer(&sprite);
194 sprite.setLayerId(CNTY_SEL_LAYER, 1);
195 sprite.setTexture(0x280, 0);
196 sprite.setClutRow(task->frame);
198}
199
200/* Moves the highlight to option `selection` (CursorTask.setSelection) */
202 task->selection = selection;
203}
204
205/* The highlighted option's task: blinks it through 8 CLUT rows, 4 frames each; when
206 done (Start pressed), flashes it with CNTY_SEL_cursorFlash, then ends */
208 s16 frame;
209
210 switch (task->state) {
211 case TASK_INIT:
212 default:
213 task->nextState(task);
214 break;
215 case TASK_RUN:
216 task->blink++;
217 task->blink %= 32;
218 task->frame = task->blink / 4;
220 break;
221 case TASK_DONE:
222 if (task->substate == 0) {
223 task->anim.index = 0;
225 task->substate++;
226 }
228 task->frame = frame;
229 if (frame != 0xFF) {
231 } else {
232 task->setState(task, TASK_KILL);
233 }
234 break;
235 case TASK_KILL:
236 break;
237 }
238}
239
240/* Creates the highlighted option (task), once the panels are open */
247
248/* The top panel's height scale on the current frame of its opening (phase 0) or
249 closing (1) */
251 s32 time = task->time;
252 s32 duration = CNTY_SEL_topPanelTweens[phase].duration;
253
254 if (time >= duration) {
255 return CNTY_SEL_topPanelTweens[phase].to;
256 }
257 return CNTY_SEL_topPanelTweens[phase].from +
258 (CNTY_SEL_topPanelTweens[phase].to - CNTY_SEL_topPanelTweens[phase].from) * time / duration;
259}
260
261/* Draws the top panel, its height scaled from its top edge */
263 SpriteDrawer sprite;
264
265 initSpriteDrawer(&sprite);
266 sprite.setLayerId(CNTY_SEL_LAYER, 1);
267 sprite.setTexture(0x280, 0);
268 sprite.setPivot(148, 0);
269 sprite.setScale(task->scaleX, task->scaleY, ONE);
271}
272
273/* The top panel's task: draws it; each TASK_DONE from the controller opens it, the
274 next one closes it */
276 s16 phase;
277
278 switch (task->state) {
279 case TASK_INIT:
280 default:
281 task->nextState(task);
282 task->scaleX = ONE;
283 task->scaleY = 0;
284 task->phase = 0;
285 break;
286 case TASK_RUN:
287 switch (task->substate) {
288 case 0:
289 break;
290 case 1:
291 phase = task->phase;
292 if (CNTY_SEL_topPanelTweens[phase].duration < task->time++) {
293 task->phase ^= 1;
294 task->setSubstate(task, 0);
295 task->scaleY = CNTY_SEL_topPanelTweens[phase].to;
296 } else {
297 task->scaleY = CNTY_SEL_getTopPanelScale(task, phase);
298 }
299 break;
300 }
302 break;
303 case TASK_DONE:
304 task->time = 0;
305 task->setState(task, TASK_RUN);
306 task->setSubstate(task, 1);
308 break;
309 case TASK_KILL:
310 break;
311 }
312}
313
314/* Creates the top panel (task), closed */
318
319/* The right panel's width scale on the current frame of its opening (phase 0) or
320 closing (1) */
322 s32 time = task->time;
323 s32 duration = CNTY_SEL_rightPanelTweens[phase].duration;
324
325 if (time >= duration) {
326 return CNTY_SEL_rightPanelTweens[phase].to;
327 }
328 return CNTY_SEL_rightPanelTweens[phase].from +
329 (CNTY_SEL_rightPanelTweens[phase].to - CNTY_SEL_rightPanelTweens[phase].from) * time / duration;
330}
331
332/* Draws the right panel, its width scaled from the screen's right edge */
334 SpriteDrawer sprite;
335
336 initSpriteDrawer(&sprite);
337 sprite.setLayerId(CNTY_SEL_LAYER, 1);
338 sprite.setTexture(0x280, 0);
339 sprite.setPivot(320, 20);
340 sprite.setScale(task->scaleX, task->scaleY, ONE);
342}
343
344/* The right panel's task: draws it; each TASK_DONE from the controller opens it, the
345 next one closes it */
347 s16 phase;
348
349 switch (task->state) {
350 case TASK_INIT:
351 default:
352 task->nextState(task);
353 task->scaleY = ONE;
354 task->scaleX = 0;
355 task->phase = 0;
356 break;
357 case TASK_RUN:
358 switch (task->substate) {
359 case 0:
360 break;
361 case 1:
362 phase = task->phase;
363 if (CNTY_SEL_rightPanelTweens[phase].duration < task->time++) {
364 task->phase ^= 1;
365 task->setSubstate(task, 0);
366 task->scaleX = CNTY_SEL_rightPanelTweens[phase].to;
367 } else {
368 task->scaleX = CNTY_SEL_getRightPanelScale(task, phase);
369 }
370 break;
371 }
373 break;
374 case TASK_DONE:
375 task->time = 0;
376 task->setState(task, TASK_RUN);
377 task->setSubstate(task, 1);
379 break;
380 case TASK_KILL:
381 break;
382 }
383}
384
385/* Creates the right panel (task), closed */
389
390/* The left panel's width scale on the current frame of its opening (phase 0) or
391 closing (1) */
393 s32 time = task->time;
394 s32 duration = CNTY_SEL_leftPanelTweens[phase].duration;
395
396 if (time >= duration) {
397 return CNTY_SEL_leftPanelTweens[phase].to;
398 }
399 return CNTY_SEL_leftPanelTweens[phase].from +
400 (CNTY_SEL_leftPanelTweens[phase].to - CNTY_SEL_leftPanelTweens[phase].from) * time / duration;
401}
402
403/* Draws the left panel, with its own CLUT, its width scaled from the screen's left
404 edge */
406 SpriteDrawer sprite;
407
408 initSpriteDrawer(&sprite);
409 sprite.setLayerId(CNTY_SEL_LAYER, 1);
410 sprite.setTexture(0x280, 0);
411 sprite.setAltClut(0, 0x1F0);
412 sprite.setPivot(0, 158);
413 sprite.setScale(task->scaleX, task->scaleY, ONE);
415}
416
417/* The left panel's task: draws it; each TASK_DONE from the controller opens it, the
418 next one closes it */
420 s16 phase;
421
422 switch (task->state) {
423 case TASK_INIT:
424 default:
425 task->nextState(task);
426 task->scaleY = ONE;
427 task->scaleX = 0;
428 task->phase = 0;
429 break;
430 case TASK_RUN:
431 switch (task->substate) {
432 case 0:
433 break;
434 case 1:
435 phase = task->phase;
436 if (CNTY_SEL_leftPanelTweens[phase].duration < task->time++) {
437 task->phase ^= 1;
438 task->setSubstate(task, 0);
439 task->scaleX = CNTY_SEL_leftPanelTweens[phase].to;
440 } else {
441 task->scaleX = CNTY_SEL_getLeftPanelScale(task, phase);
442 }
443 break;
444 }
446 break;
447 case TASK_DONE:
448 task->time = 0;
449 task->setState(task, TASK_RUN);
450 task->setSubstate(task, 1);
452 break;
453 case TASK_KILL:
454 break;
455 }
456}
457
458/* Creates the left panel (task), closed */
462
463/* Moves the highlighted option with the pad */
464static inline void moveSelection(CountryMenuTask *task) {
465 /* Options 0-4 are a column moved through with Up and Down. Options 5
466 and 6 are a second one reached with step 1, which nothing sets */
467 switch (task->step) {
468 case 0:
469 default:
471 if (task->selection > 0) {
473 task->selection--;
474 }
475 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
476 if (task->selection < 4) {
478 task->selection++;
479 }
480 } else if (PAD_PRESSED(PAD_LEFT)) {
481 /* Left does nothing in this column */
482 }
483 break;
484 case 1:
486 if (task->selection != 6) {
488 }
489 task->selection = 6;
491 if (task->selection == 6) {
493 task->selection = 5;
494 } else {
495 task->selection = 1;
497 task->setStep(task, 0);
498 }
499 }
500 break;
501 }
502}
503
504/* The screen's controller: opens the panels one after the other and lets the player
505 pick an option with Up and Down until Start, which in the European version sets
506 LANGUAGE; then flashes it, closes the panels, fades out and moves on to the next mode */
508 switch (task->state) {
509 case TASK_INIT:
510 default:
515 task->selection = 0;
516 task->timer = 0;
517 task->nextState(task);
518 break;
519 case TASK_RUN:
520 switch (task->substate) {
522 default:
523 children->rightPanel->setState(children->rightPanel, TASK_DONE);
524 task->timer = 0;
525 task->nextSubstate(task);
526 break;
528 if (task->timer++ >= 6) {
529 task->nextSubstate(task);
530 }
531 break;
533 task->timer = 0;
534 children->leftPanel->setState(children->leftPanel, TASK_DONE);
535 task->nextSubstate(task);
536 break;
538 if (task->timer++ >= 11) {
539 task->nextSubstate(task);
540 }
541 break;
543 task->timer = 0;
544 children->topPanel->setState(children->topPanel, TASK_DONE);
545 task->nextSubstate(task);
546 break;
548 if (task->timer++ >= 6) {
549 task->nextSubstate(task);
550 }
551 break;
552 case MENU_SHOW_CURSOR:
553 children->cursor = CNTY_SEL_startCursorTask();
554 task->nextSubstate(task);
555 break;
556 case MENU_SELECT:
557 if (PAD_PRESSED(PAD_START)) {
559 children->cursor->setState(children->cursor, TASK_DONE);
560 task->nextSubstate(task);
561 task->timer = 0;
562#if VERSION_EU
564#endif
565 } else {
566 moveSelection(task);
567 }
568 children->cursor->setSelection(children->cursor, task->selection);
569 break;
570 case MENU_WAIT_FLASH:
571 if (++task->timer >= 43) {
572 task->nextSubstate(task);
573 }
574 break;
576 children->rightPanel->setState(children->rightPanel, TASK_DONE);
577 children->leftPanel->setState(children->leftPanel, TASK_DONE);
578 children->topPanel->setState(children->topPanel, TASK_DONE);
579 task->timer = 0;
580 task->nextSubstate(task);
581 break;
582 case MENU_WAIT_PANELS:
583 if (++task->timer >= 6) {
584 task->nextSubstate(task);
585 }
586 break;
587 case MENU_FADE_OUT:
588 children->background->setState(children->background, TASK_DONE);
589 task->nextSubstate(task);
590 break;
591 case MENU_WAIT_FADE:
592 if (++task->timer >= 31) {
593 task->nextSubstate(task);
594 }
595 break;
596 case MENU_EXIT:
597#if VERSION_US || VERSION_JP
599#elif VERSION_EU
600 if (LANGUAGE == 0) {
602 } else {
604 }
605#endif
606 task->setState(task, TASK_KILL);
607 break;
608 }
609 break;
610 case TASK_DONE:
611 case TASK_KILL:
612 break;
613 }
614}
615
616/* Creates the screen's controller (task), which starts the background and panels */
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned char u8
Definition common.h:8
CountryMenuTask * CNTY_SEL_startMenuTask(void)
Creates the screen's controller (task), which starts the background and panels.
PanelTask * CNTY_SEL_startLeftPanelTask(void)
Creates the left panel (task), closed.
void CNTY_SEL_setCursorSelection(CursorTask *task, s16 selection)
Moves the highlight to option selection (CursorTask.setSelection)
s32 CNTY_SEL_getTopPanelScale(PanelTask *task, s32 phase)
The top panel's height scale on the current frame of its opening (phase 0) or closing (1)
void CNTY_SEL_tickTopPanel(PanelTask *task)
The top panel's task: draws it; each TASK_DONE from the controller opens it, the next one closes it.
PanelTask * CNTY_SEL_startTopPanelTask(void)
Creates the top panel (task), closed.
PanelTween CNTY_SEL_rightPanelTweens[]
Task * CNTY_SEL_start(void)
The mode's entry point (MODE_ENTRY_POINTS): clears VRAM, starts the root task and loads the screen's ...
s32 CNTY_SEL_getRightPanelScale(PanelTask *task, s32 phase)
The right panel's width scale on the current frame of its opening (phase 0) or closing (1)
RECT CNTY_SEL_screenRect
void CNTY_SEL_drawLeftPanel(PanelTask *task)
Draws the left panel, with its own CLUT, its width scaled from the screen's left edge.
void CNTY_SEL_tickRightPanel(PanelTask *task)
The right panel's task: draws it; each TASK_DONE from the controller opens it, the next one closes it...
void CNTY_SEL_tickBackground(CountryBackgroundTask *task)
The background's task: scrolls and draws it; when done, keeps it scrolling while the screen fades to ...
void CNTY_SEL_tickMenu(CountryMenuTask *task, MenuChildren *children)
The screen's controller: opens the panels one after the other and lets the player pick an option with...
PanelTask * CNTY_SEL_startRightPanelTask(void)
Creates the right panel (task), closed.
void CNTY_SEL_drawTopPanel(PanelTask *task)
Draws the top panel, its height scaled from its top edge.
u8 CNTY_SEL_languages[]
The language of each option.
void CNTY_SEL_drawBackground(CountryBackgroundTask *task)
Draws the background, moved diagonally by half its scroll.
CountryBackgroundTask * CNTY_SEL_startBackgroundTask(void)
Creates the scrolling background (task)
s32 CNTY_SEL_getFadeLevel(s32 time)
How dark the fade-out is on its frame time: 0 to 255 over 30 frames.
void CNTY_SEL_tickCursor(CursorTask *task)
The highlighted option's task: blinks it through 8 CLUT rows, 4 frames each; when done (Start pressed...
void CNTY_SEL_drawFade(s32 level)
Darkens the whole screen by level (0 to 255, 255 is black)
RECT CNTY_SEL_vramRect
s16 CNTY_SEL_stepAnimation(AnimState *anim, AnimFrame *frames, s32 depth)
Advances anim by the frames elapsed and returns the frame to show (0xFF at the end)
s32 CNTY_SEL_getLeftPanelScale(PanelTask *task, s32 phase)
The left panel's width scale on the current frame of its opening (phase 0) or closing (1)
CursorTask * CNTY_SEL_startCursorTask(void)
Creates the highlighted option (task), once the panels are open.
void CNTY_SEL_drawRightPanel(PanelTask *task)
Draws the right panel, its width scaled from the screen's right edge.
void CNTY_SEL_drawCursor(CursorTask *task)
Draws the highlighted option, in the colors of the CLUT row of its current frame.
void CNTY_SEL_tickLeftPanel(PanelTask *task)
The left panel's task: draws it; each TASK_DONE from the controller opens it, the next one closes it.
PanelTween CNTY_SEL_topPanelTweens[]
Opening (0) and closing (1) tweens of each panel's scale.
AnimFrame CNTY_SEL_cursorFlash[]
Sprite frames of the chosen option once Start is pressed.
void CNTY_SEL_tickScreen(Task *task, CountryMenuTask **menu)
The mode's root task: once the sound bank is loaded, sets up the display and the layer,...
LeftPanelTween CNTY_SEL_leftPanelTweens[]
static void moveSelection(CountryMenuTask *task)
Moves the highlighted option with the pad.
RECT CNTY_SEL_fadeRect
A little larger than the screen.
CNTY_SEL.PRO: the country select screen.
#define SPRITE_BACKGROUND
Sprites in the sprite bank.
@ MENU_FADE_OUT
@ MENU_WAIT_FLASH
@ MENU_OPEN_RIGHT_PANEL
@ MENU_SELECT
@ MENU_CLOSE_PANELS
@ MENU_WAIT_LEFT_PANEL
@ MENU_OPEN_LEFT_PANEL
@ MENU_OPEN_TOP_PANEL
@ MENU_SHOW_CURSOR
@ MENU_EXIT
@ MENU_WAIT_FADE
@ MENU_WAIT_PANELS
@ MENU_WAIT_RIGHT_PANEL
@ MENU_WAIT_TOP_PANEL
#define CNTY_SEL_IMAGES
TIM archive for VRAM.
#define CNTY_SEL_SOUND_BANK
Sounds (SOUND.playSound)
#define SPRITE_OPTIONS
one per option
#define SPRITE_TOP_PANEL
#define SPRITE_RIGHT_PANEL
#define CNTY_SEL_LAYER
Draw layer of the screen.
#define CNTY_SEL_SPRITES
sprite bank
#define CNTY_SEL_MUSIC
#define SPRITE_LEFT_PANEL
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_2
STDWTITL's second opening movie: LANGUAGE 0 alternates the two, the others play only it.
Definition game_state.h:444
#define MODE_OPENING
STDWTITL's first movie.
Definition game_state.h:439
#define SCREEN_WIDTH
The screen the modes draw on (setDisplayMode, their layers' rects)
Definition gfx.h:36
#define SCREEN_HEIGHT
Definition gfx.h:37
#define PAD_START
Definition pad.h:21
#define PAD_DOWN
Definition pad.h:24
#define PAD_RIGHT
Definition pad.h:23
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
Definition pad.h:140
#define PAD_UP
Definition pad.h:22
#define PAD_LEFT
Definition pad.h:25
#define PAD_REPEATED(button)
Definition pad.h:141
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
#define SOUND_MENU_CONFIRM
SYSTEM07.
Definition sound.h:44
#define SOUND_MENU_MOVE
SYSTEM06.
Definition sound.h:43
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
s16 frame
Definition gfx.h:297
s16 duration
Definition gfx.h:298
s16 index
Definition gfx.h:302
s16 timer
Definition gfx.h:303
The scrolling background, which also fades the screen out.
void(* nextState)(struct CountryBackgroundTask *task)
void(* setState)(struct CountryBackgroundTask *task, s32 state)
The screen's controller.
void(* setStep)(struct CountryMenuTask *task, s32 step)
void(* nextState)(struct CountryMenuTask *task)
void(* setState)(struct CountryMenuTask *task, s32 state)
void(* nextSubstate)(struct CountryMenuTask *task)
The highlighted option.
AnimState anim
void(* nextState)(struct CursorTask *task)
void(* setSelection)(struct CursorTask *task, s16 selection)
void(* setState)(struct CursorTask *task, s32 state)
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
void *(* getPrim)(void)
Definition gfx.h:19
void(* reset)(void)
Definition gfx.h:17
s32(* getFrameTime)(void)
Definition gfx.h:32
void(* allocPrimBuffers)(s32 size)
Definition gfx.h:18
struct Layer *(* createLayer)(RECT *rect, s32 otShift, s32 id)
Definition gfx.h:24
struct Layer *(* getLayer)(s32 id)
Definition gfx.h:28
void(* setPrim)(void *next)
Definition gfx.h:20
void(* setDisplayMode)(s32 w, s32 h, s32 hires, s32 interlace)
Definition gfx.h:26
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
u_long *(* getOtEntry)(struct Layer *, s32 depth)
Definition gfx.h:155
void(* setBgColor)()
no prototype: callers would truncate u8 args
Definition gfx.h:152
PanelTask * rightPanel
PanelTask * topPanel
CountryBackgroundTask * background
CursorTask * cursor
PanelTask * leftPanel
A panel that opens and closes by scaling.
void(* nextState)(struct PanelTask *task)
void(* setState)(struct PanelTask *task, s32 state)
void(* setSubstate)(struct PanelTask *task, s32 substate)
s16 phase
0: opening, 1: closing
A linear tween of a panel's scale.
s32(* isLoading)(void)
Definition sound.h:193
void(* stopSound)(s32 id)
Definition sound.h:195
void(* loadBank)(s32 id)
Definition sound.h:190
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
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(* setAltClut)()
(x, y)
Definition gfx.h:243
void(* setPivot)()
(x, y)
Definition gfx.h:250
void(* setScale)()
(x, y, z), ONE = 1.0
Definition gfx.h:248
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
Any task, seen through its header.
Definition task.h:62
void(* nextState)(struct Task *task)
Definition task.h:63
s32 state
Definition task.h:63
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
Definition gfx.h:325
void(* setClutPos)()
(x, y)
Definition gfx.h:337
void(* setImagePos)()
(x, y)
Definition gfx.h:336
void(* loadArchive)()
(archive): each image 64 halfwords to the right
Definition gfx.h:338
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
Definition tim_loader.c:119