Alchemy
Loading...
Searching...
No Matches

falling.c

Go to the documentation of this file.
1/// @file
2/// Ice and Douse: shards and bolts falling on the targets' side.
3/// Part of effect.c, the battle effect object, compiled only through it.
4
6
7/// Fills window 0's per-scanline edges for the falling shards and bolts:
8/// lines 8 to `last` take `slant`, an expression of the line `i`; the rest of
9/// the battle view, down to line 135, takes the fixed `span`; and the lines
10/// below it are empty. Every band the effects pass is 128 pixels wide.
11#define FALLING_BUILD_SLANTED_WINDOW(line, i, last, slant, span) \
12 for ((i) = 0; (i) != 160; (i)++) { \
13 if ((i) >= 8 && (i) <= (last)) \
14 (line)[i] = (slant); \
15 else if ((i) <= 135) \
16 (line)[i] = (span); \
17 else \
18 (line)[i] = WINDOW_SPAN_INVERTED; \
19 }
20
21// The falling shards (Ice) and bolts (Douse) rain diagonally onto the
22// targets' side. Both show the canvas only inside a slanted band of window 0,
23// whose edges BattleFx_ArmWin0HBlankDma feeds line by line from a table at the
24// start of Ram_MapCellBuffer. Each particle falls until it passes y 80, then
25// lands: shards shatter and kick up sparkle puffs, bolts flash and throw a
26// fountain of sparks. A falling particle's variant is -1 until it lands, then
27// counts the frames since. Shards and bolts are positioned in eighths of a
28// pixel, sparks in 16.16 fixed point.
29//
30// A WIN0H value is the left edge << 8 | the right edge, so a slant whose two
31// edges both lose one per line moves the band one pixel left a line.
32
33/// Ice keeps its shards in work->particles 0 to 31 and their puffs in 32
34/// to 63.
36
37/// A falling shard or bolt keeps falling while its y (in eighths of a pixel)
38/// is at most this, just above 80 pixels.
39#define FALLING_LAND_Y 0x27f
40
41/// Ice shards rain down diagonally onto the targets' side of the field and
42/// shatter into puffs of sparkle, flashing and shaking each target as they
43/// land.
44///
45/// Abilities: Ice, Ice Horn, Ice Missile (kind 7).
46///
47/// The canvas shows only inside a slanted band of window 0, so the shards
48/// stream out of the sky above the targets. effect->variant picks the size of
49/// the volley from gFalling_IceCounts (shards and frames: 16 for 46 frames, 20
50/// for 52, 32 for 80); variant 1 leaves longer trails and variant 2 draws
51/// additively. effect->side is 1 when the targets are the party, 0 when they
52/// are enemies.
54 void **slots;
55 void **cursor;
56 struct BattleEffectWork *work;
57 void *canvas;
58 s32 frame;
59 u8 *sparkles;
60 BlitterPair draw;
61 struct EffectStep *shard;
62 struct EffectStep *puff;
63 u16 *line;
64 s32 i;
65 s32 k;
66
67 EFFECT_GET_SLOTS(slots, cursor, work, canvas);
68 sparkles = EFFECT_SLOT(slots, HEAP_SLOT_BATTLE_SHEET);
69 work->effect = effect;
70 // Setup: the narrow canvas, the shard sheet and the sparkle dots in the
71 // sheet slot, then the display; window 1 hides BG2.
79
80 // Line the shards up above the screen, each one 8 pixels higher and
81 // further back along the slant than the one before; x is a random 24 to
82 // 94 shifted onto the targets' half.
83 {
84 s32 y;
85 s32 slant;
86
87 for (i = 0, y = -128, slant = -16; i != FALLING_SHARD_COUNT;
88 y -= 64, i++, slant -= 8) {
89 s32 x;
90
91 shard = &work->particles[i];
92 x = (Random16() & 63) + (Random16() & 7) + 24;
93 if (work->effect->side == 1)
94 x = x + slant + 24;
95 else
96 x = x - slant + 80;
97 shard->y = y;
98 shard->x = x << 3;
99 shard->variant = -1; // still falling
100 }
101 }
102 for (i = 0; i != FALLING_SHARD_PUFF_COUNT; i++)
103 work->particles[FALLING_SHARD_COUNT + i].variant = -1; // puff slot free
104
105 // The shards fall towards the targets' side, so the blitters mirror them
106 // when the targets are the party.
107 if (work->effect->side == 0) {
111 } else {
117 }
119 /* FAKEMATCH: the slot read through union HeapState keeps its load and
120 * spill before the next two instructions; as gWorkSlot[n] both move two
121 * later (4 lines of tbs-en effect.s). */
122 draw[1] = (DrawRectangle)((union HeapState *)gWorkSlot)
124
125 // Window 0's edges, one per scanline: a 128-pixel band slanting one pixel
126 // a line the way the shards fall (on line 8 from x 104 against the
127 // enemies, moving left; from x 32 against the party, moving right), then a
128 // fixed span down to line 135.
129 if (work->effect->side == 0) {
130 line = (u16 *)Ram_MapCellBuffer;
131 FALLING_BUILD_SLANTED_WINDOW(line, i, 103, (0xf0 - i) | ((0x70 - i) << 8),
132 WIN_RANGE(8, 136));
133 } else {
134 line = (u16 *)Ram_MapCellBuffer;
135 FALLING_BUILD_SLANTED_WINDOW(line, i, 95, (i - 8 + 160) | ((i + 0x18) << 8),
136 WIN_RANGE(120, 248));
137 }
138
141 // Trails: variant 1 keeps 75% of each pixel a frame, the others 50%.
143 if (work->effect->variant == 1)
144 work->transferValue = 75;
145 else
146 work->transferValue = 50;
149
150 for (frame = 0;
152 frame++) {
153 // Frame loop. 16 frames before the end, the battle shows the damage,
154 // with sound 132 as each target is hit.
155 if (frame == gFalling_IceCounts[work->effect->variant][ICE_FRAMES] - 16)
157
158 // Shards: fall 8 pixels a frame down the slant; on landing, shatter
159 // through five images, kicking up puffs in the middle of it.
160 for (i = 0; i != gFalling_IceCounts[work->effect->variant][ICE_SHARD_COUNT];
161 i++) {
162 shard = &work->particles[i];
163 if (shard->variant == -1) {
164 s32 x = shard->x / 8;
165 s32 y = shard->y / 8;
166
167 draw[work->effect->variant == 2 ? 1 : 0](canvas, work->sheet, x, y, 32,
168 32);
169 if (shard->y <= FALLING_LAND_Y) { // above y 80
170 if (work->effect->side == 0)
171 shard->x -= 64;
172 else
173 shard->x += 64;
174 shard->y += 64;
175 } else {
176 // Landed: every fourth shard plays the impact sound, and every
177 // target flashes blue in its damage pose for 8 frames.
178 if ((i & 3) == 0)
180 work->shakeFrames = 2;
181 shard->variant = 0;
185 8);
186 }
187 }
188 if (shard->variant != -1) {
189 s32 x = shard->x / 8;
190 s32 y = shard->y / 8;
191
192 // Shattering: frames 1 to 14 step through the sheet's 32x32 images
193 // 1 to 5, three frames each (0x400 bytes a picture); frame 15 ends
194 // it.
195 if (shard->variant >= 1 && shard->variant <= 14) {
196 draw[work->effect->variant == 2 ? 1 : 0](
197 canvas, work->sheet + 0x400 + ((shard->variant / 3) << 10), x, y,
198 32, 32);
199 }
200 // Frames 9 to 11 each start a puff in the first free slot, near
201 // the shard.
202 if (shard->variant >= 9 && shard->variant <= 11) {
203 for (k = 0; k != FALLING_SHARD_PUFF_COUNT; k++) {
204 puff = &work->particles[FALLING_SHARD_COUNT + k];
205 if (puff->variant == -1) {
206 puff->variant = 18;
207 puff->x = (((Random16() & 31) + shard->x / 8) << 3) + 8;
208 puff->y = ((Random16() & 15) + shard->y / 8 - 15) << 3;
209 break;
210 }
211 }
212 }
213 if (shard->variant <= 14)
214 shard->variant++;
215 }
216 }
217
218 // Puffs: count down from 18, two frames on each of the nine sparkle
219 // images (8 down to 0), centred on the puff's position.
220 for (i = 0; i != FALLING_SHARD_PUFF_COUNT; i++) {
221 puff = &work->particles[FALLING_SHARD_COUNT + i];
222 if (puff->variant != -1) {
223 if (puff->variant <= 17) {
224 s32 image = puff->variant / 2;
225 s32 x = puff->x / 8 - (gBattleFx_PuffSizes[image] >> 1);
226 s32 y = puff->y / 8 - (gBattleFx_PuffSizes[image] >> 1);
227
228 draw[work->effect->variant == 2 ? 1 : 0](
229 canvas, sparkles + gBattleFx_PuffCells[image], x, y,
231 }
232 if (puff->variant > -1)
233 puff->variant--;
234 }
235 }
237 // Shakes while work->shakeFrames, which each landing sets to 2, lasts.
238 Camera_ApplyShake(4, 4);
240 }
241
242 // Finish: the callbacks before the blocks they read, in the reverse of
243 // the order they were added.
249}
250
251/// Douse's bolts are work->particles 0 to 63; their sparks follow window 0's
252/// scanline table in Ram_MapCellBuffer.
254
255/// Ram_MapCellBuffer as the falling bolts use it: window 0's scanline table,
256/// then the bolts' sparks.
258 u16 lines[160]; ///< WIN0H for each screen line, read by the HBlank DMA
259 struct EffectStep sparks[FALLING_BOLT_SPARK_COUNT]; ///< free while -1
260};
261
262/// Ram_MapCellBuffer seen as Douse's struct BoltSparkBuffer.
263#define FALLING_BOLT_SPARKS ((struct BoltSparkBuffer *)Ram_MapCellBuffer)
264
265#define DOUSE_FALLING_CELL 0x604 ///< the falling bolt picture in the sheet
266#define DOUSE_FLASH_CELL 0x844 ///< the landing flash picture in the sheet
267#define DOUSE_BURST_CELL 0xa84 ///< the 42x42 burst picture in the sheet
268
269/// Blue bolts streak down diagonally onto the targets' side of the field, each
270/// bursting into a fountain of falling sparks where it lands, while the targets
271/// flash.
272///
273/// Abilities: Douse, Drench, Deluge (kind 9).
274///
275/// Like the falling shards, the canvas shows only inside a slanted band of
276/// window 0. effect->variant picks the volley from gFalling_Counts: 6 bolts of
277/// 8 sparks, 8 of 16 or 32 of 4, spaced 32, 24 or 8 pixels apart, over 80
278/// frames; it also picks how the canvas fades (see below). effect->side is 1
279/// when the targets are the party, 0 when they are enemies.
281 void **slots;
282 void **cursor;
283 struct BattleEffectWork *work;
284 void *canvas;
285 s32 frame;
286 DrawRectangle drawSpark;
287 DrawRectangle drawBolt;
288 struct EffectStep *bolt;
289 struct EffectStep *spark;
290 u16 *line;
291 s32 i;
292 s32 k;
293
294 EFFECT_GET_SLOTS(slots, cursor, work, canvas);
295 work->effect = effect;
296 // Setup: the bolt pictures go after the spark cells, which the particle
297 // sheet decodes at the start of work->sheet; window 1 hides BG2.
300 work->sheet + DOUSE_FALLING_CELL, 1, 1);
302 0);
307
309 drawBolt = EFFECT_SLOT(slots, HEAP_SLOT_BLITTER);
312 drawSpark = EFFECT_SLOT(slots, HEAP_SLOT_BLITTER_ALTERNATE);
313
316
317 // Line the bolts up above the screen along the slant, FALLING_BOLT_SPACING
318 // apart; all 64 are placed, though a variant drops only its first
319 // FALLING_BOLT_WAVE_COUNT.
320 for (i = 0; i != FALLING_BOLT_COUNT; i++) {
321 s32 x;
322 s32 y;
323
324 bolt = &work->particles[i];
325 x = Random16() & 63;
327 16);
328 if (work->effect->side == 1)
329 x = x + y / 2 - 48;
330 else
331 x = x - y / 2 + 72;
332 bolt->x = x << 3;
333 bolt->y = y << 3;
334 bolt->variant = -1; // still falling
335 }
336
337 // Window 0's edges, one per scanline: a 128-pixel band slanting half a
338 // pixel a line, as the bolts fall, then a fixed span down to line 135.
339 if (work->effect->side == 0) {
340 line = (u16 *)Ram_MapCellBuffer;
341 FALLING_BUILD_SLANTED_WINDOW(line, i, 103,
342 ((0x34 - i / 2) << 8) | (0xb4 - i / 2),
343 WIN_RANGE(0, 128));
344 } else {
345 line = (u16 *)Ram_MapCellBuffer;
347 line, i, 103, ((i / 2 + 60) << 8) | (i / 2 + 188), WIN_RANGE(112, 240));
348 }
349
352 // Variant 0 clears the canvas every frame; the others leave trails.
353 if (work->effect->variant == 0) {
355 } else if (work->effect->variant == 1) {
357 } else {
359 }
362
363 for (frame = 0;
365 frame++) {
366 // Frame loop. 64 frames before the end, the battle shows the damage,
367 // with sound 132 as each target is hit.
368 if (frame ==
371
372 // Bolts: fall 8 pixels a frame (4 across) until they pass y 80, then
373 // flash for frames 0 to 3 and burst for 4 to 7; the count stops at 15.
374 for (i = 0;
376 i++) {
377 s32 x;
378 s32 y;
379
380 bolt = &work->particles[i];
381 x = bolt->x / 8;
382 y = bolt->y / 8;
383 if (bolt->variant == -1) {
384 drawBolt(canvas, work->sheet + DOUSE_FALLING_CELL, x, y, 24, 24);
385 if (bolt->y <= FALLING_LAND_Y) {
386 if (work->effect->side == 0)
387 bolt->x -= 32;
388 else
389 bolt->x += 32;
390 bolt->y += 64;
391 } else {
392 // Landed: throw this bolt's sparks out from its tip, mostly
393 // upwards (variant 2's can also fall), each living 16 to 31
394 // frames. Bolt i owns its own run of sparks.
395 bolt->variant = 0;
396 for (k = 0; k != gFalling_Counts[work->effect->variant]
398 k++) {
399 spark = &FALLING_BOLT_SPARKS->sparks
400 [i * gFalling_Counts[work->effect->variant]
402 k];
403 spark->x = (x + 12) << 16;
404 spark->y = y << 16;
405 spark->velocityX = ((Random16() & 255) - 128) << 9;
406 if (work->effect->variant == 2)
407 spark->velocityY = ((Random16() & 0x1ff) - 0x180) << 10;
408 else
409 spark->velocityY = ((Random16() & 255) - 255) << 10;
410 spark->variant = (Random16() & 15) + 16;
411 }
412 // Every fourth bolt plays the hit sound, and every target
413 // flashes white in its damage pose for 2 frames.
414 if ((i & 3) == 0)
419 }
420 } else {
421 if (bolt->variant >= 0 && bolt->variant <= 3)
422 drawBolt(canvas, work->sheet + DOUSE_FLASH_CELL, x, y, 24, 24);
423 else if (bolt->variant <= 7)
424 drawBolt(canvas, work->sheet + DOUSE_BURST_CELL, x - 9, y - 9, 42,
425 42);
426 if (bolt->variant <= 14)
427 bolt->variant++;
428 }
429 }
430 // Sparks: a dot that shrinks as its life runs out, falling under
431 // gravity.
432 for (i = 0; i != FALLING_BOLT_SPARK_COUNT; i++) {
433 spark = &FALLING_BOLT_SPARKS->sparks[i];
434 if (spark->variant != -1) {
435 s32 size = spark->variant + 1;
436
437 if (size > 6)
438 size = 6;
439 EFFECT_DRAW_FLARE(drawSpark, canvas, work->sheet,
440 Q_16_16_TO_INT(spark->x), Q_16_16_TO_INT(spark->y),
441 size);
442 EffectStep_AdvanceWithGravity2D(spark, 60, 0x2000);
443 spark->variant--;
444 }
445 }
446 EFFECT_END_FRAME(work);
447 }
448
449 // Finish: stop both transfers before releasing the blitters and canvas.
453}
454
455#undef FALLING_BUILD_SLANTED_WINDOW
456#undef FALLING_LAND_Y
457#undef FALLING_BOLT_SPARKS
458#undef DOUSE_FALLING_CELL
459#undef DOUSE_FLASH_CELL
460#undef DOUSE_BURST_CELL
@ SPRITE_COLOR_WHITE
solid colour 15, white
Definition animspr.h:26
@ SPRITE_COLOR_BLUE_TINT
blue raised to full
Definition animspr.h:27
@ POSE_DAMAGE
taking damage
Definition battle.h:176
@ COMPOSITE_FLIP_X
@ COMPOSITE_CLIP_Y
@ COMPOSITE_ADDITIVE
@ COMPOSITE_MAX
BattleEffectDrawRectangle DrawRectangle
#define EFFECT_FOR_EACH_TARGET(i, effect)
Loops i over the effect's targets, effect->actors[0] to effect->actors[effect->count - 1]: the loops ...
void ObjectGroup_TickMemberTimers(void)
Counts down each target's flash timer, which ObjectGroup_UpdateMembers starts; when one runs out,...
Definition canvas.c:275
void BattleFx_ProcessPendingGraphicsTransfer(void)
Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128...
Definition canvas.c:103
void BattleFx_EndCanvasLayer(void)
Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre,...
Definition canvas.c:490
void BattleFx_ConfigureEffectDisplay(void)
Puts the battle screen back into the display state every effect starts from and ends with: no blendin...
Definition display.c:16
void BattleFx_ArmWin0HBlankDma(void)
Restarts DMA 0 as an HBlank transfer of one WIN0H value a line from PARTICLES (Ram_MapCellBuffer),...
Definition display.c:81
void Resource_LoadAndDecompress(s32 id, void *dst, s32 skipPalette, s32 copyPalette)
Decompresses a resource whose first 128 bytes may be a palette.
void ObjectGroup_UpdateMembers(s32 actorId, s32 palette, s32 animation, s32 timerSlot, s32 timerFrames)
Updates every animation group of one battler's object.
Definition dispatch.c:254
What every part of the battle effect object shares: its includes, macros and frame-loop helpers.
#define EFFECT_RELEASE_BLITTERS()
Frees the two blitters, the alternate first.
#define EFFECT_PRESENT_FRAME(work)
Ends a frame of a canvas effect: marks the canvas ready for the transfer callback,...
#define EFFECT_DRAW_FLARE(draw, canvas, sheet, x, y, size)
Draws flare cell size of sheet, a square size pixels from its centre to each edge,...
#define EFFECT_SET_TRANSFER(work, mode, value)
Sets how the canvas transfer treats what is left in the canvas after each copy: mode with value (see ...
@ CANVAS_COPY_AND_CLEAR
copy, then fill the canvas with transferValue
@ CANVAS_COPY_AND_FADE
copy, keeping 50% or 75% (transferValue) of each pixel in the canvas for the next frame
#define EFFECT_CALLBACK_ORDER
The scheduler order of every per-frame effect callback (Scheduler_AddOrUpdateCallback sorts the frame...
#define EFFECT_SLOT(slots, slot)
A work slot read through a pointer to the effect's own slot, gWorkSlot[HEAP_SLOT_BATTLE_EFFECT].
#define EFFECT_FINISH_CANVAS()
The usual end of a canvas effect: stops the transfer callback before freeing what it reads,...
#define EFFECT_SHOW_DAMAGE(hitSound)
Lets the battle show the damage: resumes its paused playback, which plays hitSound (an SE_ id; 0 keep...
#define EFFECT_FREE_PARTICLES(i, particles, count)
Marks particles[0] to particles[count - 1] free: a particle whose variant is -1 is not drawn or moved...
#define EFFECT_LOAD_BLITTER(slot, flags, mode)
Builds a blitter for the 128x128 canvas (1 << 7 pixels each way) in work slot slot: BattleFx_BuildBli...
#define EFFECT_GET_SLOTS(slots, cursor, work, canvas)
Starts at the effect's entry in the whole work-slot array.
#define EFFECT_WIN0_LAYERS
Window 0, the battle view, shows BG0 to BG2, sprites and blending.
#define EFFECT_END_FRAME(work)
The usual end of an effect frame: counts down the targets' flash timers (ObjectGroup_TickMemberTimers...
#define EFFECT_BEGIN_NARROW_CANVAS(bgControl)
Opens the canvas layer at the canvas's own width, one texel per pixel, where BattleFx_BeginCanvasLaye...
u8 gBattleFx_PuffSizes[]
Each puff cell's side.
u8 gFalling_IceCounts[][2]
Ice, by variant: shards and frames (ICE_SHARD_COUNT, ICE_FRAMES).
u16 gBattleFx_PuffCells[]
Nine square puff cells, read by the falling, frost, healing, Djinni heal and Boreas parts.
u8 gFalling_Counts[][4]
Douse, by variant: the FALLING_BOLT_ columns.
@ FALLING_BOLT_DURATION
the effect's frames
@ FALLING_BOLT_WAVE_COUNT
bolts that drop, of the 64 placed
@ FALLING_BOLT_SPACING
pixels between bolts along the slant
@ FALLING_BOLT_SPARKS_PER_BOLT
sparks each bolt throws
@ ICE_FRAMES
the effect's frames; the damage shows 16 before
@ ICE_SHARD_COUNT
shards that fall
void BattleFx_RunIce(struct BattleEffectArgument *effect)
Ice shards rain down diagonally onto the targets' side of the field and shatter into puffs of sparkle...
Definition falling.c:53
@ FALLING_SHARD_COUNT
Definition falling.c:35
@ FALLING_SHARD_PUFF_COUNT
Definition falling.c:35
#define FALLING_BUILD_SLANTED_WINDOW(line, i, last, slant, span)
Fills window 0's per-scanline edges for the falling shards and bolts: lines 8 to last take slant,...
Definition falling.c:11
#define FALLING_BOLT_SPARKS
Ram_MapCellBuffer seen as Douse's struct BoltSparkBuffer.
Definition falling.c:263
@ FALLING_BOLT_SPARK_COUNT
Definition falling.c:253
@ FALLING_BOLT_COUNT
Definition falling.c:253
#define DOUSE_FLASH_CELL
the landing flash picture in the sheet
Definition falling.c:266
#define FALLING_LAND_Y
A falling shard or bolt keeps falling while its y (in eighths of a pixel) is at most this,...
Definition falling.c:39
#define DOUSE_BURST_CELL
the 42x42 burst picture in the sheet
Definition falling.c:267
void BattleFx_RunDouse(struct BattleEffectArgument *effect)
Blue bolts streak down diagonally onto the targets' side of the field, each bursting into a fountain ...
Definition falling.c:280
#define DOUSE_FALLING_CELL
the falling bolt picture in the sheet
Definition falling.c:265
void AudioCommand_PlayFar(s32 id)
void Camera_ApplyShake(s32 rangeX, u32 rangeY)
Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre ...
Definition hail.c:364
@ HEAP_SLOT_BLITTER_ALTERNATE
Definition heap_state.h:47
@ HEAP_SLOT_BATTLE_SHEET
Definition heap_state.h:44
@ HEAP_SLOT_BLITTER
Definition heap_state.h:46
#define REG_WININ
Definition io_reg.h:81
#define BGCNT_PRIORITY(n)
Definition io_reg.h:24
#define BLDCNT_TGT1_BG2
Definition io_reg.h:125
#define WININ_WIN1_BG0
Definition io_reg.h:93
#define WININ_WIN1_CLR
Definition io_reg.h:98
#define BLDCNT_EFFECT_BLEND
weighted by REG_BLDALPHA
Definition io_reg.h:131
#define BLDCNT_TGT2_ALL
Definition io_reg.h:140
#define WIN_RANGE(start, end)
A REG_WINxH or REG_WINxV value: the window covers start up to, but not including, end.
Definition io_reg.h:80
#define WININ_WIN1_BG1
Definition io_reg.h:94
#define WININ_WIN1_OBJ
Definition io_reg.h:97
#define REG_BLDCNT
Definition io_reg.h:119
#define BGCNT_WRAP
Affine backgrounds only: wrap around instead of showing the backdrop.
Definition io_reg.h:30
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
void EffectStep_AdvanceWithGravity2D(struct EffectStep *step, s32 damping, s32 gravity)
Moves a particle one frame on the screen: adds its velocity, then gravity to its vertical speed,...
Definition positions.c:46
#define Ram_MapCellBuffer
Definition ram_buffer.h:10
char ResourceId_BlueBeamSheet
char ResourceId_SparkleDots
char ResourceId_IceShardSheet
char ResourceId_ParticleSpritesD
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
Definition scheduler.c:102
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
Definition scheduler.c:146
#define SE_115
Definition songs.h:108
#define SE_132
Definition songs.h:125
void * gWorkSlot[]
The command shared by an effect's caller, dispatcher and handlers.
s32 side
1 when the targets are the party, 0 for enemies
s16 actors[8]
the targets' unit ids, count of them
s32 variant
the ability's size, from 0 (Quake, then Earthquake)
The running battle effect's work: its canvas image, 64 particles, the display registers it stages and...
s32 frame
frame counter some effects keep, from 0
s32 shakeFrames
shake frames left; Camera_ApplyShake counts down
s32 transferMode
How the canvas transfer callbacks treat the canvas after each copy (enum CanvasTransferMode in effect...
s32 transferValue
The transfer mode's argument: the fill value, the share kept (50 or 75 percent) or the darken or brig...
struct BattleEffectArgument * effect
the command being run
struct EffectStep particles[64]
free while variant is -1
Ram_MapCellBuffer as the falling bolts use it: window 0's scanline table, then the bolts' sparks.
Definition falling.c:257
u16 lines[160]
WIN0H for each screen line, read by the HBlank DMA.
Definition falling.c:258
struct EffectStep sparks[FALLING_BOLT_SPARK_COUNT]
free while -1
Definition falling.c:259
A moving point of an effect: its position, its velocity and a value each effect uses its own way (a s...
Definition effect_step.h:13
s32 velocityX
16.16 fixed-point pixels per frame
Definition effect_step.h:28
s32 variant
each effect's own: a size, a countdown, -1 for idle
Definition effect_step.h:31
s32 x
16.16 fixed-point pixels
Definition effect_step.h:24
s32 y
16.16 fixed-point pixels
Definition effect_step.h:25
s32 velocityY
16.16 fixed-point pixels per frame
Definition effect_step.h:29
signed int s32
Definition types.h:14
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
The heap's 64 work slots, the first two holding the next free EWRAM and IWRAM addresses.
Definition heap_state.h:18
#define Q_16_16_TO_INT(v)
Definition effect.h:231
DrawRectangle BlitterPair[2]
A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_Fetch...
Definition effect.h:244