Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
overlay.h
Go to the documentation of this file.
1#ifndef DW3_OVERLAY_H
2#define DW3_OVERLAY_H
3
4/* The game modes' overlays and the task that runs them (system/overlay.c) */
5
6#include "common.h"
7#include "engine/task.h"
8
9/* Loads the overlay of the current mode (OVERLAY_LOADER) */
10typedef struct OverlayLoader {
11 /* 0x0 */ s32 mode; /* whose overlay is loaded */
12 /* 0x4 */ s32 subOverlay;
13 /* 0x8 */ void (*loadModeOverlay)(void);
14 /* 0xC */ void (*loadSubOverlay)(s32 file);
16
17/* The mode overlays' files (MODE_OVERLAY_FILES), by their disc names: each
18 one's sector count in FILE_SECTOR_COUNTS is its .PRO file's. The Japanese
19 disc numbers them as the USA one does */
20#if VERSION_US || VERSION_JP
21#define FILE_CARDGAME 0x153
22#define FILE_STDGNAME 0x154
23#define FILE_CNTY_SEL 0x157
24#define FILE_FIELDSTG 0x158
25#define FILE_FIGHTSTG 0x159
26#define FILE_SHOCKTST 0x15A
27#define FILE_SOUNDTST 0x15B
28#define FILE_STAGSLCT 0x176
29#define FILE_STCRDABM 0x177
30#define FILE_STCRDDEK 0x1BC
31#define FILE_STCRDSHP 0x1C0
32#define FILE_STDWTITL 0x1C1
33#define FILE_STFGTREP 0x1C2
34#define FILE_STGDGLAB 0x1DF
35#define FILE_STGMCARD 0x1E3
36#define FILE_STGTRAIN 0x1F6
37#define FILE_STITSHOP 0x1F7
38#define FILE_STPLNMET 0x1F8
39#define FILE_STSTATUS 0x1F9
40#elif VERSION_EU
41#define FILE_CARDGAME 0x161
42#define FILE_STDGNAME 0x162
43#define FILE_CNTY_SEL 0x165
44#define FILE_FIELDSTG 0x166
45#define FILE_FIGHTSTG 0x167
46#define FILE_SHOCKTST 0x168
47#define FILE_SOUNDTST 0x169
48#define FILE_STAGSLCT 0x184
49#define FILE_STCRDABM 0x185
50#define FILE_STCRDDEK 0x1CA
51#define FILE_STCRDSHP 0x1CE
52#define FILE_STDWTITL 0x1D0
53#define FILE_STFGTREP 0x1D1
54#define FILE_STGDGLAB 0x1EC
55#define FILE_STGMCARD 0x1EE
56#define FILE_STGTRAIN 0x1F2
57#define FILE_STITSHOP 0x205
58#define FILE_STPLNMET 0x206
59#define FILE_STSTATUS 0x207
60#endif
61
62void updateModeTask(Task *task, Task **children);
63void *createModeTask(void);
64void loadModeOverlay(void);
65void loadSubOverlay(s32 id);
66
68extern Task *(*MODE_ENTRY_POINTS[])(void);
69extern s32 MODE_OVERLAY_FILES[];
70
71/* The mode overlays' entry points, which MODE_ENTRY_POINTS holds: declared
72 here, where the executable and every overlay see them, as the overlays'
73 headers can't be included together */
74Task *FIELDSTG_start(void);
76Task *STPLNMET_start(void);
77Task *FIGHTSTG_start(void);
78Task *CARDGAME_start(void);
79Task *SOUNDTST_start(void);
81Task *STGTRAIN_start(void);
82Task *STDGNAME_start(void);
85Task *STDWTITL_start(void);
90Task *STFGTREP_start(void);
91Task *STAGSLCT_start(void);
92Task *CNTY_SEL_start(void);
93
94/* the memory map of mk/version/<version>.mk, which the Makefile gives the
95 linker: where the overlays and the stages load */
96extern u8 OVERLAY_VRAM[];
97extern u8 STAGE_VRAM[];
98/* the two areas the loader copies to, at those addresses (system/main.c) */
99extern void *const OVERLAY_ADDRESS;
100extern void *const SUB_OVERLAY_ADDRESS;
101
102#endif /* DW3_OVERLAY_H */
signed int s32
Definition common.h:11
unsigned char u8
Definition common.h:8
The task system and its registry (task/)
Task * STITSHOP_start(void)
Task * STDGNAME_start(void)
The mode's entry point (MODE_ENTRY_POINTS): starts the root task.
Definition scene.c:34
void loadSubOverlay(s32 id)
Copies a file to the second overlay area (SUB_OVERLAY_ADDRESS)
Definition overlay.c:68
s32 MODE_OVERLAY_FILES[]
Definition overlay.c:12
Task * STCRDDEK_start(void)
Task * STDWTITL_start(void)
The overlay's entry: creates its main task (STDWTITL_tickScreen)
Definition scene.c:77
void updateModeTask(Task *task, Task **children)
The root task (created by main): loads the overlay of the current game mode and calls its entry point...
Definition overlay.c:28
Task * FIGHTSTG_start(void)
The mode's entry point (MODE_ENTRY_POINTS): starts the root task.
Definition start.c:32
Task * SOUNDTST_start(void)
Creates the sound test's root task.
Definition sound_test.c:633
Task * STFGTREP_start(void)
The mode's entry point (MODE_ENTRY_POINTS)
Definition scene.c:35
Task * STGMCARD_start(void)
Task * CNTY_SEL_start(void)
The mode's entry point (MODE_ENTRY_POINTS): clears VRAM, starts the root task and loads the screen's ...
void loadModeOverlay(void)
Copies the overlay of the current mode (mode >> 8) to OVERLAY_ADDRESS.
Definition overlay.c:53
void *const SUB_OVERLAY_ADDRESS
Definition main.c:92
Task * STSTATUS_start(void)
Task * STPLNMET_start(void)
The mode's entry point (MODE_ENTRY_POINTS): starts the root task.
Definition scene.c:43
Task * STCRDABM_start(void)
u8 STAGE_VRAM[]
Task * STGTRAIN_start(void)
The mode's entry point (MODE_ENTRY_POINTS): starts the root task.
Definition scene.c:45
u8 OVERLAY_VRAM[]
the memory map of mk/version/<version>.mk, which the Makefile gives the linker: where the overlays an...
Task * CARDGAME_start(void)
The mode's entry point (MODE_ENTRY_POINTS)
Definition scene.c:51
Task *(* MODE_ENTRY_POINTS[])(void)
Each mode's overlay (mode >> 8): its entry point and its file.
Definition overlay.c:4
Task * STAGSLCT_start(void)
Creates the stage select's root task.
Task * STCRDSHP_start(void)
OverlayLoader OVERLAY_LOADER
Definition overlay.c:21
Task * SHOCKTST_start(void)
Task * FIELDSTG_start(void)
The mode overlays' entry points, which MODE_ENTRY_POINTS holds: declared here, where the executable a...
Definition start.c:34
void * createModeTask(void)
Creates the task that runs the current mode (updateModeTask)
Definition overlay.c:48
Task * STGDGLAB_createScene(void)
Starts the mode: creates its scene task.
Definition scene.c:13
void *const OVERLAY_ADDRESS
the two areas the loader copies to, at those addresses (system/main.c)
Definition main.c:91
Loads the overlay of the current mode (OVERLAY_LOADER)
Definition overlay.h:10
s32 subOverlay
Definition overlay.h:12
void(* loadModeOverlay)(void)
Definition overlay.h:13
void(* loadSubOverlay)(s32 file)
Definition overlay.h:14
s32 mode
whose overlay is loaded
Definition overlay.h:11
Any task, seen through its header.
Definition task.h:62