10#if VERSION_US || VERSION_JP
11#define MENU_TEXT TEXT_FILE(TEXT_EVENTS_270)
13#define MENU_TEXT (TEXT_EVENTS_270 - 1)
24 switch (task->
state) {
29 for (i = 0; i < 2; i++) {
46 for (j = 0; j < 2; j++) {
66 if (prev != task->
cursor) {
87 for (k = 0; k < 2; k++) {
97 if (task->
step == 1) {
139 switch (task->
state) {
144 for (i = 0; i < 2; i++) {
161 for (j = 0; j < 2; j++) {
181 if (prev != task->
cursor) {
202 for (k = 0; k < 2; k++) {
212 if (task->
step == 1) {
262#if VERSION_US || VERSION_JP
263#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_00)
264#define EVENT_TEXT_FILE (TEXT_EVENTS_270 - 1)
265#define STAGE_FILE 0x1A1
266#define STAGE_ARCHIVE 0x3C2
268#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_00)
269#define EVENT_TEXT_FILE (TEXT_EVENTS_270 - 1)
270#define STAGE_FILE 0x1AF
271#define STAGE_ARCHIVE 0x3D2
509 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
510 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
511 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
512 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
513 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
514 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
515 { 0x180, 0x100, 0x1B8, 0x159, 0x1E0, 0x59, 0x160, 0x1FB },
516 { 0x180, 0x100, 0x1B0, 0x159, 0x1C0, 0x59, 0x170, 0x1FB },
517 { 0x180, 0x100, 0x1A0, 0x15D, 0x180, 0x5D, 0x150, 0x1FA },
518 { 0x180, 0x100, 0x1A8, 0x15D, 0x1A0, 0x5D, 0x160, 0x1FA },
519 { 0x180, 0x100, 0x190, 0x171, 0x140, 0x71, 0x170, 0x1FA },
520 { 0x180, 0x100, 0x198, 0x171, 0x160, 0x71, 0x140, 0x1F9 },
521 { 0x140, 0x100, 0x140, 0x1D8, 0, 0xD8, 0x150, 0x1F9 },
522 { 0x180, 0x100, 0x180, 0x172, 0x100, 0x72, 0x160, 0x1F9 },
523 { 0x180, 0x100, 0x188, 0x172, 0x120, 0x72, 0x170, 0x1F9 },
524 { 0x180, 0x100, 0x1B0, 0x181, 0x1C0, 0x81, 0x140, 0x1F8 },
525 { 0x180, 0x100, 0x1A0, 0x185, 0x180, 0x85, 0x150, 0x1F8 },
526 { 0x180, 0x100, 0x1A8, 0x185, 0x1A0, 0x85, 0x160, 0x1F8 },
527 { 0x180, 0x100, 0x1B4, 0x100, 0x1D0, 0, 0x170, 0x1F8 },
528 { 0, 0, 0, 0, 0, 0, 0, 0 },
529 { 0, 0, 0, 0, 0, 0, 0, 0 },
530 { 0, 0, 0, 0, 0, 0, 0, 0 },
1195 { 1, 0, 0x40, 6, 0x3B, 2, 0, 5, 8, 0, 428, 75, 0, 0 },
1196 { 1, 0, 0x40, 6, 0x3D, 2, 0, 3, 8, 0, 65, 176, 0, 0 },
1197 { 1, 0, 0x40, 6, 0x3A, 2, 0, 3, 8, 0, 425, 67, 0, 0 },
1198 { 1, 0, 0x40, 6, 0x32, 1, 0x32, 0x39, 8, 0, 428, 75, 0, 0 },
1199 { 1, 0, 0x40, 4, 0x3C, 2, 0, 3, 8, 0, 470, 149, 176, 0 },
1200 { 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 86, 239, 258, 0 },
1201 { 1, 0, 0x40, 4, 1, 0, 0, 0, 0, 0, 160, 220, 248, 0 },
1202 { 1, 0, 0x40, 4, 2, 0, 0, 0, 0, 0, 192, 204, 232, 0 },
1203 { 1, 0, 0x40, 4, 3, 0, 0, 0, 0, 0, 320, 201, 231, 0 },
1204 { 1, 0, 0x40, 4, 4, 0, 0, 0, 0, 0, 291, 185, 209, 0 },
1205 { 1, 0, 0x40, 4, 5, 0, 0, 0, 0, 0, 352, 147, 168, 0 },
1206 { 1, 0, 0x40, 4, 6, 0, 0, 0, 0, 0, 371, 140, 160, 0 },
1207 { 1, 0, 0x40, 4, 7, 0, 0, 0, 0, 0, 336, 139, 160, 0 },
1208 { 1, 0, 0x40, 4, 8, 0, 0, 0, 0, 0, 385, 131, 153, 0 },
1209 { 1, 0, 0x40, 4, 9, 0, 0, 0, 0, 0, 320, 131, 153, 0 },
1210 { 1, 0, 0x40, 4, 0xA, 0, 0, 0, 0, 0, 401, 123, 144, 0 },
1211 { 1, 0, 0x40, 4, 0xB, 0, 0, 0, 0, 0, 304, 117, 144, 0 },
1212 { 1, 0, 0x40, 4, 0xC, 0, 0, 0, 0, 0, 464, 149, 176, 0 },
1213 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1216 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x201, 0x1F0, 0xA0, 7, 0, 0, 0 },
1217 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define TEXT_ENTRY(file, n)
#define MENU_SPRITES
The menu sprite sheet, and an entry of a text file: the European version numbers the disc's files dif...
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
#define SCRIPT_WAIT_WALK(id)
until the character gets to its goal
#define FIELD_COMMAND_HALT_PARTNERS
The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose c...
#define SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
#define SCRIPT_LOOK_AT(snap, x, y)
FIELDSTG_pointCamera.
#define FIELD_LAYER_MAP
the map, its objects and characters, and the menus
#define SCRIPT_COMMAND(id, command, arg)
the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hand...
#define SCRIPT_FOLLOW(snap, id)
FIELDSTG_followWithCamera.
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define FIELD_COMMAND_ICON3
its substate 3, with ITEM_GET
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#define FIELD_COMMAND_ICON1
the player icon's substate 1, with ITEM_GET
#define FIELD_COMMAND_ICON2
its substate 2
#define SCRIPT_WAIT_BOX
until box 0 closes
#define SLOT_EXIT
The kinds of StageSlot (type).
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
#define SCRIPT_WAIT(frames)
#define FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
#define SCRIPT_TALK(box, entry, id, kind)
box of the event's boxes shows the event text's entry: a talk box at the corner kind next to the char...
FieldState FIELDSTG_state
FileCache FILE_CACHE
The file cache.
#define START_EVENT(index)
action: FIELDSTG_startListedEvent
#define ITEM(kind, id)
an item, in the bag or equipped; kind (bits 9-11) isn't read, and the scripts set it after the item's...
#define PROGRESS(n)
GAME.progress is n.
#define FLAG(group, id)
The codes of the (code, value) pairs that FLAGS_00 checks as conditions and applies as actions (event...
#define PARTY_STAT(id)
checkPartyStat
#define CARD_BATTLE(opponent, kind)
action: startCardBattle
#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_SELECT
Sounds the overlays share, with SOUNDTST's names.
#define MUSIC_SHOP_2
SHOP2BGM: Lamb Chop, the Yellow Cruiser and El Dorado.
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
void startTween(PanelAnim *tween, s32 up)
Starts the menu stage's tween (stageFuncs.start) with its sound: up, from 0 to ONE over its duration,...
#define SPECIAL_STORY_JUNGLE_SOUND_TO_NETWORK_OFFLINE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_NETWORK_OFFLINE (PROGRESS_RANGES[0x19])
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ STORY_GENJI_BEATEN
WSTAG200, event 52: after the first battle, won against Tamer Genji (event 50), the Digimon Navi give...
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define SPECIAL_STORY_GENJI_BEATEN_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_GENJI_BEATEN to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x1A])
#define SPECIAL_STORY_LOOKING_FOR_TEDDY_TO_CONTROL_ROOM
GAME.progress is from STORY_LOOKING_FOR_TEDDY to STORY_CONTROL_ROOM (PROGRESS_RANGES[0x20])
#define FLAG_CARD_BATTLE_WON
set by updateModeFlags on the way back from a card battle: 1 if the player won it (FLAGS_00....
#define FLAG_CARD_BATTLE_ENDED
set by updateModeFlags on the way back from a card battle; the talks that follow one test it and clea...
#define SPECIAL_STORY_SEIRYU_BADGE_TO_ZANBAMON_DRIVEN_OFF
GAME.progress is from STORY_SEIRYU_BADGE to STORY_ZANBAMON_DRIVEN_OFF (PROGRESS_RANGES[0xE])
#define FLAG_BOOSTER_DIVERMON_TALKED
wstag270/425: Divermon says they handle Booster Packs once (also set after event 1415 with the Folder...
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
#define SPECIAL_STORY_WAY_TO_AMATERASU_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_WAY_TO_AMATERASU to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x16])
#define SPECIAL_STORY_SINCE_GENJI_BEATEN
GAME.progress is STORY_GENJI_BEATEN or later (PROGRESS_RANGES[6], to 0x63)
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
The children of a yes/no question at the bottom of the screen: FIELDSTG's ChoiceTask and the stages' ...
struct EventTask * event
the answer's (FIELDSTG_startEvent)
void(* setPos)()
(cursor, x, y)
void(* setVisible)()
(cursor, visible)
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
FieldEvent * events
up to the first id -1
s32 soundBank
SOUND.loadBank's, or 0.
StageTile * objects
the map objects, up to the first margin 0
s32 imageFile
or an image archive file, or 0
Vec2 start
where the player starts
StageSlot * slots
up to the first type 0
ActorImage * actors
then the actors', from actors[2]
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
s32 startDir
and its direction
s32 textFile
the stage's text file, for the talks
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
void *(* getEntry)(u32 fileAndIndex)
void(* applyAction)(s32 code, s32 value)
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(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setFollowScroll)()
(on)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
The table of a stage's functions: its setup, then the menu stages' tween (startTween and updateTween)...
void(* start)(PanelAnim *tween, s32 up)
s32(* update)(PanelAnim *tween)
whether it has ended
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
void(* setVisible)(struct TextWindow *obj, u8 arg)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
s32 updateTween(PanelAnim *tween)
Steps the tween (stageFuncs.update): whether it has ended.
u16 actor28Talk0Conditions[]
u16 actor10Talk2Conditions[]
u16 actor19Talk3Actions[]
u16 actor7Talk1Conditions[]
u16 actor28Talk2Actions[]
u16 actor22Talk2Actions[]
u16 actor30Talk7Actions[]
u16 actor5Talk3Conditions[]
u16 actor7Talk4Conditions[]
u16 actor8Talk1Conditions[]
void * startEvent1520(void)
Starts event 1520, which asks whether to listen to the card rules: yes starts event 65,...
u16 actor30Talk2Actions[]
u16 actor19Talk1Actions[]
void * startEvent1518(void)
Starts event 1518, which asks whether to listen to the basic card rules: yes starts event 59,...
u16 actor2Talk1Conditions[]
u16 actor30Talk5Actions[]
u16 actor4Talk3Conditions[]
u16 actor19Talk6Actions[]
u16 actor17Talk3Actions[]
u16 actor30Talk6Conditions[]
u16 actor30Talk8Actions[]
u16 actor25Talk3Conditions[]
u16 actor30Talk2Conditions[]
u16 actor21Talk0Conditions[]
u16 actor20Talk1Conditions[]
u16 actor19Talk2Actions[]
u16 actor7Talk5Conditions[]
u16 actor7Talk2Conditions[]
u16 actor26Talk0Conditions[]
u16 actor10Talk3Actions[]
u16 actor5Talk0Conditions[]
u16 actor10Talk2Actions[]
u16 actor30Talk3Actions[]
u16 actor16Talk2Conditions[]
u16 actor25Talk0Conditions[]
u16 actor26Talk3Actions[]
u16 actor30Talk1Conditions[]
u16 actor27Talk1Conditions[]
u16 actor15Talk1Actions[]
u16 actor26Talk3Conditions[]
u16 actor27Talk2Actions[]
u16 actor26Talk2Conditions[]
u16 actor14Talk5Actions[]
void updateEvent1520(StageMenu *task, ChoiceChildren *children)
A two-option menu: creates the event object of the chosen option.
u16 actor8Talk2Conditions[]
u16 actor9Talk0Conditions[]
u16 actor19Talk2Conditions[]
u16 actor3Talk0Conditions[]
u16 actor14Talk6Conditions[]
u16 actor15Talk2Conditions[]
u16 actor25Talk3Actions[]
u16 actor7Talk0Conditions[]
FieldActorEntry * stageActors[]
u16 actor19Talk0Conditions[]
u16 actor2Talk3Conditions[]
u16 actor14Talk3Actions[]
u16 actor17Talk2Conditions[]
u16 actor10Talk1Conditions[]
u16 actor17Talk1Conditions[]
u16 actor25Talk2Conditions[]
u16 actor7Talk6Conditions[]
#define MENU_TEXT
The text file of the menus, which the versions number differently.
u16 actor21Talk2Conditions[]
u16 actor28Talk3Conditions[]
u16 actor17Talk2Actions[]
u16 actor4Talk1Conditions[]
u16 actor30Talk8Conditions[]
u16 actor14Talk3Conditions[]
u16 actor12Talk0Actions[]
u16 actor25Talk2Actions[]
u16 actor16Talk3Conditions[]
u16 actor16Talk0Actions[]
u16 actor10Talk0Conditions[]
u16 actor22Talk1Conditions[]
u16 actor27Talk3Actions[]
u16 actor21Talk3Conditions[]
u16 actor19Talk3Conditions[]
u16 actor30Talk3Conditions[]
u16 actor17Talk0Conditions[]
u16 actor14Talk1Actions[]
u16 actor25Talk1Conditions[]
u16 actor28Talk1Conditions[]
u16 actor3Talk2Conditions[]
u16 actor21Talk3Actions[]
u16 actor3Talk1Conditions[]
u16 actor20Talk2Actions[]
u16 actor20Talk0Actions[]
u16 actor2Talk2Conditions[]
u16 actor26Talk1Conditions[]
u16 actor26Talk2Actions[]
u16 actor31Talk0Conditions[]
u16 actor21Talk1Conditions[]
u16 actor19Talk5Conditions[]
u16 actor30Talk7Conditions[]
u16 actor30Talk1Actions[]
u16 actor15Talk1Conditions[]
u16 actor14Talk1Conditions[]
u16 actor21Talk0Actions[]
u16 actor30Talk6Actions[]
u16 actor14Talk6Actions[]
void setupStage(void)
Sets the stage up: its map, actors and events, playing SHOP2BGM.
u16 actor20Talk2Conditions[]
u16 actor13Talk0Actions[]
u16 actor30Talk4Actions[]
u16 actor10Talk0Actions[]
u16 actor4Talk0Conditions[]
u16 actor17Talk3Conditions[]
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
u16 actor16Talk1Conditions[]
u16 actor19Talk6Conditions[]
u16 actor30Talk0Actions[]
u16 actor9Talk1Conditions[]
u16 actor22Talk0Conditions[]
u16 actor31Talk1Conditions[]
u16 actor15Talk2Actions[]
u16 actor2Talk5Conditions[]
u16 actor14Talk4Conditions[]
u16 actor31Talk0Actions[]
u16 actor2Talk0Conditions[]
u16 actor28Talk2Conditions[]
u16 actor14Talk5Conditions[]
u16 actor2Talk6Conditions[]
u16 actor19Talk5Actions[]
u16 actor5Talk1Conditions[]
u16 actor16Talk2Actions[]
u16 actor16Talk3Actions[]
u16 actor14Talk2Actions[]
u16 actor5Talk2Conditions[]
u16 actor16Talk0Conditions[]
u16 actor17Talk0Actions[]
u16 actor10Talk3Conditions[]
u16 actor28Talk3Actions[]
u16 actor27Talk3Conditions[]
u16 actor19Talk1Conditions[]
u16 actor20Talk3Actions[]
u16 actor30Talk0Conditions[]
u16 actor20Talk0Conditions[]
u16 actor7Talk3Conditions[]
u16 actor21Talk2Actions[]
u16 actor30Talk9Actions[]
u16 actor9Talk2Conditions[]
u16 actor14Talk2Conditions[]
u16 actor9Talk3Conditions[]
u16 actor15Talk0Conditions[]
u16 actor27Talk2Conditions[]
u16 actor2Talk4Conditions[]
u16 actor8Talk0Conditions[]
u16 actor4Talk2Conditions[]
u16 actor20Talk3Conditions[]
u16 actor30Talk9Conditions[]
void updateEvent1518(StageMenu *task, ChoiceChildren *children)
A two-option menu: creates the event object of the chosen option.
u16 actor30Talk5Conditions[]
void endEvent1415(void)
After event 1415, with Divermon, Tamer Nacky, Tamer Steve, Tamer Gloria and Tamer Wong: gives the pla...
u16 actor30Talk4Conditions[]
u16 actor22Talk2Conditions[]
u16 actor27Talk0Conditions[]
u16 actor19Talk4Conditions[]
u16 actor22Talk1Actions[]
u16 actor14Talk0Conditions[]
StageFuncs stageFuncs
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...