18#define FIELD_LAYER_BACK 0x1000
19#define FIELD_LAYER_COVER 0x1001
20#define FIELD_LAYER_MAP 0x1002
21#define FIELD_LAYER_BANNER 0x1003
22#define FIELD_LAYER_TEXT 0x1004
25#define FIELD_TASK_MAP 4
26#define FIELD_TASK_ACTOR 5
27#define FIELD_TASK_FIELD 7
28#define FIELD_TASK_BANNER 9
29#define FIELD_TASK_HIDDEN_SPOTS 0xB
30#define FIELD_TASK_CAMERA 0x10
31#define FIELD_TASK_ICON 0x16
32#define FIELD_TASK_LAUNCHER 0x17
33#define FIELD_TASK_COMMANDS 0x32D
41#define FIELD_COMMAND_HALT_PARTNERS 0x337
42#define FIELD_COMMAND_ICON1 0x338
43#define FIELD_COMMAND_ICON2 0x339
44#define FIELD_COMMAND_ICON3 0x34A
45#define FIELD_COMMAND_HIDE_OBJECTS(n) (0x34D + (n))
46#define FIELD_COMMAND_SHOW_OBJECTS(n) (0x353 + (n))
47#define FIELD_OBJECT_GROUPS 6
48#define FIELD_OBJECT_GROUP_ANIM 100
49#define FIELD_COMMAND_PLAY_INFO_SIG 0x365
50#define FIELD_COMMAND_PLAY_GAYALOOP 0x366
51#define FIELD_COMMAND_STOP_GAYALOOP 0x367
52#define FIELD_COMMAND_PLAY_WEAR_OFF 0x368
53#define FIELD_COMMAND_PLAY_DEMO_BGM 0x369
54#define FIELD_COMMAND_PLAY_SE000002 0x36A
55#define FIELD_COMMAND_PLAY_BEAM_SHT 0x36B
56#define FIELD_COMMAND_PLAY_SWITCH02 0x36C
57#define FIELD_COMMAND_PLAY_MASK_SET 0x36D
58#define FIELD_COMMAND_PLAY_BM_ERASE 0x36E
59#define FIELD_COMMAND_PLAY_LD_ERASE 0x36F
60#define FIELD_COMMAND_PLAY_PLAYER11 0x370
61#define FIELD_COMMAND_STOP_PLAYER11 0x371
62#define FIELD_COMMAND_SHAKE_CAMERA 0x372
63#define FIELD_COMMAND_STOP_CAMERA_SHAKE 0x373
64#define FIELD_COMMAND_PLAY_TRAP_OFF 0x374
65#define FIELD_COMMAND_PLAY_SAVEDEMO 0x375
66#define FIELD_COMMAND_SEARCH_EVENT_SPOT 0x376
67#define FIELD_COMMAND_PLAY_SWITCH03 0x377
68#define FIELD_COMMAND_PLAY_SN_ENTRY 0x378
69#define FIELD_COMMAND_PLAY_SN_ERASE 0x379
70#define FIELD_COMMAND_PLAY_TELEPORT 0x37A
71#define FIELD_COMMAND_PLAY_BULB_003 0x37C
72#define FIELD_COMMAND_PLAY_GONDRA_S 0x37D
73#define FIELD_COMMAND_PLAY_PIYOPIYO 0x37E
74#define FIELD_COMMAND_PLAY_COMCD103 0x37F
75#define FIELD_COMMAND_PLAY_COMCD201 0x380
76#define FIELD_COMMAND_PLAY_COMCD111 0x381
77#define FIELD_COMMAND_PLAY_BEAM_HIT 0x382
78#define FIELD_COMMAND_PLAY_SWITCH01 0x383
79#define FIELD_COMMAND_PLAY_COMCD115 0x384
80#define FIELD_COMMAND_STOP_COMCD115 0x385
81#define FIELD_COMMAND_STOP_BEAM_HIT 0x386
85#define FIELD_MAP_FLOOR0 0
86#define FIELD_MAP_FLOOR1 1
87#define FIELD_MAP_AREAS 4
88#define FIELD_MAP_TRIGGERS 7
146 void *(*start)(void);
157#define SCRIPT_PLACE(id, x, y) 0x100, id, x, y
158#define SCRIPT_POSE(id, set, dir) 0x101, id, set, dir
161#define SCRIPT_COMMAND(id, command, arg) 0x101, id, command, arg
162#define SCRIPT_WALK(id, x, y, dir) 0x102, id, x, y, dir
165#define SCRIPT_TALK(box, entry, id, kind) 0x200, box, entry, id, kind
166#define SCRIPT_WAIT(frames) 0x300, frames
167#define SCRIPT_WAIT_BOX 0x301
168#define SCRIPT_WAIT_WALK(id) 0x302, id
169#define SCRIPT_WAIT_ANIM(id) 0x303, id
170#define SCRIPT_LEAVE(mode, x, y, dir) 0x304, mode, x, y, dir
171#define SCRIPT_FOLLOW(snap, id) 0x600, snap, id
172#define SCRIPT_LOOK_AT(snap, x, y) 0x601, snap, x, y
185#define FIELD_CHARACTER_PLAYER 2
186#define FIELD_CHARACTER_PARTNERS 3
190#define FIELD_FLAG_ENCOUNTERED 0xF
236#define LIFT_DOWN 0x349
256#define SLOT_CLIMB_UP 2
257#define SLOT_CLIMB_DOWN 3
266#define SLOT_STOP_SLIDE 12
267#define SLOT_LAUNCH 13
268#define SLOT_LAUNCH_OUT 14
302#define SLOT_DEST(slot) ((SlotDest *)&(slot)->arg)
310#define ACTOR_WALK_OUT 5
311#define ACTOR_CLIMB 0x40
312#define ACTOR_CLIMB_UP 0x41
313#define ACTOR_CLIMB_DOWN 0x42
314#define ACTOR_GET_ON_WALL 0x43
315#define ACTOR_GET_OVER_EDGE 0x44
316#define ACTOR_CLIMB_OFF_TOP 0x45
317#define ACTOR_CLIMB_OFF_BOTTOM 0x46
318#define ACTOR_DROP 0x47
319#define ACTOR_GAUGE 0x48
320#define ACTOR_SEARCH 0x49
321#define ACTOR_TALK 0x4A
322#define ACTOR_FLY 0x4B
323#define ACTOR_FLOAT 0x4C
324#define ACTOR_USE 0x4D
325#define ACTOR_USED 0x4E
326#define ACTOR_SLIDE 0x4F
327#define ACTOR_STOP_SLIDE 0x50
443 struct Task *(*stageInit)(
void *owner);
#define TASK_HEADER(Type)
void FIELDSTG_startListedEvent(s32 index)
starts the event FIELDSTG_eventIds[index]
void FIELDSTG_openInn(void)
opens the inn
void * FIELDSTG_startEventBattle5(void)
starts a battle: the handler of the stages' events 9000
struct EventTask * FIELDSTG_startEvent(s32 id)
FIELDSTG functions the stages call.
StageTile * FIELDSTG_findNextObject(void)
and the next, or NULL
void FIELDSTG_leaveField(s32 mode, s32 arg, s32 x, s32 y, s32 dir)
FIELDSTG's functions and data that the executable calls (game/events.c, system/overlay....
FieldState FIELDSTG_state
StageTile * FIELDSTG_findObject(s32 anim)
the first map object with that animation
FieldBattleFuncs FIELDSTG_battleFuncs
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
s16 imageX
where FIELDSTG_animateActor loads each frame
A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters.
s16 frameHeight
and its height
s32 keepsDir
doesn't turn to the one who talks to it (characters 0x28-0x2A, 0x3E and 0x11A)
s32 goalX
the tile it walks to
u16 * talkActions
the talk's flag actions, applied when it ends, or NULL
s32 animSet
the animation set it plays (setAnim)
s32 climbSide
a climb shifts it a tile right (1) or left (0)
void(* walkInDir)(struct Actor *, s32 dir)
s32 animTime
the frame's time left
s32 z
how high it is off the ground, in 1/256 pixels (drawn that much higher)
void(* setGoal)(struct Actor *, s32, s32, s32)
void(* unused128)()
a method slot between warp and startWalk that FIELDSTG_createActor never sets and nothing calls
s32 walks
the pad walks it (ACTOR_WALK) instead of running
s32 pad98
never read or written
void(* warp)(struct Actor *, SlotDest *dest, s32 kind)
s32 loadedSet
the set setAnims was loaded for
s32 setAnims[5]
the set's animations, for the directions 0 to 4
s32 wallHeight
the top of the climb
struct ActorImage * image
s32 goalDir
the direction it then faces
void(* startWalk)(struct Actor *)
s32 depth
the layer's ordering table entry
struct Trail * trail
a follower's: the leader's steps
void(* getFacingTile)(struct Actor *, Vec2 *out)
void(* launch)(struct Actor *, SlotDest *dest)
s16 voice
a sound voice, or -1
s32 frame[4]
the frame's image, the one loaded, and two values
s32(* isAnimDone)(struct Actor *)
s32 flying
the flying player (FIELDSTG_controlFlight)
s32 animDone
the animation ended (isAnimDone)
s32 climbHeight
how high it has climbed, in 1/256 pixels (its shadow stays below)
s16 frameWidth
the loaded image's width in pixels
s32(* isWalking)(struct Actor *)
void(* startSlide)(struct Actor *, s32 dir)
s32 walking
walking to the goal (setGoal, FIELDSTG_walkToGoal)
s32 animFile
its animations' file and index (FIELDSTG_fileEntries), or 0
struct FieldImage * fieldImage
the field's image, for the shadow
void(* resetControl)(struct Actor *)
s32 halfWidth
half its width (FIELDSTG_actorWidths): its box's half width, and half that its half height
s32 animPos
the next word of the direction's frames
void(* setPose)(struct Actor *, s32, s32 dir)
void(* control)(struct Actor *)
its update by kind, or NULL (resetControl)
s32 reloadImage
set to reload the frame's image
s32 hasShadow
drawn with a shadow
s32 scriptFlag
cleared by FIELDSTG_clearScriptFlag; nothing in FIELDSTG or the stages reads it
void(* setDir)(struct Actor *, s32 dir)
s32 speed
0x400, 0x4CC in PAL's 50 Hz
void(* stopSlide)(struct Actor *)
struct Actor * talkPartner
the actor that talks to it
s32 zSpeed
added to z each frame
s16 padCA
never read or written
struct FieldActorEntry * entry
what created it, or NULL
void(* setAnim)(struct Actor *, s32)
A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTST...
s32 encounter
of FIELDSTG_encounters
s32 stage
the fight stage, for BATTLE_SETUP.stage
s32 music
for BATTLE_SETUP.music (MUSIC_); the empty slots, { 0, 0, MUSIC(1, 0) }, keep the bare MUSIC(1,...
The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random.
s32 count
how often they come: an index of FIELDSTG_battleRates
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)
A menu cursor: a text window showing one of the CURSOR_FRAMES glyphs.
An event (FIELDSTG_runEvent, made by FIELDSTG_startEvent): it runs a script of 16-bit words,...
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
struct FieldTalk * talks
up to the first without conditions
s16 image
its ActorImage, of FieldState.images.actors from 2 (FIELDSTG_createActor)
u16 * conditions
FLAGS_00.checkConditions's, or NULL.
void(* startEventBattle)(s32 index)
FIELDSTG_startEventBattle.
void(* startAreaBattle)(void)
FIELDSTG_startAreaBattle.
The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones ...
s32 id
the place, GAME.place
s32 serial
a number of its own, 1 to 448 over the stages; nothing reads it
s32 pad8
0 in every list; nothing reads it
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
s32 text
a file and index, the file counted from TEXT_FILE(1); or 0
s16 * script
FIELDSTG_runEvent's, or NULL.
The image of the field's effects (FieldState.images), then the actors' ActorImages.
ActorImage shadow
the actors' shadow (FIELDSTG_drawActor)
void(* getWalkStep)(Vec2 *pos, s32 scale, s32 dir, Vec2 *out)
FIELDSTG_getWalkStep.
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
s32 files[8]
the file entry of each map, set by setFile
s32(* getCell)(s32 index, Vec2 *pos)
FIELDSTG_getMapCell.
void(* setMap)(s32 index)
FIELDSTG_setMap: the map the player is on.
s32 width
of the grid, in cells
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
void(* getFlyStep)(Vec2 *pos, s32 scale, s32 dir, Vec2 *out)
FIELDSTG_getFlyStep.
s32(* isTileFree)(Vec2 *pos)
FIELDSTG_isTileFree: 0 where a character or an object stands.
The field's state (FIELDSTG_state): what a stage tells FIELDSTG about itself, filled by its setup fun...
s32 frozen
no control, triggers or encounters for the player: while the area name banner shows (FIELDSTG_createB...
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
s32 busy
an event, a warp, a launch or a battle has the player
s32 imageEntry
an image archive's file entry, loaded at (0x140, 0x100), or 0
s32 defaultStartDir
and its direction
s32 battleStarting
an encounter started (FIELDSTG_startEncounter)
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
void(* init)(void)
FIELDSTG_pickStage.
s32 menuOpen
the field menu (START) or the inn (FIELDSTG_openInn) is open: the pad doesn't move the player
Vec2 start
where the player starts
StageSlot * slots
up to the first type 0
ActorImage * actors
then the actors', from actors[2]
s32 acting
the player talks, climbs, slides or searches
s32(* getFileEntry)(s32 character)
FIELDSTG_fileEntries's.
s32(* getActorWidth)(s32 character)
FIELDSTG_actorWidths's.
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
s32 startDir
and its direction
CVECTOR spriteColor
the field's sprites' color, unless cd is 0
s32 eventText
the running event's text file and entry
Vec2 defaultStart
where the player starts without a mode argument
s32 textFile
the stage's text file, for the talks
union FieldState::@12 images
FieldImage * field
the field's image (the first two ActorImages)
s32 music
SOUND.playSound's, or 0.
FieldActorEntry ** actors
the characters, up to the first NULL
s32 stageFile
the stage overlay's file
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
s32 entry
its text's entry in the field's text file (FIELDSTG_createTalk)
u16 * actions
FLAGS_00.applyActions's when it ends, or NULL.
u16 * conditions
FLAGS_00.checkConditions's.
s16 y[2]
the objects' y when the move started
s16 raised
the objects are 0x7F up from their place, and the next move takes them down (LIFT_DOWN; flag 0x1C3D a...
s16 shake
the step of the shake table, then a frame count
s16 pad5E
never read or written
StageTile * tiles[2]
the map objects 3 and 2
s16 homeY[2]
the objects' place on the map
Where a slot leads: a StageSlot from its arg on, as the warps (FieldTask.warp) and the launches (Laun...
u16 hideAnim
which a warp doesn't read
u16 place
copied to GAME.place, the place (FieldBattles.id)
u16 placeArg
copied to GAME.placeArg
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
u16 arg
by type: a mode, a depth, a map, an event or a height (in 16 pixels, plus 1 for a climb); a warp's an...
u16 conditions[2][2]
flag code and value, or code 0xFFFF
u16 place
copied to GAME.place, the place (FieldBattles.id)
u16 hideAnim
the animation of the map objects to hide, or 0
u16 placeArg
copied to GAME.placeArg: with place, the next stage's place points
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
u8 margin
how far off the view it is still drawn; 0 ends the table
s16 cycleTime
in 1/256 frames; bit 15: going back
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
u8 cycle
1 cycles the frame, 2 the CLUT row, 3 the row back and forth
s16 sortY
drawn sorted at this y, or 0
Any task, seen through its header.
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...