63 switch (task->
state) {
67 for (i = 0; i < 20; i++) {
84#define STAGE_CHILDREN_SIZE 0x58
110#if VERSION_US || VERSION_JP
111#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
112#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
113#define STAGE_FILE 0x6DE
114#define STAGE_FILE_8 0x700
116#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_02)
117#define EVENT_TEXT_FILE (TEXT_EVENTS_700 - 1)
118#define STAGE_FILE 0x6EE
119#define STAGE_FILE_8 0x710
214 { 68, 0, 188, 0x1C4 },
215 { 68, 0, 0x11C, 0x154 },
216 { 68, 0, 0x11C, 0x254 },
217 { 68, 0, 0x15C, 0x1F4 },
218 { 68, 0, 0x1BC, 0x184 },
219 { 68, 0, 0x1BC, 0x244 },
220 { 68, 0, 0x1DC, 0x1B4 },
221 { 68, 0, 0x1DC, 0x2B4 },
222 { 68, 0, 0x1FC, 0x124 },
223 { 68, 0, 0x1FC, 0x224 },
224 { 68, 0, 0x25C, 0x174 },
225 { 68, 0, 0x27C, 0x1E4 },
226 { 68, 0, 0x27C, 0x224 },
227 { 68, 0, 0x27C, 0x2E4 },
228 { 68, 0, 0x29C, 0x254 },
229 { 68, 0, 0x2DC, 0x174 },
230 { 68, 0, 0x2FC, 0x2A4 },
231 { 68, 0, 0x31C, 0x214 },
232 { 20, 0, 0x3AC, 0x2A4 },
235 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
236 { 0, 4 }, { 255, 0 },
239 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
240 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
241 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
242 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
243 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
244 { 1, 4 }, { 255, 0x3E7 },
302 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
303 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
304 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
305 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
306 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
307 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
308 { 0x140, 0x100, 0x178, 0x100, 0xE0, 0, 0x170, 0x1FB },
309 { 0x140, 0x100, 0x170, 0x180, 0xC0, 0x80, 0x150, 0x1FA },
310 { 0x140, 0x100, 0x140, 0x160, 0, 0x60, 0x160, 0x1FA },
372 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 208, 361, 0, 0 },
373 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 240, 473, 0, 0 },
374 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 368, 409, 0, 0 },
375 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 400, 521, 0, 0 },
376 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 432, 633, 0, 0 },
377 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 496, 345, 0, 0 },
378 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 528, 457, 0, 0 },
379 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 560, 569, 0, 0 },
380 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 592, 681, 0, 0 },
381 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 656, 393, 0, 0 },
382 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 688, 505, 0, 0 },
383 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 720, 617, 0, 0 },
384 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 752, 729, 0, 0 },
385 { 1, 0, 0x40, 6, 0x32, 2, 0, 0xF, 4, 0, 848, 553, 0, 0 },
386 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
389 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x26B, 0xD0, 0x33C, 5, 0, 0, 0 },
390 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x26D, 0x1E8, 0x254, 3, 0, 0, 0 },
391 { { {
ITEM(0, 0x11), 1 }, {
FLAG_DARK_KNIGHT_WIN_SEEN, 0 } },
SLOT_EVENT, 0x32A, 0, 0, 0, 0, 0, 0 },
392 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x1F40, 0, 0, 0, 0, 0, 0 },
393 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x1F41, 0, 0, 0, 0, 0, 0 },
394 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x1F42, 0, 0, 0, 0, 0, 0 },
395 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
396 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
397 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
398 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
399 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
400 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
401 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
402 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
403 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
404 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
405 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
406 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
407 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
408 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
409 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
410 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
411 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
412 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x26C, 0x3C0, 0x2B0, 7, 0, 0, 0 },
413 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
StageEffect * createStageEffect(s32 x, s32 y, s32 frame)
Creates a StageEffect at (x, y) with its sprites' frames from FRAME.
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
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 EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#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 SLOT_LAUNCH
sends the player flying (FIELDSTG_launchActor)
#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 SLOT_EVENT
starts the event arg
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#define SCRIPT_WAIT_BOX
until box 0 closes
#define SLOT_EXIT
The kinds of StageSlot (type).
#define FIELD_MAP_AREAS
a cell's value: its battle area (FieldBattles), or 0
#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_PLACE(id, x, y)
puts a character at (x, y)
#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
#define EVENT_BATTLE(id)
action: FIELDSTG_battleFuncs.startEventBattle
#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.
TaskRegistry TASK_REGISTRY
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
#define MUSIC_DUNGEON
BGM_0023: the Ice, Fire and Dark Dungeons.
#define MUSIC(bank, n)
A field's or a battle's music (FieldState.music, Battle.music): track (SEP) n of the first sequence o...
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
#define MUSIC_BOSS_1
BOSS_001: the Digimon Arena's, the cities', the dungeons' and the A.o.A's boss battles.
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define SPECIAL_STORY_JUNGLE_SOUND_TO_AMATERASU_BRIDGE
GAME.progress is from STORY_JUNGLE_SOUND to STORY_AMATERASU_BRIDGE (PROGRESS_RANGES[0x12])
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
@ 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_GAIN_5000_BIT
an action: gives the player 5000 BIT (MONEY_GAINS[6])
#define FLAG_DARK_KNIGHT_WIN_SEEN
wstag745 event 810: Dark Knight, beaten, says the player will make a great tamer; set at its end,...
#define FLAG_GENBU_LEADER_CHALLENGE_SEEN
wstag745 event 811: the player asks Genbu Leader for his badge and he won't give it for free; set at ...
#define SPECIAL_SHOW_ITEM_GET_ICON
an action: the player's icon plays its animation 3 with SOUND_ITEM_GET (FIELD_COMMAND_ICON3); the tal...
#define FLAG_DARK_DUNGEON_5000_BIT_FOUND
wstag745: chest that gives 5000 BIT ("I got 5000 BIT!"); its conditions test it 0
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
One frame of a sprite animation; frame 0xFF ends it (or loops it)
A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random.
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones ...
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(* applyAction)(s32 code, s32 value)
s32(* checkCondition)(u16 code, u16 value)
short(* playSound)(s32 id)
returns the voice of a key-on
A sprite effect a stage creates at (x, y) with the given frame, by kind.
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
The task a stage starts (startStage), updated by its updateStage.
void(* nextState)(struct StageTask *task)
void(* setState)(struct StageTask *task, s32 state)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
void *(* find)(s32 id, s32 key1, s32 key2)
void * createTaskWithId(void(*update)(), s32 size, s32 childrenSize, s32 id)
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
void updateDarkness(StageTask *task)
The darkness: the screen drawn black (a white quad subtracted from it, blend mode 2) while in TASK_DO...
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
void endEvent810(void)
After event 810, with Dark Knight: starts the stage's event battle 0 and keeps it from playing again.
void * startEvent8001(void)
Brings the darkness back (TASK_DONE)
AnimFrame effectClutFrames[]
FieldActorEntry * stageActors[]
void * startEvent8002(void)
Lifts the darkness and starts its countdown back (TASK_RUN, key1 = 1)
void endEvent811(void)
After event 811, with Dark Knight: gives the player the Brave Sword and keeps it from playing again.
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing BGM_0023, with the Dark Dungeon's dar...
StageEffectSpot updateStageSpots[]
Defined below, after the code that uses them.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
void * createDarkness(void)
Creates the darkness task (id 0x18)
void * startEvent8000(void)
Lifts the darkness (TASK_RUN)
FieldBattles stageBattles[]