27#include "text/msg_ids.h"
39#define FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_EAST 0x300
40#define FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_WEST 0x301
41#define FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_EAST 0x302
42#define FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_WEST 0x303
43#define FLAG_SOL_SANCTUM_INNER_BLOCK_1_EAST 0x310
44#define FLAG_SOL_SANCTUM_INNER_BLOCK_1_WEST 0x311
45#define FLAG_SOL_SANCTUM_INNER_BLOCK_2_EAST 0x312
46#define FLAG_SOL_SANCTUM_INNER_BLOCK_2_WEST 0x313
47#define FLAG_SOL_SANCTUM_INNER_BLOCK_3_EAST 0x314
48#define FLAG_SOL_SANCTUM_INNER_BLOCK_3_WEST 0x315
49#define FLAG_SOL_SANCTUM_INNER_BLOCK_4_EAST 0x316
50#define FLAG_SOL_SANCTUM_INNER_BLOCK_4_WEST 0x317
51#define FLAG_SOL_SANCTUM_INNER_BLOCK_5_EAST 0x318
52#define FLAG_SOL_SANCTUM_INNER_BLOCK_5_WEST 0x319
53#define FLAG_SOL_SANCTUM_INNER_BLOCK_6_EAST 0x31a
54#define FLAG_SOL_SANCTUM_INNER_BLOCK_6_WEST 0x31b
65#define EXIT_FLAG_NONE 0xffffffff
105 s32 firstBlockEntrance = 11;
130 s32 firstBlockEntrance = 11;
245 message = MsgSolSanctumSetSmallGem;
308 message = MsgSolSanctumSetSmallGem;
330 if (column == leftColumn) {
332 }
else if (column == rightColumn) {
349 column = block->
x.
fixed >> 20;
364 column = block->
x.
fixed >> 20;
369 }
else if (column == 113) {
385 column = block->
x.
fixed >> 20;
399 column = block->
x.
fixed >> 20;
413 column = block->
x.
fixed >> 20;
427 column = block->
x.
fixed >> 20;
441 column = block->
x.
fixed >> 20;
454 column = block->
x.
fixed >> 20;
477 direction = leader->
facing >> 12;
478 block = SceneActor_FindActorAtCell(
484 destination = ⌖
502 block->
x.
fixed = destination->
x;
503 block->
z.
fixed = destination->
z;
680 if (leader !=
NULL) {
684 if (leader !=
NULL) {
688 if (leader !=
NULL) {
722 if (leader !=
NULL) {
727 if (leader !=
NULL) {
732 if (leader !=
NULL) {
734 leader->
z.
part.pixel);
943 leader->
z.
part.pixel);
948 leader->
z.
part.pixel);
953 leader->
z.
part.pixel);
979 if (leader !=
NULL) {
1015 if (leader !=
NULL) {
1017 leader->
z.
part.pixel);
1037 if (placeActors != 0) {
1043 if (placeActors != 0) {
1050 if (placeActors != 0) {
1056 if (placeActors != 0) {
1063 if (placeActors != 0) {
1069 if (placeActors != 0) {
1076 if (placeActors != 0) {
1082 if (placeActors != 0) {
1089 if (placeActors != 0) {
1095 if (placeActors != 0) {
1102 if (placeActors != 0) {
1108 if (placeActors != 0) {
1129 s32 remainingFrames;
1133 remainingFrames = (*
timer - 1);
1135 if (remainingFrames == 40) {
1140 if (((
u32)(((randomValue << 4) - randomValue) << 3) >> 16) == 0) {
1149 {0,
CONDITION_ALWAYS, 172, 0, 149,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
1154 {0,
CONDITION_ALWAYS, 172, 0, 149,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
1155 {1,
CONDITION_ALWAYS, 80, 0, 288,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
1156 {2,
CONDITION_ALWAYS, 120, 0, 112,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
1161 {0,
CONDITION_ALWAYS, 172, 0, 149,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
1162 {1,
CONDITION_ALWAYS, 280, 0, 472,
FACING_NORTH, 0, 5, 0, 555, 510, 0},
1163 {2,
CONDITION_ALWAYS, 72, 0, 56,
FACING_SOUTH, 0, 5, 0, 555, 510, 0},
1164 {3,
CONDITION_ALWAYS, 744, 0, 152,
FACING_NORTH, 0, 620, 0, 860, 195, 0},
1165 {4,
CONDITION_ALWAYS, 696, 0, 568,
FACING_NORTH, 0, 575, 265, 815, 610, 0},
1166 {5,
CONDITION_ALWAYS, 696, 0, 328,
FACING_SOUTH, 0, 575, 265, 815, 610, 0},
1167 {6,
CONDITION_ALWAYS, 984, 0, 152,
FACING_NORTH, 0, 860, 0, 1100, 195, 0},
1168 {7,
CONDITION_ALWAYS, 984, 0, 56,
FACING_SOUTH, 0, 860, 0, 1100, 195, 0},
1169 {8,
CONDITION_ALWAYS, 1224, 0, 184,
FACING_NORTH, 0, 1100, 20, 1340, 220,
1171 {9,
CONDITION_ALWAYS, 1224, 0, 104,
FACING_SOUTH, 0, 1100, 20, 1340, 220,
1173 {10,
CONDITION_ALWAYS, 1320, 0, 456,
FACING_NORTH, 0, 905, 285, 1365, 490,
1175 {11,
CONDITION_ALWAYS, 1672, 0, 280,
FACING_NORTH, 0, 1455, 0, 1890, 310,
1177 {12,
CONDITION_ALWAYS, 1512, 0, 136,
FACING_SOUTH, 0, 1455, 0, 1890, 310,
1179 {13,
CONDITION_ALWAYS, 1832, 0, 136,
FACING_SOUTH, 0, 1455, 0, 1890, 310,
1181 {14,
CONDITION_ALWAYS, 1768, 0, 568,
FACING_NORTH, 0, 1540, 440, 1995, 600,
1183 {15,
CONDITION_ALWAYS, 1672, 0, 520,
FACING_SOUTH, 0, 1540, 440, 1995, 600,
1185 {16,
CONDITION_ALWAYS, 1928, 0, 520,
FACING_SOUTH, 0, 1540, 440, 1995, 600,
1388#define PUSH_STEP(x, z) (((x) << 16) | ((z) & 0xffff))
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
static void Event_PushBlock(void)
Pushing a block: it slides one cell ahead with the leader behind it, if the cell is free.
The engine calls the debug menus import, and their palette swatch tiles.
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
void FieldScene_PrepareActors(struct ScenePlacement *entry)
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)
#define SPEAKER_WINDOW_ABOVE
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_MessageShowCentered(s32 message, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
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)
void Engine_EventCloseScreen(void)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_EventOpenScreen(void)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
void Engine_ActorWaitForMove(s32 actor)
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)
static void Event_PlayCue(s32 cue)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static s32 Event_AskYesNo(s32 speaker, s32 flags)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
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_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
Field objects and actors, and the scene transition styles.
@ 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_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
#define SCENE_EXIT_IF(exit, scene, entrance, flag)
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.
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.
#define FLAG_SHOW_LOCATION_NAME
#define FLAG_SOL_SANCTUM_FIRST_SMALL_JEWEL_FOUND
The chests: the Small Jewel for each minotaur relief, and a Herb.
#define FLAG_SCENE_TEMP_34
#define FLAG_SOL_SANCTUM_SECOND_GEM_PLACED
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_SOL_SANCTUM_ERUPTED
The volcano has erupted and the sanctum's rooms rumble and shake.
#define FLAG_SOL_SANCTUM_SECOND_SMALL_JEWEL_FOUND
#define FLAG_SOL_SANCTUM_INNER_STATUES_SEEN
Kraden has seen the statues out of his reach behind the blocks.
#define FLAG_SOL_SANCTUM_ENTERED
#define FLAG_VALE_RETURNED_FROM_MT_ALEPH
Isaac and Garet followed the elders into the sanctum.
#define FLAG_ITEM_USED_UP
the item just used is removed afterwards
#define FLAG_SOL_SANCTUM_FIRST_GEM_PLACED
#define FLAG_SEARCHING_FOR_HIDDEN_PASSAGE
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
Item numbers, named from the English release.
Small statement macros both games use for positions, velocities and bounds.
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
The reel game's title lettering.
void Battle_ResetEffectCounter(void)
Clears the field's busy flag and, while Reveal is active, ends it: Reveal used with ACT_PACKED runs i...
void FieldObject_WaitForMove(void *fieldObject)
Waits a frame at a time until a field object has arrived at its target, at most 600 frames.
void BattleFx_SetQueuedSoundAndPlay(s32 soundId)
Plays SE_298, then soundId (SE_289 for -1), and remembers soundId for BattleFx_PlayQueuedSound in the...
Scene numbers, named after their places.
char SceneId_SolSanctumEntrance2
char SceneId_SolSanctumEntrance1
#define FLAG_SOL_SANCTUM_INNER_BLOCK_3_WEST
static void Event_InspectFirstMinotaurRelief(void)
Searching the first minotaur relief: one eye sparkles, or both once the Small Jewel is set.
void InitializeSceneRecordBuffer()
static void Event_SetFirstSmallJewel(void)
Using the Small Jewel on the first relief: the leader sets it in and a passage opens.
#define FLAG_SOL_SANCTUM_INNER_BLOCK_6_WEST
struct SceneEntrance gSolSanctumEntranceEntrances1[]
static void Event_InnerBlock3Moved(void)
As Event_InnerBlock1Moved, for the third block (actor 11).
struct SceneEntrance gSolSanctumEntranceEntrances2[]
#define FLAG_SOL_SANCTUM_INNER_BLOCK_5_EAST
static void SolSanctumEntrance_InspectInnerStatues(void)
Shows the inner statues that Kraden cannot reach; he asks Isaac to try Psynergy.
static void Event_InnerBlock4Moved(void)
As Event_InnerBlock1Moved, for the fourth block (actor 12).
struct SceneEvent gSolSanctumEntranceEventsOther[]
const struct SceneEntrance * SolSanctumEntrance_GetEntrances(void)
Returns the approach's entrances (scene 19) or the halls' (scene 16), which share this overlay.
static void Event_InnerBlock1Moved(void)
Moving an inner block with Move: the column it stops in is saved and the floor under all six is set a...
#define FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_EAST
struct SceneEvent gSolSanctumEntranceEvents1Entrances14To16[]
static void Event_InnerBlock6Moved(void)
As Event_InnerBlock1Moved, for the sixth block (actor 14).
#define FLAG_SOL_SANCTUM_INNER_BLOCK_5_WEST
static void SolSanctumEntrance_RecordBlockColumn(s32 column, s32 flagBase, s32 leftColumn, s32 rightColumn)
Remembers which of a movable block's two destination columns it occupies.
static void Event_SetSecondSmallJewel(void)
Using the Small Jewel on the second relief: as the first, and the inner doorway opens.
static void Event_InspectSecondMinotaurRelief(void)
Searching the second minotaur relief, as the first.
struct SceneEvent gSolSanctumEntranceEvents2[]
const u32 * SolSanctumEntrance_GetExits(void)
static void SolSanctumEntrance_RestoreInteriorState(void)
Restores opened passages and the current room's block positions, and plays a room's first cutscene.
#define FLAG_SOL_SANCTUM_INNER_BLOCK_2_WEST
const struct ScenePlacement * SolSanctumEntrance_GetPlacements(void)
Selects the actors for the current map and puzzle room.
s32 gSolSanctumEntrance_RumbleTimer
#define FLAG_SOL_SANCTUM_INNER_BLOCK_2_EAST
#define FLAG_SOL_SANCTUM_INNER_BLOCK_4_EAST
#define FLAG_SOL_SANCTUM_OUTER_LEFT_BLOCK_WEST
#define FLAG_SOL_SANCTUM_INNER_BLOCK_3_EAST
u32 gSolSanctumEntrance_Exits[]
#define FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_EAST
#define FLAG_SOL_SANCTUM_OUTER_RIGHT_BLOCK_WEST
struct ScenePlacement gSolSanctumEntrancePlacements1[]
static void SolSanctumEntrance_RestoreInnerBlockCells(s32 placeActors)
Restores the inner blocks' collision cells and, when placeActors is nonzero (on entry),...
#define FLAG_SOL_SANCTUM_INNER_BLOCK_4_WEST
static void Event_InnerBlock5Moved(void)
As Event_InnerBlock1Moved, for the fifth block (actor 13).
static void Event_OuterRightBlockMoved(void)
Moving the outer right block with Move: the column it stops in is saved.
struct SceneEntrance gSolSanctumEntranceEntrancesOther[]
static void Event_OuterLeftBlockMoved(void)
Moving the outer left block with Move: the column it stops in is saved.
#define FLAG_SOL_SANCTUM_INNER_BLOCK_1_WEST
static void Event_OpenDoorAndEnter(void)
Walking up to the sanctum's door: it slides open and the leader walks in.
#define PUSH_STEP(x, z)
Packs a push step: X in the upper halfword, Z in the lower (pixels).
s32 gSolSanctumPushSteps[]
static void SolSanctumEntrance_ApplyEntryState(void)
Sets up the approach: after the eruption it rumbles now and then, the collision of two rows of cells ...
const struct SceneEvent * SolSanctumEntrance_GetEvents(void)
Selects the events for the current map and puzzle room, by the same entrances as SolSanctumEntrance_G...
struct ScenePlacement gSolSanctumEntrancePlacements1Entrances14To16[]
static void Event_DoorTightlyLocked(void)
Searching the door beside the way in.
#define FLAG_SOL_SANCTUM_INNER_BLOCK_6_EAST
s32 SolSanctumEntrance_Initialize(void)
Restores the outdoor or interior state for this entrance.
struct ScenePlacement gSolSanctumEntrancePlacements1Entrances11To13[]
struct ScenePlacement gSolSanctumEntrancePlacementsOther[]
#define FLAG_SOL_SANCTUM_INNER_BLOCK_1_EAST
static void Event_InnerBlock2Moved(void)
As Event_InnerBlock1Moved, for the second block (actor 10).
const struct SceneRegion * SolSanctumEntrance_GetRegions(void)
static void SolSanctumEntrance_KradenSuspectsHiddenPassage(void)
Kraden looks around the outer block room and decides a hidden passage must lead deeper in; Garet asks...
static void SolSanctumEntrance_UpdateEruptionRumbles(void)
After the eruption the approach rumbles now and then, and each shake fades.
struct SceneEvent gSolSanctumEntranceEvents1Entrances11To13[]
struct ScenePlacement gSolSanctumEntrancePlacements2[]
static void SolSanctumEntrance_IntroduceSanctum(void)
Kraden welcomes the party into Sol Sanctum on their first visit, asking whether it is their first tim...
static void SolSanctumEntrance_ReactToOpeningPassage(void)
The room shakes as stone shifts; the leader looks around and jumps.
struct SceneEvent gSolSanctumEntranceEvents1[]
Song and sound effect ids, indices into gSound_SongTable.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_EventSetMessage()
@ ACTOR_OUTER_RIGHT_BLOCK
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s32 startTransition
SCENE_TRANSITION(style, variant).
u16 unk172
FieldWork's menu request; scenes set it to 1.
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,...
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
union FieldCoordinate x
16.16 fixed-point pixels
s32 velocityX
16.16 fixed-point pixels per frame
union FieldCoordinate y
16.16 fixed-point pixels
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 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
s16 retreatEntrance
where Retreat goes; the group's first entrance
s16 retreatScene
where Retreat goes; the group's first entrance
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...
u32 value
A message below 0x10000, else an event function; for an exit, the exit kind its scene's exit table ma...
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.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels