8#define BOREAS_ICE_BLOCK_TRAILS \
9 ((struct EffectStep *)(Ram_MapCellBuffer + 0xe00))
10#define BOREAS_BIG_BLOCK_CELLS 0xc46
11#define BOREAS_FALLING_BLOCK_CELLS 0x14f9
14#define BOREAS_POINT_X(rock) gBoreas_Points[rock][0]
15#define BOREAS_POINT_Y(rock) gBoreas_Points[rock][1]
46 static struct SpriteScale unitScale = {{{0x10000, 0x10000}}};
71 canvas = (
void *)slots[0];
103 for (i = 0; i != 64; i++) {
109 for (i = 0; i != 32; i++) {
133 for (line = 0; line != 128; line++) {
151 }
else if (
frame > 63) {
153 }
else if (
frame > 31) {
179 for (i = 0; i != count; i++) {
192 for (i = 0; i != 9; i++) {
204 position.
height = 255 << 16;
205 for (row = 0; row != 3; row++) {
206 for (j = 0; j != 3; j++) {
207 position.
x = (j * 32 + 144 - shakeX) << 16;
208 position.
y = (row * 32 + 76 - shakeY) << 16;
216 dropFrame =
frame - 160;
217 if (dropFrame >= 0 && dropFrame < 158) {
222 blockX = 96 - dropFrame;
223 blockY = dropFrame * 4 - 56;
224 }
else if (
frame > 208) {
225 blockY = sinkFrame / 4 + 8;
252 for (i = 0; i != 32; i++) {
261 for (i = 0; i != 32; i++) {
270 for (i = 0; i != 32; i++) {
283 for (i = 0; i != 64; i++) {
309 for (i = 0; i != 128; i++) {
317 for (i = 0; i != 128; i++) {
318 if (
frame >= i / 4 + 224) {
335 for (i = 0; i != 128; i++) {
344 i++, trail++, spray++) {
345 if (
frame >= i + 228) {
346 s32 cell = trail->variant / 2 % 9;
351 if (++trail->variant == 18) {
367 for (i = 0; i != 9; i++) {
377 for (i = 0; i != 64; i++) {
385 for (i = 0; i != 64; i++) {
402 count = (
frame - 16) / 2;
417 (64 -
frame) * 7 + 88,
frame * 14 - 992, 40, 80);
420 for (i = 0; i != count; i++) {
432 for (i = 0; i != 64; i++) {
450 for (i = 0; i != count; i++) {
470 for (i = 0; i != 64; i++) {
475 if ((work->
particles[i].
y >> 16) > 120 && frame <= 47) {
484 if (frame == i * 8 + 32) {
493 for (i = 0; i != 64; i++) {
510 if (frame >= 72 && frame < 80) {
523#undef BOREAS_ICE_BLOCK_TRAILS
524#undef BOREAS_BIG_BLOCK_CELLS
525#undef BOREAS_FALLING_BLOCK_CELLS
@ SPRITE_COLOR_BLUE_TINT
blue raised to full
@ POSE_DAMAGE
taking damage
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 ...
#define BOREAS_ICE_BLOCK_TRAILS
#define BOREAS_BIG_BLOCK_CELLS
the dropping 24x48 ice block
#define BOREAS_FALLING_BLOCK_CELLS
the diagonal 40x80 ice block
void BattleFx_RunBoreas(struct BattleEffectArgument *effect)
Rocks and ice blocks: a window opens on rocks that crumble, a big ice block drops and throws up spray...
#define BOREAS_POINT_Y(rock)
#define BOREAS_POINT_X(rock)
gBoreas_Points has an x and a y for each rock.
void BattleFx_ProcessPendingGraphicsTransfer(void)
Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128...
void BattleFx_BeginCanvasLayer(s32 bgControl)
Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over ...
void BattleFx_EndCanvasLayer(void)
Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre,...
void BattleFx_WipeCanvas(s32 mode, s32 value)
Wipes the whole canvas to one colour with a ragged edge: each row (or column) lags a random 0 to 63 p...
void BattleFx_ConfigureEffectDisplay(void)
Puts the battle screen back into the display state every effect starts from and ends with: no blendin...
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.
void BattleFx_BuildWindowEdgeTable(void)
Builds window 0's right edge for every scanline and restarts the HBlank DMA that writes it to WIN0H e...
void BattleFx_SetupBlendedDisplay(void)
Shows the BG1 battle background behind a cleared canvas: clears the canvas buffer and the 16 KiB of V...
void BattleFx_SelectLivingTargets(struct BattleEffectArgument *effect)
Shows the battle objects of every unit with HP left on the targets' side: the enemies (units 128 to 1...
What every part of the battle effect object shares: its includes, macros and frame-loop helpers.
#define EFFECT_SHOW_WIDE_CANVAS(top)
Shows the canvas: the effect display mode, BG2 stretched to twice its width (the 128-pixel canvas sho...
#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_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
copy as drawn
@ 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_SHOW_DAMAGE(hitSound)
Lets the battle show the damage: resumes its paused playback, which plays hitSound (an SE_ id; 0 keep...
#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 CANVAS_SLOT(slots, slot)
A work slot read through a pointer to the canvas slot, gWorkSlot[HEAP_SLOT_BATTLE_CANVAS],...
#define EFFECT_WIN0_LAYERS
Window 0, the battle view, shows BG0 to BG2, sprites and blending.
u16 gBoreas_BoulderCells[]
s8 gBoreas_ShakeOffsets[]
The backdrop's jolt on frames 176 to 179.
u8 gBoreas_SprayHeights[]
u8 gBoreas_BoulderWidths[]
u8 gBoreas_DebrisWidths[]
u8 gBattleFx_PuffSizes[]
Each puff cell's side.
u16 gBattleFx_PuffCells[]
Nine square puff cells, read by the falling, frost, healing, Djinni heal and Boreas parts.
u8 gBoreas_BoulderHeights[]
u16 gBoreas_DebrisCells[]
u8 gBoreas_Animations[]
The third object's animations from frame 209, one every 4 frames.
u8 gBoreas_DebrisHeights[]
void BattleFx_SpawnObjects(s32 entryCount, s32 source, u32 priority)
Creates the effect's animation objects in gBattleFxWork's objects.
void BattleBackground_LoadFar(s32 mode, s32 resource, s32 level)
s32 AnimationObjects_SelectAnimationFar(struct AnimationObject *state, s32 flags)
void Object_ApplyProjectedPlacementFar(struct AnimationObject *sprite, const struct SpritePlacement *position, const struct SpriteScale *scale, s32 facing)
Far call to Render_ApplyProjectedPlacement.
void ResourceObject_ReleaseFar(struct AnimationObject *sprite)
void AudioCommand_PlayFar(s32 id)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
void Camera_ApplyShake(s32 rangeX, u32 rangeY)
Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre ...
@ HEAP_SLOT_BATTLE_EFFECT
@ HEAP_SLOT_BLITTER_ALTERNATE
@ HEAP_SLOT_BATTLE_CANVAS
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
#define WIN_RANGE(start, end)
A REG_WINxH or REG_WINxV value: the window covers start up to, but not including, end.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
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,...
struct Projection gProjection
#define Ram_MapCellBuffer
char ResourceId_SparkleDots
char ResourceId_VioletSkyBackdrop
char ResourceId_IceBlockSheet
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...
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
struct AnimationSpritePart image
u16 priority
2 when created
The command shared by an effect's caller, dispatcher and handlers.
s16 actors[8]
the targets' unit ids, count of them
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
struct AnimationObject * objects[16]
the effect's animation objects
s32 transferMode
How the canvas transfer callbacks treat the canvas after each copy (enum CanvasTransferMode in effect...
struct BattleEffectArgument * effect
the command being run
struct EffectStep particles[64]
free while variant is -1
A moving point of an effect: its position, its velocity and a value each effect uses its own way (a s...
s32 velocityX
16.16 fixed-point pixels per frame
s32 z
16.16 fixed-point pixels
s32 variant
each effect's own: a size, a countdown, -1 for idle
s32 x
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
s32 velocityY
16.16 fixed-point pixels per frame
A sprite's screen position and its two vertical offsets, in 16.16 pixels.
s32 x
screen x of the sprite's centre
s32 y
screen y at the ground; sets the depth slot
s32 groundHeight
how far the shadow is raised above y
s32 height
how far the image is raised above y
Horizontal and vertical sprite scale; 0x10000 is the original size.
#define EFFECT_CLIP_BOUNDS
Clips overflow on all four sides.
#define Q_16_16_TO_INT(v)
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...