8#define GAIA_WALL_TOP_CELLS 0x13c0
10#define GAIA_WALL_FOOT_CELLS 0x25c0
11#define GAIA_WALL_FOOT_BYTES (48 * 21)
12#define GAIA_FRAMES 192
27 static struct SpriteScale unitScale = {{{0x10000, 0x10000}}};
40 void *palette = (
void *)
BG_PLTT;
79 for (i = 0; i != 63; i++) {
81 s32 blue = ((
u16)entry >> 10) & 31;
82 s32 green = ((
u16)entry >> 5) & 31;
96 *color++ =
RGB(red, green, blue);
106 for (j = 0; j != 9; j++) {
107 for (i = 0; i != 32; i++) {
109 work->sheet[sheetIndex] = src[k];
113 for (j = 0; j != 32; j++) {
114 for (i = 0; i != 3; i++) {
115 for (k = 0; k != 48; k++, sheetIndex++)
116 work->sheet[sheetIndex] = src[k];
121 work->sheet[sheetIndex++] = *src++;
122 for (i = 0; i != 3; i++) {
124 work->sheet[sheetIndex++] = *src++;
162 for (i = 0; i != 6; i++)
167 for (i = 0; i != 256; i++) {
170 dust->
x = ((
Random16() & 63) + wallX + 32) << 16;
192 s32 cell = frame / 4;
195 cell = (cell & 1) + 1;
207 if (frame >= 12 && frame <= 87) {
208 s32 row = (frame - 64) / 3;
211 for (i = 0; i != 4; i++) {
221 if (frame >= 160 && frame <= 183) {
222 s32 row = 7 - (frame - 160) / 3;
225 for (i = 0; i != 4; i++) {
235 if (frame >= 88 && frame <= 159) {
251 for (i = 0; i != 64; i++) {
255 s32 size = (i & 3) + 5;
260 if (dust->
y < 0 && frame <= 159)
277 for (k = 0; k != rocks; k++) {
284 scale.x = (k << 12) + 0x8000;
291 position.
x = (rock->
x + rockX * 2) << 16;
292 position.
height = 0x2000000 - (rock->
y << 16);
293 position.
y = 0x2000000;
337 if ((frame & 3) == 0)
342 if (frame < 90 || frame > 160)
355#undef GAIA_WALL_TOP_CELLS
356#undef GAIA_WALL_FOOT_CELLS
357#undef GAIA_WALL_FOOT_BYTES
@ SPRITE_COLOR_WHITE
solid colour 15, white
@ 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 ...
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 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.
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_DRAW_MOTE(draw, canvas, sheet, x, y, size)
Particle sheets hold ten mote cells, 1x2 to 10x20 pixels.
@ CANVAS_COPY_AND_FADE
copy, keeping 50% or 75% (transferValue) of each pixel in the canvas for the next 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_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_GET_SLOTS(slots, cursor, work, canvas)
Starts at the effect's entry in the whole work-slot array.
#define EFFECT_END_FRAME(work)
The usual end of an effect frame: counts down the targets' flash timers (ObjectGroup_TickMemberTimers...
s8 gGaia_Bg2Shifts[][3]
BG2's x shift, by side and variant.
u8 gGaia_LateRockColumns[]
The columns rock particles[16] to particles[21] take.
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
s32 AnimationObjects_SelectAnimationFar(struct AnimationObject *state, s32 flags)
struct AnimationObject * ResourceObject_CreateFar(s32 id)
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)
#define GAIA_WALL_FOOT_CELLS
The standing wall's foot in the rebuilt sheet, 48x21.
#define GAIA_ROCKS
rocks that tumble up the wall
void BattleFx_RunGaia(struct BattleEffectArgument *effect)
Rising wall: the ground swells, a wall of rock rises from it, stands while rocks tumble up its face a...
#define GAIA_WALL_TOP_CELLS
The standing wall's top in the rebuilt sheet, 48x96 (stretched from 48x32).
#define GAIA_WALL_FOOT_BYTES
void Camera_ApplyShake(s32 rangeX, u32 rangeY)
Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre ...
@ HEAP_SLOT_BLITTER_ALTERNATE
#define Q_8_8(n)
The BG2/BG3 affine matrix entries are signed 8.8 fixed point: texels stepped per screen pixel.
#define BGCNT_CHAR_BASE(block)
#define BGCNT_PRIORITY(n)
#define RGB(r, g, b)
A 15-bit colour from its red, green and blue levels (0 to 31 each), as the palette stores it: blue in...
#define BLDCNT_EFFECT_BLEND
weighted by REG_BLDALPHA
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
#define BGCNT_SCREEN_BASE(block)
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
#define SET_VELOCITY(p, vx, vy, vz)
#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.
#define CLAMP(v, low, high)
Keeps v within low to high, the low bound tested first.
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
#define Ram_MapCellBuffer
char ResourceId_EarthWallSheet
char ResourceId_ParticleSpritesA
char ResourceId_OrangePaletteA
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
struct AnimationSpritePart image
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
u16 priority
2 when created
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 shakeFrames
shake frames left; Camera_ApplyShake counts down
struct AnimationObject * objects[16]
the effect's animation objects
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.
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
#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...
DrawRectangle BlitterPair[2]
A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_Fetch...