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

The training screen: the party, the partner's stats and the training menu; the screen fade; and the first object's data. More...

Include dependency graph for screen.c:

Go to the source code of this file.

Macros

#define FADER_DEPTH   6
 

Functions

void STGTRAIN_createScreenWindows (TrainScreen *screen, TrainScreenWindows *win)
 Creates the screen's text windows.
 
void STGTRAIN_showVitals (TrainScreen *screen, TrainScreenWindows *win, s32 show)
 Shows or hides the selected partner's name, level, HP and MP.
 
void STGTRAIN_showBattleStats (TrainScreen *screen, TrainScreenWindows *win, s32 show)
 Shows or hides the selected partner's stats and resistances.
 
void STGTRAIN_showTp (TrainScreen *screen, TrainScreenWindows *win, s32 show)
 Shows or hides the selected partner's TP.
 
void STGTRAIN_showStatChanges (TrainScreen *screen, PartnerTotals *before)
 Shows the selected partner's stats, in colour where they differ from before (NULL: just shows them).
 
static void STGTRAIN_animatePartner (TrainScreen *screen, s32 partner)
 Advances the selected partner's waiting animation, a frame every 13 ticks.
 
void STGTRAIN_drawScreen (TrainScreen *screen)
 Draws the screen: the panels, the party's sprites and the sign.
 
static void STGTRAIN_pickPartner (TrainScreen *screen, TrainScreenWindows *win)
 Moves the cursor over the party (left, right), showing the partner's stats, and picks the one to train (cross) or leaves (triangle)
 
static void STGTRAIN_closePartnerPick (TrainScreen *screen, TrainScreenWindows *win)
 Closes the partner pick: hides the cursor, the prompt and the help, and closes their panels.
 
static s32 STGTRAIN_partnerPickClosed (TrainScreen *screen)
 Updates the fades of the partner pick's panels; whether they are done.
 
static void STGTRAIN_waitSession (TrainScreen *screen, TrainScreenWindows *win)
 Waits for the session: once it is training (its substate 0x23), ends the last result first, then makes the next one with the TP shown; once it is done, goes back to the menu.
 
static void STGTRAIN_startLeaving (TrainScreen *screen, TrainScreenWindows *win)
 Starts leaving the screen: fades it out and closes every panel.
 
static void STGTRAIN_openBattleStats (TrainScreen *screen, TrainScreenWindows *win)
 Once the vitals' panel is open (with the help's), shows the vitals and the help, and opens the battle stats' and the prompt's panels.
 
static void STGTRAIN_openTp (TrainScreen *screen, TrainScreenWindows *win)
 Once the battle stats' panel is open, shows them and the prompt, and opens the TP's panel and the party's window.
 
static void STGTRAIN_openParty (TrainScreen *screen, TrainScreenWindows *win)
 Once the TP's panel is open, shows the TP and opens the party's panel.
 
static void STGTRAIN_waitMenu (TrainScreen *screen, TrainScreenWindows *win)
 Waits for the menu to close: with a training picked it is gone, and the training's session starts; without one (triangle) it is done, and the partner pick reopens.
 
static s32 STGTRAIN_screenClosed (TrainScreen *screen)
 Updates the fades of every panel as the screen closes; whether they are done.
 
void STGTRAIN_runScreen (TrainScreen *screen, TrainScreenWindows *win)
 The training screen: opens the panels, picks the partner, runs the menu and the trainings, and closes everything when leaving.
 
void STGTRAIN_updateScreen (TrainScreen *screen, TrainScreenWindows *win)
 The training screen's update: loads its files, then runs the menu.
 
TrainScreen * STGTRAIN_createScreen (void)
 Creates the training screen.
 

Variables

s32 STGTRAIN_waitAnims [PARTNER_COUNT][7]
 The partners' sprites while they wait, by partner: -1 ends a loop.
 

Detailed Description

The training screen: the party, the partner's stats and the training menu; the screen fade; and the first object's data.

Definition in file screen.c.

Macro Definition Documentation

◆ FADER_DEPTH

#define FADER_DEPTH   6

Definition at line 688 of file screen.c.

Function Documentation

◆ STGTRAIN_createScreenWindows()

void STGTRAIN_createScreenWindows ( TrainScreen *  screen,
TrainScreenWindows *  win 
)

Creates the screen's text windows.

screen.c

Definition at line 7 of file screen.c.

Referenced by STGTRAIN_updateScreen().

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

◆ STGTRAIN_showVitals()

void STGTRAIN_showVitals ( TrainScreen *  screen,
TrainScreenWindows *  win,
s32  show 
)

Shows or hides the selected partner's name, level, HP and MP.

Definition at line 34 of file screen.c.

Referenced by STGTRAIN_openBattleStats(), STGTRAIN_pickPartner(), STGTRAIN_showStatChanges(), and STGTRAIN_startLeaving().

Here is the caller graph for this function:

◆ STGTRAIN_showBattleStats()

void STGTRAIN_showBattleStats ( TrainScreen *  screen,
TrainScreenWindows *  win,
s32  show 
)

Shows or hides the selected partner's stats and resistances.

Definition at line 81 of file screen.c.

Referenced by STGTRAIN_openTp(), STGTRAIN_pickPartner(), STGTRAIN_runScreen(), STGTRAIN_showStatChanges(), and STGTRAIN_startLeaving().

Here is the caller graph for this function:

◆ STGTRAIN_showTp()

void STGTRAIN_showTp ( TrainScreen *  screen,
TrainScreenWindows *  win,
s32  show 
)

Shows or hides the selected partner's TP.

Definition at line 117 of file screen.c.

