37#include "text/msg_ids.h"
57#define SPEAKER(actor) (SPEAKER_WINDOW_BELOW | (actor))
63#define FLOOR_FALL_SPIN_FRAMES 30
64#define SWIRL_SPARK_LAST_FRAME 79
65#define SWIRL_SPARK_SHRINK_LAST_FRAME 39
66#define TRET_TINT_COLOR_COUNT 63
67#define TRET_TINT_CHANNEL_MAX 31
68#define TRET_TINT_END 99
110 s32 sourceRow,
s32 entrance) {
111 s32 destinationColumn;
125 Map_CopyCells(sourceColumn, sourceRow, 1, 1, destinationColumn,
132 Map_CopyCells(sourceColumn, sourceRow + 1, 1, 1, destinationColumn,
278 if (leader !=
NULL) {
282 if (leader !=
NULL) {
287 if (leader !=
NULL) {
554 s32 openingColumn = 10;
557 s32 passageColumn = 30;
564 s32 openingColumn = 10;
565 s32 passageColumn = 8;
605 layer = &mapWork->
layers[0];
626 if (entrance == 50 || entrance == 40 || entrance == 30 || entrance == 20) {
644 }
else if (entrance == 10) {
647 }
else if (entrance == 19) {
663 u16 *destinationColors;
677 sourceColors = paletteWork->
palette;
683 destinationColors = (
u16 *)0x05000020;
689 if (colorIndex > 47) {
690 redStep -= redStep / 2 + redStep / 3;
691 greenStep -= greenStep / 2 + greenStep / 3;
692 blueStep -= blueStep / 2 + blueStep / 3;
693 }
else if (colorIndex > 31) {
694 redStep -= redStep / 3 + redStep / 4;
695 greenStep -= greenStep / 3 + greenStep / 4;
696 blueStep -= blueStep / 3 + blueStep / 4;
697 }
else if (colorIndex > 15) {
698 redStep -= redStep / 4 + redStep / 5;
699 greenStep -= greenStep / 4 + greenStep / 5;
700 blueStep -= blueStep / 4 + blueStep / 5;
702 color = *sourceColors;
704 green = (color >> 5) & 31;
705 blue = (color >> 10) & 31;
721 *destinationColors++ = (blue << 10) | (green << 5) | red;
808 frame = spark->
timer;
837 void *previousResourceEntry;
844 previousResourceEntry = 0;
857 for (sparkIndex = 0; sparkIndex < 6 - wave; sparkIndex++) {
861 previousResourceEntry =
864 spark->sprite->image.priority = 0;
868 spark->
work = ((360 / (
u32)(6 - wave) * sparkIndex) << 16) / 360;
872 spark->
speed = 0x19999;
886 if (++*counter > 120) {
940 particleOptions = &options;
942 particleOptions->
update = Effect_AdvanceMotion;
945 for (particleIndex = 0; particleIndex <= 16; particleIndex++) {
946 particleVelocity = &velocity;
948 particleVelocity->
y = 0;
1078 0, 0, 0, 0, 0, 0, 0, 0,
1079 0, 0, 0, 0, 0, 0, 0, 0,
1080 0, 0, 0, 0, 0, 0, 0, 0,
1081 1, 0, 0, 1, 0, 0, 1, 0,
1082 0, 1, 0, 0, 1, 0, 0, 1,
1083 0, 0, 1, 0, 0, 1, 1, 0,
1084 1, 1, 0, 1, 1, 0, 1, 1,
1085 0, 1, 1, 0, 1, 1, 0, 1,
1086 1, 1, 1, 1, 1, 1, 1, 1,
1087 1, 1, 1, 1, 1, 1, 2, 1,
1088 1, 2, 1, 1, 2, 1, 1, 2,
1089 1, 1, 2, 2, 1, 2, 2, 1,
1090 2, 2, 2, 3, 2, 2, 3, 2,
1091 2, 3, 3, 2, 3, 3, 2, 3,
1092 3, 2, 3, 3, 2, 3, 3, 3,
1093 3, 3, 3, 3, 3, 3, 3, 3,
1094 3, 3, 3, 3, 4, 3, 3, 4,
1095 3, 3, 4, 3, 3, 4, 3, 3,
1096 4, 3, 3, 4, 3, 3, 4, 4,
1097 3, 4, 4, 3, 4, 4, 3, 4,
1098 4, 3, 4, 4, 3, 4, 4, 3,
1099 4, 4, 3, 4, 4, 3, 4, 4,
1100 3, 4, 4, 3, 4, 4, 4, 4,
1101 4, 4, 4, 4, 4, 4, 4, 4,
1102 4, 4, 4, 4, 4, 4, 4, 4,
1103 4, 4, 4, 4, 4, 4, 4, 4,
1104 4, 4, 4, 4, 4, 4, 4, 4,
1105 4, 4, 3, 4, 4, 3, 4, 4,
1106 3, 4, 4, 3, 4, 4, 3, 4,
1107 4, 3, 4, 4, 3, 4, 4, 3,
1108 4, 4, 3, 4, 4, 3, 4, 3,
1109 3, 4, 3, 3, 4, 3, 3, 4,
1110 3, 3, 4, 3, 3, 4, 3, 3,
1111 3, 3, 3, 3, 3, 3, 3, 3,
1112 3, 3, 3, 3, 3, 3, 3, 3,
1113 3, 2, 3, 3, 2, 3, 3, 2,
1114 3, 3, 2, 3, 2, 2, 3, 2,
1115 2, 2, 2, 2, 2, 2, 1, 2,
1116 2, 1, 2, 1, 1, 2, 1, 1,
1117 2, 1, 1, 2, 1, 1, 1, 1,
1118 1, 1, 1, 1, 1, 1, 1, 1,
1119 1, 1, 1, 1, 1, 1, 1, 0,
1120 1, 1, 0, 1, 1, 0, 1, 1,
1121 0, 1, 1, 0, 1, 1, 0, 1,
1122 0, 0, 1, 0, 0, 1, 0, 0,
1123 1, 0, 0, 1, 0, 0, 1, 0,
1124 0, 1, 0, 0, 99, 99, 99, 99,
1125 99, 99, 99, 99, 99, 99, 99, 99,
1126 99, 99, 99, 99, 99, 99, 99, 99,
1127 99, 99, 99, 99, 99, 99, 99, 99,
1128 99, 99, 99, 99, 99, 99, 99, 99,
1129 99, 99, 99, 99, 99, 99, 99, 99,
1130 99, 99, 99, 99, 99, 99, 99, 99,
1131 99, 99, 99, 99, 99, 99, 99, 99,
1136 { 0,
CONDITION_ALWAYS, 136, 0, 136,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1137 { 1,
CONDITION_ALWAYS, 488, 0, 248,
FACING_NORTH, 0, 352, 0, 640, 272, 0 },
1138 { 2,
CONDITION_ALWAYS, 712, 0, 152,
FACING_EAST, 0, 672, 0, 944, 272, 0 },
1139 { 3,
CONDITION_ALWAYS, 920, 0, 152,
FACING_WEST, 0, 672, 0, 944, 272, 0 },
1140 { 4,
CONDITION_ALWAYS, 168, 0, 520,
FACING_NORTH, 0, 32, 272, 304, 544, 0 },
1141 { 5,
CONDITION_ALWAYS, 296, 0, 424,
FACING_WEST, 0, 32, 272, 304, 544, 0 },
1142 { 6,
CONDITION_ALWAYS, 376, 0, 424,
FACING_EAST, 0, 352, 272, 640, 544, 0 },
1143 { 7,
CONDITION_ALWAYS, 488, 0, 520,
FACING_NORTH, 0, 352, 272, 640, 544, 0 },
1144 { 8,
CONDITION_ALWAYS, 712, 0, 424,
FACING_EAST, 0, 672, 272, 960, 544, 0 },
1145 { 9,
CONDITION_ALWAYS, 920, 0, 424,
FACING_WEST, 0, 672, 272, 960, 544, 0 },
1146 { 10,
CONDITION_ALWAYS, 168, 0, 152,
FACING_SOUTH, 0, 32, 0, 304, 272, 0 },
1147 { 11,
CONDITION_ALWAYS, 424, 24, 72,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1148 { 12,
CONDITION_ALWAYS, 744, 0, 88,
FACING_SOUTH, 0, 672, 0, 944, 272, 0 },
1149 { 13,
CONDITION_ALWAYS, 232, 24, 344,
FACING_SOUTH, 0, 32, 272, 304, 544, 0 },
1150 { 14,
CONDITION_ALWAYS, 552, 0, 360,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1151 { 15,
CONDITION_ALWAYS, 168, 24, 152,
FACING_SOUTH, 0, 32, 0, 304, 272, 0 },
1152 { 16,
CONDITION_ALWAYS, 488, 0, 168,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1153 { 21,
CONDITION_ALWAYS, 472, 0, 104,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1154 { 22,
CONDITION_ALWAYS, 504, 0, 104,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1155 { 23,
CONDITION_ALWAYS, 424, 0, 136,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1156 { 24,
CONDITION_ALWAYS, 424, 0, 168,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1157 { 25,
CONDITION_ALWAYS, 440, 0, 200,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1158 { 26,
CONDITION_ALWAYS, 488, 0, 200,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1159 { 27,
CONDITION_ALWAYS, 456, 0, 232,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1160 { 28,
CONDITION_ALWAYS, 488, 0, 232,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1161 { 29,
CONDITION_ALWAYS, 520, 0, 232,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1162 { 31,
CONDITION_ALWAYS, 760, 0, 104,
FACING_SOUTH, 0, 672, 0, 944, 272, 0 },
1163 { 32,
CONDITION_ALWAYS, 856, 0, 120,
FACING_SOUTH, 0, 672, 0, 944, 272, 0 },
1164 { 51,
CONDITION_ALWAYS, 456, 0, 392,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1165 { 52,
CONDITION_ALWAYS, 488, 0, 392,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1166 { 53,
CONDITION_ALWAYS, 520, 0, 392,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1167 { 54,
CONDITION_ALWAYS, 456, 0, 424,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1168 { 55,
CONDITION_ALWAYS, 520, 0, 424,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1169 { 56,
CONDITION_ALWAYS, 456, 0, 424,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1170 { 57,
CONDITION_ALWAYS, 488, 0, 456,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1171 { 58,
CONDITION_ALWAYS, 520, 0, 456,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1172 { 59,
CONDITION_ALWAYS, 552, 0, 456,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1173 { 50,
CONDITION_ALWAYS, 488, 0, 424,
FACING_SOUTH, 0, 352, 272, 640, 544, 0 },
1174 { 40,
CONDITION_ALWAYS, 168, 0, 424,
FACING_SOUTH, 0, 32, 272, 304, 544, 0 },
1175 { 30,
CONDITION_ALWAYS, 808, 0, 152,
FACING_SOUTH, 0, 672, 0, 944, 272, 0 },
1176 { 20,
CONDITION_ALWAYS, 488, 0, 152,
FACING_SOUTH, 0, 352, 0, 640, 272, 0 },
1177 { 19,
CONDITION_ALWAYS, 168, 0, 72,
FACING_SOUTH, 0, 32, 0, 304, 272, 0 },
1182 { 420, 28, 68, 428, 36, 76, -1, 10 },
1183 { 228, 28, 338, 236, 36, 346, -1, 12 },
1185 { 163, 28, 148, 171, 36, 156, -1, 14 },
1187 { 159, 24, 144, 175, 40, 160, -1, 14 },
1189 { -1, 0, 0, 0, 0, 0, 0, 0 },
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
const struct ScenePlacement * Scene_GetPlacements(void)
const struct SceneEntrance * Scene_GetEntrances(void)
const struct SceneEvent * Scene_GetEvents(void)
const u32 * Scene_GetExits(void)
Both scenes share one exit table.
const struct SceneRegion * Scene_GetRegions(void)
const s32 * gEffectScripts[]
The battle animation state, render objects and effect entries, and the palette buffer work.
struct BattleEffectBuffers * gPaletteBufferWork
void(*) SchedulerCallback(void)
Character numbers, with each character's Japanese name.
The engine calls the debug menus import, and their palette swatch tiles.
DMA channel registers, and the DMA and CPU fills.
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
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.
#define OBJ_DIR(no, d, t)
#define OBJ_POS_SET(no, x, z)
#define MESSAGE_PUT(no, f)
#define OBJ_EMOTE(no, e, t)
#define OBJ_SPEED(no, s, a)
Field effects, their scripts and the flags that spawn them.
@ EFFECT_USE_PALETTE
options.palette, as its group child value
@ EFFECT_USE_UPDATE
options.update
@ EFFECT_USE_START_SCALE
options.startScaleX and startScaleY
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
static s32 Event_OpenMessage(s32 speaker, s32 flags)
s32 Engine_LeaderCheckAhead(void)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
s32 Engine_MathSin(s32 angle)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
void Engine_EventWaitForScreen(void)
void Engine_EventOpenScreen(void)
void Engine_MapWaitWorkValuesBelow256(void)
void Engine_CameraWaitForMove(void)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorSetChildValue(s32 actor, s32 value)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
s32 Engine_MathCos(s32 angle)
void Engine_MapRedraw(void)
void Engine_ColorBufferInterpolate(s32 frames)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
static struct FieldActor * Actor_Get(s32 actor)
static void ColorBuffer_ApplySource(s32 value, s32 mode)
Field objects and actors, and the scene transition styles.
@ TRANSITION_BACKDROP_FADE
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
@ ACTOR_FOLLOWS_TERRAIN
moves with the ground height under it
@ ACTOR_FALLS
falls by its gravity and bounces
#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 FIND_PSYNERGY_STONE
#define SCENE_EXIT(exit, scene, entrance)
#define EVENT_SCRIPT(script)
#define EVENT_TOUCH_WALKING
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static s32 Task_AddCallback(void(*callback)(void), s32 priority)
Calls the main-image scheduler through engine_call.h.
Game flags, named where their meaning is shown.
#define FLAG_SCENE_TEMP_05
#define FLAG_SCENE_TEMP_0D
#define FLAG_SCENE_TEMP_0F
#define FLAG_SCENE_TEMP_12
#define FLAG_SCENE_TEMP_03
#define FLAG_SCENE_TEMP_13
#define FLAG_SCENE_TEMP_09
#define FLAG_SCENE_TEMP_0E
#define FLAG_IN_PARTY(character)
Flags 0 to 7: the character with that id (character_ids.h) is in the party (Party_AddActiveOwner).
#define FLAG_SCENE_TEMP_0A
#define FLAG_SCENE_TEMP_00
#define FLAG_SCENE_TEMP_08
#define FLAG_SCENE_TEMP_0B
#define FLAG_SCENE_TEMP_06
#define FLAG_SCENE_TEMP_0C
#define FLAG_SCENE_TEMP_02
#define FLAG_SCENE_TEMP_11
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_SCENE_TEMP_10
#define FLAG_SCENE_TEMP_01
#define FLAG_SCENE_TEMP_04
#define FLAG_TRET_DEFEATED
#define FLAG_SCENE_TEMP_07
#define FLAG_SCENE_TEMP_14
volatile u32 gFrameCount
Frames WaitFrames has finished.
GameState, the game's state: play time, coins, the scene and the leader's position,...
#define Battle_SetStart(mode)
Sets the battle start type.
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
The screen blend's globals and the graphics routines.
The heap's work slots and HeapState.
#define WORK_SLOT(n)
Reads slots through their own addresses; adjacent slots are reached by offsets.
s32 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
The hardware's I/O registers and their bits, as pret names them.
Item numbers, named from the English release.
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
#define Iwram_MulQ16(left, right)
void Vector_AddPolarOffset(s32 radius, s32 angle, void *position)
Moves the point position by radius in direction angle on the ground plane: x by the cosine,...
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_SET(w, v)
Write a work value.
#define SC_LOOP(n, to)
Repeat up to n times.
#define SC_POS(x, y, z)
Set position.
#define SC_SYNC
Wait for arrival.
#define SC_MOVE(x, y, z)
Move toward the target.
#define SC_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
#define SC_END
Return to the main script.
struct AnimationObject * Sprite_ShareVramCache(struct AnimationObject *sourceSprite, struct AnimationObject *sharedSprite)
Makes sourceSprite share sharedSprite's VRAM block, releasing its own; with no sharedSprite it keeps ...
void Event_SetDestination(s32 scene, s32 entrance)
Makes the event leave for the given entrance of the given scene: raises the exit request 999 and writ...
void Field_RequestBattleFromEncounterTable(s32 zoneNo, s32 slotNo)
Sets up a battle with enemy group slot of encounter table zone.
void Event_SetNextDestination(s32 scene, s32 entrance)
Sets the scene and entrance that the field goes to next (gGameState.nextScene and nextEntrance).
Scene numbers, named after their places.
char SceneId_TretTreeInteriors
Song and sound effect ids, indices into gSound_SongTable.
struct EventWork * gEventWork
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
The colour buffer (heap block 32) that fades the BG and OBJ palettes: the source palette,...
u16 palette[0x1c0]
The source palette, RGB555: 224 BG colours, then 224 OBJ colours; palette[0] is the backdrop.
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 palette
passed to ObjectGroup_SetChildValue
s32 startScaleY
16.16 fixed point, 0x10000 full size
s32 startScaleX
16.16 fixed point, 0x10000 full size
void(*) update(union FieldObject *object)
replaces the update hook
s32 startTransition
SCENE_TRANSITION(style, variant).
s32 transitionFrames
frames
A field actor: a person or thing on the field with a position, motion toward a target,...
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
s32 speed
speed limit, 16.16 fixed-point pixels per frame
s32 targetX
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
s32 velocityX
16.16 fixed-point pixels per frame
s32 bounce
The share of its falling speed kept as it bounces on landing, 16.16 fixed point (0x4000 when created)...
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
s32 terrainHeight
16.16 fixed-point pixels
s32 gravity
Taken off the vertical velocity each frame while it is above the ground, in 16.16 fixed-point pixels ...
union FieldCoordinate z
16.16 fixed-point pixels
s32 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 scaleY
16.16 fixed point, 0x10000 full size
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
s32 velocityZ
16.16 fixed-point pixels per frame
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
s32 z
16.16 fixed-point pixels
Full event work allocated by Field_RunScene (heap slot 27).
s16 command
a field Psynergy to use, as owner << 10 | Psynergy
s32 transition
SCENE_TRANSITION(style, variant); 0x100 on entry.
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
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.
#define SPEAKER(actor, window)
A speaker: the actor, and in the top four bits where the message window opens beside them (4,...
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_FloorGivesWayToUpperRightNorthwest(void)
static void Event_FloorGivesWayToLowerMiddleSouthwest(void)
static void TretTreeInteriors_RunLandingDustScene(void)
Drops the leader into the room with a ring of landing particles.
s32 gTretTreeInteriors_TableActions3[]
static void Event_FloorGivesWayToLowerMiddleNortheast(void)
static void TretPalette_UpdateSceneTint(void)
Tints background colours 16 to 78 every thirty-two frames, leaving palette 4's last colour alone.
static void Event_FloorGivesWayToLowerMiddleSoutheast(void)
struct SceneEvent gTretTreeInteriorsEvents[]
static void Event_FloorGivesWayToUpperMiddleSouthwestUpper(void)
static void TretTreeInteriors_PlayGesture(s32 gesture)
Plays a Tret animation sequence with its original pauses.
struct SceneEntrance gTretTreeInteriorsEntrances[]
static void TretTreeInteriors_ApplyPostBattleState(s32 playRecoveryScene)
Restores the post-battle map and optionally plays its conversation.
static void Event_FloorGivesWayToUpperMiddleSouthLower(void)
s16 gTretTreeInteriors_MapPatches[]
The cracked floors redrawn when the room is restored: floor flag, whether it is redrawn (not the four...
static void TretTreeInteriors_UpdateSwirlSpark(union FieldObject *fieldObject)
Moves a fading spark outward from its saved origin, then releases it.
static void Event_FloorGivesWayToUpperRightNortheast(void)
#define TRET_TINT_COLOR_COUNT
s32 gTretTreeInteriors_TableActions1[]
u32 gTretTreeInteriorsExits[]
static void TretTreeInteriors_StepOnCrackedFloor(s32 floorFlag, s32 sourceColumn, s32 sourceRow, s32 entrance)
Stepping on a cracked floor tile: the first step cracks it further and sets its temporary flag; the n...
static void Event_FloorGivesWayToLowerMiddleWestB(void)
A second cracked floor over the same lower middle west landing.
#define FLOOR_FALL_SPIN_FRAMES
static void Event_FloorGivesWayToUpperMiddleSouthwestLower(void)
static s16 * sLastFloorEntrance
static void Event_FloorGivesWayToUpperMiddleWestUpper(void)
static void Event_FloorGivesWayToLowerMiddleNorth(void)
static void Event_FloorGivesWayToUpperMiddleSouthUpper(void)
static void Event_FloorGivesWayToUpperMiddleNorthwest(void)
static void Event_FloorGivesWayToLowerMiddleSouth(void)
#define SWIRL_SPARK_SHRINK_LAST_FRAME
static void TretTreeInteriors_SpawnSwirlSparks(void)
Emits five shrinking waves of fading sparks from the saved origin.
s32 gTretTreeInteriors_TintIndex
static void Event_FightTret(void)
Walking up to Tret (touch trigger 40, until FLAG_TRET_DEFEATED): he roars, the party gathers in front...
static void Event_FloorGivesWayToLowerMiddleCenter(void)
static void Event_FloorGivesWayToLowerMiddleEast(void)
static void Event_FloorGivesWayToUpperMiddleWestLower(void)
static void Event_FloorGivesWayToUpperMiddleNortheast(void)
#define TRET_TINT_CHANNEL_MAX
s32 gTretTreeInteriors_TableActions2[]
u32 gTretTreeInteriors_TintSteps[]
s32 gTretTreeInteriors_TableActions0[]
s32 gTretTreeInteriors_ActionTable2[]
static void Event_FloorGivesWayToLowerMiddleWestA(void)
struct SceneRegion gTretTreeInteriorsRegions[]
static void TretPalette_SaveSceneColors(void)
Saves background palettes 0 to 13 as the base for Tret's scene tint.
static void Event_ResetFloorLatchWhenClear(void)
Walking off a cracked floor tile lets the next step on it count again.
struct ScenePlacement gTretTreeInteriorsPlacements[]
#define SWIRL_SPARK_LAST_FRAME
static void TretTreeInteriors_PlayPostBattleConversation(void)
After the battle: a passage opens beside Tret, who comes to, thanks the party and says good-bye.
static struct FieldPosition sSparkOrigin
s32 gTretTreeInteriors_ActionTable1[]
static void Event_FloorGivesWayToUpperMiddleSoutheastLower(void)
s32 TretTreeInteriors_EnterRoom(void)
Restores the room, tint and entry fall before continuing its story event.
static void Event_FloorGivesWayToLowerMiddleNorthwest(void)
static void TretTreeInteriors_ApplyFlaggedMapPatches(void)
Restores each enabled single-cell patch whose puzzle flag is set.
The integer types, TRUE, UNUSED and the fixed-address macros.
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
The patch levels: our groups of the measured changes from the Japanese release.
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).