39#include "text/msg_ids.h"
93 s16 *counter = &
object->timer;
99 if (*counter > 1200) {
131 if (StagedActor_FindClearPosition(&res)) {
132 SceneActor_MoveAndRedraw(res);
165 FieldScene_RedrawActorFootprint(
RIVER_LOG);
172 FieldScene_RedrawActorFootprint(8);
173 FieldScene_RedrawActorFootprint(9);
200 const s32 *sparkleAction;
201 const s32 *squashAction;
203 const s32 *restoreScaleAction;
204 const s32 *growBarrierAction;
205 const s32 *shrinkBarrierAction;
826 if (*miaInParty != 0) {
895 if (*miaInParty != 0) {
939 if (*miaInParty != 0) {
1040 if (framePhase != 0)
1047 sprite = sparkle->sprite;
1048 sprite->
flags = framePhase;
1074 arg0->
z.
fixed < 0x2640000) ||
1076 arg0->
z.
fixed < 0x2780000))
1079 arg0->
z.
fixed <= 0x248ffff) ||
1080 (
x > 0xf40000 &&
x < 0x1120000 &&
1081 arg0->
z.
fixed > 0x23b0000 && arg0->
z.
fixed <= 0x25cffff) ||
1083 arg0->
z.
fixed < 0x2780000)))) {
1149#define DIRECTION_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))
1162 207, 205, 228, 229, 298, 297,
1249 {0,
CONDITION_ALWAYS, 384, 0, 312,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
1250 {2,
CONDITION_ALWAYS, 24, 0, 128,
FACING_EAST, 0, -1, -1, -1, -1, 0},
1251 {4,
CONDITION_ALWAYS, 172, 0, 602,
FACING_EAST, 0, -1, -1, -1, -1, 0},
void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param)
Sets the param byte of every animated part of an actor's sprite.
void Object_RefreshSelectorById(u32 objectId)
Waits, at most 300 frames, for an actor's script to reach its end (command 0x10).
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
s32 gStagedActor_DirectionSteps[]
Pixel step by direction: X in the upper halfword, Z in the lower.
s32 gStagedActor_FootprintBounds[]
#define DIRECTION_STEP(dx, dz)
Pixel step by direction: X in the upper halfword, Z in the lower.
u32 gStagedActor_FootprintKinds[]
Character numbers, with each character's Japanese name.
The engine calls the debug menus import, and their palette swatch tiles.
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.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
void Engine_ObjectSetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
static s32 Event_OpenMessage(s32 speaker, s32 flags)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script)
void Engine_EventOpenScreen(void)
void Engine_GameFlagSet(s32 flag)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
void Engine_ActorWaitForMove(s32 actor)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorStop(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
static void Event_PlayCue(s32 cue)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
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_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define SCENE_EXIT(exit, scene, entrance)
#define EVENT_SCRIPT(script)
#define EVENT_TOUCH_WALKING
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
16.16 fixed-point constants, sine and cosine, and the library division.
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
Game flags, named where their meaning is shown.
#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_KOLIMA_CURSE_WITNESSED
The party has seen the curse fall, in Kolima or on the forest bridge.
#define FLAG_SCENE_TEMP_00
#define FLAG_KOLIMA_CURSE_LIFTED
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.
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
s32 gFallingEffectScript[]
The globals Kolima's scenes share: the falling effect and the party's state.
Kolima and its forest bridge: the sparkling dust that falls when Tret's curse strikes.
static s32 Kolima_FlickerCurseDust(struct ScriptInterpreter *interpreter)
An object script call, each frame of the fall: the speck flickers between palettes 10 and 7,...
@ LEADER_BARRIER
The domes of Psynergy, one over each member; Mia's only with Mia.
@ RIVER_LOG
actors 8 to 10 are the logs
@ FIRST_GROUND_SPARKLE
The sparkles of Tret's glamour on the ground, gone once the curse is lifted.
static void KolimaForestBridge_WitnessForestCurse(void)
The party, on the bridge, sees the curse fall.
static void KolimaForestBridge_FlickerBarriers(void)
Each frame the domes flicker: two show on even frames and two on odd, the hidden ones lifted 500 pixe...
s32 gKolimaForestBridge_BarrierGrowAction[]
A dome grows from a tenth of its size over 70 frames.
s32 KolimaForestBridge_Initialize(void)
On entry a log already in the river floats there again and the logs mark the cells they cover.
s32 gKolimaForestBridge_GroundSparkleAction[]
struct ScenePlacement gKolimaForestBridge_Placements[]
Garet, Ivan and Mia for the curse; the three logs; Tret and Laurel; the four domes; and the five grou...
s32 gKolimaForestBridge_BarrierShrinkAction[]
A dome sinks and shrinks away over 90 frames.
struct SceneEntrance gKolimaForestBridge_Entrances[]
@ ENTRANCE_FROM_WORLD_MAP
u32 gKolimaForestBridge_Exits[]
Exit 1 to the clearing (scene 41) and exit 4 to the world map (scene 2).
const struct SceneEntrance * KolimaForestBridge_GetEntrances(void)
Where the party enters from the clearing and the world map.
static void KolimaForestBridge_SpawnCurseSparkle(void)
Every eighth frame a sparkle of Tret's glamour (object 26) falls toward the party,...
struct SceneEvent gKolimaForestBridge_Events[]
static void KolimaForestBridge_ShowMessageAndWait(s32 speaker, s32 frames)
static void KolimaForestBridge_PushLog(void)
Walking into a log: it rolls ahead until something stops it.
s32 gKolimaForestBridge_IvanAction[]
s32 gKolimaForestBridge_BarrierHit
s32 gKolimaForestBridge_SquashAction[]
The glamour presses the party down: each squashes and wobbles until released.
s32 gKolimaForestBridge_SparkleScript[]
s32 gKolimaForestBridge_GaretAction[]
Garet, Ivan and Mia walk to their places beside the leader.
static s32 KolimaForestBridge_FlashHitBarriers(struct ScriptInterpreter *interpreter)
The end of a dome's growing: if a sparkle has burst on a dome, the dome takes its next pose.
static void KolimaForestBridge_FaceActorAndWait(s32 actorId, s32 facing, s32 waitFrames)
Turns an actor at once, then leaves time for the next beat.
s32 gKolimaForestBridge_MiaAction[]
static s32 KolimaForestBridge_BurstOnBarrier(struct ScriptInterpreter *interpreter)
The end of a sparkle's fall: one that lands on a dome (the domes' area, which differs with Mia) burst...
s32 gKolimaForestBridge_SparkleBurstScript[]
A sparkle bursts on a dome: it doubles in size and is gone.
s32 gKolimaForestBridge_RestoreScaleAction[]
s32 gKolimaForestBridge_MiaInParty
const struct ScenePlacement * KolimaForestBridge_GetPlacements(void)
The party's companions, the logs, Tret, Laurel, the domes and the ground sparkles.
s32 gKolimaForestBridge_SparkleSoundOn
static s32 KolimaForestBridge_TwinkleGroundSparkle(struct ScriptInterpreter *interpreter)
Each frame: a ground sparkle's timer runs on at random, and the sparkle shows its bright frame (7) wh...
const struct SceneEvent * KolimaForestBridge_GetEvents(void)
The logs, the jump east from the bank and the two paths.
const struct SceneRegion * KolimaForestBridge_GetRegions(void)
const u32 * KolimaForestBridge_GetExits(void)
The paths to the clearing and the world map.
Kolima, its forest bridge and the forest's tree: an effect (object 26) that stretches as it travels.
static s32 SceneEffect_AdvanceAngleUntilIdle(struct ScriptInterpreter *interpreter)
An object script call: widen the object by 0x1eb8 (about 0.12) a frame, and release it once it has re...
Kolima's forest bridge and river: the hop east onto actor 10 (the third placement).
static void KolimaForest_HopEast(void)
Touch trigger 11, walking east: hop 30 pixels east of the leader.
Declares nothing of its own: it only includes edition.h and types.h.
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_LABEL(n)
Branch destination.
#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.
static s32 StagedActor_FillGridAttributeRectangle(u32 layer, s32 x, s32 z, u32 width, u32 height, s32 value)
Sets the collision code of a width by height rectangle of cells, from cell (x, z),...
void Audio_PlayCueFromEventWork(void)
Starts the current scene's field music, chosen by Scene_ResolveInteractionResult.
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_EventSetMessage()
void Engine_EventShowMessage()
void Kolima_UpdateCurseDust(void)
A scene callback: every eighth frame a speck (object 285, its script gFallingEffectScript) starts 160...
The pushable actors' movement probes and footprint bounds.
A staged actor's effect and its request.
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
struct AnimationSpritePart image
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
u16 priority
2 when created
u16 message
the next message, advanced as each window opens
A field actor: a person or thing on the field with a position, motion toward a target,...
s32 speed
speed limit, 16.16 fixed-point pixels per frame
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
s32 velocityY
16.16 fixed-point pixels per frame
union FieldCoordinate z
16.16 fixed-point pixels
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
s32 scaleX
16.16 fixed point, 0x10000 full size
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 prefix that command handlers read from a field object's 0x70-byte slot.
Where a large thing ahead of the leader would roll to: its footprint, its actor, that position,...
struct FieldPosition position
16.16 pixels while moving; converted to cells by footprint redraws.
s32 actorSlot
the large thing's actor number, 8 to 65
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels