52#define FLAG_CROSSBONE_ISLE_THIRD_BLOCK_LOWERED 0x300
55#define CROSSBONE_PURSUER_STEP_Z 16
56#define CROSSBONE_LEADER_STEP_Z 24
58#define CROSSBONE_PURSUER_STEP_Z 24
59#define CROSSBONE_LEADER_STEP_Z 16
88 s32 destinationColumn = column;
196 if (escapeComplete == 0) {
232 spinningDjinni->sprite->rotation = 0xf800;
233 spinningDjinni->
facing = 0;
255 djinni->sprite->rotation = 0;
259 djinni->velocityY =
PIXELS(8);
267 djinni->velocityY =
PIXELS(4);
289 djinni->update = (void (*)(
301 s32 targetByteOffset;
316 targetByteOffset -= 30;
319 targetByteOffset *= 2 *
sizeof(
s32);
320 zByteOffset = targetByteOffset +
sizeof(
s32);
322 *(
const s32 *)(targets + zByteOffset));
355 s32 tileColumn = columnOffset + 77;
356 s32 collisionColumn = columnOffset + 13;
443 if (*blockedSteps > 12) {
446 *blockedSteps = resetSteps;
462 if (*blockedSteps > 12) {
465 *blockedSteps = resetSteps;
535 event->raisedTrigger = 91;
607 s32 pursuerId = pursuerIndex + 10;
686 leader->
z.
part.pixel);
710 state->
cloaked == 0 && column == 19 && (
u32)(row - 15) <= 1) {
742 u32 coefficient = 208;
764 s32 destinationColumn = 45;
765 s32 destinationRow = 43;
776 s32 destinationColumn = 45;
777 s32 destinationRow = 43;
784 if (leader->
y.
fixed == 0) {
815 if (leader->
facing == 0) {
869 }
else if (column == 42) {
871 }
else if (column == 41) {
873 }
else if (column == 39) {
875 }
else if (column == 38) {
877 }
else if (column == 37) {
890 if (leaderColumn == 38 && blockColumn != 38) {
904 StagedActor_AdvancePair();
927 if (column == 45 && row == 43) {
935 StagedActor_AdvancePair();
987 StagedActor_AdvancePair();
1035 StagedActor_AdvancePair();
1047 StagedActor_AdvancePair();
1244 djinni->
update = (void (*)(
1250 djinni->sprite->rotation = 0;
1261#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))
1274 207, 205, 228, 229, 298, 297,
1330 { 0,
CONDITION_ALWAYS, 120, 0, 152,
FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
1335 { 1,
CONDITION_ALWAYS, 200, 0, 968,
FACING_NORTH, 0, 24, 560, 504, 1008, 0 },
1336 { 2,
CONDITION_ALWAYS, 88, 0, 968,
FACING_NORTH, 0, 24, 560, 504, 1008, 0 },
1341 { 1,
CONDITION_ALWAYS, 200, 0, 408,
FACING_NORTH, 0, 40, 0, 464, 440, 0 },
1342 { 2,
CONDITION_ALWAYS, 88, 0, 392,
FACING_NORTH, 0, 40, 0, 464, 440, 0 },
1347 { 1,
CONDITION_ALWAYS, 776, 0, 952,
FACING_NORTH, 0, 512, 544, 928, 992, 0 },
1348 { 2,
CONDITION_ALWAYS, 664, 0, 952,
FACING_NORTH, 0, 512, 544, 928, 992, 0 },
Ability numbers, named from the English release.
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.
Calls through a function pointer, by argument count.
The task scheduler: tasks, their order and the scheduler's state.
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).
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,...
DMA channel registers, and the DMA and CPU fills.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
static void FieldBattleFx_RunRisingObjectSequence(s32 actor, s32 mode, s32 action)
Scene commands: the all-caps macros the scene scripts are written in.
#define OBJ_DIR(no, d, t)
#define OBJ_POS_SET(no, x, z)
#define OBJ_SPEED(no, s, a)
void ObjectDispatch_SetAnimationSpeed(struct DispatchObject *rawObject, s32 value)
Sets the animation speed (timer step) of all of an object's sprites.
Field effects, their scripts and the flags that spawn them.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
s32 Engine_LeaderCheckAhead(void)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveToActor(s32 actor, s32 pan)
void Engine_ItemShowFound(s32 item, s32 height)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script)
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)
void Engine_ActorWalkTo(s32 actor, s32 x, s32 z)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
void Engine_MapObjectSetPosition(s32 object, s32 fixed_x, s32 fixed_z)
s32 Engine_GameFlagIsSet(s32 flag)
static void MapObject_SetPosition(s32 object, s32 fixed_x, s32 fixed_z)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
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.
#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
#define FIND_COINS(coins)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static s32 FieldScheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 priority)
Calls the main-image scheduler through engine_call.h.
static void FieldObjectMotion_OffsetPositionAndResetMotion(s32 a0, s32 a1, s32 a2)
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_CROSSBONE_ISLE_BANE_LAST_ESCAPE
#define FLAG_DJINNI_0
the flag of Djinni 0, set once it is caught
#define FLAG_SCENE_TEMP_20
#define FLAG_SCENE_TEMP_03
#define FLAG_SCENE_TEMP_00
#define FLAG_SCENE_TEMP_06
#define FLAG_CROSSBONE_ISLE_BANE_SECOND_ESCAPE
#define FLAG_CROSSBONE_ISLE_BANE_FIRST_ESCAPE
Bane's three escapes in the block room.
#define FLAG_CROSSBONE_ISLE_FIRST_BLUE_DOOR_OPEN
The four blue doors in a row, then the red door.
#define FLAG_KEEP_PARTY_POSITION
#define FLAG_CROSSBONE_ISLE_RED_DOOR_OPEN
#define FLAG_SCENE_TEMP_01
#define FLAG_SCENE_TEMP_04
#define FLAG_SCENE_TEMP_07
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 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
s32 PartyInventory_Remove(s32 itemId)
Removes one itemId from whoever carries it first; always returns 0.
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.
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 heaps: allocating and freeing blocks.
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_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
Scene numbers, named after their places.
char SceneId_CrossboneIslePlatformRooms2
char SceneId_CrossboneIslePlatformRooms1
char SceneId_CrossboneIslePlatformRooms3
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
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.
struct EventWork * gEventWork
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_AudioPlayCue()
Colosso Log, River and Wall, and Crossbone Isle's platform rooms: an actor drawn as an item's menu ic...
void Colosso_ShowItemIcon(s32 id, s32 item)
Replaces the picture of actor id, when it has a sprite of its own, with the icon of item: the icon's ...
The pushable actors' movement probes and footprint bounds.
A field object as the object dispatcher's far calls take it.
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s16 raisedTrigger
a raised event for Scene_RunRaisedEvent
s32 startTransition
SCENE_TRANSITION(style, variant).
s16 blockedSteps
frames the leader has pushed against something
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
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
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...
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
s16 cloaked
1 under Cloak, which prevents battles
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...
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
An object on the field, read as an actor or as an effect.
The patch levels: our groups of the measured changes from the Japanese release.