Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
country_select.c File Reference
Include dependency graph for country_select.c:

Go to the source code of this file.

Functions

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, uploads the images, creates the screen's controller and starts the music; stops the music when killed.
 
Task * CNTY_SEL_start (void)
 The mode's entry point (MODE_ENTRY_POINTS): clears VRAM, starts the root task and loads the screen's sound bank.
 
void CNTY_SEL_drawBackground (CountryBackgroundTask *task)
 Draws the background, moved diagonally by half its scroll.
 
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_drawFade (s32 level)
 Darkens the whole screen by level (0 to 255, 255 is black)
 
void CNTY_SEL_tickBackground (CountryBackgroundTask *task)
 The background's task: scrolls and draws it; when done, keeps it scrolling while the screen fades to black over 30 frames, then ends.
 
CountryBackgroundTask * CNTY_SEL_startBackgroundTask (void)
 Creates the scrolling background (task)
 
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)
 
void CNTY_SEL_drawCursor (CursorTask *task)
 Draws the highlighted option, in the colors of the CLUT row of its current frame.
 
void CNTY_SEL_setCursorSelection (CursorTask *task, s16 selection)
 Moves the highlight to option selection (CursorTask.setSelection)
 
void CNTY_SEL_tickCursor (CursorTask *task)
 The highlighted option's task: blinks it through 8 CLUT rows, 4 frames each; when done (Start pressed), flashes it with CNTY_SEL_cursorFlash, then ends.
 
CursorTask * CNTY_SEL_startCursorTask (void)
 Creates the highlighted option (task), once the panels are open.
 
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_drawTopPanel (PanelTask *task)
 Draws the top panel, its height scaled from its top edge.
 
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.
 
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_drawRightPanel (PanelTask *task)
 Draws the right panel, its width scaled from the screen's right 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.
 
PanelTask * CNTY_SEL_startRightPanelTask (void)
 Creates the right panel (task), closed.
 
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)
 
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_tickLeftPanel (PanelTask *task)
 The left panel's task: draws it; each TASK_DONE from the controller opens it, the next one closes it.
 
PanelTask * CNTY_SEL_startLeftPanelTask (void)
 Creates the left panel (task), closed.
 
static void moveSelection (CountryMenuTask *task)
 Moves the highlighted option with the pad.
 
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 Up and Down until Start, which in the European version sets LANGUAGE; then flashes it, closes the panels, fades out and moves on to the next mode.
 
CountryMenuTask * CNTY_SEL_startMenuTask (void)
 Creates the screen's controller (task), which starts the background and panels.
 

Variables

RECT CNTY_SEL_screenRect = {0, 0, 320 , 240 }
 
RECT CNTY_SEL_vramRect = {0, 0, 1024, 512}
 
RECT CNTY_SEL_fadeRect = {0, -15, 320, 260}
 A little larger than the screen.
 
AnimFrame CNTY_SEL_cursorFlash []
 Sprite frames of the chosen option once Start is pressed.
 
PanelTween CNTY_SEL_topPanelTweens []
 Opening (0) and closing (1) tweens of each panel's scale.
 
PanelTween CNTY_SEL_rightPanelTweens []
 
LeftPanelTween CNTY_SEL_leftPanelTweens []
 
u8 CNTY_SEL_languages [] = {2, 3, 5, 4, 6, 1, 0}
 The language of each option.
 

Function Documentation

◆ CNTY_SEL_tickScreen()

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, uploads the images, creates the screen's controller and starts the music; stops the music when killed.

< TIM archive for VRAM

Definition at line 35 of file country_select.c.

Referenced by CNTY_SEL_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_start()

Task * CNTY_SEL_start ( void  )

The mode's entry point (MODE_ENTRY_POINTS): clears VRAM, starts the root task and loads the screen's sound bank.

Definition at line 73 of file country_select.c.

Here is the call graph for this function:

◆ CNTY_SEL_drawBackground()

void CNTY_SEL_drawBackground ( CountryBackgroundTask *  task)

Draws the background, moved diagonally by half its scroll.

< sprite bank

Definition at line 83 of file country_select.c.

Referenced by CNTY_SEL_tickBackground().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_getFadeLevel()

s32 CNTY_SEL_getFadeLevel ( s32  time)

How dark the fade-out is on its frame time: 0 to 255 over 30 frames.

Definition at line 96 of file country_select.c.

Referenced by CNTY_SEL_tickBackground().

Here is the caller graph for this function:

◆ CNTY_SEL_drawFade()

void CNTY_SEL_drawFade ( s32  level)

Darkens the whole screen by level (0 to 255, 255 is black)

Definition at line 104 of file country_select.c.

Referenced by CNTY_SEL_tickBackground().

Here is the caller graph for this function:

◆ CNTY_SEL_tickBackground()

void CNTY_SEL_tickBackground ( CountryBackgroundTask *  task)

The background's task: scrolls and draws it; when done, keeps it scrolling while the screen fades to black over 30 frames, then ends.

Definition at line 132 of file country_select.c.

Referenced by CNTY_SEL_startBackgroundTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_startBackgroundTask()

CountryBackgroundTask * CNTY_SEL_startBackgroundTask ( void  )

Creates the scrolling background (task)

Definition at line 161 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_stepAnimation()

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)

Definition at line 166 of file country_select.c.

Referenced by CNTY_SEL_stepAnimation(), and CNTY_SEL_tickCursor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_drawCursor()

void CNTY_SEL_drawCursor ( CursorTask *  task)

Draws the highlighted option, in the colors of the CLUT row of its current frame.

< sprite bank

< one per option

Definition at line 190 of file country_select.c.

Referenced by CNTY_SEL_tickCursor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_setCursorSelection()

void CNTY_SEL_setCursorSelection ( CursorTask *  task,
s16  selection 
)

Moves the highlight to option selection (CursorTask.setSelection)

Definition at line 201 of file country_select.c.

Referenced by CNTY_SEL_startCursorTask().

Here is the caller graph for this function:

◆ CNTY_SEL_tickCursor()

void CNTY_SEL_tickCursor ( CursorTask *  task)

The highlighted option's task: blinks it through 8 CLUT rows, 4 frames each; when done (Start pressed), flashes it with CNTY_SEL_cursorFlash, then ends.

Definition at line 207 of file country_select.c.

Referenced by CNTY_SEL_startCursorTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_startCursorTask()

CursorTask * CNTY_SEL_startCursorTask ( void  )

Creates the highlighted option (task), once the panels are open.

Definition at line 241 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_getTopPanelScale()

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)

Definition at line 250 of file country_select.c.

Referenced by CNTY_SEL_tickTopPanel().

Here is the caller graph for this function:

◆ CNTY_SEL_drawTopPanel()

void CNTY_SEL_drawTopPanel ( PanelTask *  task)

Draws the top panel, its height scaled from its top edge.

< GTE regards 4096 as 1.0

< sprite bank

Definition at line 262 of file country_select.c.

Referenced by CNTY_SEL_tickTopPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_tickTopPanel()

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.

< GTE regards 4096 as 1.0

Definition at line 275 of file country_select.c.

Referenced by CNTY_SEL_startTopPanelTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_startTopPanelTask()

PanelTask * CNTY_SEL_startTopPanelTask ( void  )

Creates the top panel (task), closed.

Definition at line 315 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_getRightPanelScale()

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)

Definition at line 321 of file country_select.c.

Referenced by CNTY_SEL_tickRightPanel().

Here is the caller graph for this function:

◆ CNTY_SEL_drawRightPanel()

void CNTY_SEL_drawRightPanel ( PanelTask *  task)

Draws the right panel, its width scaled from the screen's right edge.

< GTE regards 4096 as 1.0

< sprite bank

Definition at line 333 of file country_select.c.

Referenced by CNTY_SEL_tickRightPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_tickRightPanel()

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.

< GTE regards 4096 as 1.0

Definition at line 346 of file country_select.c.

Referenced by CNTY_SEL_startRightPanelTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_startRightPanelTask()

PanelTask * CNTY_SEL_startRightPanelTask ( void  )

Creates the right panel (task), closed.

Definition at line 386 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_getLeftPanelScale()

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)

Definition at line 392 of file country_select.c.

