Alchemy
Loading...
Searching...
No Matches

beams.c

Go to the documentation of this file.
1/// @file
2/// Beam sequences and the ring and spark scene.
3/// Part of effect.c, the battle effect object, compiled only through it.
4
6
7/// Draws the selected beam and its projected sparks over the first target: a
8/// beam, arc or wave shoots from the user; from frame 4 the target is hit,
9/// a yellow orb flashes over it and sparks fly off, for 32 frames in all.
10/// effect->kind picks the picture.
11///
12/// Reached through BattleFx_DispatchByIdRange for kinds 136 to 199 and,
13/// through its unsigned test, every kind below 100; BattlePres_RunPlainAttack
14/// (battle/staging.c) sends every plain attack there. Only kinds 0 to 5 have
15/// pictures. Shows the canvas on BG1 (BattleFx_SetupCanvasTileMap), loads
16/// palette colours 0 to 63, scrolls BG1 through gBgScroll[1] and uses
17/// work->particles 0 to 63 (only 0 to 31 fly) and both blitter slots; at the
18/// end it removes the transfer callback, frees the blitters, sets
19/// gBgScroll[1].y back to 32 and hides BG1 again
20/// (BattleFx_HideBg1AndRestoreBackdrop).
22 struct EffectPosition screenPosition;
23 struct EffectPosition anchor;
24 struct EffectPosition point;
25 void **heapCache;
26 void **cursor;
27 struct BattleEffectWork *work;
28 void *canvas;
29 s32 scrollX;
30 u8 *sheet;
31 struct BattleCamera *camera;
32 s32 kind;
33 struct BattleUnit *unit;
34 BlitterPair draw;
35 DrawRectangle *slots;
36 struct MotionObject *target;
37 void *colors = (void *)BG_PLTT;
38 s32 half;
39 s32 frame;
40 s32 i;
41
43 cursor = heapCache;
44 EFFECT_GET_WORK_AND_CANVAS(cursor, work, canvas);
45 sheet = EFFECT_SLOT(heapCache, HEAP_SLOT_BATTLE_SHEET);
46 camera = EFFECT_SLOT(heapCache, HEAP_SLOT_CAMERA);
47 kind = effect->kind;
48 work->effect = effect;
49 unit = UnitGetFar(effect->actor);
50 WaitFrames(1);
55 WaitFrames(1);
56 // Two blitters, additive and brightest-wins; kind 5 draws its pictures
57 // upside down, and side 1 mirrors them.
58 if (kind == 5) {
59 if (work->effect->side == 0) {
65 } else {
74 }
75 } else {
76 if (work->effect->side == 0) {
81 } else {
87 }
88 }
89 slots = (DrawRectangle *)gWorkSlot;
90 draw[0] = slots[HEAP_SLOT_BLITTER];
91 draw[1] = slots[HEAP_SLOT_BLITTER_ALTERNATE];
92 WaitFrames(1);
93 // The picture: kind 4 the wave, 3 the beam image, 0, 1 and 5 blue arc A,
94 // 2 blue arc B. Users numbered above 7 take the small Mars Djinni's
95 // palette, the others the crescent's. The sparks and the yellow orb
96 // follow.
97 if (kind == 4) {
99 } else if (kind == 3) {
101 0, 0);
102 } else {
103 switch (kind) {
104 case 0:
105 case 1:
106 case 5:
108 1);
109 break;
110 case 2:
112 1);
113 break;
114 }
115 }
116 if (work->effect->actor > 7)
119 128);
120 else
123 WaitFrames(1);
126 1, 0);
130 // Scroll BG1 so the first target is on screen: the scroll is held between
131 // -128 and 0, and anchor becomes the target's scrolled position.
132 EffectPosition_ProjectSprite(work->effect->actors[0], &anchor);
133 if (work->effect->side == 0)
134 scrollX = 96 - anchor.x;
135 else
136 scrollX = 32 - anchor.x;
137 if (scrollX > 0)
138 scrollX = 0;
139 if (scrollX < -128)
140 scrollX = -128;
141 anchor.x += scrollX;
142 gBgScroll[1].x = scrollX;
143 gBgScroll[1].y = 80;
144 WaitFrames(1);
145 // 64 sparks start at the first target's middle and fly away from the
146 // centre of the field at random speeds; variant is a spark's life, 16 to
147 // 79 frames, so the later sparks are larger and last longer.
148 target = GetBattleObjectSlotFar(work->effect->actors[0])->object;
149 half = BattleUnit_GetEffectHeightFar(work->effect->actors[0]) / 2;
150 for (i = 0; i != 64; i++) {
151 struct EffectStep *spark = &work->particles[i];
152
153 SET_POSITION(spark, target->x, target->y + half, target->z);
154 SET_VELOCITY(spark, (Random16() & 255) << 10,
155 ((Random16() & 255) - 32) << 10,
156 ((Random16() & 255) - 127) << 10);
157 if (spark->x > 0)
158 spark->velocityX = -spark->velocityX;
159 spark->velocityX = -spark->velocityX;
160 spark->variant = i + 16;
161 }
162
163 // 32 frames: the picture plays from frame 0, the hit lands on frame 4.
164 for (frame = 0; frame != 32; frame++) {
165 // On frame 5 the battle shows the damage, with the heavy impact if the
166 // user's class is flagged in the summon table and SE_133 otherwise. On
167 // frame 4 the target plays motion 0.
168 if (frame == 5) {
171 else
173 }
174 if (frame == 4)
176 // The picture plays from the user, to its left on side 0 and its right
177 // on side 1: the wave's six 48x16 cells backwards and the arc's six
178 // 48x72 cells, two frames each; the beam image grows through its six
179 // cells, three frames each.
180 EffectPosition_ProjectScaledBattler(work->effect->actor, &screenPosition);
181 screenPosition.y += 16;
182 if (kind == 4) {
183 if (frame <= 11) {
184 if (work->effect->side == 0)
185 draw[1](canvas, work->sheet + (5 - frame / 2) * (48 * 16),
186 screenPosition.x + scrollX - 48, screenPosition.y - 8, 48,
187 16);
188 else
189 draw[1](canvas, work->sheet + (5 - frame / 2) * (48 * 16),
190 screenPosition.x + scrollX, screenPosition.y - 8, 48, 16);
191 }
192 } else if ((u32)kind <= 2 || kind == 5) {
193 if (frame <= 11) {
194 if (work->effect->side == 0)
195 draw[1](canvas, work->sheet + frame / 2 * (48 * 72),
196 screenPosition.x + scrollX - 48, screenPosition.y - 40, 48,
197 72);
198 else
199 draw[1](canvas, work->sheet + frame / 2 * (48 * 72),
200 screenPosition.x + scrollX, screenPosition.y - 40, 48, 72);
201 }
202 } else {
203 if (frame <= 17) {
204 s32 cell = frame / 3;
205
206 if (work->effect->side == 0)
207 draw[1](canvas, work->sheet + gBeams_Cells[cell],
208 screenPosition.x + gBeams_CellReaches[cell] + scrollX - 58,
209 screenPosition.y - gBeams_CellHeights[cell] / 2,
211 else
212 draw[1](canvas, work->sheet + gBeams_Cells[cell],
213 screenPosition.x - gBeams_CellReaches[cell] + scrollX -
214 gBeams_CellWidths[cell] + 58,
215 screenPosition.y - gBeams_CellHeights[cell] / 2,
217 }
218 }
219 // Frames 4 to 15: the yellow orb flashes over the target, six 40x48
220 // cells, two frames each.
221 if (frame >= 4 && frame <= 15)
222 draw[0](canvas, Ram_MapCellBuffer + (frame - 4) / 2 * (40 * 48),
223 anchor.x - 16, anchor.y - 24, 40, 48);
225 // From frame 4 the sparks fly. Only the first 32 move: each is drawn
226 // and moved twice a frame, so it flies at double speed and its life
227 // runs out twice as fast. Even ones add, odd ones take the brighter
228 // pixel.
229 if (frame >= 4 && frame <= 31) {
230 for (i = 0; i != 64; i++) {
231 s32 pair = i / 2;
232 struct EffectStep *spark = &work->particles[pair];
233 s32 size = spark->variant;
234
235 if (size > 0) {
237 point.x += scrollX;
238 size >>= 3;
239 size += 2;
240 EFFECT_DRAW_FLARE(draw[pair & 1], canvas, sheet, point.x, point.y,
241 size);
242 EffectStep_AdvanceWithGravity3D(spark, 60, -0x400);
243 spark->variant--;
244 }
245 }
246 }
248 }
249
252 gBgScroll[1].y = 32;
254}
255
256/// Plays the selected ring-and-spark strike, restoring the user motion after
257/// it. Kinds above 199 first gather 64 motes of light into the user for 32
258/// frames while it stands still; then star burst and crescent rings flash
259/// over the canvas and sparks fly from the first target for 32 frames, and
260/// the background palette fades back in.
261///
262/// Reached through BattleFx_DispatchByIdRange for kinds 200 and up, which
263/// BattlePres_RunAttack (battle/staging.c) makes by adding 200 to the kind of
264/// a critical hit; so the gathering always plays. Shows the canvas on BG1,
265/// keeps the battle's transition centred between the user and the first
266/// target while it loads, scrolls BG1 through gBgScroll[1] and uses
267/// work->particles 0 to 63, work->imageStorage, Ram_MapCellBuffer and both
268/// blitter slots. While the motes gather it adds Palette_StepFadeTransfer and
269/// stops the user's motion, and restores both after. At the end it removes
270/// the transfer callback, frees the blitters, sets gBgScroll[1].y back to 32,
271/// steps the background palette level from 6 back to 0 and hides BG1 again.
273 struct EffectPosition screenPosition;
274 struct EffectPosition anchor;
275 struct EffectPosition point;
276 struct EffectPosition spot;
277 void **heapCache;
278 void **cursor;
279 struct BattleEffectWork *work;
280 void *canvas;
281 s32 scrollX;
282 u8 *sheet;
283 struct BattleCamera *camera;
284 s32 velocityX;
285 s32 velocityY;
286 s32 velocityZ;
287 s32 acceleration;
288 s32 strength;
289 BlitterPair draw;
290 DrawRectangle *slots;
291 struct MotionObject *object;
292 struct MotionObject *target;
293 u16 *background;
294 void *colors = (void *)BG_PLTT;
295 s32 canvasBytes = CANVAS_BYTES;
296 s32 big;
297 s32 half;
298 s32 frame;
299 s32 i;
300
302 cursor = heapCache;
303 EFFECT_GET_WORK_AND_CANVAS(cursor, work, canvas);
304 sheet = EFFECT_SLOT(heapCache, HEAP_SLOT_BATTLE_SHEET);
305 camera = EFFECT_SLOT(heapCache, HEAP_SLOT_CAMERA);
306 big = 1;
307 if (effect->kind <= 199)
308 big = 0;
309 work->effect = effect;
310 // Load the blitters and pictures a step a frame, keeping the transition
311 // centred between the user and the first target meanwhile. The star
312 // burst goes to the image storage and the crescent to the map cell
313 // buffer; users numbered above 7 also take the small Mars Djinni's
314 // palette.
316 effect->firstTarget, 130);
317 WaitFrames(1);
321 if (work->effect->side == 0) {
326 } else {
332 }
333 slots = (DrawRectangle *)gWorkSlot;
334 draw[0] = slots[HEAP_SLOT_BLITTER];
335 draw[1] = slots[HEAP_SLOT_BLITTER_ALTERNATE];
337 work->effect->firstTarget, 130);
338 WaitFrames(1);
340 work->imageStorage, 1, 0);
342 work->effect->firstTarget, 130);
343 WaitFrames(1);
345 1, 1);
346 if (work->effect->actor > 7)
349 128);
351 work->effect->firstTarget, 130);
352 WaitFrames(1);
355 work->effect->firstTarget, 130);
356 WaitFrames(1);
358
359 // The gathering: 64 motes, each in its own random rotation around the
360 // user, close in 4 a frame, mote i from frame i / 4, while the palette
361 // fades over 24 frames. The user is held still meanwhile: its
362 // velocities, acceleration and vertical strength are saved, zeroed and
363 // restored after.
364 if (big == 1) {
365 object = GetBattleObjectSlotFar(work->effect->actor)->object;
366 for (i = 0; i != 64; i++) {
367 struct EffectStep *mote = &work->particles[i];
368
369 SET_POSITION(mote, (Random16() & 63) + 16, 0, 0);
370 SET_VELOCITY(mote, Random16() & 0xffff, Random16() & 0xffff,
371 Random16() & 0xffff);
372 }
374 velocityX = object->velocityX;
375 velocityY = object->velocityY;
376 velocityZ = object->velocityZ;
377 strength = object->verticalMotionStrength;
378 acceleration = object->acceleration;
379 SET_VELOCITY(object, 0, 0, 0);
380 object->acceleration = 0;
381 object->verticalMotionStrength = 0;
382 EffectPosition_ProjectScaledBattler(work->effect->actor, &screenPosition);
383 scrollX = 64 - screenPosition.x;
384 gBgScroll[1].x = scrollX;
385 gBgScroll[1].y = 80;
386 work->fadeFrames = 24;
387 work->fadeStep = 0;
391 for (frame = 0; frame != 32; frame++) {
393 work->effect->actor, work->effect->firstTarget, 130);
394 for (i = 0; i != 64; i++) {
395 struct EffectStep *mote = &work->particles[i];
396
397 if (mote->x >= 0 && frame >= i / 4) {
398 s32 size = (i & 1) + 5;
399
404 EffectPosition_ProjectPoint(&mote->x, &point);
405 point.x += 64;
406 point.y = point.y + screenPosition.y + 24;
407 CLAMP(point.depth, -60, 60);
408 point.depth += 60;
409 EFFECT_DRAW_FLARE(draw[0], canvas, sheet, point.x, point.y, size);
410 mote->x -= 4;
411 }
412 }
414 }
418 object->acceleration = acceleration;
419 object->verticalMotionStrength = strength;
420 }
421
422 // The strike: clear the canvas, scroll BG1 so the first target is on
423 // screen, and start 64 sparks at its middle, rising and flying away from
424 // the centre of the field.
425 Iwram_ClearWords(canvas, canvasBytes);
426 Iwram_ClearWords((void *)BG_CHAR_BLOCK(1), canvasBytes);
431 if (work->effect->side == 0)
432 scrollX = 32 - anchor.x;
433 else
434 scrollX = 96 - anchor.x;
435 if (scrollX > 0)
436 scrollX = 0;
437 if (scrollX < -128)
438 scrollX = -128;
439 anchor.x += scrollX;
440 gBgScroll[1].y = 80;
441 gBgScroll[1].x = scrollX;
442 target = GetBattleObjectSlotFar(work->effect->actors[0])->object;
443 half = BattleUnit_GetEffectHeightFar(work->effect->actors[0]) / 2;
444 for (i = 0; i != 64; i++) {
445 struct EffectStep *spark = &work->particles[i];
446
447 SET_POSITION(spark, target->x, target->y + half, target->z);
448 SET_VELOCITY(spark, (Random16() & 255) << 10, (Random16() & 255) << 10,
449 ((Random16() & 255) - 127) << 10);
450 if (spark->x > 0)
451 spark->velocityX = -spark->velocityX;
452 spark->variant = i + 16;
453 }
454
455 for (frame = 0; frame != 32; frame++) {
456 if (frame == 5)
458 if (frame == 4)
460 EffectPosition_ProjectScaledBattler(work->effect->actor, &screenPosition);
461 screenPosition.y += 16;
462 // The rings: two frames each of the two star burst cells, then of the
463 // two crescent cells.
464 if (frame <= 1)
465 draw[0](canvas, work->imageStorage, 0, 0, 120, 120);
466 else if (frame <= 3)
467 draw[0](canvas, work->imageStorage + (120 * 120), 0, 0, 120, 120);
468 else if (frame <= 5)
469 draw[0](canvas, Ram_MapCellBuffer, 0, 0, 120, 120);
470 else if (frame <= 7)
471 draw[0](canvas, Ram_MapCellBuffer + (120 * 120), 0, 0, 120, 120);
473 // From frame 4 the sparks fly, as in the beam sequence: only the first
474 // 32 move, each drawn and moved twice a frame.
475 if (frame >= 4 && frame <= 31) {
476 for (i = 0; i != 64; i++) {
477 s32 pair = i / 2;
478 struct EffectStep *spark = &work->particles[pair];
479 s32 size = spark->variant;
480
481 if (size > 0) {
482 EffectPosition_ProjectPoint(&spark->x, &spot);
483 spot.x += scrollX;
484 size >>= 3;
485 size += 2;
486 spot.y += 16;
487 EFFECT_DRAW_FLARE(draw[pair & 1], canvas, sheet, spot.x, spot.y,
488 size);
489 EffectStep_AdvanceWithGravity3D(spark, 60, -0x400);
490 spark->variant--;
491 }
492 }
493 }
495 }
496
499 gBgScroll[1].y = 32;
500 // Fade the background palette back in over 7 frames.
501 for (frame = 0, background = &gBattleWork->background; frame != 7; frame++) {
502 BattlePresentation_SetPaletteLevelFar(*background, 6 - frame);
503 WaitFrames(1);
504 }
506}
@ COMPOSITE_FLIP_X
@ COMPOSITE_FLIP_Y
@ COMPOSITE_ADDITIVE
@ COMPOSITE_MAX
BattleEffectDrawRectangle DrawRectangle
struct BattleWork * gBattleWork
void BattleFx_RunRingAndSparkScene(struct BattleEffectArgument *effect)
Plays the selected ring-and-spark strike, restoring the user motion after it.
Definition beams.c:272
void BattleFx_RunBeamSequence(struct BattleEffectArgument *effect)
Draws the selected beam and its projected sparks over the first target: a beam, arc or wave shoots fr...
Definition beams.c:21
void Palette_StepFadeTransfer(void)
Darkens the battle backdrop while the canvas is open: for fadeFrames frames, writes the backdrop's co...
Definition canvas.c:243
void BattleFx_SetupCanvasTileMap(void)
Shows the canvas on BG1 instead of BG2, at its own size: BG1 becomes a 256-colour layer whose map poi...
Definition canvas.c:568
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_HideBg1AndRestoreBackdrop(void)
Hides BG1 and the windows and starts bringing the backdrop's palette back.
Definition canvas.c:537
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 Resource_LoadAndDecompress(s32 id, void *dst, s32 skipPalette, s32 copyPalette)
Decompresses a resource whose first 128 bytes may be a palette.
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_GET_WORK_AND_CANVAS(cursor, work, canvas)
The work block and canvas occupy adjacent slots, starting at HEAP_SLOT_BATTLE_EFFECT.
#define CANVAS_BYTES
The canvas: 128x128 pixels, one byte each, in its heap slot and in VRAM at BG_CHAR_BLOCK(1).
#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_SHOW_DAMAGE(hitSound)
Lets the battle show the damage: resumes its paused playback, which plays hitSound (an SE_ id; 0 keep...
#define EFFECT_START_TRANSFER(work, mode, value)
Sets the transfer, then starts copying the canvas to VRAM once a frame.
#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_PLAYBACK_ORDER
The order where the battle's own playback runs, which the palette fade and the element streaks take.
#define EFFECT_VIEW_FROM_CAMERA(camera)
Starts a frame's 3D projection from the battle camera: resets the transform, then looks from camera->...
static s32 * EffectPosition_Coordinates(struct EffectPosition *position)
Returns the position's three coordinates as an array.
Definition effect_step.h:68
u16 gBeams_Cells[]
u8 gBeams_CellReaches[]
u8 gBeams_CellWidths[]
u8 gBeams_CellHeights[]
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
s32 Summon_IsEntrySecondaryFlaggedFar(s32 index)
s32 BattleUnit_GetEffectHeightFar(s32 id)
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
void BattlePres_SetupTransitionAtPairMidpointFar(s32 a, s32 b, s32 zoom)
void BattlePresentation_SetPaletteLevelFar(s32 unused, s32 level)
void ObjectDispatch_SetAnimationSpeedFar(struct DispatchObject *obj, s32 val)
struct BattleUnit * UnitGetFar(u32 owner)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
Definition frame.c:97
@ HEAP_SLOT_BATTLE_EFFECT
Definition heap_state.h:42
@ HEAP_SLOT_BLITTER_ALTERNATE
Definition heap_state.h:47
@ HEAP_SLOT_BATTLE_SHEET
Definition heap_state.h:44
@ HEAP_SLOT_CAMERA
Definition heap_state.h:38
@ HEAP_SLOT_BLITTER
Definition heap_state.h:46
#define BGCNT_CHAR_BASE(block)
Definition io_reg.h:25
#define BGCNT_256_COLORS
Definition io_reg.h:27
#define BGCNT_PRIORITY(n)
Definition io_reg.h:24
#define BG_CHAR_BLOCK(n)
Definition io_reg.h:166
#define BGCNT_SCREEN_BASE(block)
Definition io_reg.h:28
#define BG_PLTT
Definition io_reg.h:157
#define REG_BG1CNT
Definition io_reg.h:20
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
Definition iwram_call.h:85
static s32 Iwram_ClearWords(void *destination, s32 size)
Definition iwram_call.h:55
#define SET_VELOCITY(p, vx, vy, vz)
Definition macros.h:18
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
Definition macros.h:16
#define CLAMP(v, low, high)
Keeps v within low to high, the low bound tested first.
Definition macros.h:23
struct BgScroll gBgScroll[]
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
void EffectPosition_ProjectScaledBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, scaled for the battle view, 16 pixels higher.
Definition positions.c:88
void EffectPosition_ProjectSprite(s32 id, struct EffectPosition *position)
The screen position of a battler's sprite, at its scaled height, 16 pixels higher.
Definition positions.c:77
void EffectStep_AdvanceWithGravity3D(struct EffectStep *step, s32 damping, s32 gravity)
Moves a particle one frame in three dimensions: adds its velocity, then gravity to its vertical speed...
Definition positions.c:29
s32 EffectPosition_ProjectPoint(const void *point, struct EffectPosition *position)
Projects a point in the current transform onto the screen, 16 pixels higher, and returns the projecti...
Definition positions.c:64
#define Ram_MapCellBuffer
Definition ram_buffer.h:10
char ResourceId_MarsDjinnSmallSheet
char ResourceId_CrescentSheet
char ResourceId_BlueArcSheetB
char ResourceId_YellowOrbSheet
char ResourceId_BlueArcSheetA
char ResourceId_BeamSequenceImage
char ResourceId_ParticleSpritesD
char ResourceId_WaveSheet
char ResourceId_StarBurstSheet
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_133
Definition songs.h:126
#define SE_212
Definition songs.h:207
#define SE_HEAVY_IMPACT
Definition songs.h:127
void * gWorkSlot[]
The battle camera: its eye, the focus it turns about, and its pitch, yaw and distance.
The command shared by an effect's caller, dispatcher and handlers.
s32 actor
the user's unit id
s32 side
1 when the targets are the party, 0 for enemies
s32 kind
handler table index; 200 more for a critical hit
s16 actors[8]
the targets' unit ids, count of them
s32 firstTarget
the action's first target, standing or not
The running battle effect's work: its canvas image, 64 particles, the display registers it stages and...
s32 fadeFrames
backdrop fade frames left (Palette_StepFadeTransfer)
s32 fadeStep
CANVAS_FADE_STEPs the backdrop has darkened so far.
struct BattleEffectArgument * effect
the command being run
struct EffectStep particles[64]
free while variant is -1
struct MotionObject * object
NULL once released.
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
u8 classId
Who the unit is: a character's id (ISAAC to JENNA, below 8) or an enemy's id (BattleUnitSet).
u16 background
the battle background's id
u16 y
pixels
Definition map_scroll.h:65
A field object as the object dispatcher's far calls take it.
A point projected onto the screen, with its depth.
Definition effect_step.h:46
s32 y
screen pixels
Definition effect_step.h:59
s32 depth
projected depth, larger further away
Definition effect_step.h:60
s32 x
screen pixels
Definition effect_step.h:58
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 velocityY
16.16 fixed-point pixels per frame
Definition effect_step.h:29
s32 velocityZ
16.16 fixed-point pixels per frame
Definition effect_step.h:30
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
Definition motobj.h:20
s32 z
16.16 fixed-point pixels
Definition motobj.h:25
s32 y
16.16 fixed-point pixels
Definition motobj.h:24
s32 x
16.16 fixed-point pixels
Definition motobj.h:23
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
Definition system.c:150
void SceneTransform_ApplyYaw(s32 angle)
Rotates gTransform about the Y axis by angle.
Definition transform.c:113
s32 Render_ProjectPoint(const void *point, s32 *screen)
Reads three word-aligned coordinates from point, transforms them by gTransform and projects them to t...
Definition transform.c:364
void SceneTransform_ApplyPitch(s32 angle)
Rotates gTransform about the X axis by angle.
Definition transform.c:97
void Render_ResetTransformState(void)
Allocates the one-level save area (heap slot HEAP_SLOT_TRANSFORM_STACK), clears gTransformStackDepth ...
Definition transform.c:19
void SceneTransform_ApplyRoll(s32 angle)
Rotates gTransform about the Z axis by angle.
Definition transform.c:129
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
#define EFFECT_CLIP_BOUNDS
Clips overflow on all four sides.
Definition effect.h:224
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