76 s32 offsetX = cellOffsetX;
77 s32 offsetZ = cellOffsetZ;
151 state->
mask = 0x3f3f;
225 u32 horizontalScroll;
232 horizontalScroll = *scrollOffset;
241 s32 horizontalOffset;
257 {0,
CONDITION_ALWAYS, 100, 0, 100,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
258 {1,
CONDITION_ALWAYS, 328, 0, 424,
FACING_WEST, 0, -1, -1, -1, -1, 0},
259 {2,
CONDITION_ALWAYS, 424, 0, 440,
FACING_EAST, 0, -1, -1, -1, -1, 0},
260 {3,
CONDITION_ALWAYS, 376, 0, 360,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
261 {4,
CONDITION_ALWAYS, 424, 0, 328,
FACING_EAST, 0, -1, -1, -1, -1, 0},
262 {5,
CONDITION_ALWAYS, 376, 0, 264,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
263 {6,
CONDITION_ALWAYS, 328, 0, 248,
FACING_WEST, 0, -1, -1, -1, -1, 0},
264 {7,
CONDITION_ALWAYS, 328, 0, 152,
FACING_WEST, 0, -1, -1, -1, -1, 0},
265 {8,
CONDITION_ALWAYS, 424, 0, 136,
FACING_EAST, 0, -1, -1, -1, -1, 0},
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
The task scheduler: tasks, their order and the scheduler's state.
The engine calls the debug menus import, and their palette swatch tiles.
The display transition's frames, windows and state.
Djinn numbers, named from the English release.
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
Scene commands: the all-caps macros the scene scripts are written in.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
#define MAP_CELL_STEPS_END
@ TRANSITION_BACKDROP_FADE
#define SCENE_TRANSITION(style, variant)
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define PSYNERGY_IN_AREA(ability, phase)
#define SCENE_EXIT(exit, scene, entrance)
#define EVENT_SCRIPT(script)
Game flags, named where their meaning is shown.
#define FLAG_DJINNI_0
the flag of Djinni 0, set once it is caught
void Runtime_SetIrqHandler(u32 irq, s32 vcount, InterruptHandler handler)
Installs handler for interrupt irq and enables that interrupt, or with a null handler disables it and...
volatile u32 gFrameCount
Frames WaitFrames has finished.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
struct DisplayTransitionState * gDisplayTransition
Slot 31.
The screen blend's globals and the graphics routines.
The hardware's I/O registers and their bits, as pret names them.
#define BLDCNT_EFFECT_BLEND
weighted by REG_BLDALPHA
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
The hardware's interrupt sources and the interrupt handler table.
The keypad state the VBlank interrupt keeps.
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
The reel game's title lettering.
void DisplayTransition_InitializeBattleEffectState(s32 mode)
Starts window transition mode at value 0, with no duration: the caller moves it.
void Field_RequestDjinnBattle(s32 flag, s32 no)
Sets up the battle with Djinni number no.
Declares nothing: an empty header kept for the files that include it.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
s32 SerialRuntime_PollAndTransfer(void *send, void *receive)
Looks for the link partner and, once connected, does one exchange (as SerialRuntime_ExchangePayloads)...
Song and sound effect ids, indices into gSound_SongTable.
struct EventWork * gEventWork
void Engine_EventRequestExit()
The display transition state (heap block 31): two pages of window edges for every line,...
u16 value
The progress, moved from start to end over duration frames: bit 5 says whether the transition opens o...
s16 active
WININ, or WINOUT by mode: 1 when a transition starts.
s16 mask
WINOUT, or WININ by mode: 0x3f3f or 63 when a transition starts.
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
struct FieldActor * viewCenter
the object the map view follows
s32 startTransition
SCENE_TRANSITION(style, variant).
s16 touchedTrigger
the step event a touch or exit event answers
A field actor: a person or thing on the field with a position, motion toward a target,...
union FieldCoordinate x
16.16 fixed-point pixels
union FieldCoordinate y
16.16 fixed-point pixels
s32 terrainHeight
16.16 fixed-point pixels
union FieldCoordinate z
16.16 fixed-point pixels
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
s32 selectedActor
the leader: its unit and its actor
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
s32 Map_GetTerrainHeight(s32 layer, s32 x, s32 y)
Returns the ground height of a layer at (x, y) in 16.16 pixels: the height function of the cell's ter...
u32 gTretTreeBranch_Exits[]
static void Event_ShiftNorthSixCells(void)
Touch trigger 15: the leader and camera move 96 pixels north at once.
static void UNUSED TretTreeBranch_ExchangeInputPacket(void)
Unused exchange callback: puts held/repeated keys in the transfer header.
static u16 sHofsAtOrAfterSplit
static u16 sTransferHeader[16]
struct ScenePlacement gTretTreeBranch_Placements[]
static void TretTreeBranch_UpdateBg3ScrollSplit(void)
Updates the split from the first map layer's pixel position.
s32 TretTreeBranch_Initialize(void)
Initializes the backdrop transition and installs BG3's scanline scroll split.
static void UNUSED TretTreeBranch_UnusedHookFirst(void)
static void TretTreeBranch_SetRevealWindow(struct DisplayTransitionState *state)
Selects the same mask and window parameters for Reveal and scene entry.
static u16 sHofsBeforeSplit
static void Event_ShiftSouthFiveCellsSecond(void)
Touch trigger 12: the same 80-pixel move south as trigger 10.
u16 gTretTreeBranch_CellSteps[]
const struct ScenePlacement * TretTreeBranch_GetPlacements(void)
static void TretTreeBranch_ApplyBg3ScrollAtScanline(void)
HBlank selects BG3's horizontal offset for the next scanline.
static void Event_ShiftNorthFiveCells(void)
Touch trigger 11: the leader and camera move 80 pixels north at once.
static void TretTreeBranch_ShiftLeaderAndCameraByCells(s32 cellOffsetX, s32 cellOffsetZ)
Moves the leader and camera by signed 16-pixel cell offsets, placing each at the terrain height of it...
static void Event_CastReveal(void)
Casting Reveal on the branch (its phase 2): the window transition and BG1's blend over the rest of th...
static void Event_TalkToBreeze(void)
Talking to Breeze: the Djinni hops and its battle starts.
static void TretTreeBranch_StartBg3Split(void)
Starts the scanline-dependent BG3 scroll callbacks.
struct SceneEntrance gTretTreeBranch_Entrances[]
const u32 * TretTreeBranch_GetExits(void)
const struct SceneEntrance * TretTreeBranch_GetEntrances(void)
static void UNUSED TretTreeBranch_RunEmptyEvent(void)
Unused event hook: begins and immediately ends an event.
static void Event_ShiftSouthSixCells(void)
Touch trigger 14: the leader and camera move 96 pixels south at once.
static void Event_TakeTouchedExit(void)
Walking into one of exits 1 to 8: the exit sound plays and the party leaves by the exit touched.
static u8 sTransferData[96]
struct SceneEvent gTretTreeBranch_Events[]
static void Event_ShiftSouthFiveCells(void)
Touch trigger 10: the leader and camera move 80 pixels south at once.
const struct SceneEvent * TretTreeBranch_GetEvents(void)
Returns the touch, talk, exit and Reveal events for this branch.
static void UNUSED TretTreeBranch_UnusedHookSecond(void)
static void Event_ShiftNorthFiveCellsSecond(void)
Touch trigger 13: the same 80-pixel move north as trigger 11.
const struct SceneRegion * TretTreeBranch_GetRegions(void)
The integer types, TRUE, UNUSED and the fixed-address macros.
s32 fixed
16.16 fixed-point pixels