Alchemy
Loading...
Searching...
No Matches

effect.h File Reference

Go to the source code of this file.

Data Structures

struct  BattleEffectIndexWindow
 What BattleFx_BuildCenteredIndexList (unused) reads: a value to find in a list, and how many indices either side of it to keep. More...
struct  Point2D
 Two-dimensional {x, y} pair for position or velocity, a local of the summon scenes (Nereid, Procne, Tiamat and Ramses). More...

Macros

#define PARTICLES   ((struct EffectStep *)Ram_MapCellBuffer)
 The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer as bytes, at its fixed address, and PARTICLES as particles.
#define EFFECT_CLIP_BOUNDS   (COMPOSITE_CLIP_X | COMPOSITE_CLIP_Y)
 Clips overflow on all four sides.
#define Q_16_16_TO_INT(v)
#define EFFECT_BLITTERS   ((DrawRectangle *)gWorkSlot)
 The work slots read as blitters: EFFECT_BLITTERS[HEAP_SLOT_BLITTER] and EFFECT_BLITTERS[HEAP_SLOT_BLITTER_ALTERNATE].

Typedefs

typedef void(*) BattleFxHandler(struct BattleEffectArgument *effect)
 An effect handler: plays one effect over the battle, frame by frame, and returns when it is over.
typedef DrawRectangle BlitterPair[2]
 A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_FetchRectangleBlitters fills one).

Enumerations

enum  SceneEffectKind {
  SCENE_EFFECT_RAMSES = 1 , SCENE_EFFECT_NEREID , SCENE_EFFECT_KIRIN , SCENE_EFFECT_ATALANTA ,
  SCENE_EFFECT_CYBELE , SCENE_EFFECT_NEPTUNE , SCENE_EFFECT_TIAMAT , SCENE_EFFECT_PROCNE ,
  SCENE_EFFECT_JUDGMENT , SCENE_EFFECT_BOREAS , SCENE_EFFECT_METEOR , SCENE_EFFECT_THOR
}
 The large effects BattleFx_RunSceneEffect runs, by kind: the twelve summons. More...
enum  BattleFxKind {
  BATTLE_FX_QUAKE = 1 , BATTLE_FX_SPIRE = 2 , BATTLE_FX_GAIA = 3 , BATTLE_FX_GROWTH = 4 ,
  BATTLE_FX_THORN = 5 , BATTLE_FX_FROST = 6 , BATTLE_FX_ICE = 7 , BATTLE_FX_PRISM = 8 ,
  BATTLE_FX_DOUSE = 9 , BATTLE_FX_FROTH = 10 , BATTLE_FX_FLARE = 11 , BATTLE_FX_FIRE = 12 ,
  BATTLE_FX_VOLCANO = 13 , BATTLE_FX_BLAST = 14 , BATTLE_FX_NOVA = 15 , BATTLE_FX_BOLT = 16 ,
  BATTLE_FX_RAY = 17 , BATTLE_FX_PLASMA = 18 , BATTLE_FX_SLASH = 19 , BATTLE_FX_WHIRLWIND = 20 ,
  BATTLE_FX_CURE = 21 , BATTLE_FX_PLY = 22 , BATTLE_FX_WISH = 23 , BATTLE_FX_CURE_POISON = 24 ,
  BATTLE_FX_REVIVE = 25 , BATTLE_FX_IMPACT = 26 , BATTLE_FX_DULL = 27 , BATTLE_FX_GUARD = 28 ,
  BATTLE_FX_IMPAIR = 29 , BATTLE_FX_WARD = 30 , BATTLE_FX_WEAKEN = 31 , BATTLE_FX_TAINT = 32 ,
  BATTLE_FX_DELUDE = 33 , BATTLE_FX_ORBITING_SPIRALS = 34 , BATTLE_FX_HEARTRENDER = 35 , BATTLE_FX_PARALYZE = 36 ,
  BATTLE_FX_SLEEP = 37 , BATTLE_FX_BIND = 38 , BATTLE_FX_HAUNT = 39 , BATTLE_FX_CONDEMN = 40 ,
  BATTLE_FX_CURSE = 41 , BATTLE_FX_DRAIN = 42 , BATTLE_FX_BREAK = 43 , BATTLE_FX_WISH_44 = 44 ,
  BATTLE_FX_WISH_45 = 45 , BATTLE_FX_IMPACT_46 = 46 , BATTLE_FX_IMPAIR_47 = 47 , BATTLE_FX_DRAGON_CLOUD = 49 ,
  BATTLE_FX_DEMON_NIGHT = 50 , BATTLE_FX_HELM_SPLITTER = 51 , BATTLE_FX_QUICK_STRIKE = 52 , BATTLE_FX_DEATH_PLUNGE = 53 ,
  BATTLE_FX_SHURIKEN = 54 , BATTLE_FX_ANNIHILATION = 55 , BATTLE_FX_PUNJI = 56 , BATTLE_FX_CUTTING_EDGE = 57 ,
  BATTLE_FX_RAGNAROK = 58 , BATTLE_FX_HEAT_WAVE = 59 , BATTLE_FX_PLANET_DIVER = 60 , BATTLE_FX_TITAN_BLADE = 61 ,
  BATTLE_FX_SHINING_STAR = 62 , BATTLE_FX_BLIZZARD = 63 , BATTLE_FX_DEMON_FIRE = 64 , BATTLE_FX_VORPAL_SLASH = 65 ,
  BATTLE_FX_DROWN = 66 , BATTLE_FX_TRIANGLE_STRIKE = 67 , BATTLE_FX_ASTRAL_BLAST = 68 , BATTLE_FX_GRANITE = 200 ,
  BATTLE_FX_REVIVE_201 = 201 , BATTLE_FX_VINE = 202 , BATTLE_FX_GROUND = 203 , BATTLE_FX_PLY_204 = 204 ,
  BATTLE_FX_SLEET = 205 , BATTLE_FX_WISH_206 = 206 , BATTLE_FX_HAIL = 207 , BATTLE_FX_TONIC = 208 ,
  BATTLE_FX_DEW = 209 , BATTLE_FX_IMPACT_210 = 210 , BATTLE_FX_GUARD_211 = 211 , BATTLE_FX_PSY_CRYSTAL = 212 ,
  BATTLE_FX_FLASH = 213 , BATTLE_FX_TORCH = 214 , BATTLE_FX_WARD_215 = 215 , BATTLE_FX_ZEPHYR = 216 ,
  BATTLE_FX_KITE = 217 , BATTLE_FX_BIND_218 = 218 , BATTLE_FX_GUST = 219 , BATTLE_FX_VENUS = 250 ,
  BATTLE_FX_MERCURY = 251 , BATTLE_FX_MARS = 252 , BATTLE_FX_JUPITER = 253 , BATTLE_FX_SONIC_WAVE = 300 ,
  BATTLE_FX_SHRIEK = 301 , BATTLE_FX_BANSHEE_HOWL = 302 , BATTLE_FX_CRAZY_VOICE = 303 , BATTLE_FX_WAR_CRY = 304 ,
  BATTLE_FX_WICKED_HOWL = 305 , BATTLE_FX_WING_BEAT = 306 , BATTLE_FX_WING_FLUTTER = 307 , BATTLE_FX_RUMBLE = 308 ,
  BATTLE_FX_BONE_CHILLER = 309 , BATTLE_FX_GUST_310 = 310 , BATTLE_FX_BONE_CHARGE = 311 , BATTLE_FX_MYSTIC_FLAME = 312 ,
  BATTLE_FX_NUMBING_STING = 313 , BATTLE_FX_BRUTE_FORCE = 314 , BATTLE_FX_STICKY_GOO = 315 , BATTLE_FX_CANNIBAL_FANG = 316 ,
  BATTLE_FX_BEAR_CLAW = 317 , BATTLE_FX_POISONOUS_BITE = 318 , BATTLE_FX_FLYING_ATTACK = 319 , BATTLE_FX_UNDEAD_SWORD = 320 ,
  BATTLE_FX_RANSACK = 321 , BATTLE_FX_STICKY_POISON = 322 , BATTLE_FX_POISONOUS_BITE_323 = 323 , BATTLE_FX_ELECTRIC_BITE = 324 ,
  BATTLE_FX_POISON_TAIL = 325 , BATTLE_FX_ONSLAUGHT = 326 , BATTLE_FX_VAMPIRIC_FANG = 327 , BATTLE_FX_BACTERIA_RUSH = 328 ,
  BATTLE_FX_FLYING_ATTACK_329 = 329 , BATTLE_FX_ROTTEN_BLOOD = 330 , BATTLE_FX_DOUBLE_FANG = 332 , BATTLE_FX_MORTAL_BLOW = 333 ,
  BATTLE_FX_FREEBITE_RUSH = 334 , BATTLE_FX_TWIN_BEAKS = 335 , BATTLE_FX_RABID_FANG = 336 , BATTLE_FX_ACID_BITE = 337 ,
  BATTLE_FX_DYNAMITE = 338 , BATTLE_FX_HEADBUTT = 339 , BATTLE_FX_POISON_INK = 340 , BATTLE_FX_BEAR_CLAW_342 = 342 ,
  BATTLE_FX_RANSACK_343 = 343 , BATTLE_FX_SOOTHING_STAR = 344 , BATTLE_FX_SPIDER_WEB = 345 , BATTLE_FX_HEARTRENDER_346 = 346 ,
  BATTLE_FX_MAD_SPATTER = 347 , BATTLE_FX_SPASM = 348 , BATTLE_FX_SLEEP_STAR = 349 , BATTLE_FX_DECOMPOSE = 350 ,
  BATTLE_FX_HAUNTING = 351 , BATTLE_FX_CURE_352 = 352 , BATTLE_FX_BERSERK = 353 , BATTLE_FX_CURSE_354 = 354 ,
  BATTLE_FX_SMOKE_BOMB = 380 , BATTLE_FX_WING_STROKE = 381 , BATTLE_FX_POISON_BEAT = 382 , BATTLE_FX_SPINNING_BEAT = 383 ,
  BATTLE_FX_OUTER_SPACE = 384 , BATTLE_FX_DRAGON_DRIVER = 385 , BATTLE_FX_DRAIN_FANG = 386 , BATTLE_FX_SPARK_APPROACH_VARIANT3 = 387 ,
  BATTLE_FX_THRASH = 388 , BATTLE_FX_RECOVERY = 389 , BATTLE_FX_FIRE_BLESSING = 400 , BATTLE_FX_WATER_BLESSING = 401 ,
  BATTLE_FX_ICE_BLESSING = 402 , BATTLE_FX_DARK_BLESSING = 403 , BATTLE_FX_ACID_BLESSING = 404 , BATTLE_FX_STORM_BLESSING = 405 ,
  BATTLE_FX_EVIL_BLESSING = 406 , BATTLE_FX_DEADLY_GAS = 407 , BATTLE_FX_KIND_COUNT = 408
}
 Effect kinds: the kind an ability's gBattle_ActionFlags entry selects, by the handler that plays it; a later kind that shares a handler adds its number. More...

Functions

void BattleFx_ConfigureEffectDisplay (void)
 Puts the battle screen back into the display state every effect starts from and ends with: no blending, window 0 and window 1 both covering the battle view (lines 16 to 135), and the effect display mode queued.
void BattleFx_AdvanceScrollOnInterval (void)
 Scrolls BG1 by (scrollStepX, scrollStepY) once every scrollInterval frames.
void BattleFx_AdvanceBg2OnInterval (void)
 Slides the affine BG2 in steps: once every scrollInterval frames, writes the work block's reference point (bg2x, bg2y) to BG2X and BG2Y, then moves it by (scrollStepX, scrollStepY).
void BattleFx_ArmWin0HBlankDma (void)
 Restarts DMA 0 as an HBlank transfer of one WIN0H value a line from PARTICLES (Ram_MapCellBuffer), so window 0's edges follow the per-line table the effect drew there.
void BattleFx_RunIce (struct BattleEffectArgument *effect)
 Ice shards rain down diagonally onto the targets' side of the field and shatter into puffs of sparkle, flashing and shaking each target as they land.
void BattleFx_RunDouse (struct BattleEffectArgument *effect)
 Blue bolts streak down diagonally onto the targets' side of the field, each bursting into a fountain of falling sparks where it lands, while the targets flash.
void BattleFx_RunSonicWave (struct BattleEffectArgument *effect)
 Ember streaks.
void BattleFx_RunShriek (struct BattleEffectArgument *effect)
 Lime streaks.
void BattleFx_RunBansheeHowl (struct BattleEffectArgument *effect)
 Violet streaks.
void BattleFx_RunWarCry (struct BattleEffectArgument *effect)
 Cyan streaks.
void BattleFx_RunWickedHowl (struct BattleEffectArgument *effect)
 Red streaks.
void BattleFx_RunLimeStreaks (struct BattleEffectArgument *effect)
 The streak volley in lime. UNUSED: no effect table entry points here.
void BattleFx_RunStreakVolley (struct BattleEffectArgument *effect, s32 mode)
 Fires STREAKS_MAX streaks at each target from 20 pixels above the user, one every 6 frames, each reaching 20 pixels above its target 24 frames later; each target's volley starts 32 frames after the previous one's.
void BattleFx_RunSleepStar (struct BattleEffectArgument *effect)
 Rising motes that drift onto the targets and strike.
void BattleFx_RunSoothingStar (struct BattleEffectArgument *effect)
 Rising healing motes.
void BattleFx_RunMoteFountain (struct BattleEffectArgument *effect, s32 mode)
 Motes burst out of the user in every direction and float upwards, wobbling, for 128 frames; a new group of 32 joins every 8 frames.
void BattleFx_RunNumbingSting (struct BattleEffectArgument *effect)
 One slash with glints, lightning colours.
void BattleFx_RunCannibalFang (struct BattleEffectArgument *effect)
 Three ember columns that drain the target into the user.
void BattleFx_RunPoisonousBite (struct BattleEffectArgument *effect)
 One lime column with smoke.
void BattleFx_RunRabidFang (struct BattleEffectArgument *effect)
 One column with smoke, Mars Djinn colours.
void BattleFx_RunElectricBite (struct BattleEffectArgument *effect)
 Three lightning columns with glints.
void BattleFx_RunPoisonTail (struct BattleEffectArgument *effect)
 One lime slash with smoke.
void BattleFx_RunVampiricFang (struct BattleEffectArgument *effect)
 Three columns that drain the target, Mars Djinn colours.
void BattleFx_RunDoubleFang (struct BattleEffectArgument *effect)
 Two blue columns with sparks.
void BattleFx_RunMortalBlow (struct BattleEffectArgument *effect)
 One heavy slash with sparks, Mars Djinn colours.
void BattleFx_RunTwinBeaks (struct BattleEffectArgument *effect)
 Two slashes with sparks, lightning colours.
void BattleFx_RunAcidBite (struct BattleEffectArgument *effect)
 Three pink columns with smoke.
void BattleFx_RunDrainFang (struct BattleEffectArgument *effect)
 Three additive columns that drain the target with large motes, Mars Djinn colours.
void BattleFx_RunTargetStrike (struct BattleEffectArgument *effect, s32 mode)
 Strikes the first target TARGET_STRIKE_HITS times with a sideways slash or a column of light, with the extras its flags choose, and lets the battle show the damage on the hits.
void BattleFx_RunDeathPlunge (struct BattleEffectArgument *effect)
 The user runs 9/10 of the way to the first target, then both leap and turn upside down in the air; on frame 54 the target is hit and both bounce back, while flashes burst from the user and rise in a widening ring.
void BattleFx_RunBladeRain (struct BattleEffectArgument *effect)
 Drops 16 swords, one every 4 frames, slanting in towards the first target (the middle of the canvas, x 64) and sticking in the ground, where their bottom 4 pixels are hidden.
void BattleFx_RunElementPillar (struct BattleEffectArgument *effect)
 The glow of an element around a unit: a symmetrical pillar of light stands at the unit's feet while motes spiral up around it, for 56 frames, and the first target flashes.
void BattleFx_RunShatteringOpening (struct BattleEffectArgument *effect)
 The shattering opening of the battle on the Venus aerie storm backdrop: the screen turns white and a grey disc grows from (96, 60) by 32 pixels a frame while the TileAnimationMask picture breaks into 33 pieces that fly apart and fall; background palettes 6 to 13 then ease from white back to the battle backdrop's colours, and from frame 51 32 flashes rise.
void BattleFx_RunElementBurst (struct BattleEffectArgument *effect)
 The burst of an element over a unit, for 56 frames: sparks flare at the four corners around the unit, motes spiral in, and from frame 28 a burst of light plays over the unit while the first target flashes.
void BattleFx_DrawStreaks (void)
 Draws a frame of the element streak burst: on its first frame seeds 256 streaks with random axes, then each frame draws the first 64 (streak i from frame i / 4) as lines three pixels thick that shrink 4 pixels a frame towards the centre of the canvas, a little below its middle.
void BattleFx_StartElementStreaks (s32 element)
 Starts the element streak burst and returns at once: opens the canvas and schedules BattleFx_DrawStreaks with a canvas that darkens each frame.
void BattleFx_EndElementStreaks (void)
 Ends the element streak burst that BattleFx_StartElementStreaks started: stops its callbacks and the background palette fade, clears the canvas in VRAM and frees the work and the canvas.
void BattleFx_RunPoisonBeat (struct BattleEffectArgument *effect)
 A lime swipe that knocks the target back.
void BattleFx_RunSpinningBeat (struct BattleEffectArgument *effect)
 A magenta swipe that throws the target into the air.
void BattleFx_RunSwirlSwipe (struct BattleEffectArgument *effect, s32 mode)
 A swirling swipe across the first target, six images four frames each, from the user's side: the first four from the swirl sheet, the last two from the tail sheet.
void BattleFx_RunSpiderWeb (struct BattleEffectArgument *effect)
 A spider web spreads over the targets, drawn as four mirrored 32x32 quarters around the point between the first and last target.
void BattleFx_WipeCanvas (s32 mode, s32 value)
 Wipes the whole canvas to one colour with a ragged edge: each row (or column) lags a random 0 to 63 pixels behind the front, which speeds up as it goes.
void BattleFx_ProcessPendingGraphicsTransfer (void)
 Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128 canvas into BG2's character block 1, the way transferMode says, leaving the canvas cleared, faded, darkened or brightened for the next frame.
void BattleFx_FlushPendingGraphicsTransfer (void)
 Copies a full-screen picture to VRAM once the effect has finished drawing a frame: the 0x7800 bytes of Ram_MapCellBuffer into BG character block 2 (0x06008000), the way transferMode says (modes 0 to 3; brightening is not offered).
void Graphics_ApplyWindowBlendRegisters (void)
 Writes the window, display and blend registers the effect keeps in its work, all at once.
void Display_ApplyBg2Reference (void)
 Writes the effect's BG2 reference point (work->bg2x, work->bg2y) to BG2X and BG2Y.
void Palette_StepFadeTransfer (void)
 Darkens the battle backdrop while the canvas is open: for fadeFrames frames, writes the backdrop's colours one CANVAS_FADE_STEP darker each frame into background palettes 6 to 13, so the effect stands out.
void BattleFx_ClearActorTimers (void)
 Clears every target's flash timer (work->actorTimers).
void ObjectGroup_TickMemberTimers (void)
 Counts down each target's flash timer, which ObjectGroup_UpdateMembers starts; when one runs out, the target gets its own palette back.
void BattleFx_BeginCanvasLayer (s32 bgControl)
 Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over the battle, inside the effect windows, and clears the canvas.
void BattleFx_OpenCanvasLayer (s32 bgControl)
 Opens the canvas layer as BattleFx_BeginCanvasLayer does, but with the windows off until the end, the backdrop palette starting half faded, and a 24-frame fade.
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 followed by 16 of tile 0, so the canvas repeats across the screen with gaps.
void BattleFx_EndCanvasLayer (void)
 Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre, clears the canvas tiles, stops the palette fade and brings the backdrop's palette back from level 21 to 0 over 8 frames, then shows BG2 again and hides BG1.
void BattleFx_HideBg1AndRestoreBackdrop (void)
 Hides BG1 and the windows and starts bringing the backdrop's palette back.
void BattleFx_SetupCanvasTileMap (void)
 Shows the canvas on BG1 instead of BG2, at its own size: BG1 becomes a 256-colour layer whose map points 16 rows of 16 tiles at the canvas (tiles 0x100 onwards, which at 64 bytes a tile start at character block 1, where the canvas lives), with blank tile 0xff to the right, blended over the rest inside the effect windows.
void BattleFx_DrawClippedCanvasLine (s32 x0, s32 y0, s32 x1, s32 y1, s32 color)
 Draws a line on the 128x128 8bpp canvas (16 tiles across), keeping the brighter colour where it crosses what is already drawn.
void BattleFx_RunPlanetDiver (struct BattleEffectArgument *effect)
 The user flashes and leaps into the air, turns into a ball of fire, falls onto the first target and bursts into chips that bounce on the ground.
void BattleFx_RunHaunt (struct BattleEffectArgument *effect)
 Skulls close in on each target in turn.
void BattleFx_RunOrbitingSpirals (struct BattleEffectArgument *effect)
 Four spirals circle 40 pixels above each target in turn, 16 frames apart, for 60 frames each, 16 pixels out from the centre; each target takes its damage pose halfway through.
void BattleFx_RunDemonNight (struct BattleEffectArgument *effect)
 Sixteen pink lights burst out of the user and are pulled into each target, with the heavy impact sound.
void BattleFx_RunRumble (struct BattleEffectArgument *effect)
 Eight lights in Mars Djinn colours burst out of the user and are pulled into each target.
void BattleFx_RunHaunting (struct BattleEffectArgument *effect)
 Twelve lights in Mercury Djinn colours burst out of the user and are pulled into each target.
void BattleFx_RunGatheringLights (struct BattleEffectArgument *effect, s32 mode)
 For each target in turn, 20 frames apart, lights burst out of the user, one every 2 frames; from 30 frames into the turn, one more each frame is pulled towards the middle of the target's body, and goes out when it is within 32 pixels across and in depth.
void BattleFx_FetchRectangleBlitters (s32 flip, BlitterPair out)
 Builds the two usual routines that draw onto the 128x128 canvas, both clipped on both axes.
void BattleFx_RunBerserk (struct BattleEffectArgument *effect)
 The wall rises wide and shakes the screen hard.
void BattleFx_RunSpasm (struct BattleEffectArgument *effect)
 The wall rises with a long gentle shake and the recovery sound.
void BattleFx_RunRecovery (struct BattleEffectArgument *effect)
 A wide wall of fire, without a shake.
void BattleFx_RunMirroredWall (struct BattleEffectArgument *effect, s32 mode)
 Raises a symmetrical wall (the EarthWall images) at the first target's feet for 48 frames; the target glows and the battle shows the result on frame 24.
void BattleFx_RunRevive (struct BattleEffectArgument *effect)
 With a Venus Djinni: beams of light, where motes drift down over each target and a column of light falls on it.
void BattleFx_RunDew (struct BattleEffectArgument *effect)
 With a Mercury Djinni: the same beams of light as Revive.
void BattleFx_RunDjinnBeams (struct BattleEffectArgument *effect, s32 mode)
 When effect->prelude is 1, a Djinni appears, sways and then rises out of sight.
void BattleFx_RunMadSpatter (struct BattleEffectArgument *effect)
 Gold shells that burst into shards.
void BattleFx_RunDecompose (struct BattleEffectArgument *effect)
 Green shells that burst into smoke.
void BattleFx_RunBoneChiller (struct BattleEffectArgument *effect)
 Blue shells that burst into smoke.
void BattleFx_RunStickyGoo (struct BattleEffectArgument *effect)
 Shells in the spider web's colours that burst into smoke.
void BattleFx_RunPoisonInk (struct BattleEffectArgument *effect)
 Shells in Mars Djinn colours that burst into smoke.
void BattleFx_RunStickyPoison (struct BattleEffectArgument *effect)
 Lime shells that burst into smoke.
void BattleFx_RunRottenBlood (struct BattleEffectArgument *effect)
 Green shells that burst into shards.
void BattleFx_RunLobbedShells (struct BattleEffectArgument *effect, s32 mode)
 Lobs a shell from the user at each target in turn, 8 frames apart.
void BattleFx_RunCondemn (struct BattleEffectArgument *effect)
 A tall panel (57x98) swings across the screen three times, each pass fading out through a ripple, the last over the first target; on frame 88 it shatters in a white flash into a burst of larger pieces and the target is knocked back, bouncing on frame 120.
void Graphics_ConvertBackgroundToBlueRamp (void)
 Turns the screen into shades of blue, top down, with a ragged edge.
void BattleFx_RunBind (struct BattleEffectArgument *effect)
 A triangle of light spins and shrinks onto the first target for 64 frames, then a rune stands on the target; the battle shows the result on frame 64.
void BattleFx_RunTriangleStrike (struct BattleEffectArgument *effect)
 The spinning triangle and rune of BattleFx_RunBind without the Djinni; on frame 46 the user steps up to the first target.
void BattleFx_RunAstralBlast (struct BattleEffectArgument *effect)
 Three star-shaped rings of light fly from 40 pixels above the user at the first target, 12 frames apart, growing and spinning as they go, while the camera swings round; each knocks the target back on arrival, and the third lets the battle show the damage.
void BattleFx_RunShiningStar (struct BattleEffectArgument *effect)
 Eight spinning star outlines fall from 120 pixels above the user towards the first target, a few frames apart, and bounce off the ground near it, each bounce shaking the screen and flashing the targets; the battle shows the damage on frame 96.
void BattleFx_RunProcne (struct BattleEffectArgument *effect)
 A whirlwind lifts the targets, then comets from a block of objects in a violet sky strike them.
void BattleFx_RunDragonDriver (struct BattleEffectArgument *effect)
 The rising embers from the user's side, in the LightningBolt colours.
void BattleFx_RunTiamat (struct BattleEffectArgument *effect)
 The rising embers with a formation of eight objects that sweeps in and explodes at the end.
void BattleFx_RunPaletteParticles (struct BattleEffectArgument *effect, s32 mode)
 A 208-frame effect of embers rising from the ground; pressing A or B during frames 49 to 159 skips to frame 160.
void BattleFx_RunNereid (struct BattleEffectArgument *effect)
 A formation of twelve objects sweeps in among embers and columns of fire, and explodes.
void BattleFx_RunFroth (struct BattleEffectArgument *effect)
 Motes fly out of the top of the user, hang, and from 48 frames after each appears home in on the targets in turn; each that reaches the ground strikes in a burst, flashing and knocking back its target, while the camera swings round over frames 17 to 63.
void BattleFx_RunWhirlwind (struct BattleEffectArgument *effect)
 Tornadoes sweep across the targets for 80 frames, sparkling with glints; the canvas flashes and the targets reel seven times, 8 frames apart, from frame 16, and the battle shows the damage on frame 32.
void BattleFx_RunPrism (struct BattleEffectArgument *effect)
 Crystals drop out of the sky onto the targets' side, 8 frames apart, and shatter on the ground into 16 spinning shards each, flashing the targets and shaking the screen; the battle shows the damage 80 frames before the end, and the canvas darkens away over the last 8.
void Graphics_UpdatePhasePalette (s32 frame, s32 redPhase, s32 greenPhase, s32 bluePhase)
 Rebuilds the background palette's first ramp as a grey ramp whose red, green and blue each sway with the frame, out of step by their phases (1/65536ths of a turn), so the effect shimmers through colours.
void BattleFx_RunPlasma (struct BattleEffectArgument *effect)
 Pillars of lightning strike one every 8 frames, each with a white flash, throwing sparks up from the ground and knocking the targets back; the battle shows the damage on frame 32.
void BattleFx_RunNova (struct BattleEffectArgument *effect)
 Bursts at (60, 48), the canvas behind the battle's first layer (priority 1).
void BattleFx_RunDynamite (struct BattleEffectArgument *effect)
 Orange bursts at (60, 64), the canvas in front (priority 0).
void BattleFx_RunSparkGroups (struct BattleEffectArgument *effect, s32 mode)
 One to three bursts, 8 frames apart: each flashes, rings itself with twelve smaller flashes that fade, and throws out sparks that bounce on the ground; every burst knocks the targets back.
void BattleFx_RunVolcano (struct BattleEffectArgument *effect)
 One, two or four columns of fire (gVolcano_Counts by effect->variant) rise near the far edge on the targets' side, at the depths of gVolcano_Depths, starting at gVolcano_StartFrames; each erupts with a fountain of 200 sparks and keeps spitting more, and each eruption knocks the targets back.
void BattleFx_RunTaint (struct BattleEffectArgument *effect)
 Lime smoke (effect->variant 0) or pink smoke.
void BattleFx_RunTargetMotesMode1 (struct BattleEffectArgument *effect)
 Pink smoke; no ☀️ effect table entry points here.
void BattleFx_RunDelude (struct BattleEffectArgument *effect)
 Cyan smoke that rises.
void BattleFx_RunParalyze (struct BattleEffectArgument *effect)
 Rising smoke with glints.
void BattleFx_RunHeartrender (struct BattleEffectArgument *effect)
 Hearts.
void BattleFx_RunMysticFlame (struct BattleEffectArgument *effect)
 Glowing orbs.
void BattleFx_RunDemonFire (struct BattleEffectArgument *effect)
 Glowing orbs in Mars Djinn colours, and the user strikes.
void BattleFx_RunDrown (struct BattleEffectArgument *effect)
 Vortex motes.
void BattleFx_RunTargetMotes (struct BattleEffectArgument *effect, u32 mode)
 Around each target in turn, 8 frames apart, motes (smoke, hearts, orbs) turn about a point 20 pixels up, either closing in on it or rising, and the target flashes until the end; the battle shows the damage 32 frames before the end.
void BattleFx_RunSleep (struct BattleEffectArgument *effect)
 Twelve sheep drop onto the targets' side, one every 4 frames, tumbling through eight images (the last four mirrored both ways); each target takes its damage pose in turn from frame 64, and the battle shows the result on frame 80.
void BattleFx_RunCurse (struct BattleEffectArgument *effect)
 A small flame burns above each target in turn, 16 frames apart, for 72 frames each, over a marker at its feet; the battle shows the result on frame 32.
void BattleFx_RunDjinnHeal (struct BattleEffectArgument *effect)
 A small Mercury Djinni healing the party: the user glows while motes swirl round a point that rises from the user up to above the first target (frames 30 to 69); the Djinni appears there on frame 83.
void Camera_ApplyPhasedDelta (void)
 Turns the battle camera by cameraDelta.
void BattleFx_CallDoNothing (s32 count)
 Calls the empty BattleFx_DoNothing count times, without waiting for a frame: a busy delay that changes no state.
void BattleFx_RunSceneEffect (struct BattleEffectArgument *effect)
 Runs one of the large battle effects, the ones whose presentation flags have bit 15 set: takes the effect's sheet, work and canvas, runs the effect chosen by its kind to the end, and frees them again.
void BattleFx_RunTableEffect (struct BattleEffectArgument *effect)
 Runs an ordinary battle effect: takes the effect's sheet, work and canvas, runs the entry of gBattleFx_EffectHandlers for its kind, and frees them again.
void BattleFx_BuildWindowEdgeTable (void)
 Builds window 0's right edge for every scanline and restarts the HBlank DMA that writes it to WIN0H each line.
void BattleFx_SelectLivingTargets (struct BattleEffectArgument *effect)
 Shows the battle objects of every unit with HP left on the targets' side: the enemies (units 128 to 133) when the first target is one, otherwise the party (units 0 to 7).
void BattleFx_SetupBlendedDisplay (void)
 Shows the BG1 battle background behind a cleared canvas: clears the canvas buffer and the 16 KiB of VRAM it is copied to, then blends BG2 over the rest at 14/16 and moves the projection centre down to line 120.
void ObjectGroup_UpdateMembers (s32 actorId, s32 palette, s32 animation, s32 timerSlot, s32 timerFrames)
 Updates every animation group of one battler's object.
void BattleFx_InitTilemapAndFlushQueue (void)
 Writes the tiled canvas tilemap for BG2 (priority 1), then closes the canvas layer again, which fades the background palette back in.
void BattleFx_RunCybele (struct BattleEffectArgument *effect)
 Thorn vines: thorns fly in from the right, vines grow out of the ground and lift the targets while sparks flash around them, the picture dissolves pixel by pixel, and the targets drop and explode.
void BattleFx_RunBoreas (struct BattleEffectArgument *effect)
 Rocks and ice blocks: a window opens on rocks that crumble, a big ice block drops and throws up spray; then ice blocks rain down on the targets, and boulders crumble into bouncing chips.
void BattleFx_RunBreak (struct BattleEffectArgument *effect)
 Ice shards burst up from each target in turn, 20 frames apart, tinting the target as they go, and fall away below line 112.
void BattleFx_RunDrain (struct BattleEffectArgument *effect)
 Drain: motes of light burst from each target in turn, 20 frames apart, and are pulled into the centre of the user's body.
void BattleFx_RunPly (struct BattleEffectArgument *effect)
 Ply: sparkles of light swirl around each target and close in on it, in the ice shard's or ice block's colours; the canvas is shown at its own width, centred on the first target.
void BattleFx_RunWish (struct BattleEffectArgument *effect)
 Wish (scattering style 1): healing motes tumble in from all around each target.
void BattleFx_RunCure (struct BattleEffectArgument *effect)
 Cure (mode 2): a ring of healing motes below each target closes in on it, in the blast sheet's colours.
void BattleFx_RunCurePoison (struct BattleEffectArgument *effect)
 Cure Poison: sparkles twinkle around each target, four more a frame, and go out one by one instead of closing in.
void BattleFx_RunHealingMotesMode4 (struct BattleEffectArgument *effect)
 Healing sparkles with scattering style 4, sent out from each target, as Cure Poison plays them for variants other than 0.
void BattleFx_RunTonic (struct BattleEffectArgument *effect)
 Tonic (scattering style 5): sparkles twinkle around each target, turning on two axes, and go out one by one; mode 5 plays as mode 4 does.
void BattleFx_RunPsyCrystal (struct BattleEffectArgument *effect)
 Psy Crystal: healing motes gather around each target in the Mars Djinni palette; with a prelude, a Mars Djinni appears first.
void BattleFx_RunHealingMotes (struct BattleEffectArgument *effect, u32 mode)
 Healing sparkles: motes of light scattered around each target swirl in towards it, one target every 8 frames, with the recovery sound on each target's 20th frame and a tint on its 36th.
void BattleFx_RunImpact (struct BattleEffectArgument *effect)
 Gathers stat-boost light and displays a dagger in Mars colours.
void BattleFx_RunGuard (struct BattleEffectArgument *effect)
 Gathers stat-boost light and displays a shield in Mars colours.
void BattleFx_RunWard (struct BattleEffectArgument *effect)
 Gathers stat-boost light and displays a shield in Jupiter colours.
void BattleFx_RunGranite (struct BattleEffectArgument *effect)
 Gathers stat-boost light and displays a violet streak in Venus colours.
void BattleFx_RunFlash (struct BattleEffectArgument *effect)
 Gathers stat-boost light and displays a violet streak in Mars colours.
void BattleFx_RunZephyr (struct BattleEffectArgument *effect)
 Gathers stat-boost light and displays a wisp without replacing its palette.
void BattleFx_RunStatBoost (struct BattleEffectArgument *effect, u32 mode)
 Flares of light swirl in to the centre of each target, one target every 8 frames, burst, and the mode's picture plays.
void BattleFx_RunDull (struct BattleEffectArgument *effect)
 Breaks the dagger picture into shards that fade through darker copies.
void BattleFx_RunImpair (struct BattleEffectArgument *effect)
 A shield appears over each target and breaks into shards that fade through darker copies, in the glow orb's colours (style 1).
void BattleFx_RunWeaken (struct BattleEffectArgument *effect)
 A shield appears over each target and breaks into fading shards, in the pink burst's colours (style 2).
void BattleFx_RunStatReductionMode3 (struct BattleEffectArgument *effect)
 Breaks the shield picture into fading shards with style 3, which plays as style 2 does.
void BattleFx_RunStatReduction (struct BattleEffectArgument *effect, s32 mode)
 Stat cuts: a dagger (mode 0) or a shield (other modes) appears over each target, 4 frames apart, and then breaks into 24 shards that fly off and fade out through the darker copies.
void BattleFx_RunFlare (struct BattleEffectArgument *effect)
 Flame arc: nine flames rise one after another, 4 frames apart, along a half circle, over 80 frames.
s32 BattleFx_BuildCenteredIndexList (BattleEffectIndexWindow *window, s16 *output)
 List the indices within indexRadius of where currentValue sits in values, keeping only those from 0 to entryLimit - 1.
void BattleFx_RunQuake (struct BattleEffectArgument *effect)
 Rock wall: three rock pillars rise from the left, 4 frames apart, and sink again, throwing the targets standing on them into the air.
void BattleFx_RunFire (struct BattleEffectArgument *effect)
 Homing embers: embers burst from the top of the user two a frame, turn towards the targets 48 frames after they appear, and each one that hits the ground shows an impact flare for 12 frames as its target flinches.
void BattleFx_RunFrost (struct BattleEffectArgument *effect)
 Rising motes: motes spiral upwards while ice columns spring up one every 3 frames from frame 36; at the burst frame the motes spread and fall, chips fly and smoke rises over the heights they span.
void BattleFx_RunRay (struct BattleEffectArgument *effect)
 Closing bolts: four bolts turn in towards the centre for 16 frames, scattering sparks from their roots; the sparks fly on until frame 64.
void BattleFx_RunSmokeBomb (struct BattleEffectArgument *effect)
 A fountain of grey motes and puffs of smoke bursts up beside the targets and falls back, flashing each target.
void BattleFx_RunBlast (struct BattleEffectArgument *effect)
 A fountain of fire-coloured motes and puffs of smoke bursts up beside the targets and falls back, flashing each target and making it recoil.
void BattleFx_RunEruption (struct BattleEffectArgument *effect, s32 mode)
 A fountain of motes and puffs of smoke bursts up beside the targets and falls back, hitting the targets one frame apart from frame 6.
void BattleFx_SpawnObjects (s32 entryCount, s32 source, u32 priority)
 Creates the effect's animation objects in gBattleFxWork's objects.
void BattleFx_DoNothing (void)
 Does nothing.
void BattleFx_ArmBg2AffineHBlankDma (void)
 Arms DMA 0 to copy one word of gBattleFxWork's bg2xLines table into BG2X at each horizontal blank, bending BG2 line by line.
void BattleFx_RunFireBlessing (struct BattleEffectArgument *effect)
 The user fires a stream of flash bursts at the targets, one a frame, each towards a random point near a target.
void BattleFx_RunWaterBlessing (struct BattleEffectArgument *effect)
 The user fires a stream of bursts at the targets in the water-spray palette.
void BattleFx_RunDarkBlessing (struct BattleEffectArgument *effect)
 The user fires a stream of grey bursts at the targets, which turn solid black and stay so.
void BattleFx_RunAcidBlessing (struct BattleEffectArgument *effect)
 Fires pink bursts from 16 pixels below the normal origin.
void BattleFx_RunStormBlessing (struct BattleEffectArgument *effect)
 Shows violet lightning between the user and targets instead of bursts: a bolt flickers through three pictures in front of the user, and the targets flash in turn without being knocked back.
void BattleFx_RunEvilBlessing (struct BattleEffectArgument *effect)
 The user fires a stream of demon faces at the targets, from 16 pixels in front of it.
void BattleFx_RunDeadlyGas (struct BattleEffectArgument *effect)
 The user fires a stream of Mars-coloured bursts at the targets, from 28 pixels in front of it.
void BattleFx_RunBurstShower (struct BattleEffectArgument *effect, s32 mode)
 Burst shower: for 48 frames the user fires one burst a frame at a random point near one of the targets, taking them in turn, and each target is hit every 8 frames.
void BattleFx_RunSwirlingStars (struct BattleEffectArgument *effect)
 Swirling stars: 64 stars scattered around a point 80 pixels up spin about it, each on its own axis, appearing four a frame; 30 frames after it appears, each star is drawn back towards the centre.
void BattleFx_RunOrbitingSkulls (void)
 Orbiting skulls: three skulls circle each target in turn, 16 frames apart, for 64 frames each, a third of a turn apart on a circle of 8 pixels around the target.
void BattleFx_RunTargetBursts (struct BattleEffectArgument *effect)
 Target bursts: on each target in turn, 8 frames apart, a burst flares up in the middle while five puffs of smoke scatter around it, for 40 frames.
void BattleFx_RunAtalanta (struct BattleEffectArgument *effect)
 Rain of blades: under a violet sky, a 3x3 formation of objects flies along a stored path while sixteen blades gather trails of light, flash and fly off; A or B skips ahead.
void BattleFx_RunGrowth (struct BattleEffectArgument *effect)
 Grows vines from the ground, scattering dust from each root.
void BattleFx_RunPunji (struct BattleEffectArgument *effect)
 Grows green pillars from the ground, scattering dust from each root.
void BattleFx_RunGrowingColumns (struct BattleEffectArgument *effect, s32 mode)
 Vines (mode 0) or green pillars (mode 1) grow one every 4 frames, alternately mirrored, each throwing up dust from its root.
void BattleFx_RunVine (struct BattleEffectArgument *effect)
 Rising vines: sixteen green vines grow from the middle of the row of targets, 2 frames apart, and shrink back.
void BattleFx_RunThorn (struct BattleEffectArgument *effect)
 Rising thorns: thorns burst from the ground one every 8 frames, throwing up dust from their roots.
void BattleFx_RunBolt (struct BattleEffectArgument *effect)
 A bolt of lightning strikes each target in turn, 8 frames apart.
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 the Djinni, which sways for 16 frames and bursts into motes.
void BattleFx_RunSlash (struct BattleEffectArgument *effect)
 Six comets fly at each target, three frames apart, and burst into a flash and sparks; the effect's variant picks one of three comets.
void BattleFx_RunShuriken (struct BattleEffectArgument *effect)
 Four spinning shurikens fly at each target, five frames apart, and vanish once past it.
void BattleFx_RunCrazyVoice (struct BattleEffectArgument *effect)
 Ten pellets fly slowly at each target and bounce off it, up or down at random.
void BattleFx_RunWingFlutter (struct BattleEffectArgument *effect)
 Five yellow sparks fly level at each target, five frames apart.
void BattleFx_RunWingStroke (struct BattleEffectArgument *effect)
 Ten large yellow sparks stream level at each target, one a frame, spread up and down.
void BattleFx_RunWingBeat (struct BattleEffectArgument *effect)
 Ten small yellow sparks stream level at each target, one a frame.
void BattleFx_RunCuttingEdge (struct BattleEffectArgument *effect)
 From the user's action pose, one large comet in ice colours flies at each target and bursts into 80 sparks.
void BattleFx_RunHeatWave (struct BattleEffectArgument *effect)
 From the user's action pose, seven fireballs trailing embers fly at each target, two frames apart, each bursting into 40 sparks.
void BattleFx_RunSleet (struct BattleEffectArgument *effect)
 Thirty ice chips fall from high above the user onto each target, without shaking the screen or knocking the target back; the battle shows the damage on frame 48.
void BattleFx_RunIceBlessing (struct BattleEffectArgument *effect)
 Sixty ice chips stream at each target, one a frame, without knocking it back.
void BattleFx_RunBlizzard (struct BattleEffectArgument *effect)
 From the user's action pose, sixty ice chips stream at each target, one a frame, scattered up and down, without knocking it back.
void BattleFx_RunProjectileVolley (struct BattleEffectArgument *effect, s32 mode)
 Projectile volley: shots fly from the user to each target and burst into a flash and sparks when they pass it.
void BattleFx_InitializeRisingObject (s32 id)
 Sends a battler back to its place (its anchor) with a hop.
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.
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_RunBoneCharge (struct BattleEffectArgument *effect)
 Rushes the target and scatters sparks in the fire pillar palette.
void BattleFx_RunBruteForce (struct BattleEffectArgument *effect)
 Rushes the target and scatters sparks in the ice-block palette.
void BattleFx_RunOnslaught (struct BattleEffectArgument *effect)
 Rushes the target and scatters sparks in the pink-burst palette.
void BattleFx_RunHeadbutt (struct BattleEffectArgument *effect)
 Rushes the target and scatters sparks in the blast palette.
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 it hits and 64 sparks scatter, over 60 frames in all.
void Graphics_TransposeCopy (const u8 *src, u8 *dst, s32 w, s32 h)
 Copies a w x h byte picture into an h x w one turned 90 degrees clockwise: the top row of src becomes the right column of dst.
void BattleFx_RunMercury (struct BattleEffectArgument *effect)
 Mercury Djinni flames: the small Mercury Djinni spirals around (96, 60) and fires five blue flames to the left; each flame shatters into 32 motes after 5 frames, hitting every target.
void BattleFx_RunJupiter (struct BattleEffectArgument *effect)
 Jupiter Djinni fall: the small Jupiter Djinni spirals while eight flameballs fall from the top right to the bottom left, 4 frames apart; each shatters into 32 motes below line 95, hitting every target.
void Resource_LoadAndDecompress (s32 id, void *dst, s32 skipPalette, s32 copyPalette)
 Decompresses a resource whose first 128 bytes may be a palette.
void BattleFx_RunVenus (struct BattleEffectArgument *effect)
 Venus Djinni columns: the small Venus Djinni sways while ten columns of flame in its colours rise from the ground one after another, each bursting into motes and hitting every target.
void BattleFx_RunMars (struct BattleEffectArgument *effect)
 Mars Djinni flames: a glowing orb flares, the small Mars Djinni dives to the ground, and nine flames erupt in a row while embers rise.
void BattleFx_RunHail (struct BattleEffectArgument *effect)
 Water burst: after a Mercury Djinni enters, ice chips burst out of the first target and waves rise along the bottom of the screen; the canvas fades out over the last 16 of its 64 frames.
void BattleFx_RunGround (struct BattleEffectArgument *effect)
 Venus Djinni rock toss: after a Venus Djinni enters, six rocks rise from the user shedding chips, swirl, and home in on the first target, each hitting it as it lands.
void Camera_ApplyShake (s32 rangeX, u32 rangeY)
 Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre by a random offset; once the shake runs out, BG1 returns to its saved position and the centre to (120, 120).
void BattleFx_RunThor (struct BattleEffectArgument *effect)
 The scene plays in two parts on the effect canvas.
void BattleFx_RunSpire (struct BattleEffectArgument *effect)
 Shattering rocks: boulders drop along the row of targets, centred on it, and burst into tumbling shards, hitting every target as each lands.
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 canvas with light.
void BattleFx_RunBearClaw (struct BattleEffectArgument *effect)
 Bear Claw: five strikes, the burst scene in mode 0.
void BattleFx_RunRansack (struct BattleEffectArgument *effect)
 Ransack: the same five strikes as Bear Claw (mode 0).
void BattleFx_RunBacteriaRush (struct BattleEffectArgument *effect)
 Bacteria Rush: seven strikes in the lime palette (mode 1).
void BattleFx_RunFreebiteRush (struct BattleEffectArgument *effect)
 Freebite Rush: nine strikes in the blue palette (mode 2).
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_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 (or, in rows with arc sheet 0, a wave for the third and fourth of every four), flashes and throws motes.
void BattleFx_RunGaia (struct BattleEffectArgument *effect)
 Rising wall: the ground swells, a wall of rock rises from it, stands while rocks tumble up its face and the targets are battered, and sinks again.
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, then damps every speed by damping / 64.
void EffectStep_AdvanceWithGravity2D (struct EffectStep *step, s32 damping, s32 gravity)
 Moves a particle one frame on the screen: adds its velocity, then gravity to its vertical speed, then damps both speeds by damping / 64.
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 projection's scale.
void EffectPosition_ProjectSprite (s32 id, struct EffectPosition *position)
 The screen position of a battler's sprite, at its scaled height, 16 pixels higher.
void EffectPosition_ProjectScaledBattler (s32 id, struct EffectPosition *position)
 The screen position of a battler, scaled for the battle view, 16 pixels higher.
void EffectPosition_ProjectBattler (s32 id, struct EffectPosition *position)
 The screen position of a battler, 16 pixels higher.
s32 BattleUnit_ProjectToScreen (s32 unit, s32 *screen)
 Projects a battler onto the screen, raised by half its table height (the table holds the full height in 16.16) at the sprite's scale.
void BattleFx_ProbeKeysForExtendedActor (void)
 Reads the held keys when the first target is an enemy (id 128 or more) and does nothing with them.
void BattleFx_DispatchByIdRange (struct BattleEffectArgument *effect)
 Runs a battle effect from the second range of kinds: 100 to 135 are the casting impacts (kind - 100), 136 to 199 the beam sequences, 200 and up the ring and spark scenes.
void BattleFx_RunBeamSequence (struct BattleEffectArgument *effect)
 Draws the selected beam and its projected sparks over the first target: a beam, arc or wave shoots from the user; from frame 4 the target is hit, a yellow orb flashes over it and sparks fly off, for 32 frames in all.
void BattleFx_RunRingAndSparkScene (struct BattleEffectArgument *effect)
 Plays the selected ring-and-spark strike, restoring the user motion after it.
void BattleFx_StepPaletteToResource (s32 resourceId)
 Moves each RGB555 channel of background colours 0 to 63 one level towards the resource palette.
void BattleFx_RunCastingImpact (struct BattleEffectArgument *effect, s32 mode)
 Gathers sparks around the caster, launches the Djinni and draws the impact on the first target.
void BattleFx_RunTorch (struct BattleEffectArgument *effect)
 A fiery disc fades in, its rings running outward while every scanline ripples, then fades out.
void BattleFx_RunKite (struct BattleEffectArgument *effect)
 Shows the extended Jupiter Djinni prelude over the first target, mirrored from the usual side; the Djinni's entrance is the whole effect.
void BattleFx_RunHelmSplitter (struct BattleEffectArgument *effect)
 The user leaps at the first target and strikes through a fire swirl; on frame 18 the target flashes and reels and 16 sparks scatter, bouncing off the ground.
void BattleFx_PlaceFormationObjects (s32 formation, s32 x, s32 z)
 Arranges work->objects in a formation; x and z are its origin in 16.16 pixels.
void BattleFx_RunImpactBurst (s32 formation, s32 x, s32 y)
 Opens an impact flash and scatters sparks and fragments, keeping the effect's objects in formation for the first 36 frames.
void Palette_BrightenBgEntries (s32 blueStep, s32 greenStep, s32 redStep)
 Adds per-channel steps to background colours 1 to 63, capped at 31.
void BattleFx_ArmPaletteHBlankDma (void)
 Arms DMA 0 to write one halfword of the table at work->sheet + 0x1f80 into background colour 0 at each horizontal blank, so the backdrop colour changes line by line.
void BattleFx_RunMeteor (struct BattleEffectArgument *effect)
 A formation rises out of a dissolving starfield and bursts into embers and flashes: the particle stream in mode 0, with one spawned object rising.
void BattleFx_RunOuterSpace (struct BattleEffectArgument *effect)
 The user leaps up, and two objects rise out of a dissolving starfield and burst into embers and flashes: the particle stream in mode 1, in the lightning bolt's colours.
void BattleFx_RunParticleStreams (struct BattleEffectArgument *effect, s32 mode)
 The stream runs in two halves.
void BattleFx_RunRamses (struct BattleEffectArgument *effect)
 Over the desert backdrop a formation stands while an orb circles above it, drops three times throwing puffs, and flies off; RAMSES_ROCKS rocks fall and bounce, and the orb's flight ends in a burst of RAMSES_SPARKS sparks from PARTICLES.
void BattleFx_RunDragonCloud (struct BattleEffectArgument *effect)
 A flame leaves the user along a stored path with a fading trail of 19 copies behind it, then strikes the first target on DRAGON_CLOUD_STRIKE_FRAME and bursts into embers and flashes.
void BattleFx_RunAnnihilation (struct BattleEffectArgument *effect)
 The user closes on the first target and fire bursts from it in a shower of shards.
void BattleFx_RunRagnarok (struct BattleEffectArgument *effect)
 A huge flaming blade swings down over the targets and two columns of light strike through them.
void BattleFx_RunTitanBlade (struct BattleEffectArgument *effect)
 A huge sword drops onto the first target amid charging flashes, dust and sparks.
void BattleFx_RunJudgment (struct BattleEffectArgument *effect)
 The battle wipes away to a violet sky where a formation flies forward while motes gather into it, bursts in a flash and sends out a ring of light.
void BattleFx_RunKirin (struct BattleEffectArgument *effect)
 Over a scrolling forest a row of objects rides in on a wave trailing fire, then sweeps across the targets, each throwing a burst of motes as the row passes it.
void Graphics_ResetBg2Pa (void)
 Sets BG2's horizontal scale back to one texel a pixel, for the lines above Graphics_SetBg2AffineScaleHalf's interrupt.
void Graphics_SetBg2AffineScaleHalf (void)
 Stretches BG2 to twice its width from the current line down.
void BattleFx_RunNeptune (struct BattleEffectArgument *effect)
 Over dusk clouds a formation of objects flies in through rising spray, gathers a ring of flares into a burst of light, then five blue flame columns drop onto the targets, throwing sparks.
void BattleFx_RunThrash (struct BattleEffectArgument *effect)
 The user leaps high at the first target, then a burst of 32 sparks rises beneath it.
void BattleFx_RunSparkApproachVariant3 (struct BattleEffectArgument *effect)
 The user leaps at the first target, then a burst of 340 sparks rises beneath it and the canvas flashes.
void BattleFx_RunQuickStrike (struct BattleEffectArgument *effect)
 The user leaps at the first target, four pictures flash across the effect layer, then it fills with one colour as the target is struck.
void BattleFx_RunVorpalSlash (struct BattleEffectArgument *effect)
 The user steps up to the first target, four pictures flash across the effect layer, then it fills with one colour as the target is struck.
void BattleFx_RunFlashingStrike (struct BattleEffectArgument *effect, s32 mode)
 Plays a flashing strike, the runner of BattleFx_RunQuickStrike (mode 1) and BattleFx_RunVorpalSlash (mode 2); nothing passes mode 0.
void BattleFx_RunUndeadSword (struct BattleEffectArgument *effect)
 Two mirrored columns of light rise at the first target's feet and sink again, scattering 16 sparks that drift upward; the target is struck on frame 10.
s32 BattleFx_BuildBlitter (s32 slot, s32 widthShift, s32 heightShift, s32 flags, u32 mode)
 Writes a drawing routine for the canvas into heap slot slot, built from the template BattleFx_Composite for one clip, mirroring and blend mode.

Variables

BattleFxHandler gBattleFx_EffectHandlers []
 The handlers by kind less one (effect_table.c); BattleFx_RunTableEffect calls the one an effect's kind selects.

Macro Definition Documentation

◆ PARTICLES

#define PARTICLES   ((struct EffectStep *)Ram_MapCellBuffer)

The map cell buffer (gMapCellBuffer), which the effects borrow, has two views here: Ram_MapCellBuffer as bytes, at its fixed address, and PARTICLES as particles.

The effects use these two, not gMapCellBuffer itself.

Definition at line 221 of file effect.h.

Referenced by BattleFx_ArmWin0HBlankDma(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFrost(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunGrowingColumns(), BattleFx_RunHail(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunImpactBurst(), BattleFx_RunJudgment(), BattleFx_RunJupiter(), BattleFx_RunKirin(), BattleFx_RunLobbedShells(), BattleFx_RunMars(), BattleFx_RunMercury(), BattleFx_RunMoteFountain(), BattleFx_RunNeptune(), BattleFx_RunNereid(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunPlasma(), BattleFx_RunPrism(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunRagnarok(), BattleFx_RunRamses(), BattleFx_RunRay(), BattleFx_RunShiningStar(), BattleFx_RunSleep(), BattleFx_RunSparkGroups(), BattleFx_RunSpire(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThorn(), BattleFx_RunTitanBlade(), BattleFx_RunVenus(), and BattleFx_RunVolcano().

◆ EFFECT_CLIP_BOUNDS

#define EFFECT_CLIP_BOUNDS   (COMPOSITE_CLIP_X | COMPOSITE_CLIP_Y)

Clips overflow on all four sides.

Definition at line 224 of file effect.h.

Referenced by BattleFx_FetchRectangleBlitters(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBeamSequence(), BattleFx_RunBind(), BattleFx_RunBladeRain(), BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunCurse(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFlare(), BattleFx_RunFlashingStrike(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGround(), BattleFx_RunGrowingColumns(), BattleFx_RunHaunt(), BattleFx_RunImpactBurst(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunLobbedShells(), BattleFx_RunMirroredWall(), BattleFx_RunMoteFountain(), BattleFx_RunNeptune(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunPlanetDiver(), BattleFx_RunPlasma(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRamses(), BattleFx_RunRay(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShatteringOpening(), BattleFx_RunShiningStar(), BattleFx_RunSleep(), BattleFx_RunSparkGroups(), BattleFx_RunSpiderWeb(), BattleFx_RunSpire(), BattleFx_RunStatBoost(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlSwipe(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunThorn(), BattleFx_RunTitanBlade(), BattleFx_RunTriangleStrike(), BattleFx_RunUndeadSword(), BattleFx_RunVenus(), BattleFx_RunVine(), BattleFx_RunVolcano(), and BattleFx_RunWhirlwind().

◆ Q_16_16_TO_INT

◆ EFFECT_BLITTERS

#define EFFECT_BLITTERS   ((DrawRectangle *)gWorkSlot)

The work slots read as blitters: EFFECT_BLITTERS[HEAP_SLOT_BLITTER] and EFFECT_BLITTERS[HEAP_SLOT_BLITTER_ALTERNATE].

Definition at line 248 of file effect.h.

Referenced by BattleFx_RunTargetStrike(), and BattleFx_RunThor().

Typedef Documentation

◆ BattleFxHandler

typedef void(*) BattleFxHandler(struct BattleEffectArgument *effect)

An effect handler: plays one effect over the battle, frame by frame, and returns when it is over.

Definition at line 33 of file effect.h.

◆ BlitterPair

typedef DrawRectangle BlitterPair[2]

A blitter pair: [0] built in HEAP_SLOT_BLITTER and [1] in HEAP_SLOT_BLITTER_ALTERNATE (BattleFx_FetchRectangleBlitters fills one).

Many effects keep this pair in their stack frame.

Definition at line 244 of file effect.h.

Enumeration Type Documentation

◆ SceneEffectKind

The large effects BattleFx_RunSceneEffect runs, by kind: the twelve summons.

A summon's row of actflags.tsv has effect 0x8000 plus its kind; kind 0, which no row uses, runs Meteor's scene too.

Enumerator
SCENE_EFFECT_RAMSES 

BattleFx_RunRamses (ramses.c).

SCENE_EFFECT_NEREID 

BattleFx_RunNereid (nereid.c).

SCENE_EFFECT_KIRIN 

BattleFx_RunKirin (kirin.c).

SCENE_EFFECT_ATALANTA 

BattleFx_RunAtalanta (atalanta.c).

SCENE_EFFECT_CYBELE 

BattleFx_RunCybele (cybele.c).

SCENE_EFFECT_NEPTUNE 

BattleFx_RunNeptune (neptune.c).

SCENE_EFFECT_TIAMAT 

BattleFx_RunTiamat (tiamat.c).

SCENE_EFFECT_PROCNE 

BattleFx_RunProcne (procne.c).

SCENE_EFFECT_JUDGMENT 

BattleFx_RunJudgment (judgment.c).

SCENE_EFFECT_BOREAS 

BattleFx_RunBoreas (boreas.c).

SCENE_EFFECT_METEOR 

BattleFx_RunMeteor (particle_streams.c).

SCENE_EFFECT_THOR 

BattleFx_RunThor (thor.c).

Definition at line 16 of file effect.h.

◆ BattleFxKind

Effect kinds: the kind an ability's gBattle_ActionFlags entry selects, by the handler that plays it; a later kind that shares a handler adds its number.

Kinds without a handler have no name. Kind 0 is the dispatcher's.

Enumerator
BATTLE_FX_QUAKE 
BATTLE_FX_SPIRE 
BATTLE_FX_GAIA 
BATTLE_FX_GROWTH 
BATTLE_FX_THORN 
BATTLE_FX_FROST 
BATTLE_FX_ICE 
BATTLE_FX_PRISM 
BATTLE_FX_DOUSE 
BATTLE_FX_FROTH 
BATTLE_FX_FLARE 
BATTLE_FX_FIRE 
BATTLE_FX_VOLCANO 
BATTLE_FX_BLAST 
BATTLE_FX_NOVA 
BATTLE_FX_BOLT 
BATTLE_FX_RAY 
BATTLE_FX_PLASMA 
BATTLE_FX_SLASH 
BATTLE_FX_WHIRLWIND 
BATTLE_FX_CURE 
BATTLE_FX_PLY 
BATTLE_FX_WISH 
BATTLE_FX_CURE_POISON 
BATTLE_FX_REVIVE 
BATTLE_FX_IMPACT 
BATTLE_FX_DULL 
BATTLE_FX_GUARD 
BATTLE_FX_IMPAIR 
BATTLE_FX_WARD 
BATTLE_FX_WEAKEN 
BATTLE_FX_TAINT 
BATTLE_FX_DELUDE 
BATTLE_FX_ORBITING_SPIRALS 

no ability uses it

BATTLE_FX_HEARTRENDER 
BATTLE_FX_PARALYZE 
BATTLE_FX_SLEEP 
BATTLE_FX_BIND 
BATTLE_FX_HAUNT 
BATTLE_FX_CONDEMN 
BATTLE_FX_CURSE 
BATTLE_FX_DRAIN 
BATTLE_FX_BREAK 
BATTLE_FX_WISH_44 
BATTLE_FX_WISH_45 
BATTLE_FX_IMPACT_46 
BATTLE_FX_IMPAIR_47 
BATTLE_FX_DRAGON_CLOUD 
BATTLE_FX_DEMON_NIGHT 
BATTLE_FX_HELM_SPLITTER 
BATTLE_FX_QUICK_STRIKE 
BATTLE_FX_DEATH_PLUNGE 
BATTLE_FX_SHURIKEN 
BATTLE_FX_ANNIHILATION 
BATTLE_FX_PUNJI 
BATTLE_FX_CUTTING_EDGE 
BATTLE_FX_RAGNAROK 
BATTLE_FX_HEAT_WAVE 
BATTLE_FX_PLANET_DIVER 
BATTLE_FX_TITAN_BLADE 
BATTLE_FX_SHINING_STAR 
BATTLE_FX_BLIZZARD 
BATTLE_FX_DEMON_FIRE 
BATTLE_FX_VORPAL_SLASH 
BATTLE_FX_DROWN 
BATTLE_FX_TRIANGLE_STRIKE 

no ability uses it

BATTLE_FX_ASTRAL_BLAST 
BATTLE_FX_GRANITE 
BATTLE_FX_REVIVE_201 
BATTLE_FX_VINE 
BATTLE_FX_GROUND 
BATTLE_FX_PLY_204 
BATTLE_FX_SLEET 
BATTLE_FX_WISH_206 
BATTLE_FX_HAIL 
BATTLE_FX_TONIC 
BATTLE_FX_DEW 
BATTLE_FX_IMPACT_210 
BATTLE_FX_GUARD_211 
BATTLE_FX_PSY_CRYSTAL 
BATTLE_FX_FLASH 
BATTLE_FX_TORCH 
BATTLE_FX_WARD_215 
BATTLE_FX_ZEPHYR 
BATTLE_FX_KITE 
BATTLE_FX_BIND_218 
BATTLE_FX_GUST 
BATTLE_FX_VENUS 
BATTLE_FX_MERCURY 
BATTLE_FX_MARS 
BATTLE_FX_JUPITER 
BATTLE_FX_SONIC_WAVE 
BATTLE_FX_SHRIEK 
BATTLE_FX_BANSHEE_HOWL 
BATTLE_FX_CRAZY_VOICE 
BATTLE_FX_WAR_CRY 
BATTLE_FX_WICKED_HOWL 
BATTLE_FX_WING_BEAT 
BATTLE_FX_WING_FLUTTER 
BATTLE_FX_RUMBLE 
BATTLE_FX_BONE_CHILLER 
BATTLE_FX_GUST_310 
BATTLE_FX_BONE_CHARGE 
BATTLE_FX_MYSTIC_FLAME 
BATTLE_FX_NUMBING_STING 
BATTLE_FX_BRUTE_FORCE 
BATTLE_FX_STICKY_GOO 
BATTLE_FX_CANNIBAL_FANG 
BATTLE_FX_BEAR_CLAW 
BATTLE_FX_POISONOUS_BITE 
BATTLE_FX_FLYING_ATTACK 
BATTLE_FX_UNDEAD_SWORD 
BATTLE_FX_RANSACK 
BATTLE_FX_STICKY_POISON 
BATTLE_FX_POISONOUS_BITE_323 
BATTLE_FX_ELECTRIC_BITE 
BATTLE_FX_POISON_TAIL 
BATTLE_FX_ONSLAUGHT 
BATTLE_FX_VAMPIRIC_FANG 
BATTLE_FX_BACTERIA_RUSH 
BATTLE_FX_FLYING_ATTACK_329 
BATTLE_FX_ROTTEN_BLOOD 
BATTLE_FX_DOUBLE_FANG 
BATTLE_FX_MORTAL_BLOW 
BATTLE_FX_FREEBITE_RUSH 
BATTLE_FX_TWIN_BEAKS 
BATTLE_FX_RABID_FANG 
BATTLE_FX_ACID_BITE 
BATTLE_FX_DYNAMITE 
BATTLE_FX_HEADBUTT 
BATTLE_FX_POISON_INK 
BATTLE_FX_BEAR_CLAW_342 
BATTLE_FX_RANSACK_343 
BATTLE_FX_SOOTHING_STAR 
BATTLE_FX_SPIDER_WEB 
BATTLE_FX_HEARTRENDER_346 
BATTLE_FX_MAD_SPATTER 
BATTLE_FX_SPASM 
BATTLE_FX_SLEEP_STAR 
BATTLE_FX_DECOMPOSE 
BATTLE_FX_HAUNTING 
BATTLE_FX_CURE_352 
BATTLE_FX_BERSERK 
BATTLE_FX_CURSE_354 
BATTLE_FX_SMOKE_BOMB 
BATTLE_FX_WING_STROKE 
BATTLE_FX_POISON_BEAT 
BATTLE_FX_SPINNING_BEAT 
BATTLE_FX_OUTER_SPACE 
BATTLE_FX_DRAGON_DRIVER 
BATTLE_FX_DRAIN_FANG 
BATTLE_FX_SPARK_APPROACH_VARIANT3 

no ability uses it

BATTLE_FX_THRASH 
BATTLE_FX_RECOVERY 
BATTLE_FX_FIRE_BLESSING 
BATTLE_FX_WATER_BLESSING 
BATTLE_FX_ICE_BLESSING 
BATTLE_FX_DARK_BLESSING 
BATTLE_FX_ACID_BLESSING 
BATTLE_FX_STORM_BLESSING 
BATTLE_FX_EVIL_BLESSING 
BATTLE_FX_DEADLY_GAS 
BATTLE_FX_KIND_COUNT 

one more than the last kind

Definition at line 37 of file effect.h.

Function Documentation

◆ BattleFx_ConfigureEffectDisplay()

void BattleFx_ConfigureEffectDisplay ( void )

Puts the battle screen back into the display state every effect starts from and ends with: no blending, window 0 and window 1 both covering the battle view (lines 16 to 135), and the effect display mode queued.

Called at the start and end of the handlers that change the display themselves: Ice and Douse (falling.c), the beam sequence, and the summons and scenes from Boreas to Judgment. Writes BLDCNT, BLDALPHA, the window registers and WININ and WINOUT, queues DISPCNT for two frames later and waits one frame.

Definition at line 16 of file display.c.

Referenced by BattleFx_ConfigureEffectDisplay(), BattleFx_RunAtalanta(), BattleFx_RunBeamSequence(), BattleFx_RunBoreas(), BattleFx_RunDouse(), BattleFx_RunIce(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunNeptune(), BattleFx_RunParticleStreams(), BattleFx_RunRamses(), and BattleFx_RunThor().

◆ BattleFx_AdvanceScrollOnInterval()

void BattleFx_AdvanceScrollOnInterval ( void )

Scrolls BG1 by (scrollStepX, scrollStepY) once every scrollInterval frames.

Runs each frame as a scheduler callback added by BattleFx_RunAtalanta and BattleFx_RunThor, which set the work block's scroll fields first and remove it before they return. Counts work->scrollTimer and moves gBgScroll[1].

Definition at line 37 of file display.c.

Referenced by BattleFx_AdvanceScrollOnInterval(), BattleFx_RunAtalanta(), and BattleFx_RunThor().

◆ BattleFx_AdvanceBg2OnInterval()

void BattleFx_AdvanceBg2OnInterval ( void )

Slides the affine BG2 in steps: once every scrollInterval frames, writes the work block's reference point (bg2x, bg2y) to BG2X and BG2Y, then moves it by (scrollStepX, scrollStepY).

Runs each frame as a scheduler callback added by BattleFx_RunParticleStreams, which removes it before it returns. Counts work->scrollTimer.

Definition at line 56 of file display.c.

Referenced by BattleFx_AdvanceBg2OnInterval(), and BattleFx_RunParticleStreams().

◆ BattleFx_ArmWin0HBlankDma()

void BattleFx_ArmWin0HBlankDma ( void )

Restarts DMA 0 as an HBlank transfer of one WIN0H value a line from PARTICLES (Ram_MapCellBuffer), so window 0's edges follow the per-line table the effect drew there.

Runs each frame as a scheduler callback added by BattleFx_RunIce and BattleFx_RunDouse, which remove it before they return. Stopping the channel first makes each frame's transfer start again from the table's first line.

Definition at line 81 of file display.c.

Referenced by BattleFx_ArmWin0HBlankDma(), BattleFx_RunDouse(), and BattleFx_RunIce().

◆ BattleFx_RunIce()

void BattleFx_RunIce ( struct BattleEffectArgument * effect)

Ice shards rain down diagonally onto the targets' side of the field and shatter into puffs of sparkle, flashing and shaking each target as they land.

Abilities: Ice, Ice Horn, Ice Missile (kind 7).

The canvas shows only inside a slanted band of window 0, so the shards stream out of the sky above the targets. effect->variant picks the size of the volley from gFalling_IceCounts (shards and frames: 16 for 46 frames, 20 for 52, 32 for 80); variant 1 leaves longer trails and variant 2 draws additively. effect->side is 1 when the targets are the party, 0 when they are enemies.

Definition at line 53 of file falling.c.

Referenced by BattleFx_RunIce().

◆ BattleFx_RunDouse()

void BattleFx_RunDouse ( struct BattleEffectArgument * effect)

Blue bolts streak down diagonally onto the targets' side of the field, each bursting into a fountain of falling sparks where it lands, while the targets flash.

Abilities: Douse, Drench, Deluge (kind 9).

Like the falling shards, the canvas shows only inside a slanted band of window 0. effect->variant picks the volley from gFalling_Counts: 6 bolts of 8 sparks, 8 of 16 or 32 of 4, spaced 32, 24 or 8 pixels apart, over 80 frames; it also picks how the canvas fades (see below). effect->side is 1 when the targets are the party, 0 when they are enemies.

Definition at line 280 of file falling.c.

Referenced by BattleFx_RunDouse().

◆ BattleFx_RunSonicWave()

void BattleFx_RunSonicWave ( struct BattleEffectArgument * effect)

Ember streaks.

Abilities: Sonic Wave (kind 300).

Three streaks of ember light fly from the user at each target in turn; each target flashes and recoils.

Definition at line 37 of file streaks.c.

Referenced by BattleFx_RunSonicWave().

◆ BattleFx_RunShriek()

void BattleFx_RunShriek ( struct BattleEffectArgument * effect)

Lime streaks.

Abilities: Shriek (kind 301).

Three streaks of lime light fly from the user at each target in turn; each target flashes and recoils.

Definition at line 46 of file streaks.c.

Referenced by BattleFx_RunShriek().

◆ BattleFx_RunBansheeHowl()

void BattleFx_RunBansheeHowl ( struct BattleEffectArgument * effect)

Violet streaks.

Abilities: Banshee Howl (kind 302).

Three streaks of violet light fly from the user at each target in turn; each target flashes and trembles.

Definition at line 55 of file streaks.c.

Referenced by BattleFx_RunBansheeHowl().

◆ BattleFx_RunWarCry()

void BattleFx_RunWarCry ( struct BattleEffectArgument * effect)

Cyan streaks.

Abilities: War Cry (kind 304).

Three flickering cyan streaks, cycling through three colour rows, fly from the user at each target in turn; each target flashes and recoils.

Definition at line 64 of file streaks.c.

Referenced by BattleFx_RunWarCry().

◆ BattleFx_RunWickedHowl()

void BattleFx_RunWickedHowl ( struct BattleEffectArgument * effect)

Red streaks.

Abilities: Wicked Howl (kind 305).

Three flickering red streaks, cycling through three colour rows, fly from the user at each target in turn; each target flashes and trembles.

Definition at line 73 of file streaks.c.

Referenced by BattleFx_RunWickedHowl().

◆ BattleFx_RunLimeStreaks()

void BattleFx_RunLimeStreaks ( struct BattleEffectArgument * effect)

The streak volley in lime. UNUSED: no effect table entry points here.

Definition at line 77 of file streaks.c.

Referenced by BattleFx_RunLimeStreaks().

◆ BattleFx_RunStreakVolley()

void BattleFx_RunStreakVolley ( struct BattleEffectArgument * effect,
s32 mode )

Fires STREAKS_MAX streaks at each target from 20 pixels above the user, one every 6 frames, each reaching 20 pixels above its target 24 frames later; each target's volley starts 32 frames after the previous one's.

A streak image is 20x40 and drawn twice, mirrored upwards, as a 20x80 streak that leaves a fading trail.

Called by the five streak handlers above and the unused BattleFx_RunLimeStreaks. Loads the style's colours over the first 64 of the background palette, writes work->bg2xLines and, over the last 16 frames, BLDALPHA; sets work->shakeFrames on a recoiling hit, and moves a trembling target's x.

mode : the style, 0 to 4: the streak colour (ember, lime, violet, red, cyan) and the row of gStreaks_Records that says how a hit looks.

Definition at line 99 of file streaks.c.

Referenced by BattleFx_RunBansheeHowl(), BattleFx_RunLimeStreaks(), BattleFx_RunShriek(), BattleFx_RunSonicWave(), BattleFx_RunStreakVolley(), BattleFx_RunWarCry(), and BattleFx_RunWickedHowl().

◆ BattleFx_RunSleepStar()

void BattleFx_RunSleepStar ( struct BattleEffectArgument * effect)

Rising motes that drift onto the targets and strike.

Abilities: Sleep Star (kind 349).

Motes burst out of the user and float up, wobbling, as they drift across the field; each target flinches in turn.

Definition at line 303 of file streaks.c.

Referenced by BattleFx_RunSleepStar().

◆ BattleFx_RunSoothingStar()

void BattleFx_RunSoothingStar ( struct BattleEffectArgument * effect)

Rising healing motes.

Abilities: Soothing Star (kind 344).

Orange motes burst out of the user and float up close to it, and each target glows in turn with the recovery sound.

Definition at line 312 of file streaks.c.

Referenced by BattleFx_RunSoothingStar().

◆ BattleFx_RunMoteFountain()

void BattleFx_RunMoteFountain ( struct BattleEffectArgument * effect,
s32 mode )

Motes burst out of the user in every direction and float upwards, wobbling, for 128 frames; a new group of 32 joins every 8 frames.

Each target in turn reacts from frame 48, 8 frames apart.

Called by BattleFx_RunSleepStar and BattleFx_RunSoothingStar. Fills PARTICLES 0 to 255 and loads the mode's colours over the first 64 of the background palette; the healing mode opens the canvas layer with BG control 0 and the drifting mode with 1.

mode 0: orange motes that stay close to the user; each target plays the recovery sound and glows (a healing effect). mode 1: motes on the earth palette that drift across towards the far side of the field; each target flinches (an attack).

Definition at line 330 of file streaks.c.

Referenced by BattleFx_RunMoteFountain(), BattleFx_RunSleepStar(), and BattleFx_RunSoothingStar().

◆ BattleFx_RunNumbingSting()

void BattleFx_RunNumbingSting ( struct BattleEffectArgument * effect)

One slash with glints, lightning colours.

Abilities: Numbing Sting (kind 313).

Definition at line 52 of file target_strike.c.

Referenced by BattleFx_RunNumbingSting().

◆ BattleFx_RunCannibalFang()

void BattleFx_RunCannibalFang ( struct BattleEffectArgument * effect)

Three ember columns that drain the target into the user.

Abilities: Cannibal Fang (kind 316).

Definition at line 58 of file target_strike.c.

Referenced by BattleFx_RunCannibalFang().

◆ BattleFx_RunPoisonousBite()

void BattleFx_RunPoisonousBite ( struct BattleEffectArgument * effect)

One lime column with smoke.

Abilities: Poisonous Bite (kind 318); Poison Fang (kind 323).

Definition at line 64 of file target_strike.c.

Referenced by BattleFx_RunPoisonousBite().

◆ BattleFx_RunRabidFang()

void BattleFx_RunRabidFang ( struct BattleEffectArgument * effect)

One column with smoke, Mars Djinn colours.

Abilities: Rabid Fang (kind 336).

Definition at line 70 of file target_strike.c.

Referenced by BattleFx_RunRabidFang().

◆ BattleFx_RunElectricBite()

void BattleFx_RunElectricBite ( struct BattleEffectArgument * effect)

Three lightning columns with glints.

Abilities: Electric Bite (kind 324).

Definition at line 76 of file target_strike.c.

Referenced by BattleFx_RunElectricBite().

◆ BattleFx_RunPoisonTail()

void BattleFx_RunPoisonTail ( struct BattleEffectArgument * effect)

One lime slash with smoke.

Abilities: Poison Tail (kind 325).

Definition at line 82 of file target_strike.c.

Referenced by BattleFx_RunPoisonTail().

◆ BattleFx_RunVampiricFang()

void BattleFx_RunVampiricFang ( struct BattleEffectArgument * effect)

Three columns that drain the target, Mars Djinn colours.

Abilities: Vampiric Fang (kind 327).

Definition at line 88 of file target_strike.c.

Referenced by BattleFx_RunVampiricFang().

◆ BattleFx_RunDoubleFang()

void BattleFx_RunDoubleFang ( struct BattleEffectArgument * effect)

Two blue columns with sparks.

Abilities: Double Fang (kind 332).

Definition at line 94 of file target_strike.c.

Referenced by BattleFx_RunDoubleFang().

◆ BattleFx_RunMortalBlow()

void BattleFx_RunMortalBlow ( struct BattleEffectArgument * effect)

One heavy slash with sparks, Mars Djinn colours.

Abilities: Mortal Blow (kind 333).

Definition at line 100 of file target_strike.c.

Referenced by BattleFx_RunMortalBlow().

◆ BattleFx_RunTwinBeaks()

void BattleFx_RunTwinBeaks ( struct BattleEffectArgument * effect)

Two slashes with sparks, lightning colours.

Abilities: Twin Beaks (kind 335).

Definition at line 106 of file target_strike.c.

Referenced by BattleFx_RunTwinBeaks().

◆ BattleFx_RunAcidBite()

void BattleFx_RunAcidBite ( struct BattleEffectArgument * effect)

Three pink columns with smoke.

Abilities: Acid Bite (kind 337).

Definition at line 112 of file target_strike.c.

Referenced by BattleFx_RunAcidBite().

◆ BattleFx_RunDrainFang()

void BattleFx_RunDrainFang ( struct BattleEffectArgument * effect)

Three additive columns that drain the target with large motes, Mars Djinn colours.

Abilities: Drain Fang (kind 386).

Definition at line 119 of file target_strike.c.

Referenced by BattleFx_RunDrainFang().

◆ BattleFx_RunTargetStrike()

void BattleFx_RunTargetStrike ( struct BattleEffectArgument * effect,
s32 mode )

Strikes the first target TARGET_STRIKE_HITS times with a sideways slash or a column of light, with the extras its flags choose, and lets the battle show the damage on the hits.

Called by the twelve wrappers above, from BattleFx_RunNumbingSting to BattleFx_RunDrainFang. Loads the style's colours over the first 64 of the background palette; uses work->particles 0 to 63 for smoke, PARTICLES 0 to 127 for motes and TARGET_STRIKE_SPARKS for sparks; builds and frees its blitters in both slots every frame, sets work->shakeFrames on each hit and lights the user while an absorb runs. Leaves the canvas layer closed.

mode : the style, 0 to 11, a row of gTargetStrike_Records.

Definition at line 135 of file target_strike.c.

Referenced by BattleFx_RunAcidBite(), BattleFx_RunCannibalFang(), BattleFx_RunDoubleFang(), BattleFx_RunDrainFang(), BattleFx_RunElectricBite(), BattleFx_RunMortalBlow(), BattleFx_RunNumbingSting(), BattleFx_RunPoisonousBite(), BattleFx_RunPoisonTail(), BattleFx_RunRabidFang(), BattleFx_RunTargetStrike(), BattleFx_RunTwinBeaks(), and BattleFx_RunVampiricFang().

◆ BattleFx_RunDeathPlunge()

void BattleFx_RunDeathPlunge ( struct BattleEffectArgument * effect)

The user runs 9/10 of the way to the first target, then both leap and turn upside down in the air; on frame 54 the target is hit and both bounce back, while flashes burst from the user and rise in a widening ring.

Abilities: Death Plunge (kind 53).

Definition at line 35 of file death_plunge.c.

Referenced by BattleFx_RunDeathPlunge().

◆ BattleFx_RunBladeRain()

void BattleFx_RunBladeRain ( struct BattleEffectArgument * effect)

Drops 16 swords, one every 4 frames, slanting in towards the first target (the middle of the canvas, x 64) and sticking in the ground, where their bottom 4 pixels are hidden.

Sword i falls from frame 4i + 16 and sticks at frame 4i + 25. Every 4 frames from 24 to 84 the target flashes white in its damage pose for 2 frames and the screen shakes; every 8 frames the hit sound plays.

Nothing reaches it: no handler table entry or call names it. Places 64 swords in work->particles but draws only the first 16, and moves BG2X to centre the canvas on the target.

Definition at line 188 of file death_plunge.c.

Referenced by BattleFx_RunBladeRain().

◆ BattleFx_RunElementPillar()

void BattleFx_RunElementPillar ( struct BattleEffectArgument * effect)

The glow of an element around a unit: a symmetrical pillar of light stands at the unit's feet while motes spiral up around it, for 56 frames, and the first target flashes.

Called through BattleFx_RunElementPillarFar by BattleFx_PlayUnitElementEffect (its mode 2) and four times in a row, one for each element, by BattlePres_RunUnitAction. Allocates and frees its own work, canvas and sheet slots; loads the element's colours over the first 64 of the background palette, fills PARTICLES 0 to 127 and moves BG2X with the unit. Increments effect->variant in place, so BattlePres_RunUnitAction's four calls draw ever larger motes.

effect->kind : the element, which picks the palette: 0 Venus yellow, 1 Mercury blue, 2 Mars red, others Jupiter violet. effect->variant : the mote size less one, kept to 1 to 4 after adding 1.

Definition at line 357 of file death_plunge.c.

Referenced by BattleFx_RunElementPillar().

◆ BattleFx_RunShatteringOpening()

void BattleFx_RunShatteringOpening ( struct BattleEffectArgument * effect)

The shattering opening of the battle on the Venus aerie storm backdrop: the screen turns white and a grey disc grows from (96, 60) by 32 pixels a frame while the TileAnimationMask picture breaks into 33 pieces that fly apart and fall; background palettes 6 to 13 then ease from white back to the battle backdrop's colours, and from frame 51 32 flashes rise.

Runs for 128 frames.

Called through BattleFx_RunShatteringOpeningFar by BattlePres_RunEntryTransition, as a battle opens. Allocates and frees its own work, canvas and sheet slots; sets up BG2 as the canvas itself, as BattleFx_BeginCanvasLayer would; draws the disc in Ram_MapCellBuffer and copies it over 0x7800 bytes of BG character block 2; writes background colours 1 to 63 and palettes 6 to 13; reloads the battle backdrop on BG1 on frame 5, and on its way out restores gBgScroll[1], starts the battle's palette fade (mode 2) and queues a DISPCNT without BG1.

effect : only effect->actors[0], the unit that flashes, is read.

Definition at line 547 of file death_plunge.c.

Referenced by BattleFx_RunShatteringOpening().

◆ BattleFx_RunElementBurst()

void BattleFx_RunElementBurst ( struct BattleEffectArgument * effect)

The burst of an element over a unit, for 56 frames: sparks flare at the four corners around the unit, motes spiral in, and from frame 28 a burst of light plays over the unit while the first target flashes.

Called through BattleFx_RunElementBurstFar by BattleFx_PlayUnitElementEffect (its mode 3). Allocates and frees its own work, canvas and sheet slots; loads the element's colours over the first 64 of the background palette, fills PARTICLES 0 to 127 and work->particles, and moves BG2X with the unit.

effect->kind : the element, which picks the palette: 0 Venus yellow, 1 Mercury blue, 2 Mars red, others Jupiter violet.

Definition at line 923 of file death_plunge.c.

Referenced by BattleFx_RunElementBurst().

◆ BattleFx_DrawStreaks()

void BattleFx_DrawStreaks ( void )

Draws a frame of the element streak burst: on its first frame seeds 256 streaks with random axes, then each frame draws the first 64 (streak i from frame i / 4) as lines three pixels thick that shrink 4 pixels a frame towards the centre of the canvas, a little below its middle.

Runs each frame as a scheduler callback added by BattleFx_StartElementStreaks and removed by BattleFx_EndElementStreaks. Counts work->frame, keeps the streaks in Ram_MapCellBuffer, draws into the canvas through BattleFx_DrawClippedCanvasLine, resets the render transform and sets work->transferPending.

Definition at line 1062 of file death_plunge.c.

Referenced by BattleFx_DrawStreaks(), BattleFx_EndElementStreaks(), and BattleFx_StartElementStreaks().

◆ BattleFx_StartElementStreaks()

void BattleFx_StartElementStreaks ( s32 element)

Starts the element streak burst and returns at once: opens the canvas and schedules BattleFx_DrawStreaks with a canvas that darkens each frame.

Called through BattleFx_StartElementStreaksFar by BattleFx_PlayUnitElementEffect (its mode 1), which keeps the canvas on its unit and ends the burst with BattleFx_EndElementStreaks. Allocates the work and canvas slots, which the end frees; loads the element's colours over the first 64 of the background palette; adds BattleFx_DrawStreaks and the canvas transfer to the scheduler, beside the backdrop fade BattleFx_BeginCanvasLayer adds.

element: the element, which picks the palette: 0 Venus yellow, 1 Mercury blue, 2 Mars red, 3 Jupiter violet, others a dusty grey.

Definition at line 1136 of file death_plunge.c.

Referenced by BattleFx_StartElementStreaks().

◆ BattleFx_EndElementStreaks()

void BattleFx_EndElementStreaks ( void )

Ends the element streak burst that BattleFx_StartElementStreaks started: stops its callbacks and the background palette fade, clears the canvas in VRAM and frees the work and the canvas.

Called through BattleFx_EndElementStreaksFar by BattleFx_PlayUnitElementEffect. Unlike BattleFx_EndCanvasLayer it leaves BG2's settings and the backdrop's colours as they are.

Definition at line 1183 of file death_plunge.c.

Referenced by BattleFx_EndElementStreaks().

◆ BattleFx_RunPoisonBeat()

void BattleFx_RunPoisonBeat ( struct BattleEffectArgument * effect)

A lime swipe that knocks the target back.

Abilities: Poison Beat (kind 382).

Definition at line 16 of file spider_web.c.

Referenced by BattleFx_RunPoisonBeat().

◆ BattleFx_RunSpinningBeat()

void BattleFx_RunSpinningBeat ( struct BattleEffectArgument * effect)

A magenta swipe that throws the target into the air.

Abilities: Spinning Beat (kind 383).

Definition at line 22 of file spider_web.c.

Referenced by BattleFx_RunSpinningBeat().

◆ BattleFx_RunSwirlSwipe()

void BattleFx_RunSwirlSwipe ( struct BattleEffectArgument * effect,
s32 mode )

A swirling swipe across the first target, six images four frames each, from the user's side: the first four from the swirl sheet, the last two from the tail sheet.

The swipe lands on frame 8.

Called by BattleFx_RunPoisonBeat and BattleFx_RunSpinningBeat. Decodes the tail sheet into Ram_MapCellBuffer, moves BG2X so the swipe crosses the target, and sets work->shakeFrames on the hit; mode 0 loads its colours over the first 64 of the background palette, and mode 1 throws the target's object into the air.

mode 0 : lime colours; the battle shows the damage at once and the target recoils. 48 frames. mode 1 : the target flashes, is thrown up on frame 13 and the battle shows the damage as it lands on frame 65. 74 frames.

Definition at line 39 of file spider_web.c.

Referenced by BattleFx_RunPoisonBeat(), BattleFx_RunSpinningBeat(), and BattleFx_RunSwirlSwipe().

◆ BattleFx_RunSpiderWeb()

void BattleFx_RunSpiderWeb ( struct BattleEffectArgument * effect)

A spider web spreads over the targets, drawn as four mirrored 32x32 quarters around the point between the first and last target.

Abilities: Spider Web (kind 345).

It fades in over 8 frames; the targets flash on frame 10, the battle shows the damage on frame 32, and it fades out from frame 54.

Builds and frees its blitter four times a frame, one for each quarter's flip.

Definition at line 145 of file spider_web.c.

Referenced by BattleFx_RunSpiderWeb().

◆ BattleFx_WipeCanvas()

void BattleFx_WipeCanvas ( s32 mode,
s32 value )

Wipes the whole canvas to one colour with a ragged edge: each row (or column) lags a random 0 to 63 pixels behind the front, which speeds up as it goes.

Returns when the wipe is done, a frame at a time.

Called by the summons and scenes that open on a wiped canvas: Boreas, Thor, Atalanta, Neptune, Kirin, Ramses, the particle streams and Judgment. Writes the canvas and sets work->transferPending each frame; the caller's transfer callback must already be running.

mode : 1 sweeps left to right; anything else sweeps top to bottom. value : 0 wipes to colour 1, 1 wipes to colour 0 (clears the canvas).

Definition at line 27 of file canvas.c.

Referenced by BattleFx_RunAtalanta(), BattleFx_RunBoreas(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunNeptune(), BattleFx_RunParticleStreams(), BattleFx_RunRamses(), BattleFx_RunThor(), and BattleFx_WipeCanvas().

◆ BattleFx_ProcessPendingGraphicsTransfer()

void BattleFx_ProcessPendingGraphicsTransfer ( void )

Copies the canvas to VRAM once the effect has finished drawing a frame (transferPending): the 128x128 canvas into BG2's character block 1, the way transferMode says, leaving the canvas cleared, faded, darkened or brightened for the next frame.

Runs each frame as a scheduler callback that nearly every canvas effect adds, most through EFFECT_START_TRANSFER, and removes before its blocks are freed (EFFECT_FINISH_CANVAS). Clears work->transferPending after a copy, and counts work->framesSinceTransfer: 1 on a frame that copied, one more on each frame that did not.

Definition at line 103 of file canvas.c.

Referenced by BattleFx_EndElementStreaks(), BattleFx_ProcessPendingGraphicsTransfer(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBeamSequence(), BattleFx_RunBind(), BattleFx_RunBoreas(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunCurse(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinniEntrance(), BattleFx_RunDouse(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunFire(), BattleFx_RunFlare(), BattleFx_RunFlashingStrike(), BattleFx_RunFrost(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunIce(), BattleFx_RunImpactBurst(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunNeptune(), BattleFx_RunNereid(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunProjectileVolley(), BattleFx_RunRamses(), BattleFx_RunRingAndSparkScene(), BattleFx_RunShatteringOpening(), BattleFx_RunShiningStar(), BattleFx_RunSpiderWeb(), BattleFx_RunStatBoost(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunThorn(), BattleFx_RunTriangleStrike(), BattleFx_RunUndeadSword(), BattleFx_RunVolcano(), BattleFx_RunWhirlwind(), BattleFx_StartElementStreaks(), and CastingImpact_EndPrelude().

◆ BattleFx_FlushPendingGraphicsTransfer()

void BattleFx_FlushPendingGraphicsTransfer ( void )

Copies a full-screen picture to VRAM once the effect has finished drawing a frame: the 0x7800 bytes of Ram_MapCellBuffer into BG character block 2 (0x06008000), the way transferMode says (modes 0 to 3; brightening is not offered).

Runs each frame as a scheduler callback added by BattleFx_RunParticleStreams, which removes it before it returns. Clears work->transferPending after a copy; unlike the canvas transfer it keeps no frame count.

Definition at line 158 of file canvas.c.

Referenced by BattleFx_FlushPendingGraphicsTransfer(), and BattleFx_RunParticleStreams().

◆ Graphics_ApplyWindowBlendRegisters()

void Graphics_ApplyWindowBlendRegisters ( void )

Writes the window, display and blend registers the effect keeps in its work, all at once.

Nothing in the build calls it or takes its address. Writes WIN0H to BLDALPHA from the work block's copies.

Definition at line 207 of file canvas.c.

Referenced by Graphics_ApplyWindowBlendRegisters().

◆ Display_ApplyBg2Reference()

void Display_ApplyBg2Reference ( void )

Writes the effect's BG2 reference point (work->bg2x, work->bg2y) to BG2X and BG2Y.

Nothing in the build calls it or takes its address; BattleFx_AdvanceBg2OnInterval (display.c) writes the same pair itself.

Definition at line 226 of file canvas.c.

Referenced by Display_ApplyBg2Reference().

◆ Palette_StepFadeTransfer()

void Palette_StepFadeTransfer ( void )

Darkens the battle backdrop while the canvas is open: for fadeFrames frames, writes the backdrop's colours one CANVAS_FADE_STEP darker each frame into background palettes 6 to 13, so the effect stands out.

Runs each frame as a scheduler callback added by BattleFx_BeginCanvasLayer and BattleFx_OpenCanvasLayer, and by BattleFx_RunRingAndSparkScene; BattleFx_EndCanvasLayer and BattleFx_EndElementStreaks remove it. It does nothing until the effect sets work->fadeFrames, which it counts down while counting work->fadeStep up.

Definition at line 243 of file canvas.c.

Referenced by BattleFx_BeginCanvasLayer(), BattleFx_EndCanvasLayer(), BattleFx_EndElementStreaks(), BattleFx_OpenCanvasLayer(), BattleFx_RunCastingImpact(), BattleFx_RunDjinniEntrance(), BattleFx_RunRingAndSparkScene(), CastingImpact_EndPrelude(), and Palette_StepFadeTransfer().

◆ BattleFx_ClearActorTimers()

void BattleFx_ClearActorTimers ( void )

Clears every target's flash timer (work->actorTimers).

Called as the canvas opens, by BattleFx_BeginCanvasLayer, BattleFx_OpenCanvasLayer and BattleFx_SetupCanvasTileMap, and by BattleFx_RunShatteringOpening, which opens its own.

Definition at line 262 of file canvas.c.

Referenced by BattleFx_BeginCanvasLayer(), BattleFx_ClearActorTimers(), BattleFx_OpenCanvasLayer(), BattleFx_RunShatteringOpening(), and BattleFx_SetupCanvasTileMap().

◆ ObjectGroup_TickMemberTimers()

void ObjectGroup_TickMemberTimers ( void )

Counts down each target's flash timer, which ObjectGroup_UpdateMembers starts; when one runs out, the target gets its own palette back.

Timer n belongs to effect->actors[n].

Called once a frame by nearly every effect, most through EFFECT_END_FRAME. Changes work->actorTimers and, through ObjectGroup_UpdateMembers, the colour of a target whose timer ends.

Definition at line 275 of file canvas.c.

Referenced by BattleFx_RunBurstShower(), BattleFx_RunIce(), BattleFx_RunSpiderWeb(), and ObjectGroup_TickMemberTimers().

◆ BattleFx_BeginCanvasLayer()

void BattleFx_BeginCanvasLayer ( s32 bgControl)

Opens the canvas layer: starts the background palette fade, makes BG2 the canvas, alpha-blended over the battle, inside the effect windows, and clears the canvas.

It also stops any shake and saves BG1's scroll, which BattleFx_EndCanvasLayer restores.

Called at the start of nearly every canvas effect, most often through EFFECT_BEGIN_NARROW_CANVAS, and by BattleFx_BeginTiledCanvas. Waits five frames of its own. Writes BLDCNT, BLDALPHA, BG2CNT and BG2's affine registers, the windows, WININ and WINOUT, and queues DISPCNT; writes BG2's map in screen block 7, clears the canvas in its slot and in character block 1; adds Palette_StepFadeTransfer with work->fadeFrames 0, so the backdrop keeps its colours until the effect sets a count; sets gBgScroll[1].y to 32, clears work->actorTimers and work->shakeFrames, and saves gBgScroll[1] in work->savedBg1X and savedBg1Y.

bgControl : added to BG2CNT, the layer's priority (0 to 3) and so on.

Definition at line 314 of file canvas.c.

Referenced by BattleFx_BeginCanvasLayer(), BattleFx_BeginTiledCanvas(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunBind(), BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCastingImpact(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDragonCloud(), BattleFx_RunDrain(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFlare(), BattleFx_RunFlashingStrike(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunGround(), BattleFx_RunGrowingColumns(), BattleFx_RunHail(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunJupiter(), BattleFx_RunKirin(), BattleFx_RunKite(), BattleFx_RunLobbedShells(), BattleFx_RunMars(), BattleFx_RunMercury(), BattleFx_RunMirroredWall(), BattleFx_RunMoteFountain(), BattleFx_RunNeptune(), BattleFx_RunNereid(), BattleFx_RunPaletteParticles(), BattleFx_RunPlanetDiver(), BattleFx_RunPlasma(), BattleFx_RunPrism(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRagnarok(), BattleFx_RunRamses(), BattleFx_RunRushingStrike(), BattleFx_RunShiningStar(), BattleFx_RunSparkGroups(), BattleFx_RunSpiderWeb(), BattleFx_RunStatBoost(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThorn(), BattleFx_RunTitanBlade(), BattleFx_RunTorch(), BattleFx_RunVenus(), BattleFx_RunVine(), BattleFx_RunVolcano(), BattleFx_RunWhirlwind(), and BattleFx_StartElementStreaks().

◆ BattleFx_OpenCanvasLayer()

void BattleFx_OpenCanvasLayer ( s32 bgControl)

Opens the canvas layer as BattleFx_BeginCanvasLayer does, but with the windows off until the end, the backdrop palette starting half faded, and a 24-frame fade.

It neither saves BG1's scroll nor resets the shake.

Nothing in the build calls it or takes its address. Writes the same registers, map and canvas as BattleFx_BeginCanvasLayer and sets work->fadeFrames to 24.

bgControl : added to BG2CNT, the layer's priority (0 to 3) and so on.

Definition at line 392 of file canvas.c.

Referenced by BattleFx_OpenCanvasLayer().

◆ BattleFx_BeginTiledCanvas()

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 followed by 16 of tile 0, so the canvas repeats across the screen with gaps.

Called by BattleFx_RunRay, BattleFx_RunCondemn, BattleFx_RunCastingImpact and BattleFx_InitTilemapAndFlushQueue. Opens the layer through BattleFx_BeginCanvasLayer, then rewrites BG2CNT and BG2's map in screen block 7.

bgControl : added to BG2CNT, the layer's priority (0 to 3) and so on.

Definition at line 463 of file canvas.c.

Referenced by BattleFx_BeginTiledCanvas(), BattleFx_InitTilemapAndFlushQueue(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), and BattleFx_RunRay().

◆ BattleFx_EndCanvasLayer()

void BattleFx_EndCanvasLayer ( void )

Closes the canvas layer: plays the closing sound, restores BG1's scroll and the projection centre, clears the canvas tiles, stops the palette fade and brings the backdrop's palette back from level 21 to 0 over 8 frames, then shows BG2 again and hides BG1.

Called at the end of nearly every canvas effect, most through EFFECT_FINISH_CANVAS, after the transfer callback is removed. Takes 11 frames. Writes gBgScroll[1], gProjection's centre, BG2CNT (priority 3) and BLDCNT, clears character block 1, removes Palette_StepFadeTransfer and queues two DISPCNT values.

Definition at line 490 of file canvas.c.

Referenced by BattleFx_EndCanvasLayer(), BattleFx_InitTilemapAndFlushQueue(), BattleFx_RunAnnihilation(), BattleFx_RunBind(), BattleFx_RunBoreas(), BattleFx_RunBurstScene(), BattleFx_RunCondemn(), BattleFx_RunCybele(), BattleFx_RunDjinnBeams(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunFire(), BattleFx_RunFlare(), BattleFx_RunFlashingStrike(), BattleFx_RunFrost(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunHaunt(), BattleFx_RunIce(), BattleFx_RunKite(), BattleFx_RunNereid(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunSpiderWeb(), BattleFx_RunStatBoost(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunTriangleStrike(), BattleFx_RunUndeadSword(), BattleFx_RunVolcano(), and BattleFx_RunWhirlwind().

◆ BattleFx_HideBg1AndRestoreBackdrop()

void BattleFx_HideBg1AndRestoreBackdrop ( void )

Hides BG1 and the windows and starts bringing the backdrop's palette back.

Called by BattleFx_RunBeamSequence and BattleFx_RunRingAndSparkScene (beams.c). Sets the background view's secondMode to 1, queues DISPCNT for two frames later, starts the battle's palette fade (mode 2) and waits two frames.

Definition at line 537 of file canvas.c.

Referenced by BattleFx_HideBg1AndRestoreBackdrop(), BattleFx_RunBeamSequence(), and BattleFx_RunRingAndSparkScene().

◆ BattleFx_SetupCanvasTileMap()

void BattleFx_SetupCanvasTileMap ( void )

Shows the canvas on BG1 instead of BG2, at its own size: BG1 becomes a 256-colour layer whose map points 16 rows of 16 tiles at the canvas (tiles 0x100 onwards, which at 64 bytes a tile start at character block 1, where the canvas lives), with blank tile 0xff to the right, blended over the rest inside the effect windows.

Also clears the canvas. The full-screen Ram_MapCellBuffer effects use BattleFx_FlushPendingGraphicsTransfer instead.

Called by BattleFx_RunBeamSequence and BattleFx_RunRingAndSparkScene (beams.c). Clears work->actorTimers, starts the battle's palette fade (mode 2), clears tile 0xff of character block 0 and writes BG1's map in screen block 31; writes DISPCNT, BG1CNT, BLDCNT, BLDALPHA, the windows, WININ and WINOUT directly; sets gBgScroll[1].y to 32 and the background view's secondMode to 0; clears the canvas and character block 1.

Definition at line 568 of file canvas.c.

Referenced by BattleFx_RunBeamSequence(), BattleFx_RunRingAndSparkScene(), and BattleFx_SetupCanvasTileMap().

◆ BattleFx_DrawClippedCanvasLine()

void BattleFx_DrawClippedCanvasLine ( s32 x0,
s32 y0,
s32 x1,
s32 y1,
s32 color )

Draws a line on the 128x128 8bpp canvas (16 tiles across), keeping the brighter colour where it crosses what is already drawn.

The ends' y is kept on the canvas; x is not. The line steps a pixel at a time along its longer axis, following the other in 8-bit fixed point, and leaves out its last pixel on that axis.

Called by BattleFx_DrawStreaks (death_plunge.c) and BattleFx_RunNeptune. Writes only the canvas.

x0, y0 : the start, in pixels x1, y1 : the end, in pixels color : the colour index

Definition at line 632 of file canvas.c.

Referenced by BattleFx_DrawClippedCanvasLine(), BattleFx_DrawStreaks(), and BattleFx_RunNeptune().

◆ BattleFx_RunPlanetDiver()

void BattleFx_RunPlanetDiver ( struct BattleEffectArgument * effect)

The user flashes and leaps into the air, turns into a ball of fire, falls onto the first target and bursts into chips that bounce on the ground.

Abilities: Planet Diver (kind 60).

88 frames. effect->side says which way the ball falls; actors[0] is where it lands.

Moves the user's object: it leaps on frame 4 and falls from frame 18. The flash's sheet and palette are replaced by the fireball's on frame 16.

Definition at line 52 of file planet_diver.c.

Referenced by BattleFx_RunPlanetDiver().

◆ BattleFx_RunHaunt()

void BattleFx_RunHaunt ( struct BattleEffectArgument * effect)

Skulls close in on each target in turn.

Abilities: Haunt (kind 39).

Around each target, 32 frames apart, eight skulls appear one every 4 frames, scattered up to 64 pixels away, and close in on a point 20 pixels above the target while the group spins; the target flashes 32 frames into its turn, and a skull that reaches the centre is no longer drawn. The effect layer ripples throughout. PARTICLES holds 64 skulls per target, of which the first 8 are used.

Adds BattleFx_ArmBg2AffineHBlankDma, which feeds the ripple in work->bg2xLines to BG2X line by line, and removes it before it returns.

Definition at line 249 of file planet_diver.c.

Referenced by BattleFx_RunHaunt().

◆ BattleFx_RunOrbitingSpirals()

void BattleFx_RunOrbitingSpirals ( struct BattleEffectArgument * effect)

Four spirals circle 40 pixels above each target in turn, 16 frames apart, for 60 frames each, 16 pixels out from the centre; each target takes its damage pose halfway through.

Abilities: none (kind 34).

The effect layer ripples throughout, through BattleFx_ArmBg2AffineHBlankDma, which it adds and removes. It never lets the battle show damage, and leaves the targets' flash timers alone.

Definition at line 377 of file planet_diver.c.

Referenced by BattleFx_RunOrbitingSpirals().

◆ BattleFx_RunDemonNight()

void BattleFx_RunDemonNight ( struct BattleEffectArgument * effect)

Sixteen pink lights burst out of the user and are pulled into each target, with the heavy impact sound.

Abilities: Demon Night (kind 50).

Definition at line 16 of file gathering_lights.c.

Referenced by BattleFx_RunDemonNight().

◆ BattleFx_RunRumble()

void BattleFx_RunRumble ( struct BattleEffectArgument * effect)

Eight lights in Mars Djinn colours burst out of the user and are pulled into each target.

Abilities: Rumble (kind 308).

Definition at line 23 of file gathering_lights.c.

Referenced by BattleFx_RunRumble().

◆ BattleFx_RunHaunting()

void BattleFx_RunHaunting ( struct BattleEffectArgument * effect)

Twelve lights in Mercury Djinn colours burst out of the user and are pulled into each target.

Abilities: Haunting (kind 351).

Definition at line 30 of file gathering_lights.c.

Referenced by BattleFx_RunHaunting().

◆ BattleFx_RunGatheringLights()

void BattleFx_RunGatheringLights ( struct BattleEffectArgument * effect,
s32 mode )

For each target in turn, 20 frames apart, lights burst out of the user, one every 2 frames; from 30 frames into the turn, one more each frame is pulled towards the middle of the target's body, and goes out when it is within 32 pixels across and in depth.

Each light takes one of three images. Each target is struck 70 frames after its turn starts, and the battle shows the damage at frame 80. The effect layer ripples throughout.

Called by BattleFx_RunDemonNight, BattleFx_RunRumble and BattleFx_RunHaunting. Loads its colours over the first 64 of the background palette, uses PARTICLES 0 to 1023, writes work->bg2xLines each frame and adds BattleFx_ArmBg2AffineHBlankDma to feed it to BG2X; removes both its callbacks before it returns.

mode : the colours (0 pink, 1 Mars Djinn, 2 Mercury Djinn) and the row of gGatheringLights_Counts: lights per target and frames.

Definition at line 50 of file gathering_lights.c.

Referenced by BattleFx_RunDemonNight(), BattleFx_RunGatheringLights(), BattleFx_RunHaunting(), and BattleFx_RunRumble().

◆ BattleFx_FetchRectangleBlitters()

void BattleFx_FetchRectangleBlitters ( s32 flip,
BlitterPair out )

Builds the two usual routines that draw onto the 128x128 canvas, both clipped on both axes.

Called during setup by about twenty effect parts, from the gathering lights and the Djinn beams to the casting impacts and Ragnarok, usually with effect->side as flip so pictures face the targets. Builds the blitters in heap slots HEAP_SLOT_BLITTER and HEAP_SLOT_BLITTER_ALTERNATE, which the caller frees (EFFECT_RELEASE_BLITTERS).

flip : nonzero draws mirrored. out : [0] keeps the higher colour index, [1] adds the colours (up to 63).

Definition at line 20 of file mirrored_wall.c.

Referenced by BattleFx_FetchRectangleBlitters(), BattleFx_RunAnnihilation(), BattleFx_RunBind(), BattleFx_RunBurstShower(), BattleFx_RunCastingImpact(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDragonCloud(), BattleFx_RunFrost(), BattleFx_RunGatheringLights(), BattleFx_RunHail(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunJupiter(), BattleFx_RunMars(), BattleFx_RunMercury(), BattleFx_RunNereid(), BattleFx_RunPrism(), BattleFx_RunRagnarok(), BattleFx_RunStatReduction(), BattleFx_RunSwirlingStars(), BattleFx_RunTorch(), and BattleFx_RunUndeadSword().

◆ BattleFx_RunBerserk()

void BattleFx_RunBerserk ( struct BattleEffectArgument * effect)

The wall rises wide and shakes the screen hard.

Abilities: Berserk (kind 353).

Definition at line 41 of file mirrored_wall.c.

Referenced by BattleFx_RunBerserk().

◆ BattleFx_RunSpasm()

void BattleFx_RunSpasm ( struct BattleEffectArgument * effect)

The wall rises with a long gentle shake and the recovery sound.

Abilities: Spasm (kind 348).

Definition at line 47 of file mirrored_wall.c.

Referenced by BattleFx_RunSpasm().

◆ BattleFx_RunRecovery()

void BattleFx_RunRecovery ( struct BattleEffectArgument * effect)

A wide wall of fire, without a shake.

Abilities: Recovery (kind 389).

Definition at line 53 of file mirrored_wall.c.

Referenced by BattleFx_RunRecovery().

◆ BattleFx_RunMirroredWall()

void BattleFx_RunMirroredWall ( struct BattleEffectArgument * effect,
s32 mode )

Raises a symmetrical wall (the EarthWall images) at the first target's feet for 48 frames; the target glows and the battle shows the result on frame 24.

mode : 0 actual size, a gentle shake for 32 frames 1 1.25 times as wide, a hard shake for 8 frames 2 1.25 times as wide, no shake, in the Fireball colours

Called by BattleFx_RunBerserk, BattleFx_RunSpasm and BattleFx_RunRecovery. Loads its colours over the first 64 of the background palette, sets BG2PA and BG2X so the wall stands on the target, and sets work->shakeFrames.

Definition at line 67 of file mirrored_wall.c.

Referenced by BattleFx_RunBerserk(), BattleFx_RunMirroredWall(), BattleFx_RunRecovery(), and BattleFx_RunSpasm().

◆ BattleFx_RunRevive()

void BattleFx_RunRevive ( struct BattleEffectArgument * effect)

With a Venus Djinni: beams of light, where motes drift down over each target and a column of light falls on it.

Abilities: Revive, Water of Life (kind 25); Quartz (kind 201).

Definition at line 18 of file djinn_beams.c.

Referenced by BattleFx_RunRevive().

◆ BattleFx_RunDew()

void BattleFx_RunDew ( struct BattleEffectArgument * effect)

With a Mercury Djinni: the same beams of light as Revive.

Abilities: Dew (kind 209).

Definition at line 24 of file djinn_beams.c.

Referenced by BattleFx_RunDew().

◆ BattleFx_RunDjinnBeams()

void BattleFx_RunDjinnBeams ( struct BattleEffectArgument * effect,
s32 mode )

When effect->prelude is 1, a Djinni appears, sways and then rises out of sight.

Over each target in turn, 16 frames apart, eight motes drift down, and from 72 frames after its turn starts a column of light falls on it and narrows away; the battle shows the result on frame 80.

Called by BattleFx_RunRevive and BattleFx_RunDew. Runs BattleFx_RunDjinniEntrance first when effect->prelude is 1. Loads three palettes over the first 64 background colours in turn, so the Djinni's is the one shown; fills PARTICLES 0 to 511, sets BG2PA and BG2X, and builds and frees its blitters every frame.

mode : 0 a Venus Djinni, 1 a Mercury Djinni.

Definition at line 39 of file djinn_beams.c.

Referenced by BattleFx_RunDew(), BattleFx_RunDjinnBeams(), and BattleFx_RunRevive().

◆ BattleFx_RunMadSpatter()

void BattleFx_RunMadSpatter ( struct BattleEffectArgument * effect)

Gold shells that burst into shards.

Abilities: Mad Spatter (kind 347).

Definition at line 16 of file lobbed_shells.c.

Referenced by BattleFx_RunMadSpatter().

◆ BattleFx_RunDecompose()

void BattleFx_RunDecompose ( struct BattleEffectArgument * effect)

Green shells that burst into smoke.

Abilities: Decompose (kind 350).

Definition at line 22 of file lobbed_shells.c.

Referenced by BattleFx_RunDecompose().

◆ BattleFx_RunBoneChiller()

void BattleFx_RunBoneChiller ( struct BattleEffectArgument * effect)

Blue shells that burst into smoke.

Abilities: Bone Chiller (kind 309).

Definition at line 28 of file lobbed_shells.c.

Referenced by BattleFx_RunBoneChiller().

◆ BattleFx_RunStickyGoo()

void BattleFx_RunStickyGoo ( struct BattleEffectArgument * effect)

Shells in the spider web's colours that burst into smoke.

Abilities: Sticky Goo (kind 315).

Definition at line 34 of file lobbed_shells.c.

Referenced by BattleFx_RunStickyGoo().

◆ BattleFx_RunPoisonInk()

void BattleFx_RunPoisonInk ( struct BattleEffectArgument * effect)

Shells in Mars Djinn colours that burst into smoke.

Abilities: Poison Ink (kind 340).

Definition at line 40 of file lobbed_shells.c.

Referenced by BattleFx_RunPoisonInk().

◆ BattleFx_RunStickyPoison()

void BattleFx_RunStickyPoison ( struct BattleEffectArgument * effect)

Lime shells that burst into smoke.

Abilities: Sticky Poison (kind 322).

Definition at line 46 of file lobbed_shells.c.

Referenced by BattleFx_RunStickyPoison().

◆ BattleFx_RunRottenBlood()

void BattleFx_RunRottenBlood ( struct BattleEffectArgument * effect)

Green shells that burst into shards.

Abilities: Rotten Blood (kind 330).

Definition at line 52 of file lobbed_shells.c.

Referenced by BattleFx_RunRottenBlood().

◆ BattleFx_RunLobbedShells()

void BattleFx_RunLobbedShells ( struct BattleEffectArgument * effect,
s32 mode )

Lobs a shell from the user at each target in turn, 8 frames apart.

Each tumbles through ten images as it flies and, when it lands, the target flashes and the battle shows the damage; the shell bursts into 4 smoke puffs that drift up or 16 shards that fly up and fall.

Called by the seven handlers above, from BattleFx_RunMadSpatter to BattleFx_RunRottenBlood. Loads three palettes over the first 64 background colours in turn, the style's last; uses PARTICLES 0 to 1023 for the shells and LOBBED_SHELLS_BURSTS for the bursts.

mode : the style, 0 to 6: the colours and the row of gLobbedShells_Records.

Definition at line 78 of file lobbed_shells.c.

Referenced by BattleFx_RunBoneChiller(), BattleFx_RunDecompose(), BattleFx_RunLobbedShells(), BattleFx_RunMadSpatter(), BattleFx_RunPoisonInk(), BattleFx_RunRottenBlood(), BattleFx_RunStickyGoo(), and BattleFx_RunStickyPoison().

◆ BattleFx_RunCondemn()

void BattleFx_RunCondemn ( struct BattleEffectArgument * effect)

A tall panel (57x98) swings across the screen three times, each pass fading out through a ripple, the last over the first target; on frame 88 it shatters in a white flash into a burst of larger pieces and the target is knocked back, bouncing on frame 120.

Abilities: Condemn (kind 40).

The effect layer ripples throughout. 132 frames.

Opens the tiled canvas (BattleFx_BeginTiledCanvas) and adds BattleFx_ArmBg2AffineHBlankDma to feed work->bg2xLines to BG2X; decodes the burst's pieces into Ram_MapCellBuffer; moves the target's object; and reloads the battle backdrop on BG1 before it closes the layer. It never calls EFFECT_SHOW_DAMAGE, and leaves the flash timers alone.

Definition at line 29 of file condemn.c.

Referenced by BattleFx_RunCondemn().

◆ Graphics_ConvertBackgroundToBlueRamp()

void Graphics_ConvertBackgroundToBlueRamp ( void )

Turns the screen into shades of blue, top down, with a ragged edge.

Works on a copy of the screen in Ram_MapCellBuffer. Each column starts up to 63 lines late, and the edge speeds up a little every frame; after at most 27 frames the picture moves onto a second blue ramp at colours 96 to 127. Takes 256 random numbers, one a column.

Nothing calls it or takes its address. Writes background colours 32 to 63 and then 96 to 127, the 0x7800 bytes of BG character block 2 (the backdrop's picture) and Ram_MapCellBuffer, keeps its delays in the sheet slot, and waits a frame for each step of the edge.

Definition at line 27 of file bind.c.

Referenced by Graphics_ConvertBackgroundToBlueRamp().

◆ BattleFx_RunBind()

void BattleFx_RunBind ( struct BattleEffectArgument * effect)

A triangle of light spins and shrinks onto the first target for 64 frames, then a rune stands on the target; the battle shows the result on frame 64.

Abilities: Bind (kind 38); Luff (kind 218).

When effect->prelude is 1 a Jupiter Djinni appears first, sways and rises away. The canvas darkens a little faster every 16 frames.

Runs BattleFx_RunDjinniEntrance first when effect->prelude is 1. Moves BG2X so the canvas's x 64 is on the first target, cycles the palette each frame through Graphics_UpdatePhasePalette, raises work->transferValue every 16 frames, keeps the triangle's corners in work->particles 0 to 2, and builds and frees its blitters every frame.

Definition at line 123 of file bind.c.

Referenced by BattleFx_RunBind().

◆ BattleFx_RunTriangleStrike()

void BattleFx_RunTriangleStrike ( struct BattleEffectArgument * effect)

The spinning triangle and rune of BattleFx_RunBind without the Djinni; on frame 46 the user steps up to the first target.

Abilities: none (kind 67).

Its own vertex, gBind_TriangleStrikeVertex, sets the triangle's size. Changes the same state as BattleFx_RunBind, on the narrow canvas, and starts the user's approach through BattleMotion_ApproachTargetFar.

Definition at line 297 of file bind.c.

Referenced by BattleFx_RunTriangleStrike().

◆ BattleFx_RunAstralBlast()

void BattleFx_RunAstralBlast ( struct BattleEffectArgument * effect)

Three star-shaped rings of light fly from 40 pixels above the user at the first target, 12 frames apart, growing and spinning as they go, while the camera swings round; each knocks the target back on arrival, and the third lets the battle show the damage.

Abilities: Astral Blast (kind 68).

work->particles 0 to 2 are the rings, battle positions in 16.16. Loads the rune palette into the first 64 background colours, sets the user's animation (2, at speed 48), turns the camera's yaw, sends the target back with its motion fields and sets work->shakeFrames.

Definition at line 25 of file stars.c.

Referenced by BattleFx_RunAstralBlast().

◆ BattleFx_RunShiningStar()

void BattleFx_RunShiningStar ( struct BattleEffectArgument * effect)

Eight spinning star outlines fall from 120 pixels above the user towards the first target, a few frames apart, and bounce off the ground near it, each bounce shaking the screen and flashing the targets; the battle shows the damage on frame 96.

Abilities: Shining Star (kind 62).

128 frames. work->particles 0 to 7 are the stars, battle positions in 16.16, each variant the frame it starts. Rebuilds the background ramp each frame (Graphics_UpdatePhasePalette, after loading the rune palette) and sets work->shakeFrames at each bounce.

Definition at line 212 of file stars.c.

Referenced by BattleFx_RunShiningStar().

◆ BattleFx_RunProcne()

void BattleFx_RunProcne ( struct BattleEffectArgument * effect)

A whirlwind lifts the targets, then comets from a block of objects in a violet sky strike them.

Abilities: Procne (scene kind 8).

400 frames: 0 to 159 : a whirlwind rises over the field and lifts the targets, spinning them round it and drawing them in, while dust spirals up; 160 : the backdrop becomes the violet sky, and a 3x3 block of nine objects appears and sways; 256 to 329 : motes gather into the middle of the block; 330 to 372 : four comets shoot out of it, 12 frames apart, each with a ring of sparks, striking the targets on frames 334, 347, 359 and 372 (gProcne_Frames); 395 : the targets fall back to the ground. Pressing A or B skips to frame 160, or from there to frame 395. At the end the battle shows the damage and the targets go back to their places.

work->particles hold the dust (0 to 23 drawn), then from frame 160 the gathering motes (0 to 31), the comets' rings (32 to 59) and the four comets (60 to 63). PARTICLES 0 to 511 hold the sparks, 128 for each comet of which 96 are thrown. The scene moves the targets' objects (position, height, angle and gravity) and puts back their places and angles at the end; it loads the whirlwind's and then the comets' palette into the first 64 background colours, moves gProjection.centerX to 72 from frame 160 and back to 120, and sets work->shakeFrames on each comet. It spawns the nine objects of the block on frame 160 and releases them before closing the canvas.

Definition at line 41 of file procne.c.

Referenced by BattleFx_RunProcne(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunDragonDriver()

void BattleFx_RunDragonDriver ( struct BattleEffectArgument * effect)

The rising embers from the user's side, in the LightningBolt colours.

Abilities: Dragon Driver (kind 385).

Definition at line 10 of file tiamat.c.

Referenced by BattleFx_RunDragonDriver().

◆ BattleFx_RunTiamat()

void BattleFx_RunTiamat ( struct BattleEffectArgument * effect)

The rising embers with a formation of eight objects that sweeps in and explodes at the end.

Abilities: Tiamat (scene kind 7).

Definition at line 17 of file tiamat.c.

Referenced by BattleFx_RunSceneEffect(), and BattleFx_RunTiamat().

◆ BattleFx_RunPaletteParticles()

void BattleFx_RunPaletteParticles ( struct BattleEffectArgument * effect,
s32 mode )

A 208-frame effect of embers rising from the ground; pressing A or B during frames 49 to 159 skips to frame 160.

The targets reel on frame 138, the screen flares white over frames 160 to 175 and fades out after, and the battle shows the damage on frame 178. mode : 0 also brings in a formation of eight objects that sweeps in and, at the end, explodes with BattleFx_RunImpactBurst; 1 throws the sparks and flashes from the user's side (effect->side), in the LightningBolt colours. Four kinds of particle, in canvas coordinates with y growing downwards: PARTICLES[0..511] embers: rise from y 112, speeding up; one a frame over frames 33 to 103, eight a frame over 104 to 175 particles[40..63] sparks: one on each odd frame from 41 to 127, thrown up at a slant particles[0..23] flashes: one a frame over 129 to 175, thrown across particles[24..39] streaks: fall at a slant from the top and, below y 55, play their images over and over An idle particle's variant is -1; a live one's counts its age up until it goes out (a streak's counts down its wait first).

Called by BattleFx_RunTiamat (mode 0) and BattleFx_RunDragonDriver (mode 1). Sets REG_BLDALPHA and REG_BG2CNT (the canvas in front, priority 0), loads the flash and later the streak palette (or the lightning bolt's) into the first 64 background colours and brightens them over frames 160 to 175, sets work->shakeFrames, and tints and shakes the targets. Mode 0 spawns the eight formation objects and releases them after the impact burst.

Definition at line 58 of file tiamat.c.

Referenced by BattleFx_RunDragonDriver(), BattleFx_RunPaletteParticles(), and BattleFx_RunTiamat().

◆ BattleFx_RunNereid()

void BattleFx_RunNereid ( struct BattleEffectArgument * effect)

A formation of twelve objects sweeps in among embers and columns of fire, and explodes.

Abilities: Nereid (scene kind 2).

124 frames; pressing A or B during frames 33 to 97 skips to frame 98. A formation of twelve objects sweeps in from the right; embers burst up on frame 28 and over frames 32 to 79, fall back under gravity and from frame 80 rise away, while three columns of fire stream upwards over frames 32 to 79 and the targets bounce. At the end the formation explodes with BattleFx_RunImpactBurst; the battle shows the damage on frame 120.

The embers are PARTICLES 0 to 1023, canvas pixels in 16.16, a variant of -1 marking an idle one. Loads the water spray palette into the first 64 background colours, sets REG_BLDALPHA, spawns the twelve formation objects (released at the end) and gives the targets an upward speed and the usual battle gravity at each bounce.

Definition at line 37 of file nereid.c.

Referenced by BattleFx_RunNereid(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunFroth()

void BattleFx_RunFroth ( struct BattleEffectArgument * effect)

Motes fly out of the top of the user, hang, and from 48 frames after each appears home in on the targets in turn; each that reaches the ground strikes in a burst, flashing and knocking back its target, while the camera swings round over frames 17 to 63.

Abilities: Froth, Froth Sphere, Froth Spiral (kind 10).

effect->variant picks the volley from gVortices_Counts (motes and frames) and how hard the screen shakes.

work->particles 0 to 29 are the motes, battle positions in 16.16 until a mote strikes and then its burst's canvas pixels; from 32, one seat for each target. The first 30 bytes of Ram_MapCellBuffer mark the motes that have struck. Loads the vortex palette into the first 64 background colours, sets REG_BLDALPHA and work->shakeFrames, and turns the camera through Camera_ApplyPhasedDelta (work->cameraDelta and cameraPhase), which it removes before it returns.

Definition at line 36 of file vortices.c.

Referenced by BattleFx_RunFroth().

◆ BattleFx_RunWhirlwind()

void BattleFx_RunWhirlwind ( struct BattleEffectArgument * effect)

Tornadoes sweep across the targets for 80 frames, sparkling with glints; the canvas flashes and the targets reel seven times, 8 frames apart, from frame 16, and the battle shows the damage on frame 32.

Abilities: Whirlwind, Tornado, Tempest, Gale, Typhoon, Hurricane (kind 20).

effect->variant picks the shape from gVortices_Shapes: how many tornadoes, how far they sway and how hard the screen shakes.

work->particles 0 to 15 are the glints, four for each tornado (so at most four tornadoes), offsets in pixels from its top left. Loads the tornado palette into the first 64 background colours, fades the canvas in and out through REG_BLDALPHA and keeps work->shakeFrames at 1 so the screen shakes every frame.

Definition at line 189 of file vortices.c.

Referenced by BattleFx_RunWhirlwind().

◆ BattleFx_RunPrism()

void BattleFx_RunPrism ( struct BattleEffectArgument * effect)

Crystals drop out of the sky onto the targets' side, 8 frames apart, and shatter on the ground into 16 spinning shards each, flashing the targets and shaking the screen; the battle shows the damage 80 frames before the end, and the canvas darkens away over the last 8.

Abilities: Prism, Hail Prism, Freeze Prism (kind 8).

effect->variant picks the volley from gPrism_Counts (crystals and frames: 1 in 110, 4 in 134, 12 in 166); with variant 2 the camera also swings round for the first 104 frames. The crystals are particles[]: z is 1 once shattered, variant is the frame it starts to fall. The shards are 16 per crystal in PARTICLES: z is how fast it spins.

Positions are canvas pixels in 16.16. Loads the crystal palette into the first 64 background colours and sets REG_BLDALPHA, the camera's yaw (variant 2) and work->shakeFrames, and flashes the targets at each shatter.

Definition at line 27 of file prism.c.

Referenced by BattleFx_RunPrism().

◆ Graphics_UpdatePhasePalette()

void Graphics_UpdatePhasePalette ( s32 frame,
s32 redPhase,
s32 greenPhase,
s32 bluePhase )

Rebuilds the background palette's first ramp as a grey ramp whose red, green and blue each sway with the frame, out of step by their phases (1/65536ths of a turn), so the effect shimmers through colours.

Called each frame by BattleFx_RunBind and BattleFx_RunTriangleStrike (bind.c), BattleFx_RunShiningStar (stars.c) and BattleFx_RunThor (thor.c). Level n's channel is (n + sway) / 2, the sway up to 32 levels either way, clamped to 0 to 31.

XXX: the 64 entries, black first, are copied to colours 1 to 64, so each level shows in the colour one above it and colour 64, the first of palette 4, is overwritten too. Whether the canvas's levels are meant to be one off would show in a capture of Thor or Bind against this palette.

frame : the effect's frame; the sway turns 1/64 of a circle a frame redPhase, greenPhase, bluePhase : each channel's offset in the sway

Definition at line 183 of file prism.c.

Referenced by BattleFx_RunBind(), BattleFx_RunShiningStar(), BattleFx_RunThor(), BattleFx_RunTriangleStrike(), and Graphics_UpdatePhasePalette().

◆ BattleFx_RunPlasma()

void BattleFx_RunPlasma ( struct BattleEffectArgument * effect)

Pillars of lightning strike one every 8 frames, each with a white flash, throwing sparks up from the ground and knocking the targets back; the battle shows the damage on frame 32.

Abilities: Plasma, Shine Plasma, Spark Plasma, Thunderclap, Thunderbolt, Thunderstorm (kind 18).

effect->variant picks how many pillars (gPlasma_Counts), how many sparks each throws and how long the screen shakes (gPlasma_Sparks); with variant 2 the camera also swings round for the first 64 frames. effect->side picks the row of pillar positions.

Sparks are PARTICLES 0 to 1023, canvas pixels in 16.16. Sets REG_BLDALPHA, loads the violet palette into the first 64 background colours (variant 2 keeps the lightning pillar sheet's), scrolls the camera (variant 2) and sets work->shakeFrames at each strike.

Definition at line 38 of file plasma.c.

Referenced by BattleFx_RunPlasma().

◆ BattleFx_RunNova()

void BattleFx_RunNova ( struct BattleEffectArgument * effect)

Bursts at (60, 48), the canvas behind the battle's first layer (priority 1).

Abilities: Blast, Nova, Supernova, Fire Bomb, Cluster Bomb, Carpet Bomb (kind 15).

Definition at line 198 of file plasma.c.

Referenced by BattleFx_RunNova().

◆ BattleFx_RunDynamite()

void BattleFx_RunDynamite ( struct BattleEffectArgument * effect)

Orange bursts at (60, 64), the canvas in front (priority 0).

Abilities: Dynamite (kind 338).

Definition at line 204 of file plasma.c.

Referenced by BattleFx_RunDynamite().

◆ BattleFx_RunSparkGroups()

void BattleFx_RunSparkGroups ( struct BattleEffectArgument * effect,
s32 mode )

One to three bursts, 8 frames apart: each flashes, rings itself with twelve smaller flashes that fade, and throws out sparks that bounce on the ground; every burst knocks the targets back.

effect->variant picks the shape from gPlasma_Shapes: sparks per burst, how many bursts, and each burst's offset across. Variant 2 also scrolls the camera, and variant 3 flashes the whole canvas on frame 4. mode : 0 at (60, 48), the battle shows the damage on frame 24; 1 at (60, 64), orange; the damage shows on frame 2; 2 below the user, in the LightningBolt colours, with the sparks rising instead of falling; the damage shows on frame 2.

Called by BattleFx_RunNova (mode 0) and BattleFx_RunDynamite (mode 1), and in mode 2 by BattleFx_RunCastingImpact for Severe Blow (variant 3) and by BattleFx_RunThrash (variant 4) and BattleFx_RunSparkApproachVariant3 (variant 3) in thrash.c, which set effect->variant first.

work->particles hold the ring flashes, 16 for each burst; PARTICLES the sparks, one run of gPlasma_Shapes' count for each burst. Sets REG_BLDALPHA, loads the flash burst palette into the first 64 background colours, then the orange (mode 1) or lightning (mode 2) one over it, scrolls the camera (variant 2) and sets work->shakeFrames at each burst.

Definition at line 234 of file plasma.c.

Referenced by BattleFx_RunCastingImpact(), BattleFx_RunDynamite(), BattleFx_RunNova(), BattleFx_RunSparkApproachVariant3(), BattleFx_RunSparkGroups(), and BattleFx_RunThrash().

◆ BattleFx_RunVolcano()

void BattleFx_RunVolcano ( struct BattleEffectArgument * effect)

One, two or four columns of fire (gVolcano_Counts by effect->variant) rise near the far edge on the targets' side, at the depths of gVolcano_Depths, starting at gVolcano_StartFrames; each erupts with a fountain of 200 sparks and keeps spitting more, and each eruption knocks the targets back.

Abilities: Volcano, Eruption, Pyroclasm, Lava Shower, Molten Bath, Magma Storm (kind 13).

The battle shows the damage on frame 16. Variant 0 is red, 2 orange; variant 2 also swings the camera round over the first 64 frames.

work->particles 0 to 3 are the pillars' feet, battle positions in 16.16. Sets REG_BLDALPHA, loads the red or orange palette into the first 64 background colours (variant 1 keeps the fire pillar sheet's), turns the camera's yaw (variant 2) and sets work->shakeFrames at each eruption.

Definition at line 36 of file volcano.c.

Referenced by BattleFx_RunVolcano().

◆ BattleFx_RunTaint()

void BattleFx_RunTaint ( struct BattleEffectArgument * effect)

Lime smoke (effect->variant 0) or pink smoke.

Abilities: Taint, Poison (kind 32).

Definition at line 20 of file target_motes.c.

Referenced by BattleFx_RunTaint().

◆ BattleFx_RunTargetMotesMode1()

void BattleFx_RunTargetMotesMode1 ( struct BattleEffectArgument * effect)

Pink smoke; no ☀️ effect table entry points here.

Definition at line 29 of file target_motes.c.

Referenced by BattleFx_RunTargetMotesMode1().

◆ BattleFx_RunDelude()

void BattleFx_RunDelude ( struct BattleEffectArgument * effect)

Cyan smoke that rises.

Abilities: Delude, Confuse, Mist (kind 33).

Definition at line 36 of file target_motes.c.

Referenced by BattleFx_RunDelude().

◆ BattleFx_RunParalyze()

void BattleFx_RunParalyze ( struct BattleEffectArgument * effect)

Rising smoke with glints.

Abilities: Paralyze (kind 36).

Definition at line 42 of file target_motes.c.

Referenced by BattleFx_RunParalyze().

◆ BattleFx_RunHeartrender()

void BattleFx_RunHeartrender ( struct BattleEffectArgument * effect)

Hearts.

Abilities: Heartrender (kind 346); kind 35 is used by no ability.

Definition at line 48 of file target_motes.c.

Referenced by BattleFx_RunHeartrender().

◆ BattleFx_RunMysticFlame()

void BattleFx_RunMysticFlame ( struct BattleEffectArgument * effect)

Glowing orbs.

Abilities: Mystic Flame (kind 312).

Definition at line 54 of file target_motes.c.

Referenced by BattleFx_RunCastingImpact(), and BattleFx_RunMysticFlame().

◆ BattleFx_RunDemonFire()

void BattleFx_RunDemonFire ( struct BattleEffectArgument * effect)

Glowing orbs in Mars Djinn colours, and the user strikes.

Abilities: Demon Fire (kind 64).

Definition at line 60 of file target_motes.c.

Referenced by BattleFx_RunDemonFire().

◆ BattleFx_RunDrown()

void BattleFx_RunDrown ( struct BattleEffectArgument * effect)

Vortex motes.

Abilities: Drown (kind 66).

Definition at line 66 of file target_motes.c.

Referenced by BattleFx_RunDrown().

◆ BattleFx_RunTargetMotes()

void BattleFx_RunTargetMotes ( struct BattleEffectArgument * effect,
u32 mode )

Around each target in turn, 8 frames apart, motes (smoke, hearts, orbs) turn about a point 20 pixels up, either closing in on it or rising, and the target flashes until the end; the battle shows the damage 32 frames before the end.

The effect layer ripples, except in modes 0, 1 and 3. mode : 0 lime smoke, 1 pink smoke, 2 cyan smoke, 3 smoke with glints, 4 hearts, 5 glowing orbs, 6 vortex motes, 7 orbs in Mars Djinn colours, with the user stepping up to strike the first target.

Called by the wrappers above: BattleFx_RunTaint (mode 0 or 1), BattleFx_RunDelude (2), BattleFx_RunParalyze (3), BattleFx_RunHeartrender (4), BattleFx_RunMysticFlame (5), BattleFx_RunDrown (6) and BattleFx_RunDemonFire (7).

Overwrites PARTICLES 0 to 511, loads the mode's palette into the first 64 background colours, and in the rippling modes writes work->bg2xLines each frame for BattleFx_ArmBg2AffineHBlankDma, which it schedules and removes. It builds both blitters afresh for each target every frame and releases them again, mode 3 a mirrored one for each glint too, so it ends with none held. Mode 7 sets work->shakeFrames.

Definition at line 106 of file target_motes.c.

Referenced by BattleFx_RunDelude(), BattleFx_RunDemonFire(), BattleFx_RunDrown(), BattleFx_RunHeartrender(), BattleFx_RunMysticFlame(), BattleFx_RunParalyze(), BattleFx_RunTaint(), BattleFx_RunTargetMotes(), and BattleFx_RunTargetMotesMode1().

◆ BattleFx_RunSleep()

void BattleFx_RunSleep ( struct BattleEffectArgument * effect)

Twelve sheep drop onto the targets' side, one every 4 frames, tumbling through eight images (the last four mirrored both ways); each target takes its damage pose in turn from frame 64, and the battle shows the result on frame 80.

Abilities: Sleep (kind 37).

148 frames. PARTICLES 0 to 31 are the sheep, canvas pixels in 16.16; only the first twelve fall. Loads the sheep palette into the first 64 background colours and sets REG_BLDCNT and BG2's affine registers (the narrow canvas, moved over the party's side when side is 1).

Definition at line 356 of file target_motes.c.

Referenced by BattleFx_RunSleep().

◆ BattleFx_RunCurse()

void BattleFx_RunCurse ( struct BattleEffectArgument * effect)

A small flame burns above each target in turn, 16 frames apart, for 72 frames each, over a marker at its feet; the battle shows the result on frame 32.

Abilities: Curse (kind 41); Lucid Prophecy (kind 354).

work->particles' variants give each flame its starting point in its animation. Loads the flame column palette into the first 64 background colours and sets REG_BLDCNT and BG2's affine registers (the narrow canvas, moved over the party's side when side is 1).

Definition at line 471 of file target_motes.c.

Referenced by BattleFx_RunCurse().

◆ BattleFx_RunDjinnHeal()

void BattleFx_RunDjinnHeal ( struct BattleEffectArgument * effect)

A small Mercury Djinni healing the party: the user glows while motes swirl round a point that rises from the user up to above the first target (frames 30 to 69); the Djinni appears there on frame 83.

Then, for each target in turn, 8 frames apart, sparkles spiral in on it with the recovery sound and a glow, while the Djinni sways and finally flies off. No effect table entry points here, and nothing calls it.

PARTICLES 0 to 63 hold the swirl's motes (the first 32 drawn), then 0 to 511 the healing sparkles, 64 for each target; both are offsets from the point the transform is centred on, in 16.16. work->sheet holds the Djinni, the battle sheet slot first the motes and then the sparkle dots.

Definition at line 21 of file djinn_heal.c.

Referenced by BattleFx_RunDjinnHeal().

◆ Camera_ApplyPhasedDelta()

void Camera_ApplyPhasedDelta ( void )

Turns the battle camera by cameraDelta.

The effect sets cameraPhase to 1 after each of its frames; the callback then turns the whole delta once, and half of it on the frames in between, so the turn stays smooth whatever the effect's frame rate.

Runs each frame as a scheduler callback added by BattleFx_RunFire (fire.c) and BattleFx_RunFroth (vortices.c), which remove it before they return. Changes the camera slot's yaw and work->cameraPhase.

Definition at line 230 of file djinn_heal.c.

Referenced by BattleFx_RunFire(), BattleFx_RunFroth(), and Camera_ApplyPhasedDelta().

◆ BattleFx_CallDoNothing()

void BattleFx_CallDoNothing ( s32 count)

Calls the empty BattleFx_DoNothing count times, without waiting for a frame: a busy delay that changes no state.

Called only by BattleFx_RunAnnihilation (annihilation.c), with 10000, before it releases the blitter it has just drawn with.

Definition at line 12 of file dispatch.c.

Referenced by BattleFx_CallDoNothing(), and BattleFx_RunAnnihilation().

◆ BattleFx_RunSceneEffect()

void BattleFx_RunSceneEffect ( struct BattleEffectArgument * effect)

Runs one of the large battle effects, the ones whose presentation flags have bit 15 set: takes the effect's sheet, work and canvas, runs the effect chosen by its kind to the end, and frees them again.

Called through BattleFx_RunSceneEffectFar by BattlePresentation_RunUnitTransition (battle/staging.c), when the plan's presentation flags have STAGING_SCENE, and by BattlePresentation_RunPairedUnitTransition (battle/auto_battle.c).

Each scene is named for the summon whose gBattle_ActionFlags entry selects its kind, as the handlers of gBattleFx_EffectHandlers are; kind 0, which no ability selects, runs Meteor's scene too. Takes heap slots HEAP_SLOT_BATTLE_SHEET, HEAP_SLOT_BATTLE_EFFECT and HEAP_SLOT_BATTLE_CANVAS and releases them in reverse, so the scene must have removed every callback that reads them. Unlike BattleFx_RunTableEffect it does not set work->effect: each scene does that itself.

Definition at line 45 of file dispatch.c.

Referenced by BattleFx_RunSceneEffect().

◆ BattleFx_RunTableEffect()

void BattleFx_RunTableEffect ( struct BattleEffectArgument * effect)

Runs an ordinary battle effect: takes the effect's sheet, work and canvas, runs the entry of gBattleFx_EffectHandlers for its kind, and frees them again.

Called through BattleFx_RunTableEffectFar by BattlePres_RunAttack, BattlePres_RunItem, BattlePres_RunPsynergyCast and BattlePresentation_RunUnitTransition (battle/staging.c, the last when the plan sets neither STAGING_SCENE nor STAGING_BY_ID_RANGE), and by BattlePres_RunUnitAction (battle/auto_battle.c).

Sets work->effect before the handler runs, which every handler and callback reads the effect through. Kind 0 is no effect and only clears effect->variant.

Definition at line 112 of file dispatch.c.

Referenced by BattleFx_RunTableEffect().

◆ BattleFx_BuildWindowEdgeTable()

void BattleFx_BuildWindowEdgeTable ( void )

Builds window 0's right edge for every scanline and restarts the HBlank DMA that writes it to WIN0H each line.

Runs each frame as a scheduler callback added by BattleFx_RunNeptune (neptune.c) and BattleFx_RunBoreas (boreas.c), which fill the edge offsets and remove the callback again. Writes the WIN0H table and stops and re-arms DMA channel 0.

Ram_MapCellBuffer + 0 : the base right edge (u16) Ram_MapCellBuffer + 2 : how far each of lines 8 to 135 pulls the edge in (u8 x 128) Ram_MapCellBuffer + 0x82 : the WIN0H table built here (u16 x 160) Lines outside 8 to 135 get 0xfff1, a left edge past the right, so nothing of them is in the window. Edges are clamped to 0 to 240.

Definition at line 148 of file dispatch.c.

Referenced by BattleFx_BuildWindowEdgeTable(), BattleFx_RunBoreas(), and BattleFx_RunNeptune().

◆ BattleFx_SelectLivingTargets()

void BattleFx_SelectLivingTargets ( struct BattleEffectArgument * effect)

Shows the battle objects of every unit with HP left on the targets' side: the enemies (units 128 to 133) when the first target is one, otherwise the party (units 0 to 7).

Called by the summon scenes (Ramses, Nereid, Kirin, Atalanta, Cybele, Neptune, Tiamat, Procne, Judgment, Boreas, Thor) and the particle streams as they open. Spawns the objects through BattleActor_SpawnObjectsForListFar.

Definition at line 184 of file dispatch.c.

Referenced by BattleFx_RunAtalanta(), BattleFx_RunBoreas(), BattleFx_RunCybele(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunNeptune(), BattleFx_RunNereid(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunProcne(), BattleFx_RunRamses(), BattleFx_RunThor(), and BattleFx_SelectLivingTargets().

◆ BattleFx_SetupBlendedDisplay()

void BattleFx_SetupBlendedDisplay ( void )

Shows the BG1 battle background behind a cleared canvas: clears the canvas buffer and the 16 KiB of VRAM it is copied to, then blends BG2 over the rest at 14/16 and moves the projection centre down to line 120.

Called by the summon scenes (Ramses, Kirin, Atalanta, Neptune, Procne, Judgment, Boreas, Thor) and the particle streams as they close, to give the battle back its own background. Sets gBgScroll[1].y to 32, reloads BG1 with the battle's background, waits one frame with the display off but for mode 1, then writes REG_BLDALPHA, REG_BLDCNT and REG_DISPCNT and gProjection.centerY.

Definition at line 217 of file dispatch.c.

Referenced by BattleFx_RunAtalanta(), BattleFx_RunBoreas(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunNeptune(), BattleFx_RunParticleStreams(), BattleFx_RunProcne(), BattleFx_RunRamses(), BattleFx_RunThor(), and BattleFx_SetupBlendedDisplay().

◆ ObjectGroup_UpdateMembers()

void ObjectGroup_UpdateMembers ( s32 actorId,
s32 palette,
s32 animation,
s32 timerSlot,
s32 timerFrames )

Updates every animation group of one battler's object.

actorId: the battler whose object is updated. palette: the colour mode each sprite part takes (enum SpriteColorMode), 0 for the battler's own, or -1 to leave the parts alone. A part that changes colours also restarts its frame. animation: the pose each group switches to (enum BattlePose), or -1 for none. timerSlot: the actor timer (gBattleFxWork's actorTimers) to set, or -1; ObjectGroup_TickMemberTimers restores the battler's palette when it runs out. timerFrames: the frames that timer counts. The parts and animations of a battler that is fading out stay as they are, but its timer is still set.

Called throughout the effects, most often through EFFECT_STRIKE_TARGET when a hit lands. Writes work->actorTimers[timerSlot] and each part's param and frame (0xff restarts it).

Definition at line 254 of file dispatch.c.

Referenced by BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBladeRain(), BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDouse(), BattleFx_RunDragonCloud(), BattleFx_RunDrain(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFlare(), BattleFx_RunFrost(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunGrowingColumns(), BattleFx_RunHail(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunIce(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunLobbedShells(), BattleFx_RunMirroredWall(), BattleFx_RunMoteFountain(), BattleFx_RunNeptune(), BattleFx_RunNereid(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunPlanetDiver(), BattleFx_RunPlasma(), BattleFx_RunPrism(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRagnarok(), BattleFx_RunRamses(), BattleFx_RunRay(), BattleFx_RunRushingStrike(), BattleFx_RunShatteringOpening(), BattleFx_RunShiningStar(), BattleFx_RunSleep(), BattleFx_RunSparkGroups(), BattleFx_RunSpiderWeb(), BattleFx_RunSpire(), BattleFx_RunStatBoost(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlSwipe(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunThorn(), BattleFx_RunTitanBlade(), BattleFx_RunUndeadSword(), BattleFx_RunVine(), BattleFx_RunVolcano(), BattleFx_RunWhirlwind(), ObjectGroup_TickMemberTimers(), and ObjectGroup_UpdateMembers().

◆ BattleFx_InitTilemapAndFlushQueue()

void BattleFx_InitTilemapAndFlushQueue ( void )

Writes the tiled canvas tilemap for BG2 (priority 1), then closes the canvas layer again, which fades the background palette back in.

Nothing in The Broken Seal calls it; The Lost Age keeps it too.

Definition at line 308 of file dispatch.c.

Referenced by BattleFx_InitTilemapAndFlushQueue().

◆ BattleFx_RunCybele()

void BattleFx_RunCybele ( struct BattleEffectArgument * effect)

Thorn vines: thorns fly in from the right, vines grow out of the ground and lift the targets while sparks flash around them, the picture dissolves pixel by pixel, and the targets drop and explode.

Abilities: Cybele (scene kind 5).

366 frames:

  • 0 to 127: the formation objects drop in, landing on frame 31; from 72 a thorn flies in from the right each frame.
  • 128 to 224: vines grow out of the ground, shaking the screen, while chips fly; sparks flash around the targets, which rise from 161.
  • 224 to 247: the first 64 background colours fade to grey.
  • 233 on: the canvas dissolves from the top, two rows a frame.
  • 286 on: the targets drop, 5 frames apart.
  • 302 on: each target is hit 16 frames after it drops and bursts into a blast and embers.

Pressing A or B between frames 191 and 285 skips to the drop. At the end the battle shows the damage and an impact burst (BattleFx_RunImpactBurst) explodes at the formation.

Besides the canvas and work->particles (above), it writes the dissolve order into the first 1024 bytes of Ram_MapCellBuffer, greys the first 64 background colours, lifts and drops the targets' objects (their y and gravity), and sets REG_BG2X, REG_BG2PA, REG_BLDCNT and work->shakeFrames. It spawns eight formation objects and releases them, the transfer callback and the blitters before it closes the canvas layer.

Definition at line 50 of file cybele.c.

Referenced by BattleFx_RunCybele(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunBoreas()

void BattleFx_RunBoreas ( struct BattleEffectArgument * effect)

Rocks and ice blocks: a window opens on rocks that crumble, a big ice block drops and throws up spray; then ice blocks rain down on the targets, and boulders crumble into bouncing chips.

Abilities: Boreas (scene kind 10).

The longest of the effects, in two halves. The first (288 frames, which A or B cuts short after frame 16) opens a window on a field of 16 rocks over the violet sky and nine animation objects; the rocks crumble in three waves (frames 32, 64 and 104), throwing up chips, a big ice block drops in on frames 160 to 175 and, from frame 224, bursts into spray trailed by smoke. The second (146 frames) gives the battle background back and rains ice blocks on the targets while boulders rise, crumble on frame 72 and bounce on the ground; the targets tint blue from frame 32 and the damage shows on frame 96.

Particles, by half: in the first, PARTICLES 0 to 63 are the chips (screen pixels in 16.16; a negative variant is one not yet thrown), then 0 to 127 the spray, with its smoke at BOREAS_ICE_BLOCK_TRAILS; in the second, work->particles 0 to 63 are the falling ice blocks and then the boulder chips, and PARTICLES 0 to 63 the smoke puffs, in whole pixels.

Also clears background colours 0 and 1 for the wipe and then loads the ice block palette over the first 64, writes the window registers and the window-edge table at Ram_MapCellBuffer (through BattleFx_BuildWindowEdgeTable), gBgScroll[1] for the shake, gProjection.centerY and work->shakeFrames; it releases the nine objects before the second half and its callbacks and blitters at the end.

Definition at line 45 of file boreas.c.

Referenced by BattleFx_RunBoreas(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunBreak()

void BattleFx_RunBreak ( struct BattleEffectArgument * effect)

Ice shards burst up from each target in turn, 20 frames apart, tinting the target as they go, and fall away below line 112.

Abilities: Break (kind 43).

Target n's 128 shards are PARTICLES n * 128 onwards, screen positions on the half-width canvas in 16.16; a shard's variant counts its frames and is -1 once it has gone. Loads the ice block palette into the first 64 colours of the background palette.

Definition at line 18 of file drain.c.

Referenced by BattleFx_RunBreak().

◆ BattleFx_RunDrain()

void BattleFx_RunDrain ( struct BattleEffectArgument * effect)

Drain: motes of light burst from each target in turn, 20 frames apart, and are pulled into the centre of the user's body.

Abilities: Drain, Psy Drain (kind 42).

Each target flashes in its damage pose for 42 frames as its motes burst, and the user glows from frame 40 until 20 frames before the end. Target n's motes are PARTICLES n * 128 onwards, battle positions in 16.16; only the first 32 of each 128 are moved and drawn. A negative variant marks a mote that has gone out.

effect: the targets; variant 0 takes the ice block palette, any other the blast palette.

Definition at line 143 of file drain.c.

Referenced by BattleFx_RunDrain().

◆ BattleFx_RunPly()

void BattleFx_RunPly ( struct BattleEffectArgument * effect)

Ply: sparkles of light swirl around each target and close in on it, in the ice shard's or ice block's colours; the canvas is shown at its own width, centred on the first target.

Abilities: Ply, Ply Well, Pure Ply, Herb, Nut, Vial, Potion, Soothing Water (kind 22); Fizz (kind 204).

Definition at line 25 of file healing.c.

Referenced by BattleFx_RunPly().

◆ BattleFx_RunWish()

void BattleFx_RunWish ( struct BattleEffectArgument * effect)

Wish (scattering style 1): healing motes tumble in from all around each target.

Abilities: Wish, Wish Well, Pure Wish (kind 23); Regenerate (kind 44); Reflect (kind 45); Spritz (kind 206).

Definition at line 33 of file healing.c.

Referenced by BattleFx_RunWish().

◆ BattleFx_RunCure()

void BattleFx_RunCure ( struct BattleEffectArgument * effect)

Cure (mode 2): a ring of healing motes below each target closes in on it, in the blast sheet's colours.

Abilities: Cure, Cure Well, Potent Cure, Corn (kind 21); Worms (kind 352).

Definition at line 40 of file healing.c.

Referenced by BattleFx_RunCure().

◆ BattleFx_RunCurePoison()

void BattleFx_RunCurePoison ( struct BattleEffectArgument * effect)

Cure Poison: sparkles twinkle around each target, four more a frame, and go out one by one instead of closing in.

Abilities: Cure Poison, Restore, Antidote, Elixir (kind 24).

Definition at line 47 of file healing.c.

Referenced by BattleFx_RunCurePoison().

◆ BattleFx_RunHealingMotesMode4()

void BattleFx_RunHealingMotesMode4 ( struct BattleEffectArgument * effect)

Healing sparkles with scattering style 4, sent out from each target, as Cure Poison plays them for variants other than 0.

No effect table entry reaches this one.

Definition at line 58 of file healing.c.

Referenced by BattleFx_RunHealingMotesMode4().

◆ BattleFx_RunTonic()

void BattleFx_RunTonic ( struct BattleEffectArgument * effect)

Tonic (scattering style 5): sparkles twinkle around each target, turning on two axes, and go out one by one; mode 5 plays as mode 4 does.

Abilities: Tonic (kind 208).

Definition at line 65 of file healing.c.

Referenced by BattleFx_RunTonic().

◆ BattleFx_RunPsyCrystal()

void BattleFx_RunPsyCrystal ( struct BattleEffectArgument * effect)

Psy Crystal: healing motes gather around each target in the Mars Djinni palette; with a prelude, a Mars Djinni appears first.

Abilities: Psy Crystal, Adept Ring, Ember (kind 212).

Definition at line 72 of file healing.c.

Referenced by BattleFx_RunPsyCrystal().

◆ BattleFx_RunHealingMotes()

void BattleFx_RunHealingMotes ( struct BattleEffectArgument * effect,
u32 mode )

Healing sparkles: motes of light scattered around each target swirl in towards it, one target every 8 frames, with the recovery sound on each target's 20th frame and a tint on its 36th.

Called by the wrappers above: BattleFx_RunPly (mode 0), BattleFx_RunWish (1), BattleFx_RunCure (2), BattleFx_RunCurePoison (3 or 4), BattleFx_RunTonic (5) and BattleFx_RunPsyCrystal (6).

Sets work->effect, overwrites PARTICLES 0 to 511 and the first 64 colours of the background palette, decodes into the battle sheet slot and work->sheet, and in mode 0 writes REG_BG2X and REG_BG2PA. After a djinni prelude it clears effect->variant, so the variant's mote count and resource fall back to variant 0's. The transfer callback it adds is removed again at the end, with the blitters and the canvas layer.

effect: the targets. With prelude 1, a djinni (Mars in mode 6, Mercury otherwise) appears first, sways and rises. variant picks the motes per target (0: 32, 2: 128, others: 64) and, in modes 0, 1, 3, 4 and 5, the resource (0: ice shard, others: ice block). mode: how the motes scatter and turn. Only mode 0 shows the canvas at its own width, centred on the first target. Modes 3, 4 and 5 put the motes out one by one instead of drawing them in; modes 0, 3, 4 and 5 draw sparkle dots. Mode 6 takes the Mars resource, mode 2 the blast resource.

Definition at line 107 of file healing.c.

Referenced by BattleFx_RunCure(), BattleFx_RunCurePoison(), BattleFx_RunHealingMotes(), BattleFx_RunHealingMotesMode4(), BattleFx_RunPly(), BattleFx_RunPsyCrystal(), BattleFx_RunTonic(), and BattleFx_RunWish().

◆ BattleFx_RunImpact()

void BattleFx_RunImpact ( struct BattleEffectArgument * effect)

Gathers stat-boost light and displays a dagger in Mars colours.

Abilities: Impact, High Impact, Demon Spear, Angel Spear (kind 26); Forge (kind 210); kind 46 is used by no ability.

Definition at line 11 of file stat_change.c.

Referenced by BattleFx_RunImpact().

◆ BattleFx_RunGuard()

void BattleFx_RunGuard ( struct BattleEffectArgument * effect)

Gathers stat-boost light and displays a shield in Mars colours.

Abilities: Guard, Protect, Guardian, Protector (kind 28); Corona (kind 211).

Definition at line 17 of file stat_change.c.

Referenced by BattleFx_RunGuard().

◆ BattleFx_RunWard()

void BattleFx_RunWard ( struct BattleEffectArgument * effect)

Gathers stat-boost light and displays a shield in Jupiter colours.

Abilities: Ward, Resist, Magic Shell, Magic Shield (kind 30); Breeze (kind 215).

Definition at line 24 of file stat_change.c.

Referenced by BattleFx_RunWard().

◆ BattleFx_RunGranite()

void BattleFx_RunGranite ( struct BattleEffectArgument * effect)

Gathers stat-boost light and displays a violet streak in Venus colours.

Abilities: Granite (kind 200).

Definition at line 30 of file stat_change.c.

Referenced by BattleFx_RunGranite().

◆ BattleFx_RunFlash()

void BattleFx_RunFlash ( struct BattleEffectArgument * effect)

Gathers stat-boost light and displays a violet streak in Mars colours.

Abilities: Flash (kind 213).

Definition at line 36 of file stat_change.c.

Referenced by BattleFx_RunFlash().

◆ BattleFx_RunZephyr()

void BattleFx_RunZephyr ( struct BattleEffectArgument * effect)

Gathers stat-boost light and displays a wisp without replacing its palette.

Abilities: Zephyr (kind 216).

Definition at line 42 of file stat_change.c.

Referenced by BattleFx_RunZephyr().

◆ BattleFx_RunStatBoost()

void BattleFx_RunStatBoost ( struct BattleEffectArgument * effect,
u32 mode )

Flares of light swirl in to the centre of each target, one target every 8 frames, burst, and the mode's picture plays.

Target n's flares appear from frame 8n + 1; it glows white on 8n + 48, the burst plays from 8n + 52 and the picture, with a sound, from 8n + 80. The canvas is shown at 1.25 times its width (canvas x is 4/5 of screen x). PARTICLES holds the gathering flares, 64 for each target.

Reached through the six wrappers above, Impact to Zephyr. Copies the mode's palette over the first 128 bytes of BG palette RAM (all but Zephyr), writes REG_BG2PA and REG_BG2X, and ends with the transfer callback removed and the canvas layer closed; the blitters are built and freed within each frame.

effect: the targets. With prelude 1, a Djinni appears first, sways and rises. mode: the picture: 0 a dagger, 1 and 2 a shield, 3 and 5 a violet streak, 4 a wisp. The palette comes from the Venus djinni in mode 3, the Jupiter djinni in mode 2, the Mars djinni in modes 0, 1 and 5; mode 4 keeps the palette. The Djinni is Venus in mode 3, Jupiter in modes 2 and 4, Mars otherwise.

Definition at line 76 of file stat_change.c.

Referenced by BattleFx_RunFlash(), BattleFx_RunGranite(), BattleFx_RunGuard(), BattleFx_RunImpact(), BattleFx_RunStatBoost(), BattleFx_RunWard(), and BattleFx_RunZephyr().

◆ BattleFx_RunDull()

void BattleFx_RunDull ( struct BattleEffectArgument * effect)

Breaks the dagger picture into shards that fade through darker copies.

Abilities: Dull, Blunt (kind 27).

Definition at line 374 of file stat_change.c.

Referenced by BattleFx_RunDull().

◆ BattleFx_RunImpair()

void BattleFx_RunImpair ( struct BattleEffectArgument * effect)

A shield appears over each target and breaks into shards that fade through darker copies, in the glow orb's colours (style 1).

Abilities: Impair, Debilitate (kind 29); kind 47 is used by no ability. Casting impact 21 (Meltdown) also ends by calling it.

Definition at line 382 of file stat_change.c.

Referenced by BattleFx_RunCastingImpact(), and BattleFx_RunImpair().

◆ BattleFx_RunWeaken()

void BattleFx_RunWeaken ( struct BattleEffectArgument * effect)

A shield appears over each target and breaks into fading shards, in the pink burst's colours (style 2).

Abilities: Weaken, Enfeeble (kind 31).

Definition at line 389 of file stat_change.c.

Referenced by BattleFx_RunWeaken().

◆ BattleFx_RunStatReductionMode3()

void BattleFx_RunStatReductionMode3 ( struct BattleEffectArgument * effect)

Breaks the shield picture into fading shards with style 3, which plays as style 2 does.

No effect table entry reaches it.

Definition at line 395 of file stat_change.c.

Referenced by BattleFx_RunStatReductionMode3().

◆ BattleFx_RunStatReduction()

void BattleFx_RunStatReduction ( struct BattleEffectArgument * effect,
s32 mode )

Stat cuts: a dagger (mode 0) or a shield (other modes) appears over each target, 4 frames apart, and then breaks into 24 shards that fly off and fade out through the darker copies.

In each target's own frames the picture plays until about frame 24, then breaks with a sound; the shards darken from frame 29 and are gone after frame 60.

Reached through Dull, Impair, Weaken and the unused mode 3 wrapper above. Copies the mode's palette over the first 128 bytes of BG palette RAM, writes REG_BG2PA and REG_BG2X, and ends with the transfer callback removed, both blitters freed and the canvas layer closed.

effect: the targets. mode: 0 the dagger and the pink burst palette, 1 the shield and the glow orb palette, 2 and 3 the shield and the pink burst palette.

Definition at line 419 of file stat_change.c.

Referenced by BattleFx_RunDull(), BattleFx_RunImpair(), BattleFx_RunStatReduction(), BattleFx_RunStatReductionMode3(), and BattleFx_RunWeaken().

◆ BattleFx_RunFlare()

void BattleFx_RunFlare ( struct BattleEffectArgument * effect)

Flame arc: nine flames rise one after another, 4 frames apart, along a half circle, over 80 frames.

Abilities: Flare, Flare Wall, Flare Storm (kind 11).

Each target flashes red in turn, 8 frames apart from frame 16. Writes REG_BLDCNT and REG_BLDALPHA, and ends with the blitter freed, the transfer callback removed and the canvas layer closed.

effect: the targets. variant 1 adds a second flame 16 pixels above each one, variant 2 a third 32 pixels above (and longer trails).

Definition at line 20 of file flare.c.

Referenced by BattleFx_RunFlare().

◆ BattleFx_BuildCenteredIndexList()

s32 BattleFx_BuildCenteredIndexList ( BattleEffectIndexWindow * window,
s16 * output )

List the indices within indexRadius of where currentValue sits in values, keeping only those from 0 to entryLimit - 1.

Writes the indices to output and returns how many there are.

Only the first indexRadius * 2 + 1 values are searched, and with no match the window centres on index 0. Changes nothing but output. Nothing calls it.

Definition at line 175 of file flare.c.

Referenced by BattleFx_BuildCenteredIndexList().

◆ BattleFx_RunQuake()

void BattleFx_RunQuake ( struct BattleEffectArgument * effect)

Rock wall: three rock pillars rise from the left, 4 frames apart, and sink again, throwing the targets standing on them into the air.

Abilities: Quake, Earthquake, Quake Sphere (kind 1).

Each pillar is capped with a strip of ground cut from the background.

Writes REG_BG2PA, REG_BLDCNT and, on side 1, REG_BG2X; overwrites the first 0x8000 bytes of Ram_MapCellBuffer with BG tiles; sets the targets' vertical velocity and gravity; arms work->shakeFrames. Ends with the transfer callback removed, the blitter freed and the canvas layer closed.

effect: the targets; variant picks the row of gQuake_Timings.

Definition at line 37 of file quake.c.

Referenced by BattleFx_RunQuake().

◆ BattleFx_RunFire()

void BattleFx_RunFire ( struct BattleEffectArgument * effect)

Homing embers: embers burst from the top of the user two a frame, turn towards the targets 48 frames after they appear, and each one that hits the ground shows an impact flare for 12 frames as its target flinches.

Abilities: Fire, Fireball, Inferno (kind 12).

The camera swings round over frames 17 to 79, and the battle shows the damage 24 frames before the end.

Schedules Camera_ApplyPhasedDelta for the swing and drives it through work->cameraDelta and work->cameraPhase; sets work->shakeFrames on each hit and writes REG_BLDALPHA. Ends with both callbacks removed, the blitters freed and the canvas layer closed.

effect: the targets; variant picks the number of embers (gFire_Counts).

Definition at line 26 of file fire.c.

Referenced by BattleFx_RunFire().

◆ BattleFx_RunFrost()

void BattleFx_RunFrost ( struct BattleEffectArgument * effect)

Rising motes: motes spiral upwards while ice columns spring up one every 3 frames from frame 36; at the burst frame the motes spread and fall, chips fly and smoke rises over the heights they span.

Abilities: Frost, Tundra, Glacier (kind 6).

The targets take a blue tint 4 frames apart from frame 40, the battle shows the damage 11 frames after the burst, and the effect ends 75 frames after it.

work->particles holds the 64 motes (angle, height and radius in x, y and z); after the burst the first 32 also hold the smoke puffs, in their velocity and variant fields, while motes 0 to 15 keep moving in theirs. PARTICLES holds the 32 chips. Writes REG_BG2PA and, on side 1, REG_BG2X; ends with the blitters freed, the transfer callback removed and the canvas layer closed.

effect: the targets; variant picks the number of motes and columns and the burst frame (gFrost_Timings).

Definition at line 33 of file frost.c.

Referenced by BattleFx_RunFrost().

◆ BattleFx_RunRay()

void BattleFx_RunRay ( struct BattleEffectArgument * effect)

Closing bolts: four bolts turn in towards the centre for 16 frames, scattering sparks from their roots; the sparks fly on until frame 64.

Abilities: Ray, Storm Ray, Destruct Ray (kind 17).

The targets flash white 4 frames apart from frame 4. Writes REG_BG2PA and REG_BG2X, sets work->shakeFrames over the first 16 frames, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets. variant 2 shows the canvas at double width; variant 0 draws every bolt with the maximum blend, the others alternate it with additive. The variant also sets the sparks each bolt throws a frame (gRay_Sparks).

Definition at line 26 of file ray.c.

Referenced by BattleFx_RunRay().

◆ BattleFx_RunSmokeBomb()

void BattleFx_RunSmokeBomb ( struct BattleEffectArgument * effect)

A fountain of grey motes and puffs of smoke bursts up beside the targets and falls back, flashing each target.

Abilities: Smoke Bomb, Sleep Bomb (kind 380).

It always uses the second row of gEruption_Counts: 32 motes, 16 puffs, 80 frames.

Definition at line 14 of file eruption.c.

Referenced by BattleFx_RunSmokeBomb().

◆ BattleFx_RunBlast()

void BattleFx_RunBlast ( struct BattleEffectArgument * effect)

A fountain of fire-coloured motes and puffs of smoke bursts up beside the targets and falls back, flashing each target and making it recoil.

Abilities: Blast, Mad Blast, Fiery Blast (kind 14).

Definition at line 21 of file eruption.c.

Referenced by BattleFx_RunBlast().

◆ BattleFx_RunEruption()

void BattleFx_RunEruption ( struct BattleEffectArgument * effect,
s32 mode )

A fountain of motes and puffs of smoke bursts up beside the targets and falls back, hitting the targets one frame apart from frame 6.

Called by BattleFx_RunBlast (mode 0) and BattleFx_RunSmokeBomb (mode 1). A sound and a 6-frame screen shake start on frame 2, and the battle shows the damage 48 frames before the end. Writes the first 64 BG colours, sets work->shakeFrames, and ends with the transfer callback removed, the blitter freed and the canvas layer closed.

effect: the targets. mode: 0 burns (the fire streak palette, the effect's variant picks the counts, and the targets recoil); 1 is grey (a ramp of greys, variant 1's counts).

Definition at line 47 of file eruption.c.

Referenced by BattleFx_RunBlast(), BattleFx_RunEruption(), and BattleFx_RunSmokeBomb().

◆ BattleFx_SpawnObjects()

void BattleFx_SpawnObjects ( s32 entryCount,
s32 source,
u32 priority )

Creates the effect's animation objects in gBattleFxWork's objects.

Called by the summon scenes (Ramses, Nereid, Kirin, Atalanta, Cybele, Neptune, Tiamat, Procne, Boreas, Thor), Judgment and the particle streams. Fills work->objects[0] to [entryCount - 1]: object n plays animation n, with its flags cleared and its sprite priority set. A slot whose object could not be created is left NULL.

entryCount: how many objects to create. source: the resource object every one of them is made from. priority: the sprite priority they take.

Definition at line 220 of file eruption.c.

Referenced by BattleFx_RunAtalanta(), BattleFx_RunBoreas(), BattleFx_RunCybele(), BattleFx_RunJudgment(), BattleFx_RunKirin(), BattleFx_RunNeptune(), BattleFx_RunNereid(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunProcne(), BattleFx_RunRamses(), BattleFx_RunThor(), and BattleFx_SpawnObjects().

◆ BattleFx_DoNothing()

void BattleFx_DoNothing ( void )

Does nothing.

BattleFx_CallDoNothing calls it in a loop, 10000 times for Annihilation, a busy wait.

Definition at line 242 of file eruption.c.

Referenced by BattleFx_CallDoNothing(), and BattleFx_DoNothing().

◆ BattleFx_ArmBg2AffineHBlankDma()

void BattleFx_ArmBg2AffineHBlankDma ( void )

Arms DMA 0 to copy one word of gBattleFxWork's bg2xLines table into BG2X at each horizontal blank, bending BG2 line by line.

Runs each frame as a scheduler callback added by the target motes, the casting impacts, Condemn, the gathering lights, Torch and Planet Diver, each of which removes it before it returns. Stops DMA 0 and restarts it from the top of the table.

Definition at line 31 of file burst_shower.c.

Referenced by BattleFx_ArmBg2AffineHBlankDma(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunGatheringLights(), BattleFx_RunHaunt(), BattleFx_RunOrbitingSpirals(), BattleFx_RunTargetMotes(), and BattleFx_RunTorch().

◆ BattleFx_RunFireBlessing()

void BattleFx_RunFireBlessing ( struct BattleEffectArgument * effect)

The user fires a stream of flash bursts at the targets, one a frame, each towards a random point near a target.

Abilities: Fire Blessing (kind 400).

Definition at line 43 of file burst_shower.c.

Referenced by BattleFx_RunFireBlessing().

◆ BattleFx_RunWaterBlessing()

void BattleFx_RunWaterBlessing ( struct BattleEffectArgument * effect)

The user fires a stream of bursts at the targets in the water-spray palette.

Abilities: Water Blessing (kind 401).

Definition at line 49 of file burst_shower.c.

Referenced by BattleFx_RunWaterBlessing().

◆ BattleFx_RunDarkBlessing()

void BattleFx_RunDarkBlessing ( struct BattleEffectArgument * effect)

The user fires a stream of grey bursts at the targets, which turn solid black and stay so.

Abilities: Dark Blessing (kind 403).

Definition at line 56 of file burst_shower.c.

Referenced by BattleFx_RunDarkBlessing().

◆ BattleFx_RunAcidBlessing()

void BattleFx_RunAcidBlessing ( struct BattleEffectArgument * effect)

Fires pink bursts from 16 pixels below the normal origin.

Abilities: Dark Blessing, Acid Blessing (kind 404).

Definition at line 62 of file burst_shower.c.

Referenced by BattleFx_RunAcidBlessing().

◆ BattleFx_RunStormBlessing()

void BattleFx_RunStormBlessing ( struct BattleEffectArgument * effect)

Shows violet lightning between the user and targets instead of bursts: a bolt flickers through three pictures in front of the user, and the targets flash in turn without being knocked back.

Abilities: Storm Blessing (kind 405).

Definition at line 70 of file burst_shower.c.

Referenced by BattleFx_RunStormBlessing().

◆ BattleFx_RunEvilBlessing()

void BattleFx_RunEvilBlessing ( struct BattleEffectArgument * effect)

The user fires a stream of demon faces at the targets, from 16 pixels in front of it.

Abilities: Evil Blessing (kind 406).

Definition at line 77 of file burst_shower.c.

Referenced by BattleFx_RunEvilBlessing().

◆ BattleFx_RunDeadlyGas()

void BattleFx_RunDeadlyGas ( struct BattleEffectArgument * effect)

The user fires a stream of Mars-coloured bursts at the targets, from 28 pixels in front of it.

Abilities: Deadly Gas (kind 407).

Definition at line 84 of file burst_shower.c.

Referenced by BattleFx_RunDeadlyGas().

◆ BattleFx_RunBurstShower()

void BattleFx_RunBurstShower ( struct BattleEffectArgument * effect,
s32 mode )

Burst shower: for 48 frames the user fires one burst a frame at a random point near one of the targets, taking them in turn, and each target is hit every 8 frames.

Each burst lives 24 frames. A sound plays on frame 4 and the battle shows the damage on frame 24 (frame 60 in the grey mode).

Called by the seven blessing wrappers above. Each burst is one of work->particles, its variant counting the frames it has lived (-1 when free). Writes REG_BLDALPHA, the first 64 BG colours (all but modes 5 and 7), REG_BLDCNT in the grey mode and REG_BG2PA in the lightning mode; sets work->shakeFrames on each hit. Ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the user and the targets. mode: the burst and its palette: 0 flash bursts, 1 in the ice block palette, 2 in the water spray palette, 3 pink and fired from 16 pixels lower, 4 in the Mars djinni palette from 28 pixels in front, 6 grey (the targets turn solid black and stay so), 7 demon faces from 16 pixels in front. Mode 5 fires no bursts: a violet lightning bolt stands between the user and the targets, on a canvas shown at three times its width. No kind in the effect table uses mode 1.

Definition at line 110 of file burst_shower.c.

Referenced by BattleFx_RunAcidBlessing(), BattleFx_RunBurstShower(), BattleFx_RunDarkBlessing(), BattleFx_RunDeadlyGas(), BattleFx_RunEvilBlessing(), BattleFx_RunFireBlessing(), BattleFx_RunStormBlessing(), and BattleFx_RunWaterBlessing().

◆ BattleFx_RunSwirlingStars()

void BattleFx_RunSwirlingStars ( struct BattleEffectArgument * effect)

Swirling stars: 64 stars scattered around a point 80 pixels up spin about it, each on its own axis, appearing four a frame; 30 frames after it appears, each star is drawn back towards the centre.

Stars are drawn smaller the further away they are. The scene runs for 160 frames. All 256 stars of the pool are seeded, at rest in a cube 255 pixels across, though only 64 are drawn.

Nothing calls it. Draws through the side's blitters mirrored (side ^ 1), and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

Definition at line 25 of file orbiting.c.

Referenced by BattleFx_RunSwirlingStars().

◆ BattleFx_RunOrbitingSkulls()

void BattleFx_RunOrbitingSkulls ( void )

Orbiting skulls: three skulls circle each target in turn, 16 frames apart, for 64 frames each, a third of a turn apart on a circle of 8 pixels around the target.

Runs with the effect already in gBattleFxWork.

Nothing calls it. Copies the skull palette over the first 128 bytes of BG palette RAM; writes REG_BG2PA, REG_BG2X and REG_BLDALPHA; keeps each skull's angle in velocityX of work->particles, three to a target. Ends with the transfer callback removed, the blitter freed and the canvas layer closed.

Definition at line 123 of file orbiting.c.

Referenced by BattleFx_RunOrbitingSkulls().

◆ BattleFx_RunTargetBursts()

void BattleFx_RunTargetBursts ( struct BattleEffectArgument * effect)

Target bursts: on each target in turn, 8 frames apart, a burst flares up in the middle while five puffs of smoke scatter around it, for 40 frames.

Nothing calls it. Copies the pink burst palette over the first 128 bytes of BG palette RAM, uses work->particles six to a target, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

Definition at line 235 of file orbiting.c.

Referenced by BattleFx_RunTargetBursts().

◆ BattleFx_RunAtalanta()

void BattleFx_RunAtalanta ( struct BattleEffectArgument * effect)

Rain of blades: under a violet sky, a 3x3 formation of objects flies along a stored path while sixteen blades gather trails of light, flash and fly off; A or B skips ahead.

Abilities: Atalanta (scene kind 4).

Then 24 blades fall diagonally on the targets and burst into flame, hitting each target as they land.

The gathering lasts up to 220 frames and the fall 88. work->particles holds the 16 gathering blades and then the falling ones; PARTICLES holds 24 trail particles for each gathering blade, with their rotations in ATALANTA_MATRICES. The formation is nine objects in work->objects, released between the parts. Loads the violet sky into BG1 and scrolls it with BattleFx_AdvanceScrollOnInterval during the gathering, holding view->busy; restores gBgScroll[1].x and gives BG1 back with BattleFx_SetupBlendedDisplay between the parts. Leaves the ember sheet in Ram_MapCellBuffer, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets.

Definition at line 50 of file atalanta.c.

Referenced by BattleFx_RunAtalanta(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunGrowth()

void BattleFx_RunGrowth ( struct BattleEffectArgument * effect)

Grows vines from the ground, scattering dust from each root.

Abilities: Growth, Mad Growth, Wild Growth (kind 4).

Definition at line 36 of file growth.c.

Referenced by BattleFx_RunGrowth().

◆ BattleFx_RunPunji()

void BattleFx_RunPunji ( struct BattleEffectArgument * effect)

Grows green pillars from the ground, scattering dust from each root.

Abilities: Punji, Punji Trap, Punji Strike (kind 56).

Definition at line 42 of file growth.c.

Referenced by BattleFx_RunPunji().

◆ BattleFx_RunGrowingColumns()

void BattleFx_RunGrowingColumns ( struct BattleEffectArgument * effect,
s32 mode )

Vines (mode 0) or green pillars (mode 1) grow one every 4 frames, alternately mirrored, each throwing up dust from its root.

Column i appears on frame 4i + 9, shaking the screen, and grows 8 pixels a frame to a random length capped by its shape (i % 3); a pillar also stops at its gGrowth_PillarHeights. On frame 4i + 12 the targets react (even columns with a sound), and on frames 4i + 12 and 4i + 16 the column throws up a puff of dust. The battle moves on to the results 64 frames before the end; the scene fades out over 16 frames, and nothing grows in its last 4.

Called by BattleFx_RunGrowth (mode 0) and BattleFx_RunPunji (mode 1). work->particles holds the 16 columns (struct DualColumn) and PARTICLES the dust. Writes REG_BG2PA, REG_BLDCNT, REG_BLDALPHA and, on side 1, REG_BG2X; sets work->shakeFrames as each column appears. Ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets; variant picks the number of columns (gGrowth_ColumnCounts).

Definition at line 63 of file growth.c.

Referenced by BattleFx_RunGrowingColumns(), BattleFx_RunGrowth(), and BattleFx_RunPunji().

◆ BattleFx_RunVine()

void BattleFx_RunVine ( struct BattleEffectArgument * effect)

Rising vines: sixteen green vines grow from the middle of the row of targets, 2 frames apart, and shrink back.

Abilities: Vine (kind 202).

Vine i appears on frame 2i + 5 and grows 4 pixels a frame up to 32, cycling through five 32x32 pictures, then shrinks away from frame 2i + 32; odd vines are mirrored. Vine i shakes the screen on frame 4i + 5. On frame 32 the targets react together, with a sound.

A Djinni appears first (BattleFx_RunDjinniEntrance). work->particles holds the 16 vines' x. Writes REG_BG2PA, REG_BLDCNT and REG_BG2X, sets work->shakeFrames, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

Definition at line 325 of file growth.c.

Referenced by BattleFx_RunVine().

◆ BattleFx_RunThorn()

void BattleFx_RunThorn ( struct BattleEffectArgument * effect)

Rising thorns: thorns burst from the ground one every 8 frames, throwing up dust from their roots.

Abilities: Thorn, Briar, Nettle (kind 5).

Thorn i appears on frame 8i + 9, shaking the screen, and throws up a puff of dust on each of its first two frames; on frame 8i + 12 the targets react with a sound. The battle moves on to the results 64 frames before the end, and the scene fades out over its last 16 frames.

effect: the targets; variant picks the number of thorns (gGrowth_Counts). gGrowth_Kinds gives each thorn's size and direction.

PARTICLES holds the dust, 64 puffs. Writes REG_BG2PA, REG_BLDCNT, REG_BLDALPHA and, on side 1, REG_BG2X; sets work->shakeFrames as each thorn appears. Ends with the transfer callback removed, the blitters freed and the canvas layer closed.

Definition at line 431 of file growth.c.

Referenced by BattleFx_RunThorn().

◆ BattleFx_RunBolt()

void BattleFx_RunBolt ( struct BattleEffectArgument * effect)

A bolt of lightning strikes each target in turn, 8 frames apart.

Abilities: Bolt, Flash Bolt, Blue Bolt (kind 16).

Target i's turn starts on frame 8i with a flash of the canvas. The bolt drops from the top, 64 pixels a frame down to y 104, and the screen shakes the frame after; on frame 8i + 2 sparks fly up from its foot and glints flicker there for 22 frames; on frame 8i + 4 the target recoils. The battle moves on to the results on frame 24.

PARTICLES holds the sparks, 128 for each target. Sets work->shakeFrames on each strike, and ends with the transfer callback removed, the blitter freed and the canvas layer closed; the glints' blitter is built and freed for each glint.

effect: the targets; variant picks the row of gBolt_Counts and the glints' blend.

Definition at line 40 of file bolt.c.

Referenced by BattleFx_RunBolt().

◆ BattleFx_RunDjinniEntrance()

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 the Djinni, which sways for 16 frames and bursts into motes.

Leaves the canvas cleared for the effect that follows.

The prelude of the stat boosts, the projectile volleys, the healing motes, the Djinn beams, the burst scenes, Bind, Hail, Ground, Torch and Vine, called with the work block they then use. Opens the canvas layer but does not close it: it removes the transfer and palette fade callbacks, frees both blitters, clears the canvas and its VRAM, and sets REG_BLDALPHA back to 16/16. Copies the Djinni's palette over the first 128 bytes of BG palette RAM, starts a 24-frame backdrop fade (work->fadeFrames), and uses PARTICLES 0 to 63 for the sparks and work->particles for the motes.

effect: the user and the targets. mode: the Djinni: 0 Venus, 1 Mercury, 2 Mars, 3 Jupiter; 4 to 7 the same over 84 frames instead of 64. side: 1 mirrors the pictures. anchor: where the Djinni appears: 0 over the first target, 1 at the first target's x at depth 0, 2 over the user, 3 at the user's x at depth 0, 4 in the centre of the field. outX, outY: receive the Djinni's last screen position.

Definition at line 29 of file projectiles.c.

Referenced by BattleFx_RunBind(), BattleFx_RunBurstScene(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinniEntrance(), BattleFx_RunGround(), BattleFx_RunHail(), BattleFx_RunHealingMotes(), BattleFx_RunKite(), BattleFx_RunProjectileVolley(), BattleFx_RunStatBoost(), BattleFx_RunTorch(), and BattleFx_RunVine().

◆ BattleFx_RunSlash()

void BattleFx_RunSlash ( struct BattleEffectArgument * effect)

Six comets fly at each target, three frames apart, and burst into a flash and sparks; the effect's variant picks one of three comets.

Abilities: Slash, Wind Slash, Sonic Slash (kind 19).

Definition at line 268 of file projectiles.c.

Referenced by BattleFx_RunSlash().

◆ BattleFx_RunShuriken()

void BattleFx_RunShuriken ( struct BattleEffectArgument * effect)

Four spinning shurikens fly at each target, five frames apart, and vanish once past it.

Abilities: Shuriken (kind 54).

Definition at line 275 of file projectiles.c.

Referenced by BattleFx_RunShuriken().

◆ BattleFx_RunCrazyVoice()

void BattleFx_RunCrazyVoice ( struct BattleEffectArgument * effect)

Ten pellets fly slowly at each target and bounce off it, up or down at random.

Abilities: Crazy Voice (kind 303).

Definition at line 282 of file projectiles.c.

Referenced by BattleFx_RunCrazyVoice().

◆ BattleFx_RunWingFlutter()

void BattleFx_RunWingFlutter ( struct BattleEffectArgument * effect)

Five yellow sparks fly level at each target, five frames apart.

Abilities: Wing Flutter (kind 307).

Definition at line 288 of file projectiles.c.

Referenced by BattleFx_RunWingFlutter().

◆ BattleFx_RunWingStroke()

void BattleFx_RunWingStroke ( struct BattleEffectArgument * effect)

Ten large yellow sparks stream level at each target, one a frame, spread up and down.

Abilities: Wing Stroke (kind 381).

Definition at line 295 of file projectiles.c.

Referenced by BattleFx_RunWingStroke().

◆ BattleFx_RunWingBeat()

void BattleFx_RunWingBeat ( struct BattleEffectArgument * effect)

Ten small yellow sparks stream level at each target, one a frame.

Abilities: Wing Beat (kind 306).

Definition at line 301 of file projectiles.c.

Referenced by BattleFx_RunWingBeat().

◆ BattleFx_RunCuttingEdge()

void BattleFx_RunCuttingEdge ( struct BattleEffectArgument * effect)

From the user's action pose, one large comet in ice colours flies at each target and bursts into 80 sparks.

Abilities: Cutting Edge (kind 57).

Definition at line 326 of file projectiles.c.

Referenced by BattleFx_RunCuttingEdge().

◆ BattleFx_RunHeatWave()

void BattleFx_RunHeatWave ( struct BattleEffectArgument * effect)

From the user's action pose, seven fireballs trailing embers fly at each target, two frames apart, each bursting into 40 sparks.

Abilities: Heat Wave (kind 59).

Definition at line 333 of file projectiles.c.

Referenced by BattleFx_RunHeatWave().

◆ BattleFx_RunSleet()

void BattleFx_RunSleet ( struct BattleEffectArgument * effect)

Thirty ice chips fall from high above the user onto each target, without shaking the screen or knocking the target back; the battle shows the damage on frame 48.

Abilities: Sleet (kind 205).

Definition at line 341 of file projectiles.c.

Referenced by BattleFx_RunSleet().

◆ BattleFx_RunIceBlessing()

void BattleFx_RunIceBlessing ( struct BattleEffectArgument * effect)

Sixty ice chips stream at each target, one a frame, without knocking it back.

Abilities: Ice Blessing (kind 402).

Definition at line 348 of file projectiles.c.

Referenced by BattleFx_RunIceBlessing().

◆ BattleFx_RunBlizzard()

void BattleFx_RunBlizzard ( struct BattleEffectArgument * effect)

From the user's action pose, sixty ice chips stream at each target, one a frame, scattered up and down, without knocking it back.

Abilities: Blizzard (kind 63).

Definition at line 355 of file projectiles.c.

Referenced by BattleFx_RunBlizzard().

◆ BattleFx_RunProjectileVolley()

void BattleFx_RunProjectileVolley ( struct BattleEffectArgument * effect,
s32 mode )

Projectile volley: shots fly from the user to each target and burst into a flash and sparks when they pass it.

The hit sound plays at most once every 8 frames.

Called by the eleven wrappers above, and by casting impacts 15 (mode 9) and 26 (mode 8, which no wrapper uses) once their prelude ends. With more than 63 shots in all it fires at the first target only, writing work->effect->count. Writes REG_BLDCNT in mode 1 and the first 128 bytes of BG palette RAM in modes 2 and 5; sets work->shakeFrames on each hit but in mode 7. Ends with the transfer callback removed, the blitter freed and the canvas layer closed; the second blitter is built and freed for each picture that needs it.

effect: the user and the targets. variant picks the comet in mode 0 (mode 5 always uses comet 2, mode 8 comet 0); with prelude 1 a Mercury Djinni enters first. mode: the shot and its flight (0 to 11): 0, 5 and 8 comets (5 in the ice palette), 1 shurikens, 2 bouncing pellets, 3, 4 and 11 yellow sparks, 6 fireballs with trails, 7, 9 and 10 ice chips.

Definition at line 404 of file projectiles.c.

Referenced by BattleFx_RunCastingImpact(), BattleFx_RunCrazyVoice(), BattleFx_RunIceBlessing(), BattleFx_RunProjectileVolley(), BattleFx_RunShuriken(), BattleFx_RunSlash(), BattleFx_RunSleet(), BattleFx_RunVolleyWithAction(), BattleFx_RunWingBeat(), BattleFx_RunWingFlutter(), and BattleFx_RunWingStroke().

◆ BattleFx_InitializeRisingObject()

void BattleFx_InitializeRisingObject ( s32 id)

Sends a battler back to its place (its anchor) with a hop.

Nothing calls it; ObjMotRst (battle/motion.c) sets the same motion without the hop. Sets the battler's motion object to move at up to 8 pixels a frame, jumping at 4 pixels a frame under the usual gravity, and selects its animation 1.

Definition at line 960 of file projectiles.c.

Referenced by BattleFx_InitializeRisingObject().

◆ BattleFx_SetApproachMotion()

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.

The speed is that distance over the frames; the distance is taken in 1/256 pixels so its square fits in 32 bits.

Called by BattleFx_RunRushingStrike. Sets the battler's acceleration, speed limit and gravity, turns it to face its motion, starts it moving on the ground towards that point and selects its animation 2.

Definition at line 984 of file projectiles.c.

Referenced by BattleFx_RunRushingStrike(), and BattleFx_SetApproachMotion().

◆ Graphics_PackTileRows()

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).

Called by BattleFx_RunRushingStrike and twice by the casting impacts, to squeeze a 40-pixel-wide sheet into 20-pixel pictures. Writes only dst.

src: the rows to pack. dst: receives the packed rows, half the stride apart. stride: the bytes in one row of src. rowCount: ignored; 288 rows are always packed.

Definition at line 17 of file rushing_strike.c.

Referenced by BattleFx_RunRushingStrike(), CastingImpact_PackRows(), and Graphics_PackTileRows().

◆ BattleFx_RunBoneCharge()

void BattleFx_RunBoneCharge ( struct BattleEffectArgument * effect)

Rushes the target and scatters sparks in the fire pillar palette.

Abilities: Bone Charge (kind 311).

Definition at line 39 of file rushing_strike.c.

Referenced by BattleFx_RunBoneCharge().

◆ BattleFx_RunBruteForce()

void BattleFx_RunBruteForce ( struct BattleEffectArgument * effect)

Rushes the target and scatters sparks in the ice-block palette.

Abilities: Brute Force (kind 314).

Definition at line 45 of file rushing_strike.c.

Referenced by BattleFx_RunBruteForce().

◆ BattleFx_RunOnslaught()

void BattleFx_RunOnslaught ( struct BattleEffectArgument * effect)

Rushes the target and scatters sparks in the pink-burst palette.

Abilities: Onslaught (kind 326).

Definition at line 51 of file rushing_strike.c.

Referenced by BattleFx_RunOnslaught().

◆ BattleFx_RunHeadbutt()

void BattleFx_RunHeadbutt ( struct BattleEffectArgument * effect)

Rushes the target and scatters sparks in the blast palette.

Abilities: Headbutt (kind 339).

Definition at line 57 of file rushing_strike.c.

Referenced by BattleFx_RunHeadbutt().

◆ BattleFx_RunRushingStrike()

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 it hits and 64 sparks scatter, over 60 frames in all.

Called by the four wrappers above. work->particles holds the sparks, each variant its frames left; the six packed ring pictures go to Ram_MapCellBuffer. Moves the user with BattleFx_SetApproachMotion and does not bring it back. Copies the mode's palette over the first 128 bytes of BG palette RAM, sets work->shakeFrames on the strike, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the user and the targets. mode : the palette: 0 fire pillar, 1 ice block, 2 pink burst, 3 blast.

Definition at line 76 of file rushing_strike.c.

Referenced by BattleFx_RunBoneCharge(), BattleFx_RunBruteForce(), BattleFx_RunHeadbutt(), BattleFx_RunOnslaught(), and BattleFx_RunRushingStrike().

◆ Graphics_TransposeCopy()

void Graphics_TransposeCopy ( const u8 * src,
u8 * dst,
s32 w,
s32 h )

Copies a w x h byte picture into an h x w one turned 90 degrees clockwise: the top row of src becomes the right column of dst.

Called twice by BattleFx_RunMercury, to lay its blue flames on their side. Writes only dst.

Definition at line 12 of file djinn_attacks.c.

Referenced by BattleFx_RunMercury(), and Graphics_TransposeCopy().

◆ BattleFx_RunMercury()

void BattleFx_RunMercury ( struct BattleEffectArgument * effect)

Mercury Djinni flames: the small Mercury Djinni spirals around (96, 60) and fires five blue flames to the left; each flame shatters into 32 motes after 5 frames, hitting every target.

Abilities: Mercury (kind 251).

work->particles 0 to 4 hold the flames, variant -1 until launched and then counting the frames since; Ram_MapCellBuffer takes the blue flame sheet before it is turned. Sets work->shakeFrames as each flame shatters, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets.

Definition at line 78 of file djinn_attacks.c.

Referenced by BattleFx_RunMercury().

◆ BattleFx_RunJupiter()

void BattleFx_RunJupiter ( struct BattleEffectArgument * effect)

Jupiter Djinni fall: the small Jupiter Djinni spirals while eight flameballs fall from the top right to the bottom left, 4 frames apart; each shatters into 32 motes below line 95, hitting every target.

Abilities: Jupiter (kind 253).

work->particles holds the flameballs. Copies the Djinni's palette over the first 128 bytes of BG palette RAM, writes REG_BLDALPHA, sets work->shakeFrames as each ball lands, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets.

Definition at line 220 of file djinn_attacks.c.

Referenced by BattleFx_RunJupiter().

◆ Resource_LoadAndDecompress()

void Resource_LoadAndDecompress ( s32 id,
void * dst,
s32 skipPalette,
s32 copyPalette )

Decompresses a resource whose first 128 bytes may be a palette.

Called by nearly every effect to load its pictures. Writes dst and, with copyPalette, the first 128 bytes of BG palette RAM.

id: the resource. dst: receives the decompressed data. skipPalette: the resource starts with a palette to skip. copyPalette: copy that palette to the start of background palette RAM.

Definition at line 337 of file djinn_attacks.c.

Referenced by BattleFx_RunAnnihilation(), BattleFx_RunAtalanta(), BattleFx_RunBeamSequence(), BattleFx_RunBladeRain(), BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCurse(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDouse(), BattleFx_RunDragonCloud(), BattleFx_RunDrain(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFlare(), BattleFx_RunFlashingStrike(), BattleFx_RunFrost(), BattleFx_RunGaia(), BattleFx_RunGround(), BattleFx_RunGrowingColumns(), BattleFx_RunHail(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunIce(), BattleFx_RunImpactBurst(), BattleFx_RunJudgment(), BattleFx_RunJupiter(), BattleFx_RunKirin(), BattleFx_RunMars(), BattleFx_RunMercury(), BattleFx_RunMoteFountain(), BattleFx_RunNeptune(), BattleFx_RunParticleStreams(), BattleFx_RunPlasma(), BattleFx_RunPrism(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRagnarok(), BattleFx_RunRamses(), BattleFx_RunRay(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShatteringOpening(), BattleFx_RunSleep(), BattleFx_RunSparkGroups(), BattleFx_RunSpiderWeb(), BattleFx_RunSpire(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlingStars(), BattleFx_RunSwirlSwipe(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunThorn(), BattleFx_RunTitanBlade(), BattleFx_RunUndeadSword(), BattleFx_RunVenus(), BattleFx_RunVine(), BattleFx_RunVolcano(), CastingImpact_LoadResource(), and Resource_LoadAndDecompress().

◆ BattleFx_RunVenus()

void BattleFx_RunVenus ( struct BattleEffectArgument * effect)

Venus Djinni columns: the small Venus Djinni sways while ten columns of flame in its colours rise from the ground one after another, each bursting into motes and hitting every target.

Abilities: Venus (kind 250).

work->particles holds the columns. Copies the Djinni's palette over the first 128 bytes of BG palette RAM, writes REG_BLDALPHA, sets work->shakeFrames as each column appears, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets.

Definition at line 366 of file djinn_attacks.c.

Referenced by BattleFx_RunVenus().

◆ BattleFx_RunMars()

void BattleFx_RunMars ( struct BattleEffectArgument * effect)

Mars Djinni flames: a glowing orb flares, the small Mars Djinni dives to the ground, and nine flames erupt in a row while embers rise.

Abilities: Mars (kind 252).

The scene runs for 112 frames:

0 to 23 the orb flares 20 to 31 the Djinni appears, then dives from frame 24 32 it strikes: the screen shakes and the flames start erupting 38 every target is hit 40 on the embers rise, 16 more every 2 frames

work->particles holds the nine flames, PARTICLES their 144 embers. The BG palette's first 128 bytes change three times: the glow orb's at the start, the Djinni's on frame 20 and the ember streak's on frame 32, when the streak sheet replaces the Djinni in work->sheet. Sets work->shakeFrames on the strike, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the targets.

Definition at line 499 of file djinn_attacks.c.

Referenced by BattleFx_RunMars().

◆ BattleFx_RunHail()

void BattleFx_RunHail ( struct BattleEffectArgument * effect)

Water burst: after a Mercury Djinni enters, ice chips burst out of the first target and waves rise along the bottom of the screen; the canvas fades out over the last 16 of its 64 frames.

Abilities: Hail (kind 207).

The 64 chips start together and are let go four a frame from frame 4, alternately mirrored; the battle shows the damage on frame 8. The chips live in PARTICLES, since work holds the waves' sheet.

The Djinni entrance plays whatever the prelude. Writes REG_BLDALPHA and the first 128 bytes of BG palette RAM (the water spray's, then the ice chips' on frame 1), sets work->shakeFrames on frame 8, and ends with the transfer callback removed, the blitters freed and the canvas layer closed.

effect: the user and the targets; prelude 1 keeps the Djinni circling.

Definition at line 30 of file hail.c.

Referenced by BattleFx_RunHail().

◆ BattleFx_RunGround()

void BattleFx_RunGround ( struct BattleEffectArgument * effect)

Venus Djinni rock toss: after a Venus Djinni enters, six rocks rise from the user shedding chips, swirl, and home in on the first target, each hitting it as it lands.

Abilities: Ground (kind 203).

A rock's variant is 1 while it flies and 0 once it has hit; the chips are particles 32 to 63, four for each rock, each with its picture in velocityX and its blitter flags in velocityY. The Djinni entrance plays whatever the prelude. From frame 17 the BG palette steps towards the portal sheet's (BattleFx_StepPaletteToResource). Writes REG_BLDALPHA, sets work->shakeFrames on each hit, and ends with the transfer callback removed, the blitter freed and the canvas layer closed.

effect: the user and the targets; prelude 1 keeps the Djinni circling.

Definition at line 187 of file hail.c.

Referenced by BattleFx_RunGround().

◆ Camera_ApplyShake()

void Camera_ApplyShake ( s32 rangeX,
u32 rangeY )

Shakes the battle view while gBattleFxWork's shakeFrames lasts, moving BG1 and the projection centre by a random offset; once the shake runs out, BG1 returns to its saved position and the centre to (120, 120).

It takes two random numbers each shaking frame, x first.

Called once a frame by nearly every effect, before it presents the frame. Writes gBgScroll[1] and gProjection.centerX and centerY, and counts down work->shakeFrames. The x offset is centred on half of rangeY too, so with rangeX smaller (Hail's 4 and 8) the x offset is never positive.

rangeX: the horizontal range, a power of two. rangeY: the vertical range, a power of two; both offsets are centred on half of it.

Definition at line 364 of file hail.c.

Referenced by BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBladeRain(), BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDragonCloud(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFlashingStrike(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGround(), BattleFx_RunGrowingColumns(), BattleFx_RunHail(), BattleFx_RunHelmSplitter(), BattleFx_RunIce(), BattleFx_RunJupiter(), BattleFx_RunKirin(), BattleFx_RunLobbedShells(), BattleFx_RunMars(), BattleFx_RunMercury(), BattleFx_RunMirroredWall(), BattleFx_RunNeptune(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunPlanetDiver(), BattleFx_RunPlasma(), BattleFx_RunPrism(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRagnarok(), BattleFx_RunRamses(), BattleFx_RunRay(), BattleFx_RunRushingStrike(), BattleFx_RunShiningStar(), BattleFx_RunSparkGroups(), BattleFx_RunSpire(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlSwipe(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunThorn(), BattleFx_RunTitanBlade(), BattleFx_RunUndeadSword(), BattleFx_RunVenus(), BattleFx_RunVine(), BattleFx_RunVolcano(), BattleFx_RunWhirlwind(), and Camera_ApplyShake().

◆ BattleFx_RunThor()

void BattleFx_RunThor ( struct BattleEffectArgument * effect)

The scene plays in two parts on the effect canvas.

Abilities: Thor (scene kind 12).

In the dusk part (THOR_DUSK_FRAMES, which A or B cuts short) a circle of 128 dots and three lines across it form over scrolling dusk clouds; the circle turns, sinks into the sky and a beam of light falls from it. In the lightning part (THOR_LIGHTNING_FRAMES) a pillar of lightning strikes the formation and throws sparks, THOR_BOLTS violet bolts follow while a violet mote sways above, and the formation is pushed back in smoke until an impact burst ends the effect. The sparks live in THOR_PARTICLES; a spark whose variant is 0 is free, and a positive variant counts the frames it has left.

Definition at line 68 of file thor.c.

Referenced by BattleFx_RunSceneEffect(), and BattleFx_RunThor().

◆ BattleFx_RunSpire()

void BattleFx_RunSpire ( struct BattleEffectArgument * effect)

Shattering rocks: boulders drop along the row of targets, centred on it, and burst into tumbling shards, hitting every target as each lands.

Abilities: Spire, Clay Spire, Stone Spire (kind 2).

effect: the targets; its variant picks the number of boulders (gSpire_RockCounts).

Definition at line 23 of file spire.c.

Referenced by BattleFx_RunSpire().

◆ BattleFx_RunGust()

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 canvas with light.

Abilities: Gust (kind 219); Rapid Smash, Sonic Smash, Slice (kind 310).

Definition at line 11 of file burst_scene.c.

Referenced by BattleFx_RunGust().

◆ BattleFx_RunBearClaw()

void BattleFx_RunBearClaw ( struct BattleEffectArgument * effect)

Bear Claw: five strikes, the burst scene in mode 0.

Abilities: Bear Claw (kind 317); Counterstrike (kind 342).

Definition at line 26 of file burst_scene.c.

Referenced by BattleFx_RunBearClaw().

◆ BattleFx_RunRansack()

void BattleFx_RunRansack ( struct BattleEffectArgument * effect)

Ransack: the same five strikes as Bear Claw (mode 0).

Abilities: Ransack (kind 321); Mad Dash (kind 343).

Definition at line 33 of file burst_scene.c.

Referenced by BattleFx_RunRansack().

◆ BattleFx_RunBacteriaRush()

void BattleFx_RunBacteriaRush ( struct BattleEffectArgument * effect)

Bacteria Rush: seven strikes in the lime palette (mode 1).

Abilities: Bacteria Rush (kind 328).

Definition at line 40 of file burst_scene.c.

Referenced by BattleFx_RunBacteriaRush().

◆ BattleFx_RunFreebiteRush()

void BattleFx_RunFreebiteRush ( struct BattleEffectArgument * effect)

Freebite Rush: nine strikes in the blue palette (mode 2).

Abilities: Freebite Rush (kind 334).

Definition at line 47 of file burst_scene.c.

Referenced by BattleFx_RunFreebiteRush().

◆ BattleFx_RunFlyingAttack()

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.

Abilities: Flying Attack (kind 319); Swift Strike (kind 329).

Definition at line 55 of file burst_scene.c.

Referenced by BattleFx_RunFlyingAttack().

◆ BattleFx_RunBurstScene()

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 (or, in rows with arc sheet 0, a wave for the third and fourth of every four), flashes and throws motes.

A strike lands 2 frames after it starts: an odd one jolts the target, and the last knocks it back, shakes the screen harder and ends the attack. The motes wait above the target until their strike releases them, then bounce off the ground and die out.

Called by the six wrappers above it, with the mode their ability needs. Uses PARTICLES 0 to 767 for the motes, 32 a strike, and both blitter slots, rebuilt twice a frame; loads palette colours 0 to 63 from the row's palette resource.

effect: the user and the targets; prelude 1 brings in a Jupiter Djinni first. mode : the row of gBurstScene_Records.

Definition at line 100 of file burst_scene.c.

Referenced by BattleFx_RunBacteriaRush(), BattleFx_RunBearClaw(), BattleFx_RunBurstScene(), BattleFx_RunFlyingAttack(), BattleFx_RunFreebiteRush(), BattleFx_RunGust(), and BattleFx_RunRansack().

◆ BattleFx_RunGaia()

void BattleFx_RunGaia ( struct BattleEffectArgument * effect)

Rising wall: the ground swells, a wall of rock rises from it, stands while rocks tumble up its face and the targets are battered, and sinks again.

Abilities: Gaia, Mother Gaia, Grand Gaia, Rockfall, Rockslide, Avalanche (kind 3).

The wall is symmetric: its left half is drawn, then mirrored for the right. Its centre is at canvas x 64 + wallX. The rocks are 11 animation objects, moved by particles[10] to particles[20].

effect: the targets; variant 0 to 2 widens the wall.

Definition at line 26 of file gaia.c.

Referenced by BattleFx_RunGaia().

◆ EffectStep_AdvanceWithGravity3D()

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, then damps every speed by damping / 64.

Called each frame for the 3D sparks, motes, shards and shells of 18 parts, from the casting impacts, the beam sequences and the burst scene to the lobbed shells and the stat reductions; each then projects the particle with EffectPosition_ProjectPoint. Changes only the step.

Definition at line 29 of file positions.c.

Referenced by BattleFx_RunAnnihilation(), BattleFx_RunBeamSequence(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunEruption(), BattleFx_RunGatheringLights(), BattleFx_RunHail(), BattleFx_RunJudgment(), BattleFx_RunLobbedShells(), BattleFx_RunMoteFountain(), BattleFx_RunParticleStreams(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetBursts(), BattleFx_RunTargetStrike(), and EffectStep_AdvanceWithGravity3D().

◆ EffectStep_AdvanceWithGravity2D()

void EffectStep_AdvanceWithGravity2D ( struct EffectStep * step,
s32 damping,
s32 gravity )

Moves a particle one frame on the screen: adds its velocity, then gravity to its vertical speed, then damps both speeds by damping / 64.

Called each frame for the screen-space sparks, motes, chips and puffs of 20 parts, among them Thor, Spire, Ramses, Ragnarok, the Titan Blade, the Helm Splitter, the Djinn attacks and the projectile volleys. Changes only the step; z and velocityZ are left alone.

Definition at line 46 of file positions.c.

Referenced by BattleFx_RunBolt(), BattleFx_RunBoreas(), BattleFx_RunBreak(), BattleFx_RunCybele(), BattleFx_RunDjinniEntrance(), BattleFx_RunDouse(), BattleFx_RunHelmSplitter(), BattleFx_RunImpactBurst(), BattleFx_RunJupiter(), BattleFx_RunMars(), BattleFx_RunMercury(), BattleFx_RunNeptune(), BattleFx_RunPlasma(), BattleFx_RunPrism(), BattleFx_RunProjectileVolley(), BattleFx_RunRagnarok(), BattleFx_RunRamses(), BattleFx_RunRay(), BattleFx_RunShatteringOpening(), BattleFx_RunSparkGroups(), BattleFx_RunSpire(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunTitanBlade(), BattleFx_RunUndeadSword(), BattleFx_RunVenus(), and EffectStep_AdvanceWithGravity2D().

◆ EffectPosition_ProjectPoint()

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 projection's scale.

The common way an effect places a 3D particle: 35 parts call it each frame once it has set the view, the casting impacts, beams, Judgment, Procne and the stat changes most often. Only Astral Blast (stars.c) reads the scale, to size its stars by depth.

point: three s32s in 16.16, x, y and z (an EffectStep's position).

Definition at line 64 of file positions.c.

Referenced by BattleFx_DrawStreaks(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBind(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDragonCloud(), BattleFx_RunDrain(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFrost(), BattleFx_RunFroth(), BattleFx_RunGatheringLights(), BattleFx_RunGround(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunJudgment(), BattleFx_RunLobbedShells(), BattleFx_RunMoteFountain(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunParticleStreams(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShiningStar(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunTriangleStrike(), BattleFx_RunVolcano(), and EffectPosition_ProjectPoint().

◆ EffectPosition_ProjectSprite()

void EffectPosition_ProjectSprite ( s32 id,
struct EffectPosition * position )

The screen position of a battler's sprite, at its scaled height, 16 pixels higher.

Called by BattleFx_RunBeamSequence (beams.c), for the first target, and BattleFx_RunBurstShower (burst_shower.c), for the user. Leaves the view set to the battle camera (BattleUnit_ProjectToScreen).

Definition at line 77 of file positions.c.

Referenced by BattleFx_RunBeamSequence(), BattleFx_RunBurstShower(), and EffectPosition_ProjectSprite().

◆ EffectPosition_ProjectScaledBattler()

◆ EffectPosition_ProjectBattler()

void EffectPosition_ProjectBattler ( s32 id,
struct EffectPosition * position )

The screen position of a battler, 16 pixels higher.

Called during the setup of 11 parts, among them the target strikes, Bolt, the rushing strike, the Titan Blade, the Helm Splitter and the element pillar.

Definition at line 100 of file positions.c.

Referenced by BattleFx_RunBolt(), BattleFx_RunElementPillar(), BattleFx_RunHail(), BattleFx_RunHelmSplitter(), BattleFx_RunKirin(), BattleFx_RunMirroredWall(), BattleFx_RunPlanetDiver(), BattleFx_RunRushingStrike(), BattleFx_RunTargetStrike(), BattleFx_RunTitanBlade(), BattleFx_RunUndeadSword(), and EffectPosition_ProjectBattler().

◆ BattleUnit_ProjectToScreen()

s32 BattleUnit_ProjectToScreen ( s32 unit,
s32 * screen )

Projects a battler onto the screen, raised by half its table height (the table holds the full height in 16.16) at the sprite's scale.

The view is reset to the battle camera first, so the result does not depend on the transform an effect has left behind.

Called only by EffectPosition_ProjectSprite. Leaves the render transform looking from gCameraWork's eye to its position, and always returns 0.

screen: receives x and y.

Definition at line 114 of file positions.c.

Referenced by BattleUnit_ProjectToScreen(), and EffectPosition_ProjectSprite().

◆ BattleFx_ProbeKeysForExtendedActor()

void BattleFx_ProbeKeysForExtendedActor ( void )

Reads the held keys when the first target is an enemy (id 128 or more) and does nothing with them.

Nothing calls it.

XXX: what it was for; a debug build or the Lost Age's twin of this part would show whether the keys once chose an effect for enemy targets.

Definition at line 138 of file positions.c.

Referenced by BattleFx_ProbeKeysForExtendedActor().

◆ BattleFx_DispatchByIdRange()

void BattleFx_DispatchByIdRange ( struct BattleEffectArgument * effect)

Runs a battle effect from the second range of kinds: 100 to 135 are the casting impacts (kind - 100), 136 to 199 the beam sequences, 200 and up the ring and spark scenes.

Reached from the battle's presentation through its far-call stub: from the attack, item, Psynergy cast and unit transition runners (battle/staging.c) when the plan has STAGING_BY_ID_RANGE (bit 14 of the effect word), and always from the plain attack runner and the approach action (battle/auto_battle.c). Takes heap slots HEAP_SLOT_BATTLE_SHEET (from EWRAM first), HEAP_SLOT_BATTLE_EFFECT and HEAP_SLOT_BATTLE_CANVAS for the effect, and releases them in the reverse order once it returns.

Definition at line 158 of file positions.c.

Referenced by BattleFx_DispatchByIdRange().

◆ BattleFx_RunBeamSequence()

void BattleFx_RunBeamSequence ( struct BattleEffectArgument * effect)

Draws the selected beam and its projected sparks over the first target: a beam, arc or wave shoots from the user; from frame 4 the target is hit, a yellow orb flashes over it and sparks fly off, for 32 frames in all.

effect->kind picks the picture.

Reached through BattleFx_DispatchByIdRange for kinds 136 to 199 and, through its unsigned test, every kind below 100; BattlePres_RunPlainAttack (battle/staging.c) sends every plain attack there. Only kinds 0 to 5 have pictures. Shows the canvas on BG1 (BattleFx_SetupCanvasTileMap), loads palette colours 0 to 63, scrolls BG1 through gBgScroll[1] and uses work->particles 0 to 63 (only 0 to 31 fly) and both blitter slots; at the end it removes the transfer callback, frees the blitters, sets gBgScroll[1].y back to 32 and hides BG1 again (BattleFx_HideBg1AndRestoreBackdrop).

Definition at line 21 of file beams.c.

Referenced by BattleFx_DispatchByIdRange(), and BattleFx_RunBeamSequence().

◆ BattleFx_RunRingAndSparkScene()

void BattleFx_RunRingAndSparkScene ( struct BattleEffectArgument * effect)

Plays the selected ring-and-spark strike, restoring the user motion after it.

Kinds above 199 first gather 64 motes of light into the user for 32 frames while it stands still; then star burst and crescent rings flash over the canvas and sparks fly from the first target for 32 frames, and the background palette fades back in.

Reached through BattleFx_DispatchByIdRange for kinds 200 and up, which BattlePres_RunAttack (battle/staging.c) makes by adding 200 to the kind of a critical hit; so the gathering always plays. Shows the canvas on BG1, keeps the battle's transition centred between the user and the first target while it loads, scrolls BG1 through gBgScroll[1] and uses work->particles 0 to 63, work->imageStorage, Ram_MapCellBuffer and both blitter slots. While the motes gather it adds Palette_StepFadeTransfer and stops the user's motion, and restores both after. At the end it removes the transfer callback, frees the blitters, sets gBgScroll[1].y back to 32, steps the background palette level from 6 back to 0 and hides BG1 again.

Definition at line 272 of file beams.c.

Referenced by BattleFx_DispatchByIdRange(), and BattleFx_RunRingAndSparkScene().

◆ BattleFx_StepPaletteToResource()

void BattleFx_StepPaletteToResource ( s32 resourceId)

Moves each RGB555 channel of background colours 0 to 63 one level towards the resource palette.

Colour 0 always goes towards black, whatever the resource holds.

Called once a frame, so a palette arrives in at most 31 frames: by the casting impacts, Ragnarok, the Titan Blade and Ground (hail.c). Reads and rewrites background palette RAM.

Definition at line 17 of file casting_impact.c.

Referenced by BattleFx_RunCastingImpact(), BattleFx_RunGround(), BattleFx_RunRagnarok(), BattleFx_RunTitanBlade(), and BattleFx_StepPaletteToResource().

◆ BattleFx_RunCastingImpact()

void BattleFx_RunCastingImpact ( struct BattleEffectArgument * effect,
s32 mode )

Gathers sparks around the caster, launches the Djinni and draws the impact on the first target.

Called only by BattleFx_DispatchByIdRange (positions.c), for effect kinds 100 to 135. The phases, the hand-offs and the particle ranges are in the folder README under "Effect families". Opens the canvas layer (tiled for Terra Strike, Mortal Danger and Asura), writes the background palette, BG2's scale and reference and REG_BLDALPHA, holds the caster still while the sparks gather, and adds BattleFx_ArmBg2AffineHBlankDma for the waving impacts; it releases all of them before it returns, or hands them on.

mode: the impact, an enum CastingImpact (the kind less 100). The tests on mode 100 never hold, as the dispatcher passes 0 to 35.

Definition at line 201 of file casting_impact.c.

Referenced by BattleFx_DispatchByIdRange(), and BattleFx_RunCastingImpact().

◆ BattleFx_RunTorch()

void BattleFx_RunTorch ( struct BattleEffectArgument * effect)

A fiery disc fades in, its rings running outward while every scanline ripples, then fades out.

Abilities: Torch (kind 214).

The disc is a mirrored radial picture whose pixels hold their distance from the middle, so rotating the palette moves the rings. It follows a Mars Djinni's entrance over the user, fades in over the first 9 frames, ripples throughout as BG2's x reference is fed line by line (BattleFx_ArmBg2AffineHBlankDma), and fades out over the last 7.

Definition at line 19 of file torch.c.

Referenced by BattleFx_RunTorch().

◆ BattleFx_RunKite()

void BattleFx_RunKite ( struct BattleEffectArgument * effect)

Shows the extended Jupiter Djinni prelude over the first target, mirrored from the usual side; the Djinni's entrance is the whole effect.

Abilities: Kite (kind 217).

Definition at line 159 of file torch.c.

Referenced by BattleFx_RunKite().

◆ BattleFx_RunHelmSplitter()

void BattleFx_RunHelmSplitter ( struct BattleEffectArgument * effect)

The user leaps at the first target and strikes through a fire swirl; on frame 18 the target flashes and reels and 16 sparks scatter, bouncing off the ground.

Abilities: Helm Splitter (kind 51).

Definition at line 29 of file helm_splitter.c.

Referenced by BattleFx_RunHelmSplitter().

◆ BattleFx_PlaceFormationObjects()

void BattleFx_PlaceFormationObjects ( s32 formation,
s32 x,
s32 z )

Arranges work->objects in a formation; x and z are its origin in 16.16 pixels.

Each summon that ends in an impact burst keeps its objects in its own formation, every frame while it plays and then through BattleFx_RunImpactBurst. Places the objects through Object_ApplyProjectedPlacementFar and changes nothing else.

formation: 0 = nine in a 3x3 grid at 32-pixel spacing (Thor); 1 = twelve in rows of 1, 3, 4 and 4, from 16 left and 32 up (Nereid); 2 = eight in rows of 3, 2 and 3, from 16 right (Cybele); 3 = eight drawn at 1.25 times their size (Tiamat's BattleFx_RunPaletteParticles). Any other value places nothing.

Definition at line 191 of file helm_splitter.c.

Referenced by BattleFx_PlaceFormationObjects(), BattleFx_RunCybele(), BattleFx_RunImpactBurst(), BattleFx_RunNereid(), BattleFx_RunPaletteParticles(), and BattleFx_RunThor().

◆ BattleFx_RunImpactBurst()

void BattleFx_RunImpactBurst ( s32 formation,
s32 x,
s32 y )

Opens an impact flash and scatters sparks and fragments, keeping the effect's objects in formation for the first 36 frames.

The close of four summons: Thor, Nereid, Cybele and Tiamat's BattleFx_RunPaletteParticles call it once their own frames are over, each with its own formation. Builds and frees both blitters, starts and stops the canvas transfer, sets REG_BG2PA, REG_BG2X and REG_BLDCNT, loads pictures into the sheet slot and work->sheet and overwrites work->particles 0 to 63 and PARTICLES 0 to 63. It leaves the canvas's VRAM cleared; ending the canvas layer is left to the caller.

formation: the layout for BattleFx_PlaceFormationObjects. x, y: the formation's origin in 16.16 pixels; the burst is drawn 40 pixels right of x, halved for the wide canvas.

Definition at line 265 of file helm_splitter.c.

Referenced by BattleFx_RunCybele(), BattleFx_RunImpactBurst(), BattleFx_RunNereid(), BattleFx_RunPaletteParticles(), and BattleFx_RunThor().

◆ Palette_BrightenBgEntries()

void Palette_BrightenBgEntries ( s32 blueStep,
s32 greenStep,
s32 redStep )

Adds per-channel steps to background colours 1 to 63, capped at 31.

Called once a frame to whiten the colours over a few frames: by BattleFx_RunParticleStreams from frame 36 of its burst, and by Tiamat's BattleFx_RunPaletteParticles. Rewrites background palette RAM.

Definition at line 12 of file particle_streams.c.

Referenced by BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), and Palette_BrightenBgEntries().

◆ BattleFx_ArmPaletteHBlankDma()

void BattleFx_ArmPaletteHBlankDma ( void )

Arms DMA 0 to write one halfword of the table at work->sheet + 0x1f80 into background colour 0 at each horizontal blank, so the backdrop colour changes line by line.

Runs each frame as a scheduler callback (order 0x4fe) that BattleFx_RunParticleStreams adds for its rise and removes after it; the rise rewrites the 160 colours, its heat lines, every frame. Stops DMA 0 and sets it up again, so the table is read from line 0.

Definition at line 42 of file particle_streams.c.

Referenced by BattleFx_ArmPaletteHBlankDma(), and BattleFx_RunParticleStreams().

◆ BattleFx_RunMeteor()

void BattleFx_RunMeteor ( struct BattleEffectArgument * effect)

A formation rises out of a dissolving starfield and bursts into embers and flashes: the particle stream in mode 0, with one spawned object rising.

Abilities: Meteor (scene kind 11).

Definition at line 54 of file particle_streams.c.

Referenced by BattleFx_RunMeteor(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunOuterSpace()

void BattleFx_RunOuterSpace ( struct BattleEffectArgument * effect)

The user leaps up, and two objects rise out of a dissolving starfield and burst into embers and flashes: the particle stream in mode 1, in the lightning bolt's colours.

Abilities: Outer Space (kind 384).

Definition at line 63 of file particle_streams.c.

Referenced by BattleFx_RunOuterSpace().

◆ BattleFx_RunParticleStreams()

void BattleFx_RunParticleStreams ( struct BattleEffectArgument * effect,
s32 mode )

The stream runs in two halves.

The rise dissolves the battle map into a starfield, then for up to PARTICLE_STREAMS_RISE_FRAMES lifts a formation of objects while motes, orbiting sparks and falling drops are drawn into the map buffer over a heat-tinted scanline palette. The burst then switches to a blended half-scale canvas and throws embers, screen motes and growing flashes from the origin for PARTICLE_STREAMS_BURST_FRAMES shaking frames.

Particle slots: the burst's flashes use PARTICLES 0 to 127 and its embers the 512 after them (PARTICLE_STREAMS_EMBERS); work->particles holds the rising motes (0 to 31) and the flames (32 to 47).

Called by BattleFx_RunMeteor (mode 0) and BattleFx_RunOuterSpace (mode 1). The rise shows Ram_MapCellBuffer on BG1 through BattleFx_FlushPendingGraphicsTransfer, scrolls BG2 with BattleFx_AdvanceBg2OnInterval and colours the backdrop with BattleFx_ArmPaletteHBlankDma, and removes all three after; it also moves the projection centre down to line 240 and sets the background view's active flag while it runs. The burst sets BG2 back to the half-scale canvas and ends the canvas layer. Releases the formation objects it spawned (mode 1's on frame 48 of the burst).

Starts a flame in the first free particle slot from 32 to 47; called for each drop that reaches rows 94 and 95. A flame is never drawn.

Starts a mote in the first free particle slot from 0 to 31. Nothing calls it: the rise starts its motes inline.

Definition at line 96 of file particle_streams.c.

Referenced by BattleFx_RunMeteor(), BattleFx_RunOuterSpace(), and BattleFx_RunParticleStreams().

◆ BattleFx_RunRamses()

void BattleFx_RunRamses ( struct BattleEffectArgument * effect)

Over the desert backdrop a formation stands while an orb circles above it, drops three times throwing puffs, and flies off; RAMSES_ROCKS rocks fall and bounce, and the orb's flight ends in a burst of RAMSES_SPARKS sparks from PARTICLES.

Abilities: Ramses (scene kind 1).

Up to RAMSES_FRAMES frames; A or B ends it early.

0 to 90 the orb circles above the formation 91 to 196 it drops three times, 40 frames apart, throwing puffs, and rises again; the screen shakes over frames 96 to 251 244 to 275 it flies off to the left, speeding up 260 the targets are struck and the sparks burst out

After frame 96 the rocks fall and bounce. Within a frame the order of the steps matters: later steps draw over earlier ones, and several of them consume random numbers.

Definition at line 36 of file ramses.c.

Referenced by BattleFx_RunRamses(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunDragonCloud()

void BattleFx_RunDragonCloud ( struct BattleEffectArgument * effect)

A flame leaves the user along a stored path with a fading trail of 19 copies behind it, then strikes the first target on DRAGON_CLOUD_STRIKE_FRAME and bursts into embers and flashes.

Abilities: Dragon Cloud (kind 49).

The trail's last nine copies are darker versions of the trail picture, each DRAGON_CLOUD_TRAIL_CELL_BYTES long. The camera turns over the first 64 of the DRAGON_CLOUD_FRAMES frames:

0 to 17 a pair of puffs, one mirrored, bursts in front of the user 18 to 58 the flame follows its stored path 50 the first target flashes, the screen shakes and eight puffs rise in an arc 78 to 83 the flame dives in again 83 the target is struck; embers and flashes burst from it

Definition at line 41 of file dragon_cloud.c.

Referenced by BattleFx_RunDragonCloud().

◆ BattleFx_RunAnnihilation()

void BattleFx_RunAnnihilation ( struct BattleEffectArgument * effect)

The user closes on the first target and fire bursts from it in a shower of shards.

Abilities: Annihilation (kind 55).

Its frames:

4 on 64 shards scatter from the target and fall 6 to 11 a fire streak flares in front of the user 8 the target is struck; the canvas is filled 16 to 47 a fire burst grows over the target in three steps

effect: the user and the target; a nonzero variant gives the burst its second picture and a sound.

Definition at line 23 of file annihilation.c.

Referenced by BattleFx_RunAnnihilation().

◆ BattleFx_RunRagnarok()

void BattleFx_RunRagnarok ( struct BattleEffectArgument * effect)

A huge flaming blade swings down over the targets and two columns of light strike through them.

Abilities: Ragnarok (kind 58).

The sword is drawn for 40 frames: it swings down over 10 frames, pauses until frame 20, then creeps on. The columns flash at frames 16 and 24 and scatter sparks six frames later, as the targets recoil; the battle shows the damage on frame 40. Column x comes from gRagnarok_StrikeColumns: first two of three per side. work->particles holds 16 flashes a column and PARTICLES 340 sparks a column.

Definition at line 33 of file ragnarok.c.

Referenced by BattleFx_RunRagnarok().

◆ BattleFx_RunTitanBlade()

void BattleFx_RunTitanBlade ( struct BattleEffectArgument * effect)

A huge sword drops onto the first target amid charging flashes, dust and sparks.

Abilities: Titan Blade (kind 61).

Dust rises at the target's feet from frame 28 while a pillar of fire scrolls over it; the sword drops in, holds, sinks and plunges after frame 60. A ring of flashes bursts from frame 56, sparks fly from frame 60 as the battle shows the damage, and every target flashes and recoils on frame 68. The canvas is wiped at frames 9 and 60.

Definition at line 33 of file titan_blade.c.

Referenced by BattleFx_RunTitanBlade().

◆ BattleFx_RunJudgment()

void BattleFx_RunJudgment ( struct BattleEffectArgument * effect)

The battle wipes away to a violet sky where a formation flies forward while motes gather into it, bursts in a flash and sends out a ring of light.

Abilities: Judgment (scene kind 9).

The scene then cuts to an aerial view where the blast spreads in rings, to a beach, and to a forest swept by an explosion front, before brightening back into the battle. The folder README describes both parts. The scene leaves gProjection.centerY at 240.

Definition at line 63 of file judgment.c.

Referenced by BattleFx_RunJudgment(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunKirin()

void BattleFx_RunKirin ( struct BattleEffectArgument * effect)

Over a scrolling forest a row of objects rides in on a wave trailing fire, then sweeps across the targets, each throwing a burst of motes as the row passes it.

Abilities: Kirin (scene kind 3).

The scene runs in two stages. In the sweep (120 frames; A or B ends it after frame 16), KIRIN_OBJECTS objects ride in on a sine wave while the backdrop scrolls, a ring of motes opens around them and a trail of fire follows. In the rise (96 frames) the row slides across the targets; each target the row passes throws a burst of 32 motes and plays its hit reaction, and the fire sheet slides off behind it. The battle shows the damage at the end. The scene leaves gProjection.centerY at 240.

Particles: work->particles 0 to 47 are the fire trail (x in pixels, y 16.16, variant the frames before it starts); PARTICLES 32i to 32i + 31 are target i's burst motes, variant their frames left.

Definition at line 28 of file kirin.c.

Referenced by BattleFx_RunKirin(), and BattleFx_RunSceneEffect().

◆ Graphics_ResetBg2Pa()

void Graphics_ResetBg2Pa ( void )

Sets BG2's horizontal scale back to one texel a pixel, for the lines above Graphics_SetBg2AffineScaleHalf's interrupt.

BattleFx_RunNeptune schedules it as a frame callback for its first stage.

Definition at line 10 of file neptune.c.

Referenced by BattleFx_RunNeptune(), and Graphics_ResetBg2Pa().

◆ Graphics_SetBg2AffineScaleHalf()

void Graphics_SetBg2AffineScaleHalf ( void )

Stretches BG2 to twice its width from the current line down.

BattleFx_RunNeptune installs it as the VCount interrupt handler, on line 0 and from frame 152 on line 96, for its first stage.

Definition at line 15 of file neptune.c.

Referenced by BattleFx_RunNeptune(), and Graphics_SetBg2AffineScaleHalf().

◆ BattleFx_RunNeptune()

void BattleFx_RunNeptune ( struct BattleEffectArgument * effect)

Over dusk clouds a formation of objects flies in through rising spray, gathers a ring of flares into a burst of light, then five blue flame columns drop onto the targets, throwing sparks.

Abilities: Neptune (scene kind 6).

The scene runs in two stages. The first (244 frames; A or B ends it after frame 16) places NEPTUNE_OBJECTS objects at one and a half times their size, opens the window with an edge table built every frame, sprays particles under gravity, converges a ring of flares, then breaks into a burst of light; meanwhile a frame callback and an interrupt change BG2's horizontal scale. The second stage (144 frames) drops five blue flame columns onto the targets, one every 16 frames; each throws sparks when it reaches the ground (NEPTUNE_FLAME_GROUND). The battle shows the damage on its frame 96. The scene leaves gProjection.centerY at 240.

Particles: in the first stage work->particles 0 to 31 are the converging flares, then from frame 222 0 to 63 the burst points; PARTICLES holds the spray (variant counts its frames, -1 when free). In the second stage work->particles 0 to 4 are the flame columns (variant their frames on the ground) and PARTICLES the sparks (variant their frames left, 0 when free). The window's edge step, noise and scanline table use the map cell buffer's first 450 bytes on frames 0 to 15, over spray particles 0 to 16, which are already launched.

Definition at line 51 of file neptune.c.

Referenced by BattleFx_RunNeptune(), and BattleFx_RunSceneEffect().

◆ BattleFx_RunThrash()

void BattleFx_RunThrash ( struct BattleEffectArgument * effect)

The user leaps high at the first target, then a burst of 32 sparks rises beneath it.

Abilities: Thrash (kind 388).

The leap takes the user three quarters of the way in 24 steps, starting up at 12.2 pixels a frame (16.16); after 29 frames the spark group plays with effect->variant set to 4, overriding the ability's own.

Definition at line 19 of file thrash.c.

Referenced by BattleFx_RunThrash().

◆ BattleFx_RunSparkApproachVariant3()

void BattleFx_RunSparkApproachVariant3 ( struct BattleEffectArgument * effect)

The user leaps at the first target, then a burst of 340 sparks rises beneath it and the canvas flashes.

Abilities: none (kind 387).

A lower leap than Thrash's (7.2 pixels a frame up), and the spark group after 12 frames with effect->variant set to 3, overriding the ability's own.

Definition at line 34 of file thrash.c.

Referenced by BattleFx_RunSparkApproachVariant3().

◆ BattleFx_RunQuickStrike()

void BattleFx_RunQuickStrike ( struct BattleEffectArgument * effect)

The user leaps at the first target, four pictures flash across the effect layer, then it fills with one colour as the target is struck.

Abilities: Quick Strike (kind 52).

Definition at line 45 of file thrash.c.

Referenced by BattleFx_RunQuickStrike().

◆ BattleFx_RunVorpalSlash()

void BattleFx_RunVorpalSlash ( struct BattleEffectArgument * effect)

The user steps up to the first target, four pictures flash across the effect layer, then it fills with one colour as the target is struck.

Abilities: Vorpal Slash (kind 65).

Definition at line 53 of file thrash.c.

Referenced by BattleFx_RunVorpalSlash().

◆ BattleFx_RunFlashingStrike()

void BattleFx_RunFlashingStrike ( struct BattleEffectArgument * effect,
s32 mode )

Plays a flashing strike, the runner of BattleFx_RunQuickStrike (mode 1) and BattleFx_RunVorpalSlash (mode 2); nothing passes mode 0.

The user steps up to the first target over 16 frames. Then four 120x120 pictures show for four frames each (mirrored when effect->side is 1), the canvas fills with colour 0x3f on frames 16 to 19, the battle shows the damage on frame 18, and on frame 20 the target reels and the screen shakes. 21 frames.

Opens and closes the canvas layer; the pictures take work->imageStorage and the start of Ram_MapCellBuffer.

mode: picks the pictures (RevealMaskE and F for 0, C and D for 1, A and B for 2); mode 1 also makes the step a hop.

Definition at line 71 of file thrash.c.

Referenced by BattleFx_RunFlashingStrike(), BattleFx_RunQuickStrike(), and BattleFx_RunVorpalSlash().

◆ BattleFx_RunUndeadSword()

void BattleFx_RunUndeadSword ( struct BattleEffectArgument * effect)

Two mirrored columns of light rise at the first target's feet and sink again, scattering 16 sparks that drift upward; the target is struck on frame 10.

Abilities: Undead Sword (kind 320).

54 frames. BG2 is moved so that the canvas's centre line stands on the target. The sparks are work->particles 0 to 15, variant their age in frames.

Definition at line 20 of file undead_sword.c.

Referenced by BattleFx_RunUndeadSword().

◆ BattleFx_BuildBlitter()

s32 BattleFx_BuildBlitter ( s32 slot,
s32 widthShift,
s32 heightShift,
s32 flags,
u32 mode )

Writes a drawing routine for the canvas into heap slot slot, built from the template BattleFx_Composite for one clip, mirroring and blend mode.

Called through EFFECT_LOAD_BLITTER by nearly every canvas effect and by BattleFx_FetchRectangleBlitters, directly by the particle streams for a canvas 256 pixels wide, and from other banks through its far stub, BattleEffect_LoadWorkFar (the star field in battle/star_field.c and object/colorfx.c).

It allocates the slot's block (from IWRAM when it fits) at exactly the routine's size. A slot that already holds a block keeps it, whatever its size, and the routine is written over it: callers release the slot first when the new routine may be longer. The caller calls the slot's block as a DrawRectangle.

widthShift, heightShift: the canvas's width and height as powers of two. flags: the COMPOSITE_CLIP_ and COMPOSITE_FLIP_ bits. mode: how source pixels combine with the canvas (COMPOSITE_COPY, COMPOSITE_TRANSPARENT, COMPOSITE_MAX or COMPOSITE_ADDITIVE).

Returns nonzero when the walk ended exactly at gBattleFx_MoteCells, the end of the template; no caller reads it.

Definition at line 281 of file blitter.c.

Referenced by BattleFx_BuildBlitter(), and BattleFx_RunParticleStreams().

Variable Documentation

◆ gBattleFx_EffectHandlers

BattleFxHandler gBattleFx_EffectHandlers[]
extern

The handlers by kind less one (effect_table.c); BattleFx_RunTableEffect calls the one an effect's kind selects.

The effect handlers, indexed by effect kind minus one, which BattleFx_RunTableEffect calls; kind zero is handled by the dispatcher.

The handlers by kind less one (effect_table.c); BattleFx_RunTableEffect calls the one an effect's kind selects.

Each handler is named for the first ability, by ability id, whose entry in gBattle_ActionFlags (battle/actflags.tsv) selects its kind, with that ability's English name (MsgAbilityName + id): kind 1 is Quake, Earthquake and Quake Sphere, so BattleFx_RunQuake. A handler several kinds share takes the name of its lowest kind's first ability, and a name another handler has already taken passes to the next ability (kind 15 is BattleFx_RunNova, as its first ability is a second Blast). Kinds that no ability uses keep descriptive names. Each row gives the kind's name, the part of effect.c that defines its handler and its first ability; the handler's own comment there lists every ability that reaches it.

Definition at line 389 of file effect_table.c.

Referenced by BattleFx_RunTableEffect().