Skip to Content
The Alchemy Project

struct BATTLE_EFFECT_STATE

The running battle effect's state: its canvas image, 64 particles, the display registers it stages and its sprites. More…

Declared in battle_effect_state.h.

Fields

NameDescription
union { struct { Uint8sheet, bg2xLines, imageTail, imageStorage, image, origin, trackedCanvas [27008]; Sint32 bg2xLines[160]; Uint8 imageTail[1152]; }; Uint8 imageStorage[28800]; struct { Uint8 image[5060]; BATTLE_BG2_ORIGIN origin; } trackedCanvas; }Images and scanline tables reuse the storage before the particles.
PARTICLEparticles [64]Free while variant is -1.
Sint32transferModeHow the canvas transfer events treat the canvas after each copy (CANVAS_TRANSFER_MODE in battle_effect_internal.h).
Sint32transferValueThe transfer mode's argument: the fill value, the share kept (50 or 75 percent) or the darken or brighten amount.
Sint32unusedNever read or written in either game.
Sint32frameTick counter some effects keep, from 0.
Sint32scrollTimerTicks since the last interval scroll step.
Sint32scrollIntervalTicks between interval scroll steps.
Sint32scrollStepXAdded to BG1 or BG2 x at each step.
Sint32scrollStepYAdded to BG1 or BG2 y at each step.
Sint32savedBg1XBG1 scroll restored when a shake ends.
Sint32savedBg1YBG1 scroll restored when a shake ends.
Sint32shakeFrameShake ticks left; btCameraShake counts down.
Sint32cameraDeltaCamera yaw turned per tick of the effect.
Sint32cameraPhaseThe effect sets 1 after a tick; btCameraApplyPhasedDelta then turns the whole cameraDelta and sets 0, else turns half and toggles 0 and 2.
Sint32fadeFrameBattle background fade ticks left (btEffectDarkenBackgroundStep).
Sint32fadeStepCANVAS_FADE_STEPs the background has darkened so far.
Uint16win0hWindow, display and blend registers, which btEffectApplyWindowBlendRegisters writes all at once.
Uint16win0v
Uint16win1h
Uint16win1v
Uint16winin
Uint16winout
Uint16dispcnt
Uint16bldcnt
Uint16bldalpha
Uint16paddingAligns bg2x; never read or written.
Sint32bg2xBG2's reference point, written
Sint32bg2yto BG2X and BG2Y by btEffectApplyBg2Reference and btEffectAdvanceBg2OnInterval.
struct SPR *sprites [16]The effect's sprites.
Uint8actorTimers [8]Each target's flash timer in ticks, for args->targets[n]: set by btEffectTintBattler, counted down by btEffectCountDownBattlerTints.
Sint32framesSinceTransfer1 on a canvas copy's VBlank, then counts up.
Sint32transferPending1 once the effect has presented its canvas (EFFECT_PRESENT_CANVAS); the canvas transfer event copies the canvas and clears it.
BATTLE_EFFECT_PARM *argsThe command being run.

Description

The running battle effect's state: its canvas image, 64 particles, the display registers it stages and its sprites. It lives in the HEAP_SLOT_BATTLE_EFFECT heap slot.

struct BATTLE_EFFECT_STATE

Referenced by btCameraApplyPhasedDelta(), btCameraShake(), btCastingImpactEndPrelude(), btEffectAdvanceBg2OnInterval(), btEffectAdvanceScrollOnInterval(), btEffectApplyBg2Reference(), btEffectApplyWindowBlendRegisters(), btEffectArmBg2AffineHBlankDMA(), btEffectArmPaletteHBlankDMA(), btEffectClearTintTimers(), btEffectCountDownBattlerTints(), btEffectCreateSprites(), btEffectDarkenBackgroundStep(), btEffectDrawStreaks(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectPlaceFormationSprites(), btEffectReadKeysForEnemyTarget(), btEffectRunAnnihilation(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBind(), btEffectRunBladeRain(), btEffectRunBolt(), btEffectRunBoreas(), btEffectRunBreak(), btEffectRunBurstShower(), btEffectRunByIdRange(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectRunCurse(), btEffectRunCybele(), btEffectRunDeathPlunge(), btEffectRunDjinnBeams(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunDouse(), btEffectRunDragonCloud(), btEffectRunDragonFire(), btEffectRunDrain(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunEruption(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFromTable() and 74 more.

Definition at line 69 of file battle_effect_state.h.

Fields in detail

sheet, bg2xLines, imageTail, imageStorage, image, origin, trackedCanvas

union { struct { Uint8 sheet[27008]; Sint32 bg2xLines[160]; Uint8 imageTail[1152]; }; Uint8 imageStorage[28800]; struct { Uint8 image[5060]; BATTLE_BG2_ORIGIN origin; } trackedCanvas; }

Images and scanline tables reuse the storage before the particles.

The tile-effect mask extends beyond sprite sheet into the table

area.

the effect's decoded pictures, at fixed offsets

offsets

BG2X for each scanline, for an HBlank DMA

The rest of imageStorage, which only effects that skip the scanline table reach through it.

effects that skip the scanline table

reach through it.

The tracked elemental effect stages its origin inside the

image area.

particles

PARTICLE particles[64]

Free while variant is -1.

transferMode

Sint32 transferMode

How the canvas transfer events treat the canvas after each copy (CANVAS_TRANSFER_MODE in battle_effect_internal.h).

transferValue

Sint32 transferValue

The transfer mode's argument: the fill value, the share kept (50 or 75 percent) or the darken or brighten amount.

unused

Sint32 unused

Never read or written in either game.

frame

Sint32 frame

Tick counter some effects keep, from 0.

scrollTimer

Sint32 scrollTimer

Ticks since the last interval scroll step.

scrollInterval

Sint32 scrollInterval

Ticks between interval scroll steps.

scrollStepX

Sint32 scrollStepX

Added to BG1 or BG2 x at each step.

scrollStepY

Sint32 scrollStepY

Added to BG1 or BG2 y at each step.

savedBg1X

Sint32 savedBg1X

BG1 scroll restored when a shake ends.

savedBg1Y

Sint32 savedBg1Y

BG1 scroll restored when a shake ends.

shakeFrame

Sint32 shakeFrame

Shake ticks left; btCameraShake counts down.

cameraDelta

Sint32 cameraDelta

Camera yaw turned per tick of the effect.

cameraPhase

Sint32 cameraPhase

The effect sets 1 after a tick; btCameraApplyPhasedDelta then turns the whole cameraDelta and sets 0, else turns half and toggles 0 and 2.

fadeFrame

Sint32 fadeFrame

Battle background fade ticks left (btEffectDarkenBackgroundStep).

fadeStep

Sint32 fadeStep

CANVAS_FADE_STEPs the background has darkened so far.

win0h

Uint16 win0h

Window, display and blend registers, which btEffectApplyWindowBlendRegisters writes all at once.

win0v

Uint16 win0v

win1h

Uint16 win1h

win1v

Uint16 win1v

winin

Uint16 winin

winout

Uint16 winout

dispcnt

Uint16 dispcnt

bldcnt

Uint16 bldcnt

bldalpha

Uint16 bldalpha

padding

Uint16 padding

Aligns bg2x; never read or written.

bg2x

Sint32 bg2x

BG2's reference point, written

bg2y

Sint32 bg2y

to BG2X and BG2Y by btEffectApplyBg2Reference and btEffectAdvanceBg2OnInterval.

sprites

struct SPR *sprites[16]

The effect's sprites.

actorTimers

Uint8 actorTimers[8]

Each target's flash timer in ticks, for args->targets[n]: set by btEffectTintBattler, counted down by btEffectCountDownBattlerTints.

framesSinceTransfer

Sint32 framesSinceTransfer

1 on a canvas copy's VBlank, then counts up.

transferPending

Sint32 transferPending

1 once the effect has presented its canvas (EFFECT_PRESENT_CANVAS); the canvas transfer event copies the canvas and clears it.

args

BATTLE_EFFECT_PARM *args

The command being run.