39#include "text/msg_ids.h"
57#define WATER_RAISED_FLAG FLAG_SCENE_TEMP_00
61#define FIRST_FROZEN_POOL_FLAG FLAG_SCENE_TEMP_00
62#define LEADER_ON_THIRD_POOL_FLAG FLAG_SCENE_TEMP_03
63#define PILLAR_SUNK_FLAG FLAG_SCENE_TEMP_04
91 s32 remainingFrames = 60;
94 if (remainingFrames == 0) {
114 s32 remainingFrames = 60;
117 if (remainingFrames == 0) {
124 if (actor->
y.
fixed <= limit) {
138 s32 *layerOriginX,
s32 *layerOriginZ) {
145 for (i = 0; i <= 5; i++) {
160 if (coordinate < 0) {
161 coordinate = -coordinate;
165 farExtent = -farExtent;
167 *depth = (coordinate + farExtent) >> 4;
169 if (coordinate < 0) {
170 coordinate = -coordinate;
174 farExtent = -farExtent;
176 *width = (coordinate + farExtent) >> 4;
185 coordinate += offsetZ;
199 s32 layerOriginX, layerOriginZ;
205 actorId, &width, &depth, &probe, &layerOriginX, &layerOriginZ) == 0) {
244 s32 layerOriginX, layerOriginZ;
248 actorId, &width, &depth, &probe, &layerOriginX, &layerOriginZ) == 0) {
277 cell += x + (y << 7);
301 cell +=
sizeof(
struct MapCell) * (x + (y << 7));
302 cell[1] = (source->
bits.
lowFlags << 4) | (cell[1] & ~0x30);
307 struct CrossboneIslePillarCellBits *cell =
308 (
struct CrossboneIslePillarCellBits *)map->
layers[layer].
cells;
310 cell += x + (y << 7);
336 temporaryActor =
NULL;
339 level = height /
PIXELS(16);
345 for (row = 0; row <= rows; row++) {
347 (row << 20) + actor->
z.
fixed);
366 temporaryActor = OverlayObject_PrepareObject(
x,
y,
z, kind);
377 if (temporaryActor != 0) {
392 if (elapsedFrames > 31)
421 if (cycleFrame == 0) {
427 x = leader->
x.
fixed + ((((
u32)((drawX << 4) + drawX) >> 16) - 8) << 16);
429 z = leader->
z.
fixed + ((((
u32)((drawZ << 4) + drawZ) >> 16) - 8) << 16);
432 (((
u32)((drawY << 2) + drawY) >> 16) << 16) +
PIXELS(3), 10);
433 Effect_Spawn(x, leader->
y.
fixed, z, 0, velocityY, cycleFrame,
443 s32 savedMotionFlags;
453 savedMotionFlags = *flags;
455 jumpDirection = (leader->
facing + 0x2000) & 0xc000;
460 position = &destination;
467 jumpDirection = leader->
facing >> 12;
469 position->
x = leader->
x.
fixed + (step & 0xffff0000);
472 position->
z = leader->
z.
fixed + step;
476 StagedActor_FindAtTile(position, leader) == 0) {
484 position->
x = leader->
x.
fixed + ((step & 0xffff0000) * 2);
487 position->
z = leader->
z.
fixed + step;
489 if (StagedActor_FindAtTile(position, leader) == 0 &&
505 *flags = savedMotionFlags;
521 object->effect.x +=
object->effect.velocity.x;
522 object->effect.y +=
object->effect.velocity.y;
523 object->effect.z +=
object->effect.velocity.z;
524 velocityX =
object->effect.velocity.x;
525 velocityY =
object->effect.velocity.y;
526 velocityZ =
object->effect.velocity.z;
527 object->effect.velocity.x = velocityX -
Math_Divide(velocityX, 10);
528 object->effect.velocity.y = velocityY -
Math_Divide(velocityY, 3);
529 object->effect.velocity.z = velocityZ -
Math_Divide(velocityZ, 10);
530 object->effect.scaleX +=
object->effect.scaleRateX;
531 object->effect.scaleY +=
object->effect.scaleRateY;
532 object->effect.sprite->rotation +=
object->effect.spin;
592 StagedActor_AdvancePair();
601 if (StagedActor_FindClearPosition(&out) != 0)
602 SceneActor_MoveAndRedraw(out);
635 volatile u32 *reg = (
volatile u32 *)0x04000014;
637 if (line == 227 || line <= 46) {
643 reg = (
volatile u32 *)0x04000018;
663 *destination++ = *source++;
664 *destination++ = *source++;
665 *destination = *source;
667 coordinates[1] += 0xc0;
668 coordinates[3] += 0xc0;
669 coordinates[5] += 0xc0;
678 if (waterRaised == 0) {
728 if (waterRaised == 0) {
788 if (actor->sprite->image.priority < front->sprite->image.priority) {
790 actor->sprite->image.priority = front->sprite->image.priority;
791 actor->sprite->shadow.priority = front->sprite->shadow.priority;
814 if (front->sprite->image.priority > actor->sprite->image.priority) {
816 actor->sprite->image.priority = front->sprite->image.priority;
817 actor->sprite->shadow.priority = front->sprite->shadow.priority;
843 actor->sprite->image.priority = leader->sprite->image.priority;
852 for (
id = 8;
id <= 11;
id++) {
857 for (
id = 8;
id <= 11;
id++) {
864 if (actor->sprite->image.priority < leader->sprite->image.priority) {
866 actor->sprite->image.priority = leader->sprite->image.priority;
867 actor->sprite->shadow.priority = leader->sprite->shadow.priority;
897 s32 savedPlacement[3];
900 for (i = 0; i <= 2; i++) {
902 for (j = i; j <= 3; j++) {
908 Dma_Set(secondActor, &savedActor,
910 sizeof(savedActor) /
sizeof(
u32),
913 Dma_Set(firstActor, secondActor,
915 sizeof(savedActor) /
sizeof(
u32),
918 Dma_Set(&savedActor, firstActor,
920 sizeof(savedActor) /
sizeof(
u32),
962 for (
id = 8;
id <= 11;
id++) {
1013 if (actor->
y.
fixed >= 0) {
1027 for (k = 0; k <= 3; k++) {
1033 if ((actor->
x.
fixed >> 20) == (other->
x.
fixed >> 20) &&
1055 StagedActor_AdvancePair();
1077 if (StagedActor_FindAtTile(p, leader) !=
NULL) {
1140 actor->
update = (void (*)(
1187 pillar->sprite->image.priority = 2;
1209 settings = &options;
1222 velocityX = -(((draw * 5) >> 16) *
PIXELS(1) +
PIXELS(6));
1225 velocityY = -(((draw * 5) >> 16) *
PIXELS(1) +
PIXELS(5));
1261 settings = &options;
1272 Effect_Spawn(x, y, z, 0, scale, phase,
1349 (pillar->
z.
fixed >> 20), 1, 1, 255);
1350 if ((pillar->
x.
fixed >> 20) == 16) {
1352 if (alreadyLowered == 0) {
1369 if (StagedActor_FindClearPosition(&probe) != 0) {
1370 SceneActor_MoveAndRedraw(probe);
1373 StagedActor_AdvancePair();
1408 actor->sprite->image.priority = 2;
1422 actor->
update = (void (*)(
1440 actor->
update = (void (*)(
1451 for (selector = 8; selector <= 11; selector++) {
1459 actor->sprite->image.priority);
1480 FieldScene_RedrawActorFootprint(8);
1481 FieldScene_RedrawActorFootprint(9);
1482 FieldScene_RedrawActorFootprint(10);
1483 FieldScene_RedrawActorFootprint(11);
1484 FieldScene_RedrawActorFootprint(12);
1488 FieldScene_RedrawActorFootprint(8);
1489 FieldScene_RedrawActorFootprint(9);
1490 FieldScene_RedrawActorFootprint(10);
1491 FieldScene_RedrawActorFootprint(11);
1492 FieldScene_RedrawActorFootprint(12);
1493 FieldScene_RedrawActorFootprint(13);
1494 FieldScene_RedrawActorFootprint(14);
1495 FieldScene_RedrawActorFootprint(15);
1521 for (i = 0; i < 4; i++) {
1534 for (
id = 8;
id < 12;
id++) {
1550 FieldScene_RedrawActorFootprint(8);
1551 FieldScene_RedrawActorFootprint(9);
1594#define DIRECTION_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))
1607 207, 205, 228, 229, 298, 297,
1636 MAP_CELL_STEP(76, 34, 1, 2, 4),
MAP_CELL_STEP(77, 34, 1, 2, 4),
MAP_CELL_STEP(78, 34, 1, 2, 4),
MAP_CELL_STEP(79, 34, 1, 2, 4),
MAP_CELL_STEPS_END,
1640 MAP_CELL_STEP(79, 34, 1, 2, 4),
MAP_CELL_STEP(78, 34, 1, 2, 4),
MAP_CELL_STEP(77, 34, 1, 2, 4),
MAP_CELL_STEP(76, 34, 1, 2, 4),
MAP_CELL_STEPS_END,
1644 MAP_CELL_STEP(67, 34, 2, 5, 6),
MAP_CELL_STEP(69, 34, 2, 5, 6),
MAP_CELL_STEP(71, 34, 2, 5, 6),
MAP_CELL_STEP(73, 34, 2, 5, 6),
MAP_CELL_STEPS_END,
1648 MAP_CELL_STEP(71, 50, 2, 5, 6),
MAP_CELL_STEP(69, 50, 2, 5, 6),
MAP_CELL_STEP(67, 50, 2, 5, 6),
MAP_CELL_STEP(65, 50, 2, 5, 6),
MAP_CELL_STEPS_END,
1652 MAP_CELL_STEP(75, 38, 2, 1, 4),
MAP_CELL_STEP(77, 38, 2, 1, 6),
MAP_CELL_STEP(79, 38, 2, 1, 8),
MAP_CELL_STEP(65, 53, 2, 1, 1),
MAP_CELL_STEPS_END,
1656 { 0,
CONDITION_ALWAYS, 120, 0, 152,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1661 { 1,
CONDITION_ALWAYS, 712, 0, 760,
FACING_NORTH, 0, 560, 368, 992, 792, 0 },
1662 { 2,
CONDITION_ALWAYS, 600, 0, 760,
FACING_NORTH, 0, 560, 368, 992, 792, 0 },
1667 { 1,
CONDITION_ALWAYS, 216, 0, 360,
FACING_NORTH, 0, 32, 32, 384, 400, 0 },
1668 { 2,
CONDITION_ALWAYS, 104, 0, 360,
FACING_NORTH, 0, 32, 32, 384, 400, 0 },
1673 { 1,
CONDITION_ALWAYS, 184, 0, 472,
FACING_NORTH, 0, -1, -1, -1, -1, 0 },
1674 { 2,
CONDITION_ALWAYS, 64, 0, 472,
FACING_NORTH, 0, -1, -1, -1, -1, 0 },
1679 { 1,
CONDITION_ALWAYS, 744, 0, 520,
FACING_NORTH, 0, 440, 16, 960, 544, 0 },
1680 { 2,
CONDITION_ALWAYS, 632, 0, 520,
FACING_NORTH, 0, 440, 16, 960, 544, 0 },
1685 { 1,
CONDITION_ALWAYS, 280, 0, 488,
FACING_NORTH, 0, 16, 32, 464, 528, 0 },
1686 { 2,
CONDITION_ALWAYS, 168, 0, 488,
FACING_NORTH, 0, 16, 32, 464, 528, 0 },
Ability numbers, named from the English release.
void ObjectGroup_SetChildValue(struct FieldActor *actor, s32 param)
Sets the param byte of every animated part of an actor's sprite.
void ObjectMotion_WaitForAnimationChange(u32 objectId)
Waits, at most 90 frames, for an actor's animation to change.
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)
s32 Scene_Initialize(void)
Sets up whichever scene is being entered and runs its arrival events.
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[]
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
const s32 * gEffectScripts[]
Calls through a function pointer, by argument count.
s32 Field_ClimbUp(void)
Climbing up (the player presses up at a climbable wall).
s32 Field_ClimbDown(void)
Climbing down (the player presses down at a climbable wall).
static __inline__ void Dma_Wait(volatile u32 *dma)
static s32 CrossboneIslePillarRooms_DrawRaisedFootprint(s32 actorId)
Draws the raised pillar's footprint and puts its actor under the leader.
static void Event_StartRising(void)
Stepping on trigger 40 in room 4: the fade overlay follows the leader, and the leader's rise counter ...
struct ScenePlacement gCrossboneIslePillarRoomsPlacements1[]
struct SceneEntrance gCrossboneIslePillarRoomsEntrances5[]
static void CrossboneIslePillarRooms_SetCellAttributes(s32 layer, s32 x, s32 y, const union CrossboneIslePillarCell *source)
Copies the cell's flags and collision attributes without replacing its tile.
struct SceneEvent gCrossboneIslePillarRoomsEventsOther[]
static void Event_JumpOrPushRoom4Pillar(void)
Walking into a pillar in room 4: jump across if possible, otherwise push it, and the pillars settle.
static void CrossboneIslePillarRooms_ReadMapCell(s32 layer, s32 x, s32 y, union CrossboneIslePillarCell *dst)
Reads one map cell through DMA, waiting until the transfer finishes.
static u8 sShakenScroll[12]
static void CrossboneIslePillarRooms_ShrinkPillar(s32 index)
Shrinks the pillar and lowers its height for up to thirty-two frames.
static void Event_JumpOrPushPillar(void)
Walking into a pillar in room 1: jump two cells across it where the cells allow, otherwise push it.
static UNUSED void CrossboneIslePillarRooms_SpawnUnusedLeaderParticle(void)
Spawns the unused particle near the leader once every four frames.
static void Event_PushPillar(void)
Walking into a pillar in rooms 2 and 3: push it if the cell beyond is clear.
static s32 CrossboneIslePillarRooms_SyncPriorityIfBehind(struct FieldActor *actor, struct FieldActor *front)
Matches a nearby actor's draw priority when it is behind the comparison actor.
static void Event_FlipWaterSwitch(void)
Searching the switch in room 3 flips it.
static void Event_FrostRaisesPillar(void)
Later in the same Frost: the third pool shrinks back, and the pillar beside it (actor 14) rises 32 pi...
static void CrossboneIslePillarRooms_PrepLoweredActor(s32 id)
Prepares the lowered actor's collision and draw priority below the leader.
static s32 CrossboneIslePillarRooms_UpdateFrozenPoolPriority(union FieldObject *fieldObject)
Puts the frozen pool under the leader when it is behind and below the leader.
static void CrossboneIslePillarRooms_DrawRaisedPillars(void)
Redraws all seven pillars at the raised water level.
static void Event_FreezeFirstPool(void)
Frost on the first pool in room 5: it freezes into a pillar of ice.
static void CrossboneIslePillarRooms_SpawnFrostParticle(void)
Emits growing, rotating particles during the third pool's Frost sequence.
static struct PillarSlot sPillarSlots[4]
static void CrossboneIslePillarRooms_RestoreFlaggedPillar(s32 actorId)
Restores a previously frozen pillar's mode, map cell, priority hook, and script.
static s32 CrossboneIslePillarRooms_SyncPriorityIfAhead(struct FieldActor *front, struct FieldActor *actor)
Matches the comparison actor's draw priority when it overlaps the actor in front.
static void CrossboneIslePillarRooms_FreezePool(s32 id)
Remembers the frozen pool, installs its priority callback, and starts its flicker script.
static s32 CrossboneIslePillarRooms_RestoreGroundFootprint(s32 actorId)
Restores the ground tiles and collision attributes under the actor's footprint.
static void Event_FreezeSecondPool(void)
Frost on the second pool in room 5.
static s32 CrossboneIslePillarRooms_SetChildValueFromTimer(struct ScriptInterpreter *interpreter)
Applies the actor timer's low four bits to its child sprite value.
struct SceneEntrance gCrossboneIslePillarRoomsEntrances4[]
static void CrossboneIslePillarRooms_PrepareWaterScroll(void)
Copies the three background scroll pairs and shifts their vertical offsets by 192 pixels.
#define WATER_RAISED_FLAG
Room 3: the water has been raised.
struct SceneEntrance gCrossboneIslePillarRoomsEntrances3[]
static void Event_StartMovingSinkingPillar(void)
Move begins on room 5's sinking pillar: its cell is cleared.
static struct FieldPosition sProbePosition
static void CrossboneIslePillarRooms_AnimateWaterLevel(void)
Reveals the alternate water tiles through a gradually randomized scroll transition.
static void Event_StopRising(void)
Stepping on trigger 41 in room 4: the overlay lets the leader go, and the rise counter stops.
static s32 CrossboneIslePillarRooms_UpdateActorPriority(union FieldObject *fieldObject)
Keeps each moving pillar's priority and collision flags consistent with the leader.
struct SceneEntrance gCrossboneIslePillarRoomsEntrances1[]
static void Event_ClimbUp(void)
Walking north at room 4's ladder: climb up.
#define LEADER_ON_THIRD_POOL_FLAG
u16 gCrossboneIslePillarRooms_ShiftSteps4[]
struct SceneEvent gCrossboneIslePillarRoomsEvents4[]
struct SceneEvent gCrossboneIslePillarRoomsEvents2[]
struct ScenePlacement gCrossboneIslePillarRoomsNoPlacements[]
static s32 CrossboneIslePillarRooms_SpawnThawParticle(union FieldObject *fieldObject)
Emits a randomized particle from the thawing pool every eight frames.
static void CrossboneIslePillarRooms_StopAtGroundOrHeight(struct FieldActor *actor, s32 limit)
Waits until the actor reaches the ground or height limit, then stops its descent.
static void Event_FrostBeginsOnThirdPool(void)
Frost begins on the third pool: note whether the leader stands on it.
struct SceneEvent gCrossboneIslePillarRoomsEvents3[]
static void CrossboneIslePillarRooms_SortPillarActors(void)
Sorts the four pillars by height and depth, carrying their saved cell state with them.
static void CrossboneIslePillarRooms_JitterBackgroundScroll(void)
Randomly substitutes the shifted background scroll during the water transition.
static void Event_MoveSinkingPillar(void)
Move on room 5's sinking pillar, and after each push: once it reaches column 16 it sinks two pixels i...
u16 gCrossboneIslePillarRooms_ShiftSteps5[]
static void Event_MovePillar(void)
Move or Carry on one of room 4's pillars, and after each push there: the pillars settle,...
static s32 CrossboneIslePillarRooms_QueryFootprint(s32 id, u32 *width, u32 *depth, struct StagedActorProbe *probe, s32 *layerOriginX, s32 *layerOriginZ)
Finds the actor's footprint dimensions, grid position, and map-layer origin.
static void CrossboneIslePillarRooms_SettleActorOnGround(struct FieldActor *actor)
Waits up to sixty frames for landing, then stops vertical movement on the ground.
struct ScenePlacement gCrossboneIslePillarRoomsPlacements5[]
struct SceneEntrance gCrossboneIslePillarRoomsEntrances2[]
u16 gCrossboneIslePillarRooms_ShiftSteps1[]
struct ScenePlacement gCrossboneIslePillarRoomsPlacements2[]
struct ScenePlacement gCrossboneIslePillarRoomsPlacementsOther[]
static void CrossboneIslePillarRooms_UpdateDampedParticle(union FieldObject *object)
Moves the particle while damping its velocity, growing it, and advancing rotation.
static void Event_PushOrClimbDown(void)
Walking south at room 4's ladder: push the pillar below, jump, or climb down.
struct SceneEvent gCrossboneIslePillarRoomsEvents1[]
static s32 CrossboneIslePillarRooms_TryJumpAcrossPillar(void)
Jumps two cells forward when both the intervening and landing cells permit it.
u16 gCrossboneIslePillarRooms_ShiftSteps3[]
struct SceneEntrance gCrossboneIslePillarRoomsEntrancesOther[]
u32 gCrossboneIslePillarRoomsExits[]
static void Event_PushSinkingPillar(void)
Walking into room 5's sinking pillar: push it if the cell beyond is clear.
struct SceneEvent gCrossboneIslePillarRoomsEvents5[]
static void CrossboneIslePillarRooms_UpdateLeaderPriority(void)
Matches the leader's draw priority to a nearby pillar in front.
s32 gCrossboneIslePillarRooms_ActionTable[]
#define FIRST_FROZEN_POOL_FLAG
u16 gCrossboneIslePillarRooms_ShiftSteps2[]
struct ScenePlacement gCrossboneIslePillarRoomsPlacements3[]
static void Event_FreezeThirdPool(void)
Frost ends on the third pool: unless the leader stood on it, it freezes, and a frozen second pool tha...
static s32 CrossboneIslePillarRooms_LowerActorToLedge(s32 id, s32 far)
Finds the next terrain ledge and stops the falling actor at its projected height.
static void CrossboneIslePillarRooms_InitializePillarPriority(s32 id)
Uses terrain layer 2 and installs the moving pillar's priority callback.
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...
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static UNUSED void * OverlayObject_CreateConfiguredObject(s32 x, s32 y, s32 z, s32 type)
A still effect in palette 15, at sprite priority 1, drawn under the actors.
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
Scene commands: the all-caps macros the scene scripts are written in.
#define OBJ_POS_SET(no, x, z)
void BattleFx_StartFadeOverlay(void *object)
Starts the fade overlay on object (the party leader when NULL): loads its solid tiles,...
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
@ EFFECT_USE_ROTATION
options.rotation, as the sprite's
@ EFFECT_SCALE_TO_TARGET
Grows from the start scale, or full size, to the target scale over the script's repeat count.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
void Object_SetMode(struct FieldActor *object, s32 animation)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Actor_SetBuiltinAction(s32 actor, s32 action)
void Engine_MessageShowCentered(s32 message, s32 flags)
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
static s32 Math_Divide(s32 dividend, s32 divisor)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
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.
void Engine_ActorWaitForMove(s32 actor)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorSetChildValue(s32 actor, s32 value)
#define MAP_CELL_STEPS_END
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_MapRedraw(void)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
@ ACTOR_FOLLOWS_TERRAIN
moves with the ground height under it
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
#define SCENE_TRANSITION(style, variant)
The field's runtime work: map cells, scene records and regions, map markers and FieldWork.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define PSYNERGY_PHASE_ON_ACTOR(ability, phase)
A Psynergy event on an actor at one phase of the cast, as PSYNERGY_IN_AREA is for an area.
#define SCENE_EXITS(scene)
#define SCENE_EXIT(exit, scene, entrance)
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define EVENT_TOUCH_WALKING
#define TOUCH_WALKING_INTO(facing)
#define FIND_COINS(coins)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldObject_SetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
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_SCENE_TEMP_03
#define FLAG_SCENE_TEMP_00
#define FLAG_SCENE_TEMP_02
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_SCENE_TEMP_01
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.
void * gEffectWork
Slot 56: points to a scene-specific structure.
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.
The main-image routines scene overlays import.
The hardware's I/O registers and their bits, as pret names them.
The hardware's interrupt sources and the interrupt handler table.
Item numbers, named from the English release.
Small statement macros both games use for positions, velocities and bounds.
Maps: their cells, layers, animations and blend scripts, and the map state.
static void Map_DrawCellPanel(s32 x, s32 y, s32 width, s32 height, s32 plane, s32 destX, s32 destY)
Draws the width by height cells at cell (x, y) of the map into screen block 5 from cell (destX,...
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_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
The fade overlay, the weather particles and the actor effect work.
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),...
#define ACTOR_ACTION_IDLE
The work pointers in the gWorkSlot table, by name.
Scene numbers, named after their places.
char SceneId_CrossboneIslePillarRooms3
char SceneId_CrossboneIslePillarRooms2
char SceneId_CrossboneIslePillarRooms5
char SceneId_CrossboneIslePillarRooms4
char SceneId_CrossboneIslePillarRooms1
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_JUMP
An actor jumps: ObjectMotion_Launch plays the high jump above 5 pixels a frame.
struct EventWork * gEventWork
void Engine_AudioPlayCue()
The pushable actors' movement probes and footprint bounds.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
u8 highFlags
bits 15..14, read by Map_GetCellHighFlags
u32 lowFlags
bits 13..12 of MapCell.metatileAndFlags
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 targetScaleY
16.16 fixed point, 0x10000 full size
s32 targetScaleX
16.16 fixed point, 0x10000 full size
s32 palette
passed to ObjectGroup_SetChildValue
s32 startScaleY
16.16 fixed point, 0x10000 full size
u16 rotation
1/65536 turns
s32 startScaleX
16.16 fixed point, 0x10000 full size
void(*) update(union FieldObject *object)
replaces the update hook
s32 startTransition
SCENE_TRANSITION(style, variant).
The fade overlay draws one mark on each side of its tracked actor.
struct FieldActor * actor
the actor tracked; null draws nothing
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
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
u8 riseCounter
not read by the engine; scene code's own counter
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 terrainHeight
16.16 fixed-point pixels
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 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.
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
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).
u8 movementMode
1 while the leader is climbing, 0 otherwise
One cell of a map layer: its metatile and flags, its collision code and an attribute indexing the col...
u8 attributeB
Indexes the 4-byte collision entries (gMapCollision): terrain kind in the first byte's low four bits,...
u8 collisionCode
The step code: 1 to 239 scene events, 240 and 241 encounter ground, 250 hazard, 252 to 254 for Field_...
A pillar slot's place and ground cell, without its flag; it holds one slot while two are swapped.
union CrossboneIslePillarCell cell
Where one of room 4's pillars stands, the ground cell saved under it and its footprint flag.
union CrossboneIslePillarCell cell
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 footprintIndex
The large thing's row in gStagedActor_FootprintKinds and gStagedActor_FootprintBounds,...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
s32 GetMapCellCollision(s32 layer, s32 x, s32 y)
Returns the collision code of a layer's cell at (x, y) in 16.16 pixels.
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...
The integer types, TRUE, UNUSED and the fixed-address macros.
A copied map cell, also read in the two flag pairs the pillar redraw keeps.
struct CrossboneIslePillarCell::CrossboneIslePillarCellBits bits
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.