Cite as
everything8215, FF5 disassembly
Original
https://github.com/everything8215/ff5
Pinned
everything8215/ff5 @ 997c87d1d8fdff2c142d91050fe400b6cb293905
Accessed
2026-10-21
Licence
GPL-3.0 (LICENSE file)
Credit
everything8215 and the repository's contributors, who disassembled and commented the Super Famicom game. Every label and comment quoted in ff5 claims is theirs.
Notes
ca65 source that builds Final Fantasy V 1.0 (J) and the RPGe fan translation 1.10 (README, with CRC32s). Final Fantasy V had no official release outside Japan on the Super Famicom; the claims read the Japanese game's code.

Cited on

Claims (11)

A combatant's ATB timer is set to 120 + equipment weight ÷ 8 − agility, at least 1, adjusted for haste or slow, and UpdateTimer counts it down by one each tick and flags it when it reaches 0, when the turn comes due. The battle speed setting sets a wait of 0, 15, 30, 60, 120, or 240 when a character's turn arrives.src/battle/battle-main.asm L5397–5416src/battle/battle-main.asm L4721–4748src/battle/battle-main.asm L11470–11473src/battle/battle-main.asm L5336–5349src/battle/battle-main.asm L24789–24792Code
A physical attack first rolls 0–99 against its hit % (100 where the attack type calls SetHit100andTargetEvade, as fists and katanas do) and misses on a roll at or above it; a target that can dodge then rolls 0–99 against its evade %, and a roll under it is a miss, or a shield block when the target carries a shield.src/battle/battle-main.asm L19091–19122src/battle/battle-main.asm L18698–18705src/battle/battle-main.asm L16363–16369src/battle/battle-main.asm L16574–16582Code
Three attack types call CheckCrit: fists (type 30), katanas (type 37), and type 36, which the source comments as bows with an element and which uses the knife damage formula, after moving its crit % from its second parameter to the first. CheckCrit makes a critical when a roll of 0–99 is under that crit %, and a critical doubles Attack and sets Defense to 0.src/battle/battle-main.asm L20794–20812src/battle/battle-main.asm L16363–16382src/battle/battle-main.asm L16574–16592src/battle/battle-main.asm L16542–16564Code
Physical damage is (Attack − Defense) × M, at most 9,999, and 0 when Defense is at least Attack. For swords, Attack is the weapon's attack power plus a random 0 to an eighth of it, and M is Level × Strength ÷ 128 + 2.src/battle/battle-main.asm L22910–22945src/battle/battle-main.asm L19430–19467Code
While FleeSuccess is nonzero, CheckFlee counts a flee ticker up each pass; on the 20th it rolls 0–99 and escapes when the roll is under the encounter's flee chance, and otherwise the ticker restarts. A flee chance with the high bit set shows the can't-run message instead, and a FleeSuccess of $80 (the Exit spell) escapes at once. The source doesn't show what sets FleeSuccess for ordinary running; its RAM notes only guess that holding L and R does.src/battle/battle-main.asm L13368–13397src/battle/battle_ram.inc L1662–1663src/battle/battle-main.asm L16011–16018Code
Each step on a normal map adds the map's rate to a random-battle counter ($E0 at the normal rate; $40, $180, or $200 at the others), and a battle starts when a byte from the random table, plus an offset that grows by $11 each time its pointer wraps, is under the counter's high byte.src/field/field-main.asm L21620–21670src/field/field-main.asm L21700–21701src/field/field-main.asm L21861–21873Code
Final Fantasy IV and V both give each combatant a timer that counts down to its turn. Final Fantasy IV sets its length from a ratio, 50 times a reference party member's agility over 10 times the combatant's; Final Fantasy V sets it to 120 plus equipment weight ÷ 8 minus agility.src/battle/battle-main.asm L5405–5416Code
Final Fantasy IV counts a weapon attack's hits from a loop of percentage rolls, one per point of the attack multiplier, less the target's evade rolls; Final Fantasy V's physical check makes one hit roll and one evade roll, and the attack either lands or misses.src/battle/battle-main.asm L19092–19122Code
Final Fantasy V counts each combatant's ATB timer down by one per tick from 120 + weight ÷ 8 − agility; Final Fantasy VI instead adds a constant built from speed to a gauge every 2 frames and gives the turn when the gauge overflows.src/battle/battle-main.asm L5405–5416src/battle/battle-main.asm L4740–4745Code
Final Fantasy VI keeps Final Fantasy V's random-battle counter, which each step raises by the map's rate and which a byte from the random table, offset each time its pointer wraps, is tested against; it halves the normal rate from $E0 to $70 per step and changes the high one from $180 to $160.src/field/field-main.asm L21700–21701src/field/field-main.asm L21658–21670Code
In Final Fantasy V only three weapon attack types roll for a critical (fists, katanas, and type 36), at the crit % the attack type carries; in Final Fantasy VI an attack that can crit does so on a random byte under 8, 1 in 32, whatever the weapon.src/battle/battle-main.asm L20794–20803src/battle/battle-main.asm L16363–16382src/battle/battle-main.asm L16574–16592src/battle/battle-main.asm L16542–16564Code