9#define ATALANTA_MATRICES (Ram_MapCellBuffer + 0x3800)
126 for (i = 0; i != 16; i++) {
130 slash->
y = ((
Random16() & 63) + 32) << 16;
134 for (j = 0; j != 24; j++) {
154 pathX = (path[0] << 8) + (
u8)path[1];
155 pathY = (path[2] << 8) + (
u8)path[3];
163 position.
height = 0xff0000;
164 for (row = 0; row != 3; row++) {
165 for (column = 0; column != 3; column++) {
166 position.
x = (pathX + 80 + column * 32) << 16;
167 position.
y = (64 - pathY + row * 32) << 16;
184 for (i = 0; i != 16; i++) {
185 s32 start = i * 8 + 64;
187 if (frame >= start) {
192 if (frame == i * 8 + 84)
194 if (frame >= i * 8 + 85) {
205 }
else if (frame >= i * 8 + 80) {
207 switch (frame - start - 16) {
244 for (j = 0; j != 24; j++) {
261 screen.
x = (screen.
x >> 1) +
x;
262 screen.
y = screen.
y +
y;
265 screen.
x = (screen.
x >> 1) +
x;
266 screen.
y = screen.
y +
y + 16;
270 screen.
y - 5, 5, 10);
285 for (i = 0; i != 9; i++)
296 for (i = 0; i != 32; i++) {
300 if (member < work->effect->
count) {
304 slash->
x = target.
x / 2 + (80 - slash->
y) / 2;
316 for (frame = 0; frame != 88; frame++) {
317 for (i = 0; i != 24; i++) {
320 if (frame >= i * 2 || frame > 40) {
333 slash->
x - (width >> 1) - 8,
346 slash->
y - 40, 16, 21);
348 slash->
x - 16, slash->
y - 19, 29, 35);
357 height = height - slash->
y + 56;
359 slash->
y - 40, 16, 21);
361 slash->
y - 19, 29, 35);
364 slash->
y + 16, 21, height);
374 if (member < work->effect->
count) {
391#undef ATALANTA_MATRICES
@ SPRITE_COLOR_WHITE
solid colour 15, white
SlashSheetCell
The pictures in the slash sheet: five flash frames, then the slash in three parts.
@ ATALANTA_SLASH_FLASH_5_TOP
@ ATALANTA_SLASH_FLASH_3_BOTTOM
@ ATALANTA_SLASH_FLASH_5_BOTTOM
@ ATALANTA_SLASH_FLASH_4_MIDDLE
@ ATALANTA_SLASH_FLASH_4_TOP
@ ATALANTA_SLASH_FLASH_4_BOTTOM
@ ATALANTA_SLASH_FLASH_5_MIDDLE
@ ATALANTA_SLASH_FLASH_3_TOP
#define ATALANTA_MATRICES
The trail particles' random rotations, 48 bytes each, after the 384 particles in PARTICLES.
void BattleFx_RunAtalanta(struct BattleEffectArgument *effect)
Rain of blades: under a violet sky, a 3x3 formation of objects flies along a stored path while sixtee...
@ POSE_DAMAGE
taking damage
void BattleFx_ProcessPendingGraphicsTransfer(void)
Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128...
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 BattleFx_AdvanceScrollOnInterval(void)
Scrolls BG1 by (scrollStepX, scrollStepY) once every scrollInterval frames.
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_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_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_FINISH_CANVAS()
The usual end of a canvas effect: stops the transfer callback before freeing what it reads,...
#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_DISPCNT
The battle screen's display mode while an effect plays: background mode 1 with BG0 to BG2,...
#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...
u16 gBattleFx_PuffArcCells[]
u8 gBattleFx_PuffArcCellHeights[]
u8 gBattleFx_PuffArcCellBiasY[]
u16 gBattleFx_MoteCells[]
Mote cells: particle sheets hold ten, cell n (from 0) n + 1 pixels wide and twice that tall.
u8 gBattleFx_PuffArcCellWidths[]
struct SpriteScale gAtalanta_UnitScale
Staged particle scale: Atalanta's formation objects keep this scale, one to one, throughout.
void BattleFx_SpawnObjects(s32 entryCount, s32 source, u32 priority)
Creates the effect's animation objects in gBattleFxWork's objects.
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
void BattleBackground_LoadFar(s32 mode, s32 resource, s32 level)
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_BACKGROUND
@ HEAP_SLOT_BATTLE_CANVAS
#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 BGCNT_SCREEN_BASE(block)
#define BGCNT_WRAP
Affine backgrounds only: wrap around instead of showing the backdrop.
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
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 EffectPosition_ProjectScaledBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, scaled for the battle view, 16 pixels higher.
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...
struct Projection gProjection
#define Ram_MapCellBuffer
char ResourceId_SlashSheet
char ResourceId_LimePalette
char ResourceId_VioletSkyBackdrop
char ResourceId_ParticleSpritesA
char ResourceId_StagedParticlePath
char ResourceId_EmberStreakSheet
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,...
The battle background's work slot as the background code reads it: its display mode (2 draws it as an...
s32 busy
while set, BattleCamera_SetRange leaves BG1's scroll
The command shared by an effect's caller, dispatcher and handlers.
s16 actors[8]
the targets' unit ids, count of them
s32 count
targets in actors, at least 1
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 frame
frame counter some effects keep, from 0
s32 fadeStep
CANVAS_FADE_STEPs the backdrop has darkened so far.
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...
s32 scrollStepY
added to BG1 or BG2 y at each step
s32 scrollTimer
frames since the last interval scroll step
struct BattleEffectArgument * effect
the command being run
s32 scrollStepX
added to BG1 or BG2 x at each step
s32 scrollInterval
frames between interval scroll steps
struct EffectStep particles[64]
free while variant is -1
A point projected onto the screen, with its depth.
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 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
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...