Referenced by STGTRAIN_openParty(), STGTRAIN_pickPartner(), STGTRAIN_startLeaving(), and STGTRAIN_waitSession().

Here is the caller graph for this function:

◆ STGTRAIN_showStatChanges()

void STGTRAIN_showStatChanges ( TrainScreen *  screen,
PartnerTotals *  before 
)

Shows the selected partner's stats, in colour where they differ from before (NULL: just shows them).

The MP label is given win->mp[3] (that is, slashes[0]) as its window, as in the original. The match depends on the stats and resistances being read as *(totals.fields.battle + i).

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

Definition at line 139 of file screen.c.

Referenced by STGTRAIN_createScreen().

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

◆ STGTRAIN_animatePartner()

static void STGTRAIN_animatePartner ( TrainScreen *  screen,
s32  partner 
)
inlinestatic

Advances the selected partner's waiting animation, a frame every 13 ticks.

Definition at line 212 of file screen.c.

Referenced by STGTRAIN_drawScreen().

Here is the caller graph for this function:

◆ STGTRAIN_drawScreen()

void STGTRAIN_drawScreen ( TrainScreen *  screen)

Draws the screen: the panels, the party's sprites and the sign.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< its sprite bank

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< its sprite bank

< its sprite bank

Definition at line 223 of file screen.c.

Referenced by STGTRAIN_updateScreen().

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

◆ STGTRAIN_pickPartner()

static void STGTRAIN_pickPartner ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Moves the cursor over the party (left, right), showing the partner's stats, and picks the one to train (cross) or leaves (triangle)

< SYSTEM06

< SYSTEM07

< SYSTEM01

Definition at line 332 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_closePartnerPick()

static void STGTRAIN_closePartnerPick ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Closes the partner pick: hides the cursor, the prompt and the help, and closes their panels.

Definition at line 367 of file screen.c.

Referenced by STGTRAIN_runScreen(), and STGTRAIN_startLeaving().

Here is the caller graph for this function:

◆ STGTRAIN_partnerPickClosed()

static s32 STGTRAIN_partnerPickClosed ( TrainScreen *  screen)
inlinestatic

Updates the fades of the partner pick's panels; whether they are done.

Definition at line 377 of file screen.c.

Referenced by STGTRAIN_runScreen(), and STGTRAIN_screenClosed().

Here is the caller graph for this function:

◆ STGTRAIN_waitSession()

static void STGTRAIN_waitSession ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Waits for the session: once it is training (its substate 0x23), ends the last result first, then makes the next one with the TP shown; once it is done, goes back to the menu.

Definition at line 386 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_startLeaving()

static void STGTRAIN_startLeaving ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Starts leaving the screen: fades it out and closes every panel.

Definition at line 401 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_openBattleStats()

static void STGTRAIN_openBattleStats ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Once the vitals' panel is open (with the help's), shows the vitals and the help, and opens the battle stats' and the prompt's panels.

Definition at line 418 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_openTp()

static void STGTRAIN_openTp ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Once the battle stats' panel is open, shows them and the prompt, and opens the TP's panel and the party's window.

Definition at line 431 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_openParty()

static void STGTRAIN_openParty ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Once the TP's panel is open, shows the TP and opens the party's panel.

Definition at line 443 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_waitMenu()

static void STGTRAIN_waitMenu ( TrainScreen *  screen,
TrainScreenWindows *  win 
)
inlinestatic

Waits for the menu to close: with a training picked it is gone, and the training's session starts; without one (triangle) it is done, and the partner pick reopens.

Definition at line 455 of file screen.c.

Referenced by STGTRAIN_runScreen().

Here is the caller graph for this function:

◆ STGTRAIN_screenClosed()

static s32 STGTRAIN_screenClosed ( TrainScreen *  screen)
inlinestatic

Updates the fades of every panel as the screen closes; whether they are done.

Definition at line 467 of file screen.c.

Referenced by STGTRAIN_runScreen().

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

◆ STGTRAIN_runScreen()

void STGTRAIN_runScreen ( TrainScreen *  screen,
TrainScreenWindows *  win 
)

The training screen: opens the panels, picks the partner, runs the menu and the trainings, and closes everything when leaving.

Definition at line 478 of file screen.c.

Referenced by STGTRAIN_updateScreen().

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

◆ STGTRAIN_updateScreen()

void STGTRAIN_updateScreen ( TrainScreen *  screen,
TrainScreenWindows *  win 
)

The training screen's update: loads its files, then runs the menu.

< TRAINING: the gym's training

< TRAINING: the gym's training

Definition at line 593 of file screen.c.

Referenced by STGTRAIN_createScreen().

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

◆ STGTRAIN_createScreen()

TrainScreen * STGTRAIN_createScreen ( void  )

Creates the training screen.

Definition at line 646 of file screen.c.

Referenced by STGTRAIN_updateRoot().

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

Variable Documentation

◆ STGTRAIN_waitAnims

s32 STGTRAIN_waitAnims[PARTNER_COUNT][7]
Initial value:
= {
{7, 8, 9, 10, 9, 8, -1},
{14, 15, 16, 15, -1, -1, -1},
{11, 12, 13, 12, -1, -1, -1},
{3, 4, 5, 6, 5, 4, -1},
{25, 26, 27, 28, 27, 26, -1},
{0, 1, 2, 1, -1, -1, -1},
{17, 18, 19, 20, 19, 18, -1},
{21, 22, 23, 24, 23, 22, -1},
}

The partners' sprites while they wait, by partner: -1 ends a loop.

The overlay's data, in its order: the first object's, the second's and the third's.

Definition at line 692 of file screen.c.

Referenced by STGTRAIN_animatePartner(), and STGTRAIN_drawScreen().