Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
country_select.h File Reference

CNTY_SEL.PRO: the country select screen. More...

#include "engine/game.h"
Include dependency graph for country_select.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PanelTween
 A linear tween of a panel's scale. More...
 
struct  LeftPanelTween
 
struct  CountryBackgroundTask
 The scrolling background, which also fades the screen out. More...
 
struct  CursorTask
 The highlighted option. More...
 
struct  PanelTask
 A panel that opens and closes by scaling. More...
 
struct  MenuChildren
 
struct  CountryMenuTask
 The screen's controller. More...
 

Macros

#define CNTY_SEL_FILE   0x8A3
 The screen's file, read with FILE_CACHE.getEntry: the discs number their files differently.
 
#define CNTY_SEL_SPRITES   (CNTY_SEL_FILE << 16)
 sprite bank
 
#define CNTY_SEL_IMAGES   (CNTY_SEL_FILE << 16 | 1)
 TIM archive for VRAM.
 
#define SPRITE_BACKGROUND   0
 Sprites in the sprite bank.
 
#define SPRITE_RIGHT_PANEL   1
 
#define SPRITE_TOP_PANEL   2
 
#define SPRITE_LEFT_PANEL   3
 
#define SPRITE_OPTIONS   4
 one per option
 
#define CNTY_SEL_LAYER   0x100
 Draw layer of the screen.
 
#define CNTY_SEL_SOUND_BANK   0x21
 Sounds (SOUND.playSound)
 
#define CNTY_SEL_MUSIC   MUSIC(0x21, 2)
 

Enumerations

enum  MenuStep {
  MENU_OPEN_RIGHT_PANEL , MENU_WAIT_RIGHT_PANEL , MENU_OPEN_LEFT_PANEL , MENU_WAIT_LEFT_PANEL ,
  MENU_OPEN_TOP_PANEL , MENU_WAIT_TOP_PANEL , MENU_SHOW_CURSOR , MENU_SELECT ,
  MENU_WAIT_FLASH , MENU_CLOSE_PANELS , MENU_WAIT_PANELS , MENU_FADE_OUT ,
  MENU_WAIT_FADE , MENU_EXIT
}
 CountryMenuTask substates (Task.substate) in TASK_RUN. More...
 

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.
 
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.
 
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
 
RECT CNTY_SEL_vramRect
 
RECT CNTY_SEL_fadeRect
 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 []
 The language of each option.
 

Detailed Description

CNTY_SEL.PRO: the country select screen.

A background scrolls diagonally, three panels open one after the other and a highlighted option blinks until Start is pressed. Then the option flashes, the panels close, the screen fades to black and the game moves on to MODE_OPENING. The USA version doesn't store the choice; the European one sets the language from it (LANGUAGE), and moves on to MODE_OPENING_2 for any language but 0.

Definition in file country_select.h.

Macro Definition Documentation

◆ CNTY_SEL_FILE

#define CNTY_SEL_FILE   0x8A3

The screen's file, read with FILE_CACHE.getEntry: the discs number their files differently.

Definition at line 27 of file country_select.h.

◆ CNTY_SEL_SPRITES

#define CNTY_SEL_SPRITES   (CNTY_SEL_FILE << 16)

sprite bank

Definition at line 29 of file country_select.h.

◆ CNTY_SEL_IMAGES

#define CNTY_SEL_IMAGES   (CNTY_SEL_FILE << 16 | 1)

TIM archive for VRAM.

Definition at line 30 of file country_select.h.

◆ SPRITE_BACKGROUND

#define SPRITE_BACKGROUND   0

Sprites in the sprite bank.

Definition at line 33 of file country_select.h.

◆ SPRITE_RIGHT_PANEL

#define SPRITE_RIGHT_PANEL   1

Definition at line 34 of file country_select.h.

◆ SPRITE_TOP_PANEL

#define SPRITE_TOP_PANEL   2

Definition at line 35 of file country_select.h.

◆ SPRITE_LEFT_PANEL

#define SPRITE_LEFT_PANEL   3

Definition at line 36 of file country_select.h.

◆ SPRITE_OPTIONS

#define SPRITE_OPTIONS   4

one per option

Definition at line 37 of file country_select.h.

◆ CNTY_SEL_LAYER

#define CNTY_SEL_LAYER   0x100

Draw layer of the screen.

Definition at line 40 of file country_select.h.

◆ CNTY_SEL_SOUND_BANK

#define CNTY_SEL_SOUND_BANK   0x21

Sounds (SOUND.playSound)

Definition at line 43 of file country_select.h.

◆ CNTY_SEL_MUSIC

#define CNTY_SEL_MUSIC   MUSIC(0x21, 2)

Definition at line 44 of file country_select.h.

Enumeration Type Documentation

◆ MenuStep

enum MenuStep

CountryMenuTask substates (Task.substate) in TASK_RUN.

Enumerator
MENU_OPEN_RIGHT_PANEL 
MENU_WAIT_RIGHT_PANEL 
MENU_OPEN_LEFT_PANEL 
MENU_WAIT_LEFT_PANEL 
MENU_OPEN_TOP_PANEL 
MENU_WAIT_TOP_PANEL 
MENU_SHOW_CURSOR 
MENU_SELECT 
MENU_WAIT_FLASH 
MENU_CLOSE_PANELS 
MENU_WAIT_PANELS 
MENU_FADE_OUT 
MENU_WAIT_FADE 
MENU_EXIT 

Definition at line 102 of file country_select.h.

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_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:

◆ 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
extern

Definition at line 3 of file country_select.c.

Referenced by CNTY_SEL_tickScreen().

◆ CNTY_SEL_vramRect

RECT CNTY_SEL_vramRect
extern

Definition at line 4 of file country_select.c.

Referenced by CNTY_SEL_start().

◆ CNTY_SEL_fadeRect

RECT CNTY_SEL_fadeRect
extern

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[]
extern

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[]
extern

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[]
extern

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[]
extern

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[]
extern

The language of each option.

Definition at line 29 of file country_select.c.

Referenced by CNTY_SEL_tickMenu().