25 for (x = 0; x != 40; x++) {
26 dst[offset / 2 + x / 2] = src[offset + x];
30 }
while (row != rows);
33#define RUSHING_STRIKE_SPARK_COUNT 64
34#define RUSHING_STRIKE_RING_BYTES 0x3c0
60#define RUSHING_STRIKE_FRAMES 60
61#define RUSHING_STRIKE_FRAME 10
154 newSpark->
x = target->
x;
155 newSpark->
y = target->
y + 0xa0000;
156 newSpark->
z = target->
z;
162 newSpark->
variant = i / 2 + 16;
171 draw[0](canvas, work->sheet, screen.
x / 2 - 16, screen.
y - 48, 40, 32);
172 draw[1](canvas, work->sheet, screen.
x / 2 - 16, screen.
y - 16, 40, 32);
183 ringFrame = frame - 8;
184 if (ringFrame >= 0 && ringFrame <= 11) {
185 s32 ring = ringFrame / 2;
187 origin.
x / 2 - 16, screen.
y - 40, 20, 48);
191 if (ringFrame >= 0 && ringFrame <= 55) {
214#undef RUSHING_STRIKE_SPARK_COUNT
215#undef RUSHING_STRIKE_RING_BYTES
216#undef RUSHING_STRIKE_FRAMES
217#undef RUSHING_STRIKE_FRAME
@ SPRITE_COLOR_WHITE
solid colour 15, white
@ POSE_DAMAGE
taking damage
BattleEffectDrawRectangle DrawRectangle
void BattleFx_BeginCanvasLayer(s32 bgControl)
Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over ...
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_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_FINISH_CANVAS()
The usual end of a canvas effect: stops the transfer callback before freeing what it reads,...
#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...
#define EFFECT_VIEW_FROM_CAMERA(camera)
Starts a frame's 3D projection from the battle camera: resets the transform, then looks from camera->...
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
void BattleMotion_ApplyVariantMotionFar(s32 id, s32 variant)
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
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
#define SET_VELOCITY(p, vx, vy, vz)
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
void EffectPosition_ProjectBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, 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_SetApproachMotion(s32 id, s32 targetId, s32 frames)
Moves a battler 80% of the way to another one over a number of frames, in its action pose.
#define Ram_MapCellBuffer
char ResourceId_PinkBurstSheet
char ResourceId_YellowOrbSheet
char ResourceId_BlueBurstSheet
char ResourceId_BlastSheet
char ResourceId_ParticleSpritesA
char ResourceId_IceBlockSheet
char ResourceId_FirePillarSheetB
void BattleFx_RunBoneCharge(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the fire pillar palette.
void BattleFx_RunHeadbutt(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the blast palette.
void BattleFx_RunOnslaught(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the pink-burst palette.
#define RUSHING_STRIKE_SPARK_COUNT
sparks
void BattleFx_RunBruteForce(struct BattleEffectArgument *effect)
Rushes the target and scatters sparks in the ice-block palette.
#define RUSHING_STRIKE_RING_BYTES
one 20x48 ring picture
#define RUSHING_STRIKE_FRAMES
#define RUSHING_STRIKE_FRAME
the user strikes
void Graphics_PackTileRows(u8 *src, u8 *dst, s32 stride, s32 rowCount)
Packs 288 rows of 40 bytes to half width, keeping every second byte (the bytes of the odd columns win...
void BattleFx_RunRushingStrike(struct BattleEffectArgument *effect, s32 mode)
Rushing strike: the user rushes at the first target and strikes it on frame 10; a ring flares where i...
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
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 BattleEffectArgument * effect
the command being run
struct EffectStep particles[64]
free while variant is -1
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 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
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.
DrawRectangle BlitterPair[2]
A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_Fetch...