80#define BURST_SCENE_FLASH_CELLS 0x5100
82#define BURST_SCENE_WAVE_CELLS (Ram_MapCellBuffer + 0x5e00)
137 for (row = 0; row != 288; row++) {
138 for (col = 0; col != 40; col++) {
139 s32 src = row * 40 + col;
142 work->sheet[dst] = work->sheet[src];
179 for (i = 0; i != 768; i++) {
217 for (i = 0; i != bursts; i++) {
220 if (frame >= start && frame < start + 6) {
221 s32 step = frame - start;
227 draw[i & 1](canvas, work->sheet + step * (48 * 72),
228 targetPos.
x / 2 - 16, targetPos.
y - 40, 48, 72);
230 draw[i & 1](canvas, work->sheet + step * (48 * 72),
231 targetPos.
x / 2 - 32, targetPos.
y - 40, 48, 72);
236 targetPos.
x / 2 - 16, actorPos.
y - 8, 48, 16);
239 targetPos.
x / 2 - 32, actorPos.
y - 8, 48, 16);
242 if (frame == start + 2) {
249 if (i == bursts - 1) {
263 if (frame >= start + 2 && frame < start + 14)
265 work->sheet + ((frame - start - 2) / 2) * (20 * 48) +
267 targetPos.
x / 2 - 10, targetPos.
y - 24, 20, 48);
282 for (i = 0; i != 512; i++) {
295 if (mote->
y < 0x80000)
308#undef BURST_SCENE_FLASH_CELLS
309#undef BURST_SCENE_WAVE_CELLS
@ SPRITE_COLOR_WHITE
solid colour 15, white
@ POSE_DAMAGE
taking damage
BattleEffectDrawRectangle DrawRectangle
void BattleFx_RunRansack(struct BattleEffectArgument *effect)
Ransack: the same five strikes as Bear Claw (mode 0).
void BattleFx_RunGust(struct BattleEffectArgument *effect)
Gust: the burst scene in mode 6, 7 or 8 as the variant grows, one to three strikes that each fill the...
BurstField
The bytes of a gBurstScene_Records row, one row a mode.
@ BURST_SCENE_PALETTE
the palette's resource (0 to 3)
@ BURST_SCENE_MOTES
motes thrown by each strike
@ BURST_SCENE_INTERVAL
frames between strikes
@ BURST_SCENE_FRAMES
frames in the whole effect
@ BURST_SCENE_ARC_SHEET
0: blue arc A, else B; 1 also draws every strike as an arc
@ BURST_SCENE_STRIKES
the strikes
@ BURST_SCENE_FLASH
1 fills the canvas on each hit
void BattleFx_RunFlyingAttack(struct BattleEffectArgument *effect)
Flying Attack: the burst scene in mode 3, 4 or 5 as the variant grows, one to three strikes.
void BattleFx_RunBearClaw(struct BattleEffectArgument *effect)
Bear Claw: five strikes, the burst scene in mode 0.
#define BURST_SCENE_WAVE_CELLS
The wave pictures, in the map buffer past the motes.
void BattleFx_RunFreebiteRush(struct BattleEffectArgument *effect)
Freebite Rush: nine strikes in the blue palette (mode 2).
void BattleFx_RunBacteriaRush(struct BattleEffectArgument *effect)
Bacteria Rush: seven strikes in the lime palette (mode 1).
void BattleFx_RunBurstScene(struct BattleEffectArgument *effect, s32 mode)
Flurry: the user closes on the first target and strikes it again and again; each strike shows an arc ...
#define BURST_SCENE_FLASH_CELLS
The flash pictures, packed to half width after the arcs.
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 CANVAS_BYTES
The canvas: 128x128 pixels, one byte each, in its heap slot and in VRAM at BG_CHAR_BLOCK(1).
#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_END_FRAME(work)
The usual end of an effect frame: counts down the targets' flash timers (ObjectGroup_TickMemberTimers...
#define EFFECT_VIEW_FROM_CAMERA(camera)
Starts a frame's 3D projection from the battle camera: resets the transform, then looks from camera->...
u8 gBurstScene_Records[][7]
Each burst scene mode, by the BURST_SCENE_ columns (burst_scene.c).
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
void BattleMotion_ApproachTargetFar(s32 actorId, s32 targetId, s32 travel_divisor, s32 initial_velocity_y)
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
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.
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
static s32 Iwram_FillWords(void *destination, s32 size, u32 value)
#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.
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.
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...
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...
void BattleFx_RunDjinniEntrance(struct BattleEffectArgument *effect, s32 mode, s32 side, s32 anchor, s32 *outX, s32 *outY)
Djinni entrance: sparks swirl around a point that travels from the user to the goal and gather into t...
char ResourceId_BlueArcSheetB
char ResourceId_YellowOrbSheet
char ResourceId_LimePalette
char ResourceId_BlueArcSheetA
char ResourceId_MarsDjinnSheet
char ResourceId_ParticleSpritesA
char ResourceId_WaveSheet
char ResourceId_EmberStreakSheet
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
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
s16 actors[8]
the targets' unit ids, count of them
s32 variant
the ability's size, from 0 (Quake, then Earthquake)
s32 prelude
1 plays a prelude: in some effects a Djinni appears
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 BattleEffectArgument * effect
the command being run
struct MotionObject * object
NULL once released.
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
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
s32 z
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
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 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...