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-extractFUN_8003E4E8. Names from CDNAME.TXT (block-start #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
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.
- Driver
FUN_801D6628- Where
- Title-screen overlay (0971)
- Opcodes
- 13
- Operands
- byte stream
- Status
- Fully ported
- Driver
FUN_80023070- Where
- SCUS_942.54 + town overlay
- Opcodes
- 71 + 61 sub-ops
- Operands
- u16 stream
- Status
- Fully ported
- Driver
FUN_8003774C- Where
- SCUS_942.54
- Opcodes
- 6
- Operands
- byte stream
- Status
- Partially ported (4/6)
- Driver
FUN_801DE840- Where
- Town overlay (0897)
- Opcodes
- 43 + default-route extensions
- Operands
- byte stream
- Status
- Fully ported (43/43)
- Driver
FUN_801E0088(per-frame walker)- Where
- Battle overlay (0898)
- Shape
- per-slot state machine (no central opcode table)
- Pool
- 32 master + 128 child slots
- Status
- Init / spawn / walker scaffold ported; per-state transitions delegate to host
How they wire together: field-VM op 0x22 EXEC_MOVE calls FUN_800204F8 to stage a move record into the actor; the per-frame actor tick (FUN_80021DF4) calls FUN_80023070 to step the move VM; move-VM opcode 0x2F escapes to the town overlay extension at FUN_801D362C. The motion VM (FUN_8003774C) runs independently per actor for NPC pathing and camera-follow paths; the engine's Camera ticks it via Camera::tick_script. 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.