48#define WESTERN_MOVABLE_OBJECT 9
49#define EASTERN_MOVABLE_OBJECT 10
50#define SLIDING_OBJECT 11
51#define OBJECT_SINK_FRAMES 68
52#define OBJECT_SINK_STEP 0x8000
53#define ACTOR_LANDING_TIMEOUT 60
54#define FIRST_DJINNI_ROUTE_TRIGGER 45
57#define FLAG_KITE (FLAG_DJINNI_0 + 3 * 20 + 4)
70#define FLAG_VALE_CAVE_SLIDERS_EAST 0x301
72#define FLAG_VALE_CAVE_KITE_BEHIND_LEDGE 0x302
91 while (framesRemaining != 0) {
125#define VALE_CAVE_FACE_LEADER_CALLBACK ValeCave_FaceActorTowardLeader
127#define VALE_CAVE_FACE_LEADER_CALLBACK \
128 ((void (*)(union FieldObject *))ValeCave_FaceActorTowardLeader)
193 Effect_Spawn(particleX, 0, particleZ, 0, 0, 0,
218 leftEffect = OverlayObject_PrepareObject(
221 rightEffect = OverlayObject_PrepareObject(
226 particleOptions = &options;
232 PIXELS(624), particleOptions);
260 leftEffect = OverlayObject_PrepareObject(
263 rightEffect = OverlayObject_PrepareObject(
268 particleOptions = &options;
274 PIXELS(656), particleOptions);
294 StagedActor_AdvancePair();
308 s32 savedMotionFlags;
314 landingPosition[0].
fixed = (leader->
x.
fixed & -0x100000) + 0x80000;
316 landingPosition[2].
fixed = (leader->
z.
fixed & -0x100000) + 0x280000;
320 landingPosition[2].
fixed = leader->
z.
fixed + 0x200000;
330 leader->
speed = 0x30000;
336 landingPosition[2].
part.pixel);
420 const u8 *walkTargetBytes;
428 routeIndex =
event->touchedTrigger;
440 targetZOffset = routeIndex +
sizeof(
s32);
442 *(
const s32 *)(walkTargetBytes + routeIndex),
443 *(
const s32 *)(walkTargetBytes + targetZOffset));
464 s32 stationaryMotion;
469 if (StagedActor_FindClearPosition(&probe) != 0) {
470 SceneActor_MoveAndRedraw(probe);
474 stationaryMotion = 0;
477 movedObject->
bounce = stationaryMotion;
496 clearedRows, stationaryMotion);
499 clearedRows, stationaryMotion);
517 s32 stationaryMotion;
530 stationaryMotion = 0;
533 pushedObject->
bounce = stationaryMotion;
564 if (StagedActor_FindClearPosition(&probe) != 0) {
565 SceneActor_MoveAndRedraw(probe);
576 s32 emptyAttributes = 0;
580 0, 13, (probe.
position.
z >> 20) - 1, 4, clearedRows, emptyAttributes);
696 actor->
x.
fixed = (column << 20) + 0x80000;
697 actor->
z.
fixed = (row << 20) + 0x80000;
708 s32 northernObjectMoved;
777 if (northernObjectMoved != 0) {
781 northernObjectMoved);
819#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((u32)(dz) & 0xffff))
821#define DIRECTION_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))
835 207, 205, 228, 229, 298, 297,
869 { 0,
CONDITION_ALWAYS, 120, 0, 152,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
874 { 0,
CONDITION_ALWAYS, 120, 0, 152,
FACING_SOUTH, 0, 16, 0, 336, 368, 0 },
875 { 1,
CONDITION_ALWAYS, 104, 0, 344,
FACING_NORTH, 0, 16, 0, 336, 368, 0 },
876 { 2,
CONDITION_ALWAYS, 136, 0, 184,
FACING_SOUTH, 0, 16, 0, 336, 368, 0 },
877 { 3,
CONDITION_ALWAYS, 136, 0, 376,
FACING_NORTH, 0, 16, 0, 336, 368, 0 },
882 { 0,
CONDITION_ALWAYS, 120, 0, 152,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
883 { 1,
CONDITION_ALWAYS, 328, 0, 392,
FACING_NORTH, 0, 48, 32, 544, 416, 0 },
884 { 2,
CONDITION_ALWAYS, 312, 0, 160,
FACING_SOUTH, 0, 48, 32, 544, 416, 0 },
885 { 3,
CONDITION_ALWAYS, 120, 0, 120,
FACING_SOUTH, 0, 48, 32, 544, 416, 0 },
886 { 4,
CONDITION_ALWAYS, 504, 0, 136,
FACING_SOUTH, 0, 48, 32, 544, 416, 0 },
887 { 5,
CONDITION_ALWAYS, 792, 0, 360,
FACING_NORTH, 0, 624, 16, 944, 384, 0 },
888 { 6,
CONDITION_ALWAYS, 680, 0, 248,
FACING_SOUTH, 0, 624, 16, 944, 384, 0 },
889 { 7,
CONDITION_ALWAYS, 904, 0, 232,
FACING_SOUTH, 0, 624, 16, 944, 384, 0 },
890 { 8,
CONDITION_ALWAYS, 408, 0, 872,
FACING_NORTH, 0, 312, 472, 704, 896, 0 },
891 { 9,
CONDITION_ALWAYS, 488, 0, 744,
FACING_NORTH, 0, 312, 472, 704, 896, 0 },
892 { 10,
CONDITION_ALWAYS, 632, 0, 552,
FACING_SOUTH, 0, 312, 472, 704, 896, 0 },
897 { 0,
CONDITION_ALWAYS, 200, 0, 432,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
898 { 1,
CONDITION_ALWAYS, 200, 0, 432,
FACING_NORTH, 0, 64, 24, 416, 464, 0 },
899 { 2,
CONDITION_ALWAYS, 344, 0, 120,
FACING_SOUTH, 0, 64, 24, 416, 464, 0 },
900 { 3,
CONDITION_ALWAYS, 120, 0, 264,
FACING_NORTH, 0, 64, 24, 416, 464, 0 },
901 { 4,
CONDITION_ALWAYS, 536, 0, 776,
FACING_NORTH, 0, 400, 440, 896, 800, 0 },
902 { 5,
CONDITION_ALWAYS, 840, 0, 776,
FACING_NORTH, 0, 400, 440, 896, 800, 0 },
Ability numbers, named from the English release.
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[]
const s32 * gEffectScripts[]
The engine calls the debug menus import, and their palette swatch tiles.
void Djinn_JoinParty(s32 slot, s32 element, s32 djinn)
A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn,...
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.
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
Field effects, their scripts and the flags that spawn them.
@ EFFECT_USE_PALETTE
options.palette, as its group child value
@ 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 void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
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_ActorWalkTo(s32 actor, s32 x, s32 z)
static void Event_PlayCue(s32 cue)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
s32 Engine_GameFlagIsSet(s32 flag)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ TRANSITION_BACKDROP_FADE
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
@ 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 SCENE_EXIT(exit, scene, entrance)
#define PSYNERGY_ON_ACTOR(ability)
#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_SCENE_TEMP_05
#define FLAG_SHOW_LOCATION_NAME
#define FLAG_SCENE_TEMP_03
#define FLAG_SCENE_TEMP_00
#define FLAG_SCENE_TEMP_02
#define FLAG_VALE_CAVE_HALT_GEM
the second room's chest
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_SCENE_TEMP_01
#define FLAG_SCENE_TEMP_04
#define FLAG_VALE_CAVE_NUT
the second room's other chest
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.
Item numbers, named from the English release.
Declares nothing of its own: it only includes edition.h and types.h.
s32 ArcTan2(s32 x, s32 y)
Returns the angle of the vector (x, y), in 1/65536 turns, measured from the y axis: 0 along +y,...
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#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.
static void SceneActor_PlacePairAtOffset(s32 id, s32 dx, s32 dz)
Moves the character the player controls (in mode 27) and actor id together by (dx,...
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),...
Scene numbers, named after their places.
Declares nothing of its own: it only includes types.h.
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.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
The pushable actors' movement probes and footprint bounds.
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
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s32 startTransition
SCENE_TRANSITION(style, variant).
s16 touchedTrigger
the step event a touch or exit event answers
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
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 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....
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
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 pausedObject
Halt: the stopped object; -1 for none.
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...
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.
The integer types, TRUE, UNUSED and the fixed-address macros.
A field coordinate, read whole or as its fraction and its whole pixels.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
struct SceneEvent gValeCave_Events3[]
static void ValeCave_CenterActorOnCell(s32 actorId, s32 column, s32 row)
Centers an actor on a map cell and gives it underfoot priority.
s32 ValeCave_Initialize(void)
Chooses the entry transition and restores the room's puzzle state.
#define FLAG_VALE_CAVE_SLIDERS_EAST
The sliding objects of the second room are at their eastern end.
static void Event_LeaveRoom(void)
The first room's exits play the exit sound before leaving.
#define FIRST_DJINNI_ROUTE_TRIGGER
static void Event_RevealHiddenTile(void)
Reveal shows a hidden tile in the second room.
struct SceneEvent gValeCave_Events1[]
#define FLAG_VALE_CAVE_KITE_BEHIND_LEDGE
Kite has run behind the ledge and keeps to its far side.
static void Event_MoveWestObjectIntoHole(void)
Move on the western object: once over its hole, Isaac steps aside and the object sinks into the floor...
static void Event_PushObjectNorth(void)
Pushing the object north: it slides a cell, opening the way.
const struct SceneEvent * ValeCave_GetEvents(void)
Selects the current room's touch, Psynergy and search bindings.
struct SceneEvent gValeCave_EventsOther[]
static void ValeCave_UpdateSlidingObjectPassage(void)
Rebuilds the passage cells around the sliding object's saved side.
static void Event_SlideObjectsEast(void)
Walking east onto the sliding objects: they slide to the eastern end.
#define OBJECT_SINK_FRAMES
static void Event_PushObjectOffLedge(void)
Pushing the western object east: it falls off the ledge, opening the way.
static void Event_KiteKeepsAway(void)
Walking around the ledge: Kite keeps to the far side of it, unless Halt has stopped it.
static void Event_PushObjectOverEdge(void)
Pushing an object along the ledge: at its edge the object falls off, opening the way.
static void Event_KiteRunsOff(void)
Coming near Kite: the camera finds it; it notices the party and hops away up the ledge.
struct ScenePlacement gValeCave_Placements2[]
static void Event_KiteRunsBehindLedge(void)
Coming near again: Kite runs behind the ledge and turns to watch the party.
#define ACTOR_LANDING_TIMEOUT
struct SceneEntrance gValeCave_Entrances1[]
#define WESTERN_MOVABLE_OBJECT
static void ValeCave_ApplyEntryState(void)
Restores the Djinni route and completed movable-object puzzles on entry.
static void ValeCave_WaitForActorLanding(struct FieldActor *actor)
Waits for an actor to land, bounded by a one-second timeout.
const struct ScenePlacement * ValeCave_GetPlacements(void)
Selects the current room's actors and movable objects.
static s32 Event_HopDownLedge(s32 unusedArgument)
Walking south off the ledge: Isaac hops down if the cell below is free.
#define FLAG_KITE
The flag of Kite, set once it is caught.
static void Event_TouchSlidingObjects(void)
Touching the sliding objects restarts their animation.
static s32 ValeCave_FaceActorTowardLeader(union FieldObject *fieldObject)
Turns Kite to face the party leader each frame.
static void Event_PushEastObjectIntoHole(void)
Pushing the eastern object: it moves a cell, and sinks if over its hole.
struct SceneEntrance gValeCave_Entrances2[]
struct SceneEvent gValeCave_Events2[]
struct ScenePlacement gValeCave_Placements3[]
s32 gValeCave_WalkTargets[]
#define VALE_CAVE_FACE_LEADER_CALLBACK
#define EASTERN_MOVABLE_OBJECT
struct SceneEntrance gValeCave_EntrancesOther[]
static void Event_MoveEastObjectIntoHole(void)
Move on the eastern object: once over its hole, it sinks into the floor.
const struct SceneRegion * ValeCave_GetRegions(void)
static void Event_TalkToKite(void)
Talking to Kite after Halt: it joins the party.
const u32 * ValeCave_GetExits(void)
Returns the shared packed exits for all cave rooms.
static void Event_HaltKite(void)
Halt on Kite: it stops where it stands.
const struct SceneEntrance * ValeCave_GetEntrances(void)
Selects entrance positions and camera bounds for the current cave room.
struct ScenePlacement gValeCave_Placements1[]
static void ValeCave_SinkObjectWithParticles(s32 actorId, s32 baseX, s32 baseZ, struct EffectOptions *particleOptions)
Lowers one object while emitting a particle each frame around its opening.
struct SceneEntrance gValeCave_Entrances3[]
static void Event_SlideObjectsWest(void)
Walking west onto the sliding objects: they slide back to the western end.
static void Event_HideRevealedTile(void)
Reveal ends: the hidden tile is hidden again.
The patch levels: our groups of the measured changes from the Japanese release.