1#ifndef ALCHEMY_PSYNERGY_EFFECTS_INTERNAL_H
2#define ALCHEMY_PSYNERGY_EFFECTS_INTERNAL_H
63#include "text/msg_ids.h"
100#define PSYNERGY_EFFECT_SLOT_COUNT 24
140 }
while (remainingSlots >= 0);
185#define DEFINE_SHRINK_AND_DESTROY(name, step) \
186 void name(union FieldObject *fieldObject) { \
187 void *obj = fieldObject; \
190 scale = ((struct MotionObject *)obj)->scaleX + step; \
191 ((struct MotionObject *)obj)->scaleY = \
192 ((struct MotionObject *)obj)->scaleY + step; \
193 ((struct MotionObject *)obj)->angle = \
194 ((struct MotionObject *)obj)->angle + 0x2000; \
195 ((struct MotionObject *)obj)->scaleX = scale; \
196 if (scale < 0x3000) { \
197 ObjectDispatch_ReleaseFar(obj); \
202#define HEAP_SLOT_FX 56
231 if (fragment !=
NULL) {
242#define ITEM_BREAK_SHARD_MAX 24
247#define DEFINE_ITEM_BREAK_EFFECT(name, spawn) \
249 struct BattleFxScene *work; \
250 struct MotionObject *obj; \
251 struct MotionObject *pair[2]; \
252 struct ScatterPosition pos; \
253 struct MotionObject **walk; \
257 work = gEffectWork; \
258 BattleEffect_InitializeSharedScene(); \
260 pos.y = work->y + 0x100000; \
262 pair[0] = spawn(pos.x + 0x200000, pos.y, pos.z, 0x8000); \
263 pair[1] = spawn(pos.x - 0x200000, pos.y, pos.z, 0); \
267 for (n = 0; n < 2; n++) { \
270 Motion_SetTargetPositionFromMagnitudeAngle( \
271 (struct ObjectRuntime *)obj, 0x180000, obj->angle); \
274 FieldObject_WaitForMoveFar(pair[0]); \
275 AudioCommand_PlayFar(SE_HEAVY_IMPACT); \
276 for (n = 0; n < ITEM_BREAK_SHARD_MAX; n++) { \
278 pos.y = work->y + 0x100000; \
280 obj = (struct MotionObject *)Object_Spawn(285, pos.x, pos.y, pos.z); \
282 ObjectDispatch_InitializeFar((struct DispatchObject *)obj, \
283 gBattleFx_FragmentScript); \
284 obj->speedLimit = Random16() + 0x20000; \
285 obj->acceleration = 0x20000; \
286 obj->motionFlags = 0; \
287 dist = Random16() * 24 + 0x80000; \
288 Motion_SetTargetPositionFromMagnitudeAngle( \
289 (struct ObjectRuntime *)obj, dist, Random16()); \
293 ObjectDispatch_ReleaseFar((struct DispatchObject *)pair[0]); \
294 ObjectDispatch_ReleaseFar((struct DispatchObject *)pair[1]); \
295 BattleFx_PrepareBufferInterpolation(); \
298#define ABOVE (16 << 16)
Ability numbers, named from the English release.
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
B5Context, the object context a battle routine reads; most of its fields are still unnamed.
The battle calculation tables: hit chances, HP and PP damage and recovery.
The battle animation state, render objects and effect entries, and the palette buffer work.
Which units are in a battle, and the Djinn recovery list.
BattleUnit_Recalculate, which recalculates a unit's stats.
BattlePlan, an action planned for its targets: the hits, criticals and multipliers rolled.
BattleUnit, a party member's or enemy's battle state, with the elements, abilities and actions it use...
The task scheduler: tasks, their order and the scheduler's state.
The engine calls the debug menus import, and their palette swatch tiles.
The display transition's frames, windows and state.
DMA channel registers, and the DMA and CPU fills.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
void EffectSlot_Update(struct EffectSlot *effect)
Updates one effect slot: counts its age, runs its callback (after any delay), moves it and draws it.
Effect slots: the particles Psynergy effects move and draw.
EventWork, the running scene's event work.
FacingObject, the view of an object that turns to face a target.
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
void ObjectDispatch_InitializeFar(struct DispatchObject *obj, const s32 *script)
FieldCoordinate, a position on the field.
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,...
Field objects and actors, and the scene transition styles.
@ ACTOR_FALLS
falls by its gravity and bounces
The field's runtime work: map cells, scene records and regions, map markers and FieldWork.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
16.16 fixed-point constants, sine and cosine, and the library division.
FixedPointPosition, a position in 16.16 fixed point.
Game flags, named where their meaning is shown.
The frame loop's globals: lag counts, the CPU load display and the VBlank flags.
BattleFxScene, the work of a battle or field Psynergy effect scene, and its arc objects.
FieldBlendWork, the field's colour blend work.
const s32 gBattleFx_CommonParticleScript[]
[0] only frees the actor, +1 waits for it to arrive and frees it; +3 is gBattleFx_SourceHoldScript,...
GameState, the game's state: play time, coins, the scene and the leader's position,...
The work slots of gWorkSlot, read through their own names.
void * gEffectWork
Slot 56: points to a scene-specific structure.
The screen blend's globals and the graphics routines.
The heap's work slots and HeapState.
gOverflowItem, an item slot the spoils code uses when items are handed out.
The hardware's I/O registers and their bits, as pret names them.
The register write queue that VBlank carries out after each finished frame.
Io_Write16, a 16-bit write to a register or memory.
The hardware's interrupt sources and the interrupt handler table.
Items: their definitions, types, flags and effects.
Declares nothing of its own: it only includes types.h, edition.h and farcall.h.
Item numbers, named from the English release.
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
The keypad state the VBlank interrupt keeps.
Small statement macros both games use for positions, velocities and bounds.
Maps: their cells, layers, animations and blend scripts, and the map state.
The heaps: allocating and freeing blocks.
The reel game's title lettering.
MotionObject, an effect object that moves and draws one sprite.
The object dispatcher's forward declaration.
The object dispatcher's scripts: key checks, the player, the world map and the camera.
The fade overlay, the weather particles and the actor effect work.
The object scripts effects give their particles and fragments.
Declares nothing: an empty header kept for the files that include it.
ObjectRuntime, a field object's runtime state, and the object snapshots.
Declares nothing of its own: it only includes types.h, edition.h and farcall.h.
Palette fades, the battle effect palette buffers and the colour channel curves.
Declares nothing of its own: it only includes static_assert.h and game_state.h.
static void BattleFx_InitializeFallingFragment(struct ItemBreakFragmentObject *fragment)
Both item fragments and Lift shed the same short-lived falling particle.
static void BattleFx_MoveAfterimageHalfway(union FieldObject *fieldObject)
Per-frame update of an afterimage: closes half the distance to the object it is linked to,...
static __inline__ void FieldFx_UpdateSceneSlots(void)
Runs the update of each of the 24 effect slots.
#define PSYNERGY_EFFECT_SLOT_COUNT
The effect slots of a Psynergy effect's scene (gEffectWork->slots).
The work pointers in the gWorkSlot table, by name.
Resource numbers, named where their contents are known.
FIELD_AT_OFFSET and the entity and camera views older scene code reads.
Scene numbers, named after their places.
ScriptMotionObject, an object moved by a field script.
ScriptObjectRuntime, the work of an object a script moves.
Song and sound effect ids, indices into gSound_SongTable.
STATIC_ASSERT, a compile-time check that emits nothing.
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
struct EffectSlot slots[24]
A FieldActor seen with the halfword at 0x5e (lifetime), which FieldActor does not name.
struct FieldActor * linkedObject
void(*) callback(union FieldObject *object)
A FieldActor seen with the halfword at 0x64 unsigned and the one at 0x66 signed, as the bytes read th...
A field object as the object dispatcher's far calls take it.
A particle a Psynergy effect moves and draws: its sprite, its position and target,...
A world position, as Camera_WorldToScreen converts it to the screen.
A field actor: a person or thing on the field with a position, motion toward a target,...
struct FieldActor * linkedObject
The object its action script follows or faces.
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 FieldActor seen with the halfword at 0x5e (its lifetime), which FieldActor does not name.
A field actor (struct FieldActor), seen with its position as one vector.
struct AnimationObject * sprite
A FieldActor seen with the halfword at 0x5e (its lifetime), which FieldActor does not name.
s16 phase
phase of the sway (128 frames a cycle)
s32 anchorX
centre of the sway (FieldActor's targetX)
s32 gravity
as in FieldActor
void(*) update(union FieldObject *object)
u8 motionFlags
as in FieldActor
A particle's sprite, seen as the two fields Douse and Mind Read set on it.
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
The integer types, TRUE, UNUSED and the fixed-address macros.
UiWork, the window system's work, and the status screen's cursors.
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
Declares nothing of its own: it only includes the window, battle command, resource and VRAM table hea...
The sprite VRAM block cache and its owners.
The window renderer's work.