10 {8, 4}, {9, 4}, {10, 4}, {11, 30}, {0xFF, 999},
39 switch (task->
state) {
100 return time * 255 / 30;
111 poly->r0 = poly->g0 = poly->b0 = level;
122 mode = (DR_TPAGE *)(poly + 1);
125 setDrawTPage(mode, 0, 1, getTPage(0, 2, 320, 0));
133 switch (task->
state) {
151 if (task->
fade >= 30) {
174 anim->
timer -= elapsed;
176 if (anim->
timer <= 0) {
180 if (frame->
frame == 0xFF) {
210 switch (task->
state) {
254 if (time >= duration) {
278 switch (task->
state) {
325 if (time >= duration) {
349 switch (task->
state) {
396 if (time >= duration) {
422 switch (task->
state) {
467 switch (task->
step) {
508 switch (task->
state) {
528 if (task->
timer++ >= 6) {
538 if (task->
timer++ >= 11) {
548 if (task->
timer++ >= 6) {
571 if (++task->
timer >= 43) {
583 if (++task->
timer >= 6) {
592 if (++task->
timer >= 31) {
597#if VERSION_US || VERSION_JP
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)
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)
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.
#define CNTY_SEL_IMAGES
TIM archive for VRAM.
#define CNTY_SEL_SOUND_BANK
Sounds (SOUND.playSound)
#define SPRITE_OPTIONS
one per option
#define SPRITE_RIGHT_PANEL
#define CNTY_SEL_LAYER
Draw layer of the screen.
#define CNTY_SEL_SPRITES
sprite bank
#define SPRITE_LEFT_PANEL
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
s32 LANGUAGE
The European version's settings, in the small data (.sdata) between file/file_table....
FileCache FILE_CACHE
The file cache.
#define MODE_OPENING_2
STDWTITL's second opening movie: LANGUAGE 0 alternates the two, the others play only it.
#define MODE_OPENING
STDWTITL's first movie.
#define SCREEN_WIDTH
The screen the modes draw on (setDisplayMode, their layers' rects)
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
#define PAD_REPEATED(button)
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_CONFIRM
SYSTEM07.
#define SOUND_MENU_MOVE
SYSTEM06.
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)
The scrolling background, which also fades the screen out.
void(* nextState)(struct CountryBackgroundTask *task)
void(* setState)(struct CountryBackgroundTask *task, s32 state)
void(* nextState)(struct CursorTask *task)
void(* setSelection)(struct CursorTask *task, s16 selection)
void(* setState)(struct CursorTask *task, s32 state)
void *(* getEntry)(u32 fileAndIndex)
void(* requestMode)(s32 mode, s32 arg)
s32(* getFrameTime)(void)
void(* allocPrimBuffers)(s32 size)
struct Layer *(* createLayer)(RECT *rect, s32 otShift, s32 id)
struct Layer *(* getLayer)(s32 id)
void(* setPrim)(void *next)
void(* setDisplayMode)(s32 w, s32 h, s32 hires, s32 interlace)
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
u_long *(* getOtEntry)(struct Layer *, s32 depth)
void(* setBgColor)()
no prototype: callers would truncate u8 args
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.
void(* stopSound)(s32 id)
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setAltClut)()
(x, y)
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
Any task, seen through its header.
void(* nextState)(struct Task *task)
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
void(* setClutPos)()
(x, y)
void(* setImagePos)()
(x, y)
void(* loadArchive)()
(archive): each image 64 halfwords to the right
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.