Some Legend of Legaia battles simply stop: mid-fight, almost always in the Gaza rematch, the next action never comes and the camera circles the party forever. It is a fault in the game's own code, not in an emulator - it reproduces from pad input on the retail disc under both PCSX-Redux CPU cores, frame for frame. This page shows what stalls, why, and the nine-word patch that lets the game repair itself, shipped in the browser ROM patcher.
0x19 (attack approach)0x801CE818+0x14D50; --approach-softlock-fixThe orbiting camera carries no information of its own. The battle round driver sweeps the camera's idle azimuth every frame without consulting the action state machine, so an orbiting camera is what any stalled Legaia battle looks like. The component that stops advancing is the per-action state machine in the battle overlay.
Two independent live captures localise it. A poll-only emulator probe flags any action state held for thousands of frames; both captures park in the same state: 0x19, the attack approach.
Every physical attack enters approach setup, state 0x14. Its first act is a range check - “within reach” is a size-scaled radius, about 416 units for a boss-sized actor. From there the attack routes four ways:
The decisive branch is the walk gate. Out of reach, a monster attacker needs its approach-transition clip - action tag 0x20 in its per-monster action table. If the tag is missing, setup stages the ordinary tag-1 “Move” locomotion clip instead and drops into the wait-in-range poll. A sweep of the monster archive puts numbers on it: 180 of 186 monsters have no tag 0x20, bosses included. All 186 carry the Move clip - the float or walk cycle the enemy viewer shows.
The two approach mechanisms differ in one property. The walking states 0x15–0x18 contain the state machine's own stepping code - a monster in that chain is moved by the engine. The fallback state 0x19 contains none: it re-derives facing, re-polls the range check, and on failure bumps a counter that nothing reads as a timeout. All movement comes from the staged animation's playback: the Move clip slides the actor along its facing at about 19 units per frame.
Position captures of ordinary play show this working every time: a healthy boss melee starts out of reach (438–1,078 units against a ~416 reach - standard formation spacing is out of reach; the models are large enough that it reads as adjacent) and the Move clip walks the boss in over 28–67 frames. The path fails only if the animation stops, and no code can observe that it stopped: the clip is staged once, in 0x14, and never again.
0x19 has no timeout.The second capture logs the actor's animation pair - staged clip versus playing clip - every frame, which pins what kills the clip. Kemaro carries its target ~2,500 units off-arena and stages his hit reaction there, which sets the “exit to idle at clip end” flag. Its put-back starts his idle pose through the mid-clip commit, which keeps that flag, so the flag waits for the end of his idle loop - 360 vsyncs. When his next action inside that window is the melee, the Move clip carries the flag and is swapped for idle at its first loop end, about 12 frames in.
v26536 summon cinematic: boss staged off-arena to (0,-2048),
his damage-reaction clip plays (pair 2/2), restored, pair -> 0/0
v26867 summon action ends
v26873 boss melee starts DIRECTLY next - 0x14, target ~1022 away -> fallback
v26876 0x19, pair 1/1: Move clip ENGAGED, sliding ~19 units/vsync
v26888 pair 0/0: clip DEAD after ~12 vsyncs / ~236 units
frozen at ~786 (> 416 reach) -> polls forever = the softlock
The pair is actor+0x1DA (staged clip) / actor+0x1D9 (playing clip). The stale latch is bit 2 of the anim event flags actor+0x1DC: a later capture shows it still set after the put-back turns the pair to 0/0. The carried reaction clip never reaches its own end because Kemaro pins it on frame 3 with the target's speed scale set to 0 (0x801F8370..0x801F8380).
Two fixes are possible. Retargeting the walk-gate fallback straight into the strike (one word - attack from wherever you stand) closes the softlock but removes every monster's approach walk, because out-of-reach is the norm. The shipped fix addresses the defect itself: the dead clip that nothing re-stages.
There is no free space for new code - every verified-dead run in the executable is occupied by other patch features - so the guard replaces nine redundant words inside the poll itself. State 0x19 recomputes the actor's facing every frame, but the target does not move during an approach and both neighbouring states recompute it anyway. Nine words with no observable effect, exactly where the guard needs to live.
The guard reads the staged-clip byte each poll. While the clip is alive nothing happens - healthy fights are byte-identical. If the clip is dead while the poll still fails, the guard sets the state byte back to 0x14. That single write is enough because the staging logic already exists in retail: the 0x14 arm re-runs next frame, re-checks the range, re-stages the Move clip, and the attacker resumes walking. If the clip dies again, the guard fires again - a stuttering but monotonic approach that always arrives.
+0x14D50. No injected routine, no reclaimed dead space, no new behaviour.The walk gate that selects the lane: 801e3260 li a1,0x20 scans the action table for the approach-transition tag via FUN_80050E2C; not found → li a1,0x1, stage the Move clip into actor+0x1DA, jump to the 0x19 poll. Party reach comes from the static table DAT_80078870 = {256, 384, 1024}; monster reach from the size-scaled check FUN_8004E2F0.
The same bounce protects a party attacker whose run clip dies. The one shape it cannot rescue - a monster with no Move clip at all - does not exist: the roster sweep finds zero.
legaia-patcher randomize --input DISC.bin --approach-softlock-fixThe fix is seedless, composes with every other patch option, and the Balanced / Full Chaos presets enable it by default. See the patcher reference.
| Evidence | Address | What it proves |
|---|---|---|
| Battle-action state machine | FUN_801E295C (PROT 0898) | The 0x14 → 0x15..0x19 → 0x1E routing; 0x19 has no movement code and no timeout |
| Battle round driver | FUN_801D0748 | Camera orbit runs unconditionally - the symptom is generic |
| Action-table scan / range check | FUN_80050E2C / FUN_8004E2F0 | Tag 0x20 selects the walk chain; reach is size-scaled (~416 for a boss) |
| Monster archive sweep | PROT 867 | 180 of 186 monsters lack tag 0x20; all 186 carry the tag-1 Move clip |
| Two live park captures | PCSX-Redux poll probe | Both stall in 0x19; animation pair +0x1DA/+0x1D9 goes 1/1 → 0/0 ~12 frames in |
| Reproduction | recompiler + interpreter cores | Kemaro → melee parks on demand with identical onset |
| Disc oracle + replays | +0x14D50, nine words | Exactly nine words change; both park states replay to a completed round with only those words poked |
The full evidence trail is on settled RE threads.