Referenced by CNTY_SEL_tickLeftPanel().

Here is the caller graph for this function:

◆ CNTY_SEL_drawLeftPanel()

void CNTY_SEL_drawLeftPanel ( PanelTask *  task)

Draws the left panel, with its own CLUT, its width scaled from the screen's left edge.

< GTE regards 4096 as 1.0

< sprite bank

Definition at line 405 of file country_select.c.

Referenced by CNTY_SEL_tickLeftPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_tickLeftPanel()

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.

< GTE regards 4096 as 1.0

Definition at line 419 of file country_select.c.

Referenced by CNTY_SEL_startLeftPanelTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_startLeftPanelTask()

PanelTask * CNTY_SEL_startLeftPanelTask ( void  )

Creates the left panel (task), closed.

Definition at line 459 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveSelection()

static void moveSelection ( CountryMenuTask *  task)
inlinestatic

Moves the highlighted option with the pad.

< SYSTEM06

< SYSTEM06

< SYSTEM06

< SYSTEM06

< SYSTEM06

Definition at line 464 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().

Here is the caller graph for this function:

◆ CNTY_SEL_tickMenu()

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 Up and Down until Start, which in the European version sets LANGUAGE; then flashes it, closes the panels, fades out and moves on to the next mode.

< SYSTEM07

< STDWTITL's first movie

< STDWTITL's second opening movie: LANGUAGE 0 alternates the two, the others play only it

Definition at line 507 of file country_select.c.

Referenced by CNTY_SEL_startMenuTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CNTY_SEL_startMenuTask()

CountryMenuTask * CNTY_SEL_startMenuTask ( void  )

Creates the screen's controller (task), which starts the background and panels.

Definition at line 617 of file country_select.c.

Referenced by CNTY_SEL_tickScreen().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CNTY_SEL_screenRect

RECT CNTY_SEL_screenRect = {0, 0, 320 , 240 }

Definition at line 3 of file country_select.c.

Referenced by CNTY_SEL_tickScreen().

◆ CNTY_SEL_vramRect

RECT CNTY_SEL_vramRect = {0, 0, 1024, 512}

Definition at line 4 of file country_select.c.

Referenced by CNTY_SEL_start().

◆ CNTY_SEL_fadeRect

RECT CNTY_SEL_fadeRect = {0, -15, 320, 260}

A little larger than the screen.

Definition at line 6 of file country_select.c.

Referenced by CNTY_SEL_drawFade().

◆ CNTY_SEL_cursorFlash

AnimFrame CNTY_SEL_cursorFlash[]
Initial value:
= {
{8, 4}, {9, 4}, {10, 4}, {11, 30}, {0xFF, 999},
}

Sprite frames of the chosen option once Start is pressed.

Definition at line 9 of file country_select.c.

Referenced by CNTY_SEL_tickCursor().

◆ CNTY_SEL_topPanelTweens

PanelTween CNTY_SEL_topPanelTweens[]
Initial value:
= {
{10, 0x1000, 0},
{5, 0, 0x1000},
}

Opening (0) and closing (1) tweens of each panel's scale.

Definition at line 14 of file country_select.c.

Referenced by CNTY_SEL_getTopPanelScale(), and CNTY_SEL_tickTopPanel().

◆ CNTY_SEL_rightPanelTweens

PanelTween CNTY_SEL_rightPanelTweens[]
Initial value:
= {
{10, 0x1000, 0},
{5, 0, 0x1000},
}

Definition at line 18 of file country_select.c.

Referenced by CNTY_SEL_getRightPanelScale(), and CNTY_SEL_tickRightPanel().

◆ CNTY_SEL_leftPanelTweens

LeftPanelTween CNTY_SEL_leftPanelTweens[]
Initial value:
= {
{10, 0x1000, 0},
{5, 0, 0x1000},
}

Definition at line 22 of file country_select.c.

Referenced by CNTY_SEL_getLeftPanelScale(), and CNTY_SEL_tickLeftPanel().

◆ CNTY_SEL_languages

u8 CNTY_SEL_languages[] = {2, 3, 5, 4, 6, 1, 0}

The language of each option.

Definition at line 29 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().