How the layers stack
A PlayStation game is a stack of containers: a disc holds files, one file holds an archive, the archive holds bundles, the bundles hold models, textures and sounds, and the running game loads all of that into a handful of little script engines. This page is the map of that stack and of the code that reads each layer - start here before any format or subsystem page.
At a glance
- Almost everything is in one file.
PROT.DATis the game's archive: 1233 numbered entries holding every scene, monster, tune and menu. The executable only carries the tables that tie them together. - Each layer has one owner. One Rust crate reads the disc, one splits the archive, one sorts entries by format, and one small crate per format decodes it. That is what lets the browser pages and the native tools share code.
- The game runs on scripts. Towns, cutscenes, battle moves, menus and NPC pathing are bytecode interpreted by a family of small virtual machines. The engine port reimplements those VMs rather than emulating the CPU.
- Two tracks, one repo. Preservation (extract and document every asset) and reimplementation (a from-scratch engine) feed each other: the docs are the spec the engine is built from, and the engine is the test that the docs are right.
The pipeline
Going top to bottom: a PSX disc image, then the ISO filesystem, then the archive (PROT.DAT), then per-entry containers, then individual sub-assets, and finally the engine that brings them to life. Click any layer to read its format page or the crate that handles it.
disc-extractPROT.DAT (the archive), SCUS_942.54 (the executable), DMY.DAT (dev fixture data), the MOV/ movies, the XA/ voice streams, CDNAME.TXT (the archive's name list) and SYSTEM.CNF.prot-extractCDNAME.TXT, whose numbers are raw table indices and sit two ahead of the extraction numbering (why).assettextures · crates/tim Legaia TMD
3D models · crates/tmd VAB
instruments · crates/vab SEQ
music score · crates/seq MES
dialog · crates/mes ANM
animation · crates/anm MDT
moves · crates/mdt LZS
compression · crates/lzs
Two tracks, one repo
The -re in the project name means both reverse engineering and reimplementation. The tracks are separate crates with a clear boundary between them.
| Track | What it produces | Where it lives |
|---|---|---|
| Preservation | Every asset off the disc as PNG / WAV / OBJ / glTF / JSON, a format spec per file type with the game function that reads it named as evidence, and round-trip parsers that can write assets back. | The container crates (iso, prot, lzs, asset), one crate per format, the extract driver, and the patcher. |
| Reimplementation | A playable engine built from those specs plus logic traced in Ghidra and rewritten fresh - never a decompilation or static recompile of Sony's executable. Retail behaviour is the measured ground truth; enhancements (dynamic lighting, see-through walls, free-angle movement, VR) are toggles that leave the faithful mode bit-identical when off. | engine-core, engine-vm, engine-ui, engine-render, engine-audio, engine-shell, and the asset-viewer / web-viewer front ends. |
What keeps the two honest is a set of parity oracles: the engine's video memory, sound output and game-mode trace are compared against emulator captures of the real game, so a doc that is wrong shows up as a pixel or a sample that differs. The engine page has the boundaries and the current list of enhancement toggles.
The runtime VMs
When you talk to a villager, watch a cutscene, throw a Tactical Art or open the shop, no hand-written code for that moment is running. Instead the game's engine interprets small programs stored with the data: the villager's dialogue is a script, the art is a move record, the shop window is a widget program. The five interpreters below share one actor model - the same records describe your character, an NPC, a monster and a spark of a spell - and each has its own page. Four are classic bytecode dispatchers; the effect VM is a per-slot state machine that plays the same role with a different shape.
"Five VMs" is the orientation, not the census: the field VM's menu sub-dispatcher, the move VM's overlay extension, and the battle, world-map and tile-board state machines are separate dispatchers with their own tables. The VM inventory lists every one.
- What it runs
- Menu window widgets - the shop and pause-menu choreography
- Where
- Menu overlay (PROT 0899)
- Opcodes
- 13
- Operands
- byte stream
- Status
- ported - drives the shop widget choreography in the engine
- What it runs
- Move records - Tactical Arts, summons, scene props that animate
- Where
- Executable, plus a 61-sub-op extension in the town overlay
- Opcodes
- 71 + 61 sub-ops
- Operands
- u16 stream
- Status
- ported - extension ported, reached only from the town overlay
- What it runs
- NPC pathing, face-the-player, camera follow
- Where
- Executable
- Opcodes
- 22
- Operands
- byte stream
- Status
- ported
- What it runs
- Cutscene blocking and story-flag writes; bytecode ships in each scene's MAN
- Where
- Executable
- Opcodes
- 32
- Operands
- byte stream
- Status
- partial - table decoded, port split across three crates
- What it runs
- Everything in a town or dungeon: dialogue, doors, chests, shops, inns, story flags
- Where
- Town / field overlay (PROT 0897)
- Opcodes
- 43 + default-route extensions
- Operands
- byte stream
- Status
- ported
- What it runs
- Battle sparks, slashes and spell visuals
- Where
- Battle overlay (PROT 0898)
- Shape
- per-slot state machine - no opcode table, by construction
- Pool
- 32 master + 128 child slots
- Status
- ported
How they wire together
The field VM drives the scene. When it needs an actor to perform something, it stages a move record into that actor, and the per-frame actor tick steps the move VM through it. One move-VM opcode escapes into an overlay-resident extension dispatcher that exists only while the town overlay is loaded, so battle-side move records can never reach it. The motion VMs run independently per actor for pathing and camera follow. The effect VM is battle-only, but every effect is bound to a master-slot actor that the script VM and the battle state machine can reference - the same actor model throughout. Driver addresses and traces are on the linked subsystem pages.
Where to go next
| You want to… | Read |
|---|---|
| See it running before reading anything | Play the port, asset viewer, media browser |
| Install the tools or build from source | Quick start, getting started |
| Understand one file format | Formats index - each page has a confidence badge |
| Understand one part of the running game | Subsystems index |
| Mod or translate your own copy | Modding and translation, then randomizer / translation |
| Look up a function or RAM address | Key functions, memory map |
| Find an open question to work on, or check one already answered | Open threads, settled threads, do not re-walk |