86 (
volatile u32 *)channel);
void BattleFx_ConfigureEffectDisplay(void)
Puts the battle screen back into the display state every effect starts from and ends with: no blendin...
void BattleFx_AdvanceBg2OnInterval(void)
Slides the affine BG2 in steps: once every scrollInterval frames, writes the work block's reference p...
void BattleFx_ArmWin0HBlankDma(void)
Restarts DMA 0 as an HBlank transfer of one WIN0H value a line from PARTICLES (Ram_MapCellBuffer),...
void BattleFx_AdvanceScrollOnInterval(void)
Scrolls BG1 by (scrollStepX, scrollStepY) once every scrollInterval frames.
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
What every part of the battle effect object shares: its includes, macros and frame-loop helpers.
static void Dma_Stop(volatile u16 *channel)
Stops a DMA channel: clears its repeat and start timing bits, then its enable bit,...
#define EFFECT_WINOUT
Outside the battle view: BG0 and blending only.
#define EFFECT_DISPCNT
The battle screen's display mode while an effect plays: background mode 1 with BG0 to BG2,...
#define EFFECT_SET_BATTLE_WINDOWS()
Windows 0 and 1 both cover the battle view: the full width, lines 16 to.
#define EFFECT_WIN0_LAYERS
Window 0, the battle view, shows BG0 to BG2, sprites and blending.
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
@ HEAP_SLOT_BATTLE_EFFECT
#define WORK_SLOT(n)
Reads slots through their own addresses; adjacent slots are reached by offsets.
#define DMA_HBLANK_HALFWORD_PER_LINE
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
#define IO_WRITE_QUEUE_PUSH(address, value, control)
Disables interrupts to add one register write or DMA to the queue; a write to a full queue is dropped...
The running battle effect's work: its canvas image, 64 particles, the display registers it stages and...
s32 bg2x
BG2's reference point, written to BG2X and BG2Y by Display_ApplyBg2Reference and BattleFx_AdvanceBg2O...
s32 scrollStepY
added to BG1 or BG2 y at each step
s32 scrollTimer
frames since the last interval scroll step
s32 scrollStepX
added to BG1 or BG2 x at each step
s32 scrollInterval
frames between interval scroll steps
#define PARTICLES
The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer...