Formats
Byte-level specifications for every file format on the Legend of Legaia disc - from the raw CD sector layout, through the archive that holds the game's assets and the compression around them, to each asset type: textures, meshes, sound banks, dialog, stat tables. Every claim traces to a function in the game's own code, and every format has a from-scratch Rust parser in the workspace.
How this section is organised
Pages are grouped the way the disc is layered, outermost first: the disc and its one big archive, then how the game unpacks and routes what it loads, then the individual asset types, the stat tables baked into the executable, the bundles a scene loads as a unit, and the archive entries that hold code. New here? Start with disc geometry and PROT.DAT - every other page assumes those two.
Each page carries a badge for how solid its decode is. The badge is a claim about evidence, not page length; a page's own confidence row is authoritative over the badge here.
- Confirmed - verified end-to-end against real on-disc data, with passing tests.
- Inferred - deduced from byte patterns; structurally consistent but not exhaustively validated.
Disc + container layer
The disc image before any in-game format is involved: the sector layout, the one archive that holds nearly everything, and the text file that names its contents.
iso crate hides the sector layer and returns clean user data.#define name N lines; each define marks a block start and names inherit forward. The numbers are raw TOC indices, two above the extraction numbering.Compression + dispatch
How archive bytes become usable assets: the compression scheme, the type-byte dispatcher, and the several near-identical "many assets in one file" pack layouts.
(type_byte << 24) | size calling convention the dispatcher takes, and the descriptor-pair walker that only runtime overlays call.u32 count + u32 word_offsets[count], then assets back-to-back. Used inside DATA_FIELD streaming chunks.byte_offset = word_index*4 + 4). Includes the boot-UI bundle at the head of the archive.0x01059B84 word is a DATA_FIELD chunk header (type byte + payload length) wrapping an asset::pack of one scene's TIM atlases at raw-TOC +4 of its block. The page keeps the reading that made it look like a magic-prefixed bundle.data\battle\PLAYER1..4 (extraction 0863..0866): header + LZS art records + equip-slot descriptor table + per-slot mesh and texture streams. Also the in-battle pose source for the assembled meshes.Per-asset formats
What a single texture, model, sound bank or dialog file looks like once unpacked.
crates/tim exports to PNG and encodes PNG back to TIM.0x80000002: offset pointers, an 8-byte primitive group header, and a 6-row shape table that sets each record's layout. No mesh is lit from its normals.crates/vab extracts and decodes to WAV. The vab_01 block (extraction 1070..1192) is wall-to-wall VAB.pQES container in Legaia's 15-byte-header variant: u32 BE version, PPQN 480, a placeholder tempo the first body event overrides, meta events without a length byte.crates/xa demuxes per channel and emits one WAV per stream.(896, 0).legaia_anm::AnimPlayer.MOVE base is sourced per scene from a CDNAME slot, not from one boot-time PROT entry.0xD0-stride, in each player battle file's record[0]): command sequence, power bytes at +0x24 (Confirmed), hit-cue timing, impact-effect class. The menu's arrows are a separate SCUS table.0x414 bytes per slot. Cheat-database-pinned offsets for stats, level, magic rank, spells, summons and equipment.Battle / stat tables
The game's numbers - item names, spell stats, equipment bonuses, steal chances - are static tables inside SCUS_942.54, the main executable, not in the asset archive. Each is byte-pinned against the executable.
0x81..=0x8B; named monster attacks from 0x25. Parser legaia_asset::spell_names.legaia_asset::item_names.legaia_asset::equip_stats.legaia_asset::accessory_passive.[chance, item] pairs - chance first, the reverse of the drop fields. What the Evil God Icon steals. Parser legaia_asset::steal_table.town01. Parser legaia_asset::new_game.0x10800 bytes each: per-special-attack palettes, texture pages, summon-creature actor records and the player art-animation "ME" archives.Streaming + scene containers
The bundle formats a scene loads as a unit - room geometry, textures, scripts and audio together - plus the records that drive encounters and scene transitions.
crates/asset::parse_streaming; a sister detector catches the shape whose final chunk walks past EOF..PCH walk-on trigger sidecar: a four-kind sub-table directory plus inline 4-byte trigger records, exactly one sector in all 97 scenes. The stager prescript is the next PROT entry.legaia_asset::place_names.efect.dat 2-pack (extraction 0873) - a sprite atlas, frame-animation batches and spawn scripts indexed by effect id.Runtime overlay carriers
Archive entries that hold code, not assets: overlays are chunks of MIPS machine code the game loads into RAM on demand, and most of the game's logic lives in them.
0x801C0000+, detected by the function-prologue fingerprint at byte 0.Auxiliary
[opcode][window id][operand] in the menu overlay's data segment..dpk, .spk, .MAP, .PCH) and their consumers. The per-scene .dpk pack holds a VAB + SEQ pair.