How the layers stack
Click any layer to see what crate handles it and what's documented for it.
The pipeline at a glance
Going top-to-bottom: a PSX disc image, then the ISO filesystem, then the project's archive (PROT.DAT), then per-entry containers, then individual sub-assets. Each layer is owned by exactly one crate.
disc-extractprot-extract#define markers; names inherit forward).assetcrates/tim Legaia TMD
crates/tmd VAB sound bank
crates/vab MES dialog
crates/mes ANM animation
crates/anm MDT moves
crates/mdt LZS
crates/lzs
play-window). Native binary + WASM build.The five runtime VMs
Legaia's runtime is driven by five independent VMs that talk to one shared actor model. Four are clean bytecode dispatchers (actor / move-table / motion / field-event); the fifth (effect) is a per-slot state machine - different shape, same architectural role. Click each card to read the dedicated subsystem page.
- Where
- Title-screen overlay (0971)
- Opcodes
- 13
- Operands
- byte stream
- Status
- ported not wired
- Note
- All 13 opcodes are ported, but nothing in the engine calls the interpreter yet - it is inert.
- Where
- SCUS_942.54 + town overlay
- Opcodes
- 71 + 61 sub-ops
- Operands
- u16 stream
- Status
- ported
- Where
- SCUS_942.54
- Opcodes
- 22 (JT
0x80010EE0) - Operands
- byte stream
- Status
- ported
- Where
- SCUS_942.54 (MAN tail-section 1)
- Opcodes
- 32 (JT
0x80010FE8,0x01..=0x20) - Operands
- byte stream
- Status
- partial - table decoded, port split across three crates
- Where
- Town overlay (0897)
- Opcodes
- 43 + default-route extensions
- Operands
- byte stream
- Status
- ported
- Where
- Battle overlay (0898)
- Shape
- per-slot state machine (no central opcode table)
- Pool
- 32 master + 128 child slots
- Status
- done
How they wire together: field-VM op 0x22 EXEC_MOVE stages a move record into the actor; the per-frame actor tick steps the move VM; move-VM opcode 0x2F escapes to an overlay-resident extension dispatcher - a single 61-sub-opcode copy that lives in the field overlay (0897) only, so op 0x2F executes only while that overlay is resident and battle-side move records cannot reach it. The motion VM runs independently per actor for NPC pathing and camera-follow paths. The effect VM is on a different track - battle-only - but shares the same actor model: every effect is bound to a master-slot actor that the script-VM and battle-action SM can reference. The linked subsystem pages carry the driver function addresses and traces.
0x2F. Actor / motion / effect VMs run independently but bind to the same actor records.