7#define CONDEMN_FRAMES 132
8#define CONDEMN_BREAK_FRAME 88
9#define CONDEMN_BOUNCE_FRAME 120
12#define CONDEMN_PANEL_X(column, stage) gCondemn_PanelX[(column)][(stage)]
13#define CONDEMN_PANEL_Y(row, stage) gCondemn_PanelY[(row)][(stage)]
101 screenX = (swing[0] >> 16) + (((
Trig_Sin(spin) * 16)) >> 16) + 48;
102 screenY = (swing[1] >> 16) + (((
Trig_Cos(spin) * 4)) >> 16) + 16;
110 swing[0] = -0x200000;
125 swing[0] = (pos[0].
x - 128) << 16;
127 swing[0] = (pos[0].
x - 64) << 16;
138 scanline = work->bg2xLines;
142 ripple = (frame * 2) - 32;
145 }
else if (frame <= 63) {
147 ripple = (frame * 2) - 96;
158 lineOffset = (6 - screenX) << 8;
160 for (; i != 160; i++) {
161 *scanline++ = lineOffset - ((
Trig_Sin(angle) * ripple) >> 10);
164 if (drawPanel != 0) {
192 if ((frame - 88) <= 1U) {
195 if ((frame - 90) <= 1U) {
200 if ((frame - 92) <= 1U) {
205 if ((frame - 94) <= 1U) {
211 if ((frame - 96) <= 1U) {
217 if ((frame - 98) <= 1U) {
258#undef CONDEMN_BREAK_FRAME
259#undef CONDEMN_BOUNCE_FRAME
260#undef CONDEMN_PANEL_X
261#undef CONDEMN_PANEL_Y
@ POSE_DAMAGE
taking damage
BattleEffectDrawRectangle DrawRectangle
struct BattleWork * gBattleWork
void BattleFx_ArmBg2AffineHBlankDma(void)
Arms DMA 0 to copy one word of gBattleFxWork's bg2xLines table into BG2X at each horizontal blank,...
void BattleFx_ProcessPendingGraphicsTransfer(void)
Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128...
void BattleFx_EndCanvasLayer(void)
Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre,...
void BattleFx_BeginTiledCanvas(s32 bgControl)
Opens the canvas layer with BG2 a wrapping 256x256 map: each row of the map is the canvas's 16 tiles ...
#define CONDEMN_PANEL_X(column, stage)
gCondemn_PanelX and _PanelY have seven stages for each column and row.
#define CONDEMN_BREAK_FRAME
the panel breaks in a white flash
void BattleFx_RunCondemn(struct BattleEffectArgument *effect)
A tall panel (57x98) swings across the screen three times, each pass fading out through a ripple,...
#define CONDEMN_BOUNCE_FRAME
the falling target bounces
#define CONDEMN_PANEL_Y(row, stage)
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_PRESENT_FRAME(work)
Ends a frame of a canvas effect: marks the canvas ready for the transfer callback,...
@ CANVAS_COPY_AND_CLEAR
copy, then fill the canvas with transferValue
#define CANVAS_BYTES
The canvas: 128x128 pixels, one byte each, in its heap slot and in VRAM at BG_CHAR_BLOCK(1).
#define EFFECT_CALLBACK_ORDER
The scheduler order of every per-frame effect callback (Scheduler_AddOrUpdateCallback sorts the 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_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.
struct BattleObj * GetBattleObjectSlotFar(s32 objectId)
Far call to BattleObjGet.
void BattleBackground_LoadFar(s32 mode, s32 resource, s32 level)
void Object_SetMoveTargetFar(struct ObjectRuntime *object, s32 x, s32 y, s32 z)
void AudioCommand_PlayFar(s32 id)
@ 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 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)
void EffectPosition_ProjectScaledBattler(s32 id, struct EffectPosition *position)
The screen position of a battler, scaled for the battle view, 16 pixels higher.
#define Ram_MapCellBuffer
char ResourceId_CounterRevealSheet
char ResourceId_RedCrescentSheetA
s32 Resource_DecodeType01(const void *source, void *destination)
Decodes a type-01 resource and returns its unpacked byte count.
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 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
The running battle effect's work: its canvas image, 64 particles, the display registers it stages and...
struct BattleEffectArgument * effect
the command being run
struct MotionObject * object
NULL once released.
u16 background
the battle background's id
A point projected onto the screen, with its depth.
An effect object that moves and draws one sprite: its position, scale, velocity and target,...
s32 speedLimit
16.16 fixed-point pixels per frame
u8 snapToTarget
nonzero: lands exactly on the target, else brakes in
s32 velocityY
16.16 fixed-point pixels per frame
s32 acceleration
Horizontal speed gained each frame towards the target, or lost braking without one,...
s32 verticalMotionStrength
Gravity: taken from velocityY each frame above the ground with motionFlags bit 1, in 16....
u8 autoFaceMotion
bit 0 turns the object to face where it moves
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
s32 z
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...