Alchemy
Loading...
Searching...
No Matches

field_fx.c

Go to the documentation of this file.
1/// @file
2/// Showing a found item, and Reveal's sparkles on hidden things.
3/// Part of object.c, the field object, compiled only through it.
4
6
7STATIC_ASSERT(offsetof(struct ObjectRuntime, velocityY) == 0x28);
8STATIC_ASSERT(offsetof(struct ObjectRuntime, flags) == 0x55);
9STATIC_ASSERT(offsetof(struct ObjectRuntime, animation) == 0x50);
10
11/// An actor as these effects see it.
12struct EffectObj {
13 s32 scriptWord; ///< the encoded script pointer
14 u8 pad0[0x24];
16 u8 pad1[0x1c];
18 u8 pad2[4];
20 u8 pad3[24];
21 void (*updateHook)(union FieldObject *object); ///< frame hook at offset 0x6c
22};
23
24STATIC_ASSERT(sizeof(struct EffectObj) == 0x70);
25STATIC_ASSERT(offsetof(struct EffectObj, updateHook) == 0x6c);
26
27/// ObjectSystem_Initialize allocates 64 ObjectRuntime records in heap slot 5.
28#define EFFECT_OBJECT_COUNT 64
29#ifdef UBFIX
30#define EFFECT_OBJECT_POOL ((struct EffectObj *)gObjectSlots)
31#else
32// UB: gObjectSlots and gEventWork are separate globals. The named pool load
33// changes register allocation and shrinks StartRandomParticleEmitter from 0x158
34// to 0x156 bytes in tbs-en; keep the native read here.
35#define EFFECT_OBJECT_POOL (*(struct EffectObj **)((u8 *)&gEventWork - 88))
36#endif
37#define SPARKLE_OBJECT_ID 285
38
39/// Keeps the party leader off the markers: a leader within 16 pixels of a
40/// marker cell's centre is moved 20 pixels from that centre, in the direction
41/// it stood, and loses its move target. Only the first marker it stands on
42/// moves it. Called by two scene overlays (Suhalla Desert, Lamakan Desert).
45 struct MarkerSlot *marker = ((struct FieldWork *)gEventWork)->markers;
46 s32 markerIndex = 0;
47 s32 x;
48 s32 z;
49 s32 cellX;
50 s32 cellZ;
51 s32 dx;
52 s32 dz;
53
54 // The slots are filled in order, so the first with id 0 ends the list.
55 if (marker->id != 0) {
56 x = leader->x;
57 z = leader->z;
58 for (;;) {
59 cellX = marker->column << 20;
60 dx = x - cellX - (8 << 16);
61 cellZ = marker->row << 20;
62 dz = z - cellZ - (8 << 16);
63 if ((dx >= -0xfffff && dx <= 0xfffff) &&
64 (dz >= -0xfffff && dz <= 0xfffff)) {
65 leader->x = cellX + (8 << 16);
66 leader->z = cellZ + (8 << 16);
67 Vector_AddPolarOffset(20 << 16, (u16)ArcTan2(dz, dx),
68 (struct EffectVector *)&leader->x);
69 leader->targetX = ACTOR_NO_TARGET;
70 leader->targetY = ACTOR_NO_TARGET;
71 leader->targetZ = ACTOR_NO_TARGET;
72 return;
73 }
74 markerIndex++;
75 marker++;
76 if (markerIndex > 9 || marker->id == 0)
77 break;
78 }
79 }
80}
81
82/// Starts the particle script and its first child at priority 1, if the spawn
83/// succeeded. Allocation failure leaves the effect absent.
84static inline void Object_InitializeSparkle(struct ObjectRuntime *obj) {
85 // Sharing the offset and spawn as well changes literal/argument load order in
86 // both emitters, without changing their sizes.
87 if (obj != 0) {
91 ((struct AnimationObject *)obj->animation)->image.priority = 1;
92 }
93}
94
95/// Each frame of a found item's picture: one time in ten, a sparkle appears
96/// within 16 pixels of it. Installed as the picture's updateHook by
97/// BattleFx_StartRandomParticleEmitter, EffectRuntime_RunRisingObjectSequence
98/// and BattleFx_StartEffectObject22.
99void ItemDisplay_EmitSparkles(union FieldObject *fieldObject) {
100 struct ObjectRuntime *emitter = (struct ObjectRuntime *)fieldObject;
101 union PolarOffsetPosition position;
102 struct ObjectRuntime *obj;
103 u32 randomRadius;
104
105 // Clear the flags once the picture's rise has all but stopped.
106 // XXX: what the flags at 0x55 hold here is unknown; the object system's
107 // readers of ObjectRuntime.flags would settle it.
108 if (emitter->velocityY >= -255 && emitter->velocityY <= 255)
109 emitter->flags = 0;
110
111 // Test the chance before drawing the radius and angle from the RNG.
112 if ((100 * Random16() >> 16) > 9)
113 return;
114
115 position.vector.x = emitter->x;
116 position.vector.y = emitter->y;
117 position.vector.z = emitter->z;
118 randomRadius = Random16();
119 Vector_AddPolarOffset(randomRadius << 4, Random16(), position.coordinates);
120 obj = Object_Spawn(SPARKLE_OBJECT_ID, position.vector.x, position.vector.y,
121 position.vector.z);
123}
124
125/// Shows the picture of item (0 for none) at the centre of the cell 16 pixels
126/// in front of character actor, 16 pixels up, with sparkles. While Reveal is
127/// active, its sparkles are cleared first. Returns the picture's actor, or 0.
128/// The picture is object 22, thrown up (velocityY 2 << 16, gravity 0x4000),
129/// its icon drawn through heap block 17 and loaded into VRAM. Called by
130/// Field_SearchTile for coins and items found, and by
131/// BattleFx_PlayCueAndStartEmitterOnTarget.
133 struct EffectObj *picture;
134
135 s32 work = (s32)gEventWork;
136 u32 actorOffset = (actor * 4) + 0x14; // EventWork's actors[actor]
137
138 s32 srcZ = (s32)*(struct FieldActor **)(work + actorOffset);
139 union PolarOffsetPosition picturePosition;
140 s32 pictureX;
141
142 if (srcZ == 0)
143 return 0;
144
145 picturePosition.vector.x = ((struct FieldActor *)srcZ)->x.fixed;
146 picturePosition.vector.y = ((struct FieldActor *)srcZ)->y.fixed;
147 picturePosition.vector.z = ((struct FieldActor *)srcZ)->z.fixed;
148 Vector_AddPolarOffset(16 << 16, ((struct FieldActor *)srcZ)->facing,
149 picturePosition.coordinates);
150 pictureX = (picturePosition.vector.x & 0xfff00000) + (8 << 16);
151 // srcZ now holds the cell's z.
152 srcZ = (picturePosition.vector.z & 0xfff00000) + (8 << 16);
153
154 if (((struct FieldWork *)work)->revealActive != 0) {
155 // Stop both the marker emitters and the sparkle actors they already made.
156 struct EffectObj *effect = EFFECT_OBJECT_POOL;
157
158 // work now counts the actors left.
159 work = EFFECT_OBJECT_COUNT - 1;
160
161 do {
162 if (effect->scriptWord != 0) {
163 if (effect->updateHook == RevealMarker_EmitSparkles) {
165 }
166 if (effect->scriptWord == (s32)gBattleFx_ParticleScript) {
168 }
169 }
170 work--;
171 effect++;
172 } while (work >= 0);
173 }
174
175 WaitFrames(3);
176 picture = (struct EffectObj *)Object_CreateFar(22, pictureX, 16 << 16, srcZ);
177 if (picture == 0)
178 return 0;
179
182 {
183 struct AnimationObject *sprite = picture->animation;
184 void *iconBuffer;
185
186 sprite->flags = 0;
187 sprite->count = 0;
188 sprite->image.fullColor = 0;
189 sprite->image.palette = 0;
190 sprite->image.priority = 1;
191
192 picture->velocityY = 0x20000;
193 picture->gravity = 0x4000;
194
195 // Draw the item's icon into heap block 17, then send it to the sprite's
196 // tiles: 128 bytes from offset 0x400 of the block.
197 iconBuffer = Runtime_AllocateHeapBlock(17, 0x608);
199
200 sprite->image.tile =
201 VramCache_Load(sprite->slot, 128, (u8 *)iconBuffer + 0x400);
202
205 }
206
207 return picture;
208}
209
210/// Releases object unless it is NULL. Called by Field_SearchTile to drop the
211/// picture of an item nobody could carry.
212void Object_DestroyIfPresent(void *object) {
213 if (object != 0)
215}
216
217/// Raises a found item's picture to 36 pixels above the party leader, who
218/// holds it up (animation 28) facing the screen. Called by Field_SearchTile for
219/// what a search finds, by EffectRuntime_RunRisingObjectSequence and by
220/// BattleFx_StartEffectObject22.
222 struct ObjectRuntime *leader;
223
224 if (object == 0)
225 return;
226
228 object->acceleration = 1 << 16;
229 object->speedLimit = 2 << 16;
230 object->flags = 0;
231 Object_SetMoveTargetFar(object, leader->x, leader->y + (36 << 16), leader->z);
232 WaitFrames(3);
236 // Angle 0x4000, a quarter turn, faces the screen.
237 leader->angle = 0x4000;
238}
239
240/// Shows a found item's picture: flags bit 0 adds sparkles and bit 1 raises it
241/// above the leader, with waits of 60 and 80 frames around that when both are
242/// set. The leader then returns to animation 1. Scene overlays call it as
243/// Engine_RunRisingObjectSequence (six of them).
245 void *leader;
246
247 if (object != NULL) {
249 if (flags & 1) {
252 ((struct EffectObj *)object)->velocityY = 0x20000;
253 ((struct EffectObj *)object)->gravity = 0x4000;
254 ((struct EffectObj *)object)->updateHook = ItemDisplay_EmitSparkles;
255 }
256 if (flags == 3) {
257 WaitFrames(60);
258 }
259 if (flags & 2) {
261 }
262 if (flags == 3) {
263 WaitFrames(80);
264 }
266 }
267}
268
269/// Shows the picture of item 36 pixels above the party leader for 80 frames;
270/// flags bit 0 adds sparkles and bit 1 raises it as a found item. Then it
271/// releases the picture and the leader returns to animation 1. Scene overlays
272/// call it as Engine_ItemShowFound (41 of them).
275 void *iconBuffer = Runtime_AllocateHeapBlock(17, 0x608);
276 struct EffectObj *object = (struct EffectObj *)Object_CreateFar(
277 22, leader->x.fixed, leader->y.fixed + (36 << 16), leader->z.fixed);
278
279 if (object != 0) {
280 struct AnimationObject *sprite = object->animation;
281
282 sprite->flags = 0;
283 sprite->count = 0;
284 sprite->image.fullColor = 0;
285 sprite->image.palette = 0;
286 sprite->image.priority = 1;
287
289 VramCache_Load(sprite->slot, 128, (u8 *)iconBuffer + 0x400);
291
292 if (flags & 1)
293 object->updateHook = ItemDisplay_EmitSparkles;
294 if (flags & 2)
296
297 WaitFrames(80);
300 }
301}
302
303// The German, Spanish, French and Italian editions stop Reveal's sparkles
304// while a menu is open.
305#if TBS_PATCH_2
306
307#define PARTICLES_PAUSE_FOR_MENU 1
308#endif
309
310#if defined(PARTICLES_PAUSE_FOR_MENU)
311#define MENU_OPEN_OFFSET 0xcca ///< in gEventWork: non-zero while a menu is open
312
313/// While Reveal is active, destroys all its sparkles. Called by the pause
314/// menu (window/selection.c) when it opens over Reveal.
316 if (((struct FieldWork *)gEventWork)->revealActive != 0) {
317 struct EffectObj *effect = EFFECT_OBJECT_POOL;
318 s32 remainingActors = EFFECT_OBJECT_COUNT - 1;
319
320 do {
321 if (effect->scriptWord != 0) {
324 }
325 remainingActors--;
326 effect++;
327 } while (remainingActors >= 0);
328 }
329}
330
331#endif
332
333/// Each frame of a Reveal marker: one time in ten, a sparkle appears within 16
334/// pixels of it. Installed as the marker's updateHook by
335/// FieldEffect_SpawnNearbyMarkers.
336void RevealMarker_EmitSparkles(union FieldObject *fieldObject) {
337 const struct FieldActor *source = (const struct FieldActor *)fieldObject;
338 union PolarOffsetPosition position;
339 struct ObjectRuntime *obj;
340 u32 randomRadius;
341
342#if defined(PARTICLES_PAUSE_FOR_MENU)
343 if (*(s8 *)((u8 *)gEventWork + MENU_OPEN_OFFSET) != 0)
344 return;
345#endif
346 if ((100 * Random16() >> 16) > 9)
347 return;
348
349 position.vector.x = source->x.fixed;
350 position.vector.y = source->y.fixed;
351 position.vector.z = source->z.fixed;
352 randomRadius = Random16();
353 Vector_AddPolarOffset(randomRadius << 4, Random16(), position.coordinates);
354 obj = Object_Spawn(SPARKLE_OBJECT_ID, position.vector.x, position.vector.y,
355 position.vector.z);
357}
358
359/// Returns 1 while Reveal is active, else 0. Run by a Reveal marker's object
360/// script (gBattleFx_MarkerParticleScript) through SC_CALL.
362 s16 revealState;
363 u32 isActive = 0;
364 struct FieldWork *work = (struct FieldWork *)gEventWork;
365
366 if (work != NULL) {
367 revealState = work->revealActive;
368 isActive = (0 - revealState) | revealState;
369 isActive >>= 31;
370 }
371 return isActive;
372}
373
374/// Reveal: marks with sparkles the hidden things within 8 cells left or right
375/// and 5 up or down of the leader: map places 100 to 239 with no marker actor,
376/// whose search event (kind 3) gives an item, coins, a Psynergy stone or a
377/// mimic (types 0 to 3 and 5) and whose flag is not yet set. Each mark is an
378/// object 22 running gBattleFx_MarkerParticleScript. Called by Reveal's effect
379/// (psynergy_effects/reveal.c).
381 u8 *markerData;
382 struct ObjectRuntime *actor;
383 const struct SceneEvent *entry;
384 s32 leaderColumn;
385 s32 leaderRow;
386 s32 column;
387 s32 row;
388 s32 id;
389
390 // The map's places: (column, row, id) triples, ended by 0xff, 0xff; the
391 // same list as MarkerMap's markers in markers.c.
392 markerData = *(u8 **)(((u8 *)gMapWork[0]) + 16);
394 leaderColumn = actor->x >> 20;
395 leaderRow = actor->z >> 20;
396 if (markerData != 0) {
397 while (column = *markerData++, row = *markerData++,
398 column != 0xff || row != 0xff) {
399 id = *markerData++;
400 if (Marker_GetActor(id) != NULL)
401 continue;
402 if (id < 100 || id > 239)
403 continue;
404 if (leaderColumn - column >= 0) {
405 if (leaderColumn - column > 8)
406 continue;
407 } else if (column - leaderColumn > 8)
408 continue;
409 if (leaderRow - row >= 0) {
410 if (leaderRow - row > 5)
411 continue;
412 } else if (row - leaderRow > 5)
413 continue;
414 entry = gOverlayArea.events();
415 if (entry->control == (u32)-1)
416 continue;
417 do {
418 if (entry->trigger == id && (entry->control & 15) == EVENT_SEARCH) {
419 switch (entry->value & 0xfff00000) {
420 case 0:
421 case 0x100000:
422 case 0x200000:
423 case 0x300000:
424 case 0x500000:
425 if (entry->condition != -1 &&
426 GameFlag_TestFar(entry->condition) == 0) {
427 /* FAKEMATCH(temporary): the spawned marker reuses actor, so the
428 * one pseudo keeps ObjectTable_Get's result in r5; as a variable
429 * of its own, 9 of 163 instructions differ in tbs-en. */
430 actor = (struct ObjectRuntime *)Object_CreateFar(
431 22, (column << 20) + (8 << 16), 0, (row << 20) + (8 << 16));
432 if (actor != 0) {
436 (struct DispatchObject *)actor, 0);
437 ((struct EffectObj *)actor)->updateHook =
439 }
440 }
441 break;
442 }
443 }
444 entry++;
445 } while (entry->control != (u32)-1);
446 }
447 }
448}
449
450#undef EFFECT_OBJECT_COUNT
451#undef EFFECT_OBJECT_POOL
452#undef SPARKLE_OBJECT_ID
453#undef PARTICLES_PAUSE_FOR_MENU
454#undef MENU_OPEN_OFFSET
void * ObjectTable_Get(u32 actorIndex)
Returns the actor in slot index (0 to 65), or NULL.
Definition actors.c:462
struct ObjectRuntime * Object_CreateFar(s32 id, s32 x, s32 y, s32 z)
Far call to FieldObject_Create.
void ObjectDispatch_ReleaseFar(struct DispatchObject *obj)
void ObjectDispatch_SetSingleChildFlagsFar(struct DispatchObject *obj, u32 flags)
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_InitializeFar(struct DispatchObject *obj, const s32 *script)
void Object_SetMoveTargetFar(struct ObjectRuntime *object, s32 x, s32 y, s32 z)
s32 GameFlag_TestFar(s32 flag)
void Ui_PrepareTransferForItemFar(s32 code)
void ItemDisplay_EmitSparkles(union FieldObject *fieldObject)
Each frame of a found item's picture: one time in ten, a sparkle appears within 16 pixels of it.
Definition field_fx.c:99
void Object_DestroyIfPresent(void *object)
Releases object unless it is NULL.
Definition field_fx.c:212
void Marker_MoveLeaderAway(void)
Keeps the party leader off the markers: a leader within 16 pixels of a marker cell's centre is moved ...
Definition field_fx.c:43
#define SPARKLE_OBJECT_ID
Definition field_fx.c:37
struct EffectObj * BattleFx_StartRandomParticleEmitter(s32 actor, s32 item)
Shows the picture of item (0 for none) at the centre of the cell 16 pixels in front of character acto...
Definition field_fx.c:132
void FieldEffect_SpawnNearbyMarkers(void)
Reveal: marks with sparkles the hidden things within 8 cells left or right and 5 up or down of the le...
Definition field_fx.c:380
#define EFFECT_OBJECT_COUNT
ObjectSystem_Initialize allocates 64 ObjectRuntime records in heap slot 5.
Definition field_fx.c:28
void EffectRuntime_RunRisingObjectSequence(void *object, s32 flags)
Shows a found item's picture: flags bit 0 adds sparkles and bit 1 raises it above the leader,...
Definition field_fx.c:244
void BattleFx_StartEffectObject22(s32 item, s32 flags)
Shows the picture of item 36 pixels above the party leader for 80 frames; flags bit 0 adds sparkles a...
Definition field_fx.c:273
static void Object_InitializeSparkle(struct ObjectRuntime *obj)
Starts the particle script and its first child at priority 1, if the spawn succeeded.
Definition field_fx.c:84
void RevealMarker_EmitSparkles(union FieldObject *fieldObject)
Each frame of a Reveal marker: one time in ten, a sparkle appears within 16 pixels of it.
Definition field_fx.c:336
void ItemDisplay_RaiseAboveLeader(struct ObjectRuntime *object)
Raises a found item's picture to 36 pixels above the party leader, who holds it up (animation 28) fac...
Definition field_fx.c:221
s32 Field_IsRevealActive(struct ScriptInterpreter *interpreter)
Returns 1 while Reveal is active, else 0.
Definition field_fx.c:361
#define EFFECT_OBJECT_POOL
Definition field_fx.c:35
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
Definition field_obj.h:145
struct SceneEntries gOverlayArea
@ EVENT_SEARCH
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
Definition frame.c:97
const s32 gBattleFx_MarkerParticleScript[]
Definition fxdata.c:114
const s32 gBattleFx_RisingPulseScript[]
Pulses twice, then rests, over and over.
Definition fxdata.c:75
const s32 gBattleFx_ParticleScript[]
Rises for 60 frames, then disappears.
Definition fxdata.c:107
const s32 gBattleFx_ParticleEmitterScript[]
Grows from half size to full size, a step every 2 frames.
Definition fxdata.c:56
struct GameState gGameState
void * gMapWork[]
void * Runtime_AllocateHeapBlock(s32 kind, s32 size)
Returns heap slot kind's block, first allocating size bytes for it (rounded up to words),...
Definition heap.c:47
struct ObjectRuntime * Marker_GetActor(s32 id)
Returns the actor of marker id, or NULL when no slot has it.
Definition markers.c:226
void Vector_AddPolarOffset(s32 radius, s32 angle, void *position)
Moves the point position by radius in direction angle on the ground plane: x by the cosine,...
Definition math.c:23
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
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,...
Definition math.c:36
void Runtime_ReleaseHeapBlock(s32 slot)
struct ObjectRuntime * Object_Spawn(s32 kind, s32 x, s32 y, s32 z)
Creates an object for an effect, at the caster's ground height, with sprite priority 0 and animation ...
Definition dispatch.c:371
What every part of object.c shares: its includes and the macros and types more than one part uses.
struct EventWork * gEventWork
#define NULL
Definition bilibin.h:6
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
struct AnimationSpritePart image
Definition animspr.h:109
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
Definition animspr.h:128
u8 slot
VRAM cache entry holding its tiles.
Definition animspr.h:112
u8 count
layers in use, up to the last one present
Definition animspr.h:129
u16 fullColor
256 colours; set for both parts when created
Definition animspr.h:94
u16 tile
first sprite tile in VRAM
Definition animspr.h:99
u16 priority
2 when created
Definition animspr.h:100
A field object as the object dispatcher's far calls take it.
An actor as these effects see it.
Definition field_fx.c:12
struct AnimationObject * animation
Definition field_fx.c:19
u8 pad3[24]
Definition field_fx.c:20
s32 scriptWord
the encoded script pointer
Definition field_fx.c:13
u8 pad1[0x1c]
Definition field_fx.c:16
u8 pad0[0x24]
Definition field_fx.c:14
s32 velocityY
Definition field_fx.c:15
s32 gravity
Definition field_fx.c:17
u8 pad2[4]
Definition field_fx.c:18
void(*) updateHook(union FieldObject *object)
frame hook at offset 0x6c
Definition field_fx.c:21
A world position, as Camera_WorldToScreen converts it to the screen.
Definition battle.h:73
s32 y
16.16 fixed-point pixels
Definition battle.h:75
s32 z
16.16 fixed-point pixels
Definition battle.h:76
s32 x
16.16 fixed-point pixels
Definition battle.h:74
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
u16 facing
1/65536 turns
Definition field_obj.h:34
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
Definition field_obj.h:112
Full event work allocated by Field_RunScene (heap slot 27).
s16 revealActive
nonzero while Reveal is active
struct MarkerSlot markers[10]
the map's markers (MARKER_MAX)
s32 selectedActor
the leader: its unit and its actor
Definition game_state.h:59
A map marker placed as an actor: a chest or a Psynergy stone.
u8 id
the trigger of its scene event
u8 column
its 16-pixel cell
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 targetZ
16.16 fixed-point pixels; 0x80000000 when unset
u16 angle
1/65536 turns
s32 targetY
16.16 fixed-point pixels; 0x80000000 when unset
s32 velocityY
16.16 fixed-point pixels per frame
s32 z
16.16 fixed-point pixels
s32 targetX
16.16 fixed-point pixels; 0x80000000 when unset
u8 flags
FieldActor.motionFlags: 3 when created, 4 for a placed actor above the ground; zero is free flight in...
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
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...
The prefix that command handlers read from a field object's 0x70-byte slot.
Definition script.h:16
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed char s8
Definition types.h:10
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
The polar-offset routine walks three array elements.
struct EffectVector vector
void BattleFx_ClearRandomParticles(void)
s32 VramCache_Load(u32 no, u32 size, const void *src)
Gives cache entry no size bytes of sprite VRAM and copies src there.
Definition vram_cache.c:143