21 switch (task->
state) {
26 if (object->
anim == 1) {
62 switch (task->
state) {
65 for (i = 0; i < 4; i++) {
91#define STAGE_CHILDREN_SIZE 0x14
111 if (task !=
NULL &&
id == 0x335) {
139#if VERSION_US || VERSION_JP
140#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
141#define EVENT_TEXT_FILE (TEXT_EVENTS_800 - 1)
142#define STAGE_FILE 0x705
144#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_07)
145#define EVENT_TEXT_FILE (TEXT_EVENTS_800 - 1)
146#define STAGE_FILE 0x715
478 { 61, 6 }, { 62, 6 }, { 63, 6 }, { 64, 6 },
479 { 65, 4 }, { 66, 4 }, { 67, 4 }, { 65, 4 },
480 { 66, 4 }, { 67, 4 }, { 65, 4 }, { 66, 4 },
481 { 67, 4 }, { 65, 4 }, { 66, 4 }, { 67, 4 },
482 { 65, 4 }, { 66, 4 }, { 67, 4 }, { 65, 4 },
483 { 66, 4 }, { 67, 4 }, { 65, 4 }, { 66, 4 },
484 { 67, 4 }, { 65, 4 }, { 66, 4 }, { 67, 4 },
485 { 65, 4 }, { 66, 4 }, { 67, 4 }, { 64, 6 },
486 { 63, 6 }, { 62, 6 }, { 61, 6 }, { 255, 0x3E7 },
489 { 60, 2, 0x1CC, 0x1B4 },
490 { 60, 0, 0x1CC, 0x1B4 },
491 { 60, 0, 0x28C, 0x155 },
492 { 44, 0, 0x16C, 242 },
495 { 0, 6 }, { 1, 6 }, { 2, 68 }, { 1, 4 },
496 { 0, 4 }, { 255, 0 },
499 { 0x12C, 18 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
500 { 4, 6 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
501 { 5, 4 }, { 6, 4 }, { 7, 4 }, { 5, 4 },
502 { 6, 4 }, { 7, 4 }, { 5, 4 }, { 6, 4 },
503 { 7, 4 }, { 4, 4 }, { 3, 4 }, { 2, 4 },
504 { 1, 4 }, { 255, 0x3E7 },
562 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
563 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
564 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
565 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
566 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
567 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
568 { 0x140, 0x100, 0x14A, 0x178, 0x28, 0x78, 0x160, 0x1FC },
569 { 0x140, 0x100, 0x152, 0x100, 0x48, 0, 0x170, 0x1FC },
570 { 0x140, 0x100, 0x140, 0x100, 0, 0, 0x140, 0x1FB },
571 { 0x140, 0x100, 0x14A, 0x158, 0x28, 0x58, 0x150, 0x1FB },
572 { 0x140, 0x100, 0x15A, 0x1C0, 0x68, 0xC0, 0x160, 0x1FB },
573 { 0x140, 0x100, 0x170, 0x198, 0xC0, 0x98, 0x170, 0x1FB },
574 { 0x140, 0x100, 0x16A, 0x1C0, 0xA8, 0xC0, 0x140, 0x1FA },
575 { 0x140, 0x100, 0x162, 0x100, 0x88, 0, 0x150, 0x1F9 },
609 { 0, 1, 0x40, 2, 0x3D, 0, 0, 0, 0, 0, 268, 164, 208, 0 },
610 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
613 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x2DE, 0xA0, 0x7C, 7, 0, 0, 0 },
614 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_LAUNCH, 0x2DF, 0x180, 0xFE, 3, 0, 0, 0 },
615 { { {
FLAG(0x40, 0xA5), 0 }, {
CODES_END, 0 } },
SLOT_EVENT, 0x438, 0, 0, 0, 0, 0, 0 },
616 { { {
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 FIELD_COMMAND_PLAY_BM_ERASE
#define FIELD_COMMAND_PLAY_DEMO_BGM
#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 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_COMMAND_STOP_CAMERA_SHAKE
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define FIELD_COMMAND_SHAKE_CAMERA
#define FIELD_COMMAND_PLAY_SN_ENTRY
#define SLOT_EVENT
starts the event arg
#define FIELD_COMMAND_PLAY_PLAYER11
#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_COMMAND_STOP_PLAYER11
#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 SCRIPT_WAIT_ANIM(id)
until its animation ends
#define FIELD_COMMAND_PLAY_TELEPORT
#define FIELD_COMMAND_PLAY_LD_ERASE
#define FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
#define FIELD_COMMAND_PLAY_SN_ERASE
#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 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...
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define MUSIC_LAST_BOSS_2
LASTB_02: Lord Megadeath's second form (WSTAG820, fighter 0x1D3's entrance)
#define SOUND_TELEPORT
TELEPORT.
#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_SATELLITE_CONTROL_ROOM
ENV_0206: the Spy Satellite's Control Room.
#define MUSIC_LAST_BOSS
LASTBOSS: Lord Megadeath's battle (WSTAG820)
#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,...
s32 stepAnimationOnce(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame,...
@ STORY_GUNSLINGER
WSTAG810 (Gunslinger 1F), event 1035.
@ STORY_MOVIE_BATTLES
WSTAG820, event 1080, with Snatchmon: each encounter plays MODE_BATTLE_MOVIE first.
#define FLAG_SNATCHMON_APPEARS_SEEN
wstag820 event 1070: Snatchmon appears and questions Lord Megadeath's orders; set at its end,...
#define FLAG_MEGADEATH_WIN_SEEN
wstag820 event 1060: beaten, Lord Megadeath calls it a test and brings out Snatchmon; set at its end,...
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.
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.
A sprite at (x, y) from the stage's sheet (FieldState.sheetEntry) with an animated palette,...
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 StageTileTask *task, s32 state)
void(* nextState)(struct StageTileTask *task)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
Any task, seen through its header.
void(* setState)(struct Task *task, s32 state)
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 updateStageEffect(StageEffect *task)
An effect that plays its animation each time it is set to TASK_DONE.
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
AnimFrame effectClutFrames[]
void handleCommand845(Task *task, s32 id)
Sets the task to TASK_DONE when the id is 0x335.
AnimFrame updateTileTaskFrames[]
FieldActorEntry * stageActors[]
void * createCommand853(s32 id)
Creates the task of updateTileTask with the given id, with a sound.
void endEvent1070(void)
After event 1070, with the player: keeps it from playing again.
void setupStage(void)
Sets the stage up: its map, actors, battles and events, playing the ambience ENV_0206.
StageEffectSpot updateStageSpots[]
Defined below, after the code that uses them.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
void * createStageEffectWithId(s32 arg)
Creates the StageEffect of updateStageEffect at (0x1CC, 0x1B4) with frame 0x3C.
void updateTileTask(StageTileTask *task)
Shows the map object with animation 1, animated once, then hides it and kills itself.
void endEvent1080(void)
After event 1080, with Snatchmon: moves the story on to STORY_MOVIE_BATTLES and starts the stage's ev...
void endEvent1060(void)
After event 1060, with the player: starts the stage's event battle 0 and keeps it from playing again.
FieldBattles stageBattles[]