55 while (column != 255 || row != 255) {
57 if (
id >= 100 &&
id <= 239) {
62 for (;
event->control != -1;
event++) {
66 if ((event->
control & 0x1ff) == 19) {
70 20, (column << 20) + 0x80000, 0, (row << 20) + 0x80000);
71 if (markerActor ==
NULL)
79 if ((event->
value & 0xfff00000) == 0x500000) {
86 markerActor->homeX = markerActor->x / 0x10000;
87 markerActor->homeZ = markerActor->z / 0x10000;
88 markerActor->unk23 = 1;
89 markerActor->flags59 = 1;
90 slot->
id =
event->trigger;
92 slot->
column = markerActor->x / 0x100000;
93 slot->
row = markerActor->z / 0x100000;
100 if ((event->
value & 0xfff00000) != 0x300000)
105 28, (column << 20) + 0x80000, 0, (row << 20) + 0x80000);
106 if (markerActor ==
NULL)
113 markerActor->homeX = markerActor->x / 0x10000;
114 markerActor->homeZ = markerActor->z / 0x10000;
115 markerActor->flags59 = 1;
116 markerActor->unk23 = 1;
118 slot->
id =
event->trigger;
119 slot->
column = markerActor->x / 0x100000;
120 slot->
row = markerActor->z / 0x100000;
145 for (slotIndex = 0; slotIndex <= 9; slotIndex++, slot++) {
146 if (slot->
id ==
id) {
147 matchingSlot = slotIndex;
164 if (slotIndex != -1) {
189 if (slotIndex != -1) {
196 if (
object !=
NULL) {
197 object->velocityY = 8 << 16;
215 if (slotIndex != -1) {
244 if (slotIndex != -1) {
266 if (slotIndex != -1) {
269 if (
object !=
NULL) {
271 objectX = (marker->
column << 20) + 0x80000;
273 objectZ = (marker->
row << 20) + 0x80000;
277 object->terrainHeight = terrainHeight;
278 object->y = terrainHeight;
#define Dma_Fill32(value, destination, size)
Fills size bytes at destination with the word value by DMA3.
struct ObjectRuntime * Object_CreateFar(s32 id, s32 x, s32 y, s32 z)
Far call to FieldObject_Create.
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
s32 Map_GetTerrainHeightFar(s32 layer, s32 x, s32 y)
void ObjectDispatch_SetSingleChildFlagsFar(struct DispatchObject *obj, u32 flags)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_StartIdleFar(struct DispatchObject *obj)
s32 GameFlag_TestFar(s32 flag)
void AudioCommand_PlayFar(s32 id)
struct SceneEntries gOverlayArea
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
void Field_PlaceMapMarkers(void)
Places an actor at each of the map's markers (ids 100 to 239) that the scene has an event for,...
void Marker_SetActorPosition(s32 id, s32 x, s32 z)
Moves the actor of marker id to (x, z) on the ground; -1 keeps the centre of its cell on that axis.
s32 Marker_FindSlot(s32 id)
Returns the marker slot (0 to 9) whose event trigger is id, or -1.
struct ObjectRuntime * Marker_GetActor(s32 id)
Returns the actor of marker id, or NULL when no slot has it.
UNUSED void EffectRuntime_ReservedNoOp(void)
void ObjectMotion_SnapToTerrain(void *object)
Sets an actor's y and terrainHeight to the map's height at its x and z.
void Marker_CloseChest(s32 id)
Closes the chest of marker id again (its item could not be carried), with SE_125.
void Marker_ShowOpened(s32 id)
Shows the chest of marker id open (animation 2), with no sound.
static __inline__ void SetMarkerAnimationAndPlaySound(s32 id, s32 animation, s32 sound)
Gives the actor of marker id animation, plays sound and waits 12 frames.
void Marker_OpenChest(s32 id)
Opens the chest of marker id (animation 4) with SE_124, and waits 12 frames.
void Marker_LaunchMimic(s32 id)
Makes the chest of marker id jump up as a mimic: after 18 frames it takes animation 7,...
void Marker_Hide(s32 id)
Hides the actor of marker id by clearing its animationKind.
What every part of object.c shares: its includes and the macros and types more than one part uses.
struct EventWork * gEventWork
A field object as the object dispatcher's far calls take it.
Full event work allocated by Field_RunScene (heap slot 27).
struct MarkerSlot markers[10]
the map's markers (MARKER_MAX)
The start of the map's work.
u8 * markers
(column, row, id) triples, ended by 255, 255
A map marker placed as an actor: a chest or a Psynergy stone.
u8 id
the trigger of its scene event
struct ObjectRuntime * object
u8 column
its 16-pixel cell
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 terrainHeight
16.16 fixed-point pixels
s32 z
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
u8 animationKind
Low four bits: 0 no sprite, 1 one sprite, 2 a group of up to four.
const struct SceneEvent *(*) events(void)
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
s16 condition
-1 always, a flag | 0x1000 set, else the flag clear
s16 trigger
What the event answers: an actor id, a tile's collision code, a marker id or a raised value.
u32 value
A message below 0x10000, else an event function; for an exit, the exit kind its scene's exit table ma...
u32 control
The kind and its detail, read by Scene_FindEvent and the item, Psynergy and search lookups; -1 ends t...
A field object as its object script commands see it: the script and its place, position,...