Battle Effects
This page is a guide to the games/tla/src/battle_effect/ folder of the Alchemy
project. Its code draws the spells, weapon unleashes, and summon animations seen
on the battlefield.
Each animation runs as a blocking C handler on a shared 128×128 brightness
canvas and decides no combat arithmetic. When the strike lands, the handler
signals btPlaybackStart so that damage numbers and reactions play in step. For
the sequel's summons, The Lost Age also adds IWRAM software-rasterised 3D
meshes.
The sections below cover how abilities dispatch into shared variants, how VBlank canvas decay produces motion trails without any trail being drawn, and how the 2D blitters and ARM 3D kernels work, followed by a file map. The broader design is described in Battle & Effects.
Dispatch, variants, and the 128×128 brightness canvas

AbilityBattleEffects in
ability_staging.c maps each ability
to an effect ID plus a variant (0, 1, 2, ...), so tiered lines such as
Quake, Earthquake, and Quake Sphere share one handler. The 4 basic elemental
summons run through that same table. The remaining 25 summons (Ramses
through Iris, including all 13 multi-element summons) dispatch to dedicated
handlers via btEffectRunSummon.
Nearly every effect draws 6-bit brightness intensities (0..63) onto a 128×128
RAM canvas mapped through a 64-colour palette ramp. The same drawing therefore
appears as fire under one ramp and ice under another. Most effects stretch the
canvas 2× horizontally and blend additively so that blasts glow like light,
while solid effects such as Quake draw 1× opaque so that pillars occlude sprites
behind them.
VBlank transfer and automatic trails

Handlers draw into RAM and wait a tick while btEffectTransferCanvas copies to
VRAM during VBlank and applies one post-copy rule:
| Post-copy mode | Visual result |
|---|---|
| Wipe clean | Only this tick's drawing |
Decay to 3/4 | Long fading trail (last tick's fireball, a quarter dimmer) |
Decay to 1/2 | Short crisp trail |
| Leave untouched | Persistent buildup across ticks |
Blitters, particles, and effect families

Assembly blitters stamp graphics with replace, max-brightness, or additive
blending. For example, Ray keeps the brighter pixel so bolts stay uniform, while
stronger variants add every other bolt so crossings flare. Shared round motes
and square flares unpack at 10 sizes from graphics/battle_effects/, and
summon textures are kept in graphics/summon/
(Graphics assets).
Many effects reuse the same routines. Gaia and Rockfall share one rock wall at
different widths, Herbs borrow Ply's sparkles, Djinn share a prelude
handler, and one shared casting impact handler covers 101 effect IDs.
btEffectRunBolt is a compact handler loop suited to a first reading.
IWRAM 3D software-rasterised polygon kernels
New in The Lost Age, btRenderDrawModelList projects 3D meshes through the
battle camera using btRenderTransformVertices. It then copies ARM rasteriser
kernels (MODEL_KIND) into IWRAM to draw rings, columns, coils (Coatlicue),
whirlpools, and pillars (Iris) directly onto the 128×128 canvas:
- Solid, textured, shaded, and transform kernels (
render_kernels.s): Flat-shaded faces (replace, max-brightness, additive), affine texture-mapped faces (replace, max-brightness, additive, narrow-span), shaded texels that discard pixels darkened to0, narrow solid spans, andbtRenderTransformVertices. - Unused fill kernels (
render_fill_mesh_kernels.s): An unused ARM counterpart ofbtRenderFillMesh, and textured and shaded max-brightness prototypes that nothing reaches.
File map
| File(s) | Role |
|---|---|
battle_effect.c, battle_effect_internal.h | Parent translation unit #includeing all battle_effect_*.c parts in ROM order |
battle_effect_*.c | Per-ability and 25 dedicated summon handlers (btEffectRunBolt, etc.) |
battle_effect_table.c | Effect asset and handler dispatch tables |
render_kernels.s, render_fill_mesh_kernels.s | ARM IWRAM 3D software polygon rasteriser and vertex transform kernels |
Assembly blitters, stubs.s | 2D canvas blitter fragments and jump-table stubs |
Source files
| File | Description |
|---|---|
battle_effect.c | The battle effects: what plays on screen when a Psynergy, Djinni, summon, unleash or monster ability is used. |
battle_effect_annihilation.c | Annihilation: a fire streak from the user, then a burst of fire and shards on the target. |
battle_effect_atalanta.c | The Atalanta summon. |
battle_effect_azul.c | The summon Azul: a sea serpent that shatters the battlefield, closes the foes in a sphere of water and bursts it over them. |
battle_effect_beams.c | The plain attack's slash, the critical hit's gathering light and crescent, and pushing a unit back in its damage pose. |
battle_effect_bind.c | Bind's spinning triangle and rune, the unused Triangle Strike built on it, and an unused wash of blue down the battlefield. |
battle_effect_blitter.c | The canvas blitter builder: loading and building ARM blitters from blitter_template.s and blitter_fragments.c. |
battle_effect_bolt.c | Bolt, Flash Bolt and Blue Bolt: lightning strikes each target in turn. |
battle_effect_boreas.c | The Boreas summon: Boreas in a mass of ice under a violet sky, then a torrent of ice crystals over the targets. |
battle_effect_breaths.c | The monsters' breaths (Beam, Rolling Flame, Ghost Soldier, Pike Assault and Blast Breath), the crescent slash of Human Hunt and Echo Cut, and the four-way mirrored blit many effects draw their glows with. |
battle_effect_burst_shower.c | The burst shower: a stream of shots from the user at the targets, which most monster breaths and a few Djinn play, each with its own picture. |
battle_effect_canvas.c | Eclipse and the Doom Dragon's change of form, then the canvas layer: its transfers, opening and closing it, its maps, the battle background's darkening behind it, the targets' flash timers, and lines. |
battle_effect_canvas_wipe.c | The canvas wipe: the ragged sweep that blacks out or clears the canvas as the summons and the larger effects open and close. |
battle_effect_cards.c | The Sleep, Baffle, Death and Sword Cards. |
battle_effect_casting_impact.c | The casting impacts, the Djinn attacks, unleashes and enemy abilities that open the same way: sparks close in on the caster, a streak shoots at the target and the orb flashes over it in a spray of sparks, and then each impact plays its own effect over the target (CASTING_IMPACT). |
battle_effect_catastrophe.c | The Catastrophe summon: the chained demon over a red sky, its sword's orb landing far below, and lightning and smoke sweeping over the foes. |
battle_effect_charon.c | The Charon summon, and btRenderBuildQuadStrip, which builds the strip meshes many effects lay their bands, ribbons and flames on (Catastrophe's smoke, Cruel Ruin's ribbons, Megiddo's corona). |
battle_effect_condemn.c | Condemn. |
battle_effect_constants.c | The constants the battle effects copy into their locals, in the order of the effects that read them: mostly the scales their sprites are placed at, and a few corners, points and widths. |
battle_effect_cruel_ruin.c | Cruel Ruin, one of the Doom Dragon's attacks. |
battle_effect_crystal.c | Crystal. |
battle_effect_cybele.c | The Cybele summon, and a routine nothing calls that opens and closes a tiled canvas. |
battle_effect_daedalus.c | Yellow orb packing and the summon Daedalus with its second strike. |
battle_effect_death_plunge.c | Death Plunge and Death Leap, the user's leap at a foe. |
battle_effect_dispatch.c | Running summon and table effects, and shared target helpers. |
battle_effect_display.c | Display, scroll and window HBlank DMA helpers. |
battle_effect_djinn_attacks.c | The summons that spend one Djinni: Mercury, Jupiter, Venus and Mars. |
battle_effect_djinn_beams.c | Canvas blitter setup and Djinn beams (Revive, Dew, Spark). |
battle_effect_djinn_heal.c | The comets and feathers of Balm, Tinder and Phoenix, the Zagan summon, and the camera turn Fire and Froth share. |
battle_effect_djinni_charge.c | Core and Cannon, a Mars Djinni charging the target, and Rime and Haze, which hand over to the Djinni sign. |
battle_effect_dragon_cloud.c | Dragon Cloud and Epicenter, a flame flown at a foe. |
battle_effect_drain.c | Break and Drain. |
battle_effect_element_pillar.c | |
battle_effect_eruption.c | Smoke Bomb and Blast, and the function that creates an effect's sprites. |
battle_effect_falling.c | Ice and Douse: shards and drops of water falling on the targets' side. |
battle_effect_fire.c | Fire. |
battle_effect_fire_puppet.c | Fire Puppet and Whiplash. |
battle_effect_flare.c | Flare, and an unused function that lists the indices around a value. |
battle_effect_flora.c | The Flora summon, Sabre Dance and Backstab, with the function that sets a battler's sprite priority and an unused one that sends a unit outward. |
battle_effect_flurry.c | Gust, Flying Attack, the rush bursts and the claws: the flurry of strikes they all play. |
battle_effect_frost.c | Frost. |
battle_effect_fume.c | Fume. |
battle_effect_gaia.c | Gaia, and the effect sprites with tiles of their own. |
battle_effect_gasp.c | The body that sixteen abilities' effects share, named for Gasp, the first of them. |
battle_effect_gathering_lights.c | Demon Night, Rumble, Haunting and Thorny Grave. |
battle_effect_geode.c | Geode. |
battle_effect_growth.c | Growth, Punji, Vine and Thorn. |
battle_effect_hail.c | Hail and Ground, and the battle camera's shakes. |
battle_effect_haunt.c | Haunt and the orbiting spirals. |
battle_effect_haures.c | The Haures summon, and the open cylinder a summon's band is drawn on. |
battle_effect_healing.c | The healing motes of Ply, Wish, Cure, Cure Poison, Tonic and Psy Crystal. |
battle_effect_heavy_divide.c | The body of Heavy Divide and Strong Hit, then Cool, Wyrd Curse, Radiant Fire and Hurricane, and the handlers that play Earth Force's and Thunder Mine's bolt trail. |
battle_effect_helm_splitter.c | Helm Splitter. |
battle_effect_internal.h | What every part of the battle_effect object shares: its includes, the canvas's and the shared sheets' sizes, the modes of the bodies several effects play, and the functions and tables the parts reach across each other. |
battle_effect_judgment.c | The Judgment summon. |
battle_effect_kirin.c | The Kirin summon. |
battle_effect_legend.c | Legend, the Bramble, Frost, Flame and Thunder Cards, and the Sleep, Baffle, Death and Sword Cards' entries into their own body. |
battle_effect_light_surge.c | Light Surge, then the handlers that play the twisting column for Whorl, Gale, Lethe Albion, Poison Flow and Raging Flood. |
battle_effect_liquifier.c | Liquifier, and the canvas bursts: a glowing ball that strikes the target in flames and sparks. |
battle_effect_lobbed_shells.c | Lobbed shells (Mad Spatter, Mud, Decompose, Bone Chiller, Sticky Goo, Poison Ink, Sticky Poison, Rotten Blood, Rising Venom, Formic Acid). |
battle_effect_megiddo.c | Megiddo, the Sol Blade's unleash. |
battle_effect_meteor_blow.c | Meteor Blow: a flight through a sky of stars behind a burning meteor, which then crashes down on the foes. |
battle_effect_mirrored_wall.c | The mirrored wall of Spasm, Berserk, Recovery and Sack. |
battle_effect_moloch.c | The Moloch and Iris summons: Moloch's snowstorm and frosty breath, and Iris's opening, petals, drops, pillars and fountain of light, with the diagonal canvas line her light bars are drawn with. |
battle_effect_neptune.c | The Neptune summon, and the two line functions that set BG2's horizontal scale. |
battle_effect_nereid.c | The Nereid summon. |
battle_effect_nirvana.c | Nirvana, Stone Justice, Soul Shatter and Serac, and Heavy Divide's and Strong Hit's ways into the heavy blow. |
battle_effect_ocean_fist.c | Ocean Fist. |
battle_effect_odyssey.c | Odyssey, a cloud swirl nothing shows, Iris's screen wipe and teardown, and the shade ramps Iris's textures are filled with. |
battle_effect_orbiting.c | Swirling stars and target bursts, two effects no table names and nothing in the game reaches. |
battle_effect_planet_diver.c | Planet Diver, Planetary and leaping strikes. |
battle_effect_plasma.c | Plasma, and the spark groups of Blast and Dynamite. |
battle_effect_positions.c | Where on the screen an effect draws: points and units projected through the battle camera, each set 16 pixels higher. |
battle_effect_prism.c | Prism. |
battle_effect_procne.c | The Procne summon. |
battle_effect_projectiles.c | The Djinni entrance that opens the Djinn effects; the projectile volleys, from Slash and Shuriken to the stings, the wing attacks and the fire and ice volleys of Cutting Edge, Heat Wave and Blizzard; and a battler sent leaping toward another. |
battle_effect_quake.c | Quake. |
battle_effect_raging_heat.c | Raging Heat and Juggle, then the white band the summons sweep in to white out the battle. |
battle_effect_ragnarok.c | Ragnarok. |
battle_effect_ramses.c | The Ramses summon. |
battle_effect_ray.c | Ray. |
battle_effect_render.c | Drawing models: transforming and projecting their corners, the model list, textures copied to IWRAM, and an unused run of the ARM fill kernel. |
battle_effect_render_mesh.c | C software mesh renderers: filled, textured and wireframe meshes. |
battle_effect_rime.c | Rime and Haze, whose Djinni rises while its sign turns over the target, then the entry points of the abilities btEffectRunGaspFamily plays. |
battle_effect_rising_dragon.c | Rising Dragon and Heartbreak. |
battle_effect_rushing_strike.c | Rushing strikes (Bone Charge, Brute Force, Onslaught, Headbutt, Stun Muscle, Living Armor). |
battle_effect_spider_web.c | Poison Beat, Spinning Beat, the swirl swipe and Spider Web. |
battle_effect_spire.c | Spire. |
battle_effect_star_mine.c | Star Mine, the enemies' Rising Dragon and the backdrop it scrolls, then the entry points of the rushing strikes. |
battle_effect_starfield_fall.c | Meteor and Outer Space; the summons' formations and the burst they end in; brightening the background's colours; and an unused knockback and an unused copy of Nereid. |
battle_effect_stars.c | Astral Blast and Shining Star. |
battle_effect_stat_change.c | Stat boosts and reductions (Impact, Guard, Ward, Dull, Weaken ...). |
battle_effect_streaks.c | Streak volleys (Sonic Wave, Shriek, War Cry ...) and mote fountains (Sleep Star, Soothing Star, Slaver). |
battle_effect_table.c | Battle effect tables, in the order of the effect code that reads them. |
battle_effect_target_motes.c | The status motes of Taint, Delude, Paralyze, Heartrender, Mystic Flame, Demonfire and Drown, then Sleep's sheep, Curse's candles, an unused Mercury Djinni heal, and Balm, Tinder and Phoenix. |
battle_effect_target_strike.c | Target strikes (Numbing Sting, Cannibal Fang, Poisonous Bite, ...), Mad Zephyr and Blade Rain. |
battle_effect_thor.c | The Thor summon. |
battle_effect_thrash.c | Thrash, Mighty Press and Severe Blow, and the flashing strikes: Quick Strike, Vorpal Slash, Lunar Slash, Boost Hack and Twin Shear. |
battle_effect_thunder_mine.c | The body of Thunder Mine and Earth Force, then Megaera and Void Beam. |
battle_effect_tiamat.c | The Tiamat summon and Dragon Driver. |
battle_effect_titan_blade.c | The great sword that falls onto the target in Titan Blade and Acheron's Grief. |
battle_effect_torch.c | Torch and Kite. |
battle_effect_trident.c | |
battle_effect_triple_chomp.c | Triple Chomp, and the entry points of Beam, Rolling Flame, Ghost Soldier and Blast Breath. |
battle_effect_ulysses.c | Drawing helpers several effects share (a sprite from the pool, the grey ramp, shaded discs, the mirrored palette), then the Ulysses summon. |
battle_effect_undead_sword.c | Undead Sword, Plume Edge and Diamond Berg, and the bodies of Dreamtide and Watery Grave and of Waft and Aroma. |
battle_effect_vengeance.c | Vengeance and Life Shear, a geyser, swarms of stars and a column of bubbles, and the Coatlicue summon. |
battle_effect_volcano.c | Volcano: pillars of fire scroll up among the targets over a flickering flame, each erupting in a fountain of sparks and spitting more. |
battle_effect_vortices.c | Froth's bubbles that burst into vortices, and Whirlwind's tornadoes. |
battle_effect_whorl.c | The twisting column of Whorl, Gale, Lethe Albion, Poison Flow and Raging Flood, and the Djinn Core and Cannon. |
blitter_color_fragments.c | The colour fragments btEffectBuildBlitter (battle_effect_blitter.c) builds canvas blitters from, as it does the others in blitter_fragments.c: each adds four picture pixels to a canvas word at once, forward or reverse, and caps each byte that reaches the cap mask's bit at the brightest canvas level. |
blitter_fragments.c | The pieces btEffectBuildBlitter (battle_effect_blitter.c) builds canvas blitters from. |
blitter_operands.c | The ARM immediate operands for powers of two, which the blitter builder (battle_effect_blitter.c) adds to its clip instructions to fit them to the canvas width, as The Broken Seal's builder does. |
| File | Description |
|---|---|
battle_effect.h | The battle effects as the rest of the battle calls them: a runner for each Psynergy, Djinni, summon and monster ability, and the canvas, palette, particle and model helpers they share. |
battle_effect_ids.h | The kinds of battle effect, by BATTLE_PLAN.battleEffect's low twelve bits: the large effects btEffectRunSummon runs, and the effects the table of handlers plays. |
battle_effect_table.h | The rows and columns of the battle effects' tables, which battle_effect_table.c fills and the effects read. |
blitter_operands.h | The ARM operands for powers of two that the blitter builder adds to its templates (blitter_operands.c). |
render_model.h | The model records the battle effects hand to the ARM model renderer. |
stubs.h | The stub calls into the battle effect module, as the other modules' code calls them. |