26#include "text/msg_ids.h"
36#define FLAG_SOL_SANCTUM_FLOATING_EYE_SEEN 0x309
99 if (paletteActive == 0) {
152 if (paletteActive == 0) {
193 *backdropColor = black;
414 leader->
z.
part.pixel);
422 leader->
z.
part.pixel);
430 leader->
z.
part.pixel);
493 request = MsgSolSanctumMeanLookFarther;
572 if (destinationActor != 0) {
574 destinationActor->
z.
part.pixel);
784 s32 twelveFrameFlashes;
785 s32 eightFrameFlashes;
787 s32 fourFrameFlashes;
803 for (twelveFrameFlashes = 0; twelveFrameFlashes != 4; twelveFrameFlashes++) {
806 for (eightFrameFlashes = 0; eightFrameFlashes != 6; eightFrameFlashes++) {
809 for (sixFrameFlashes = 0; sixFrameFlashes != 8; sixFrameFlashes++) {
812 for (fourFrameFlashes = 0; fourFrameFlashes != 10; fourFrameFlashes++) {
815 for (twoFrameFlashes = 0; twoFrameFlashes != 12; twoFrameFlashes++) {
856 for (flash = 0; flash != 4; flash++) {
878 for (flash = 0; flash != 6; flash++) {
881 for (flash = 0; flash != 8; flash++) {
884 for (flash = 0; flash != 10; flash++) {
887 for (flash = 0; flash != 12; flash++) {
918 s32 twelveFrameFlashes;
919 s32 eightFrameFlashes;
921 s32 fourFrameFlashes;
964 for (twelveFrameFlashes = 0; twelveFrameFlashes != 4; twelveFrameFlashes++) {
967 for (eightFrameFlashes = 0; eightFrameFlashes != 6; eightFrameFlashes++) {
970 for (sixFrameFlashes = 0; sixFrameFlashes != 8; sixFrameFlashes++) {
973 for (fourFrameFlashes = 0; fourFrameFlashes != 10; fourFrameFlashes++) {
976 for (twoFrameFlashes = 0; twoFrameFlashes != 12; twoFrameFlashes++) {
1054 leader->
z.
part.pixel);
1181 sprite = actor->sprite;
1188 }
while (frame != 120);
1196 }
while (frame != 60);
1212 s32 steeringFlags = 254;
1221 sprite = actor->sprite;
1227 }
while (frame != 120);
1235 }
while (frame != 60);
1259 s32 playedEntrySequence;
1264 playedEntrySequence = 0;
1293 playedEntrySequence = 1;
1303 playedEntrySequence = 1;
1310 playedEntrySequence = 1;
1326 if (playedEntrySequence == 0) {
1504 if (leader !=
NULL) {
1506 leader->
z.
part.pixel);
1516 ->paletteBufferWork;
1547 {0,
CONDITION_ALWAYS, 288, 0, 157,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1548 {1,
CONDITION_ALWAYS, 55, 0, 477,
FACING_NORTH, 0, 0, 0, 752, 496, 0},
1549 {2,
CONDITION_ALWAYS, 647, 0, 327,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1550 {3,
CONDITION_ALWAYS, 287, 0, 218,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1551 {4,
CONDITION_ALWAYS, 576, 0, 8,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1552 {5,
CONDITION_ALWAYS, 576, 0, 8,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1553 {6,
CONDITION_ALWAYS, 576, 0, 8,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1554 {7,
CONDITION_ALWAYS, 576, 0, 8,
FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1555 {8,
CONDITION_ALWAYS, 297, 0, 119,
FACING_NORTHWEST, 0, 0, 0, 752, 496, 0},
void Object_LinkPair(s32 firstId, s32 secondId, s32 wait)
The event command "actors face each other": turns two actors toward each other, then waits wait frame...
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
struct BattleEffectBuffers * gPaletteBufferWork
Calls through a function pointer, by argument count.
The engine calls the debug menus import, and their palette swatch tiles.
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,...
#define SPEAKER_PORTRAIT_LEFT
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)
#define SPEAKER_WINDOW_ABOVE
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
#define SPEAKER_PORTRAIT_RIGHT
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
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_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
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_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
#define SPEAKER_WINDOW_BELOW
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
void Engine_ActorWaitForMove(s32 actor)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
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.
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
static s32 Random_Next(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)
void Engine_ColorBufferApplyTarget(s32 value, s32 mode)
void Engine_ColorBufferApplySource(s32 value, s32 mode)
static struct FieldActor * Actor_Get(s32 actor)
static void ColorBuffer_ApplySource(s32 value, s32 mode)
@ TRANSITION_BACKDROP_FADE
#define SCENE_TRANSITION(style, variant)
@ ACTOR_FACES_MOTION
turns toward its velocity, 1/16 turn a frame
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)
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.
Game flags, named where their meaning is shown.
#define FLAG_SOL_SANCTUM_HERB_FOUND
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_SCENE_TEMP_00
#define FLAG_SOL_SANCTUM_NORTHEAST_LIGHT_SHOWN
#define FLAG_SOL_SANCTUM_FALLING_LIGHTS_SEEN
The statues' lights have flashed and fallen through the Luna room.
#define FLAG_SOL_SANCTUM_ISAAC_SEARCHING_FOR_KRADEN
Isaac agreed to look farther on while Kraden studies the rooms.
#define FLAG_SOL_SANCTUM_ERUPTED
The volcano has erupted and the sanctum's rooms rumble and shake.
#define FLAG_SCENE_TEMP_02
#define FLAG_SOL_SANCTUM_SOUTHWEST_LIGHT_SHOWN
#define FLAG_SOL_SANCTUM_STAR_ROOM_PASSAGE_OPEN
The floor has opened over the way up to the Elemental Star room.
#define FLAG_SOL_SANCTUM_LUNA_PICTURE_CHANGED
Kraden has seen the picture of Luna change to Sol.
#define FLAG_SOL_SANCTUM_FLOOR_SYMBOL_SEEN
Kraden has seen the symbol on the floor change.
#define FLAG_SOL_SANCTUM_NORTHEAST_SEAL_OPEN
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_SOL_SANCTUM_SOUTHEAST_SEAL_OPEN
#define FLAG_SOL_SANCTUM_FOUND
Crossbone Isle's pursuer room: a pursuer is after the leader.
#define FLAG_SOL_SANCTUM_STATUE_TRAP_SPRUNG
The statues' lights have flashed as Kraden stood among them.
#define FLAG_SOL_SANCTUM_NORTHWEST_LIGHT_SHOWN
The light each seal shows in the Luna and Sol rooms, lit or dark.
#define FLAG_SOL_SANCTUM_SOUTHWEST_SEAL_OPEN
#define FLAG_SCENE_TEMP_01
#define FLAG_SOL_SANCTUM_SOUTHEAST_LIGHT_SHOWN
#define FLAG_SOL_SANCTUM_NORTHWEST_SEAL_OPEN
A statue stands on its seal and the seal's light shines.
#define FLAG_SOL_SANCTUM_KRADEN_SAID_YOU_FOUND_IT
Kraden has praised Isaac after the seals' lights flashed.
#define FLAG_SOL_SANCTUM_LUNA_SOL_ROOMS_SEEN
Kraden has seen the Luna and Sol rooms and asked the party to search on.
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 hardware's I/O registers and their bits, as pret names them.
Io_Write16, a 16-bit write to a register or memory.
#define Io_Write16(v, reg)
Writes a value to a 16-bit register or memory location.
Item numbers, named from the English release.
void Map_ClearLayerEntryFlag(u32 channelIndex)
Resumes tile animation channel channelIndex by clearing its paused byte.
The reel game's title lettering.
Palette fades, the battle effect palette buffers and the colour channel curves.
@ PALETTE_TRANSFORM_PLAIN
each colour unchanged
void BattleFx_SetQueuedSoundAndPlay(s32 soundId)
Plays SE_298, then soundId (SE_289 for -1), and remembers soundId for BattleFx_PlayQueuedSound in the...
static void Event_KradenStopsPartyLeaving(void)
Heading out before the stars are bagged: the party is called back.
static void Event_TalkToKraden(void)
Talking to Kraden: about the stars still to bag, or the hostages.
void InitializeSceneRecordBuffer()
static void SolSanctumLunaSolRooms_DiscussFloorSymbolChangingToLuna(void)
Kraden notices that the symbol on the floor has changed from Sol to Luna.
const struct ScenePlacement * SolSanctumLunaSolRooms_GetPlacements(void)
Returns the eight statues (actors 8 to 15), Kraden (actor 16), Jenna and Garet, all of them always pl...
static void SolSanctumLunaSolRooms_DrawAlternateSavedStatueLights(void)
Draws the saved lights using their alternate tile rows.
static void SolSanctumLunaSolRooms_SpringStatueTrap(void)
The seals' lights flash ever faster around Kraden, who hurries back to Isaac.
static void SolSanctumLunaSolRooms_UpdateFirstStatueLight(void)
Animates the first falling light and manages the shared shake pulse.
struct SceneEvent gSolSanctumLunaSolRoomsEvents[]
static void SolSanctumLunaSolRooms_AnimateSavedStatueLights(void)
The lights of the seals Isaac has opened since flash ever faster in the room of Luna.
static void Event_UpdateRoomTintInverse(void)
Crossing cell code 14: as code 13, with the tints the other way round.
static void SolSanctumLunaSolRooms_RunStatueLightSequence(void)
The seals' lights flash and lights fall through the room of Luna while Kraden calls on Isaac to stop.
const struct SceneEntrance * SolSanctumLunaSolRooms_GetEntrances(void)
static void SolSanctumLunaSolRooms_FlashCurrentStatueLights(s32 frames)
Flashes both tile sets of the current statue lights at this pace.
static void SolSanctumLunaSolRooms_UpdateSecondStatueLight(void)
Animates the second falling light with its own random restart delay, as the first.
const struct SceneEvent * SolSanctumLunaSolRooms_GetEvents(void)
Returns the floor's cell codes that tint the rooms, Kraden's talk and cutscenes, the floor symbol and...
static void SolSanctumLunaSolRooms_DrawStatueLightTiles(s32 firstFlag, s32 sourceRow)
Draws the light of each open seal, from four consecutive flags, with the tiles of the given source ro...
static void SolSanctumLunaSolRooms_DrawCurrentStatueLights(void)
Draws the active lights from the current statue flags.
static void SolSanctumLunaSolRooms_UpdateFourthStatueLight(void)
Animates the fourth falling light with its own random restart delay, as the first.
static void Event_RestorePlainTint(void)
Crossing cell code 15: the room fades back to its plain colours.
const struct SceneRegion * SolSanctumLunaSolRooms_GetRegions(void)
static void SolSanctumLunaSolRooms_ShowMessageAndWait(s32 speaker, s32 waitFrames)
Advances the active dialogue and pauses for the requested frames.
struct ScenePlacement gSolSanctumLunaSolRoomsPlacements[]
static void Event_KradenSeesLunaPictureChange(void)
Walking up to Kraden once all four seals are open: the picture of Luna has changed to Sol.
static void SolSanctumLunaSolRooms_DrawAlternateCurrentStatueLights(void)
Draws the current lights using their alternate tile rows.
static void SolSanctumLunaSolRooms_ShowFloatingEye(void)
Entering after the eruption the first time: in a white flash a floating eye shows itself to Isaac and...
u32 gSolSanctumLunaSolRoomsExits[]
static void SolSanctumLunaSolRooms_FlashSavedStatueLights(s32 frames)
Flashes both tile sets of the saved statue lights at this pace.
static s32 SolSanctumLunaSolRooms_AreAllStatueLightsLit(void)
Returns 1 when all four seals are open.
static void SolSanctumLunaSolRooms_PrepareStatueTransition(void)
Opens on Kraden in the room of Luna with its first tint, as a flash crosses it.
static void Event_RiseToElementalStarRoom(void)
Searching the floor symbol after Kraden has seen it change: the floor opens, and Isaac then Kraden ri...
s32 SolSanctumLunaSolRooms_Initialize(void)
Restores puzzle tiles and plays the cutscene this entrance calls for.
static void Event_KradenFindsHall(void)
Walking into the hall the first time: Kraden studies the symbols and asks the party to keep exploring...
static void SolSanctumLunaSolRooms_IntroduceSolAndLunaRooms(void)
Kraden finds the room of Luna beside the room of Sol, and asks Isaac to look farther up the passage.
struct SceneEntrance gSolSanctumLunaSolRoomsEntrances[]
static void SolSanctumLunaSolRooms_UpdateThirdStatueLight(void)
Animates the third falling light with its own random restart delay, as the first.
static void Event_ClearBackdropColor(void)
Crossing cell code 19: the backdrop turns black.
#define FLAG_SOL_SANCTUM_FLOATING_EYE_SEEN
static void SolSanctumLunaSolRooms_DrawSavedStatueLights(void)
Draws the active lights from the saved statue flags.
static void Event_ApplySecondRoomTint(void)
Crossing cell code 12: the room fades to its second tint.
static void Event_UpdateRoomTint(void)
Crossing cell code 13: the room fades to the tint that matches the seals' lights.
const u32 * SolSanctumLunaSolRooms_GetExits(void)
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()
void Engine_EventShowMessage()
s32 gSolSanctumLunaSolRooms_FlashState
u16 gSolSanctumLunaSolRooms_Light3Timer
u16 gSolSanctumLunaSolRooms_Light1Timer
u16 gSolSanctumLunaSolRooms_Light2Timer
u16 gSolSanctumLunaSolRooms_Light4Timer
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
s32 scale
16.16 fixed point, 0x10000 full size
The colour buffer (heap block 32) that fades the BG and OBJ palettes: the source palette,...
u16 target[0x540]
the colours current moves toward, as current
u16 palette[0x1c0]
The source palette, RGB555: 224 BG colours, then 224 OBJ colours; palette[0] is the backdrop.
The work slot pointers from the event work (slot 27) onward, reaching the palette buffer work in slot...
void * slots28To31[4]
not read here
u8 * paletteBufferWork
slot 32, gPaletteBufferWork
struct EventWork * event
slot 27, gEventWork
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
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,...
u8 steeringFlags
ActorSteeringFlag bits.
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
union FieldCoordinate z
16.16 fixed-point pixels
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.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels