Build a PSP Static Recompiler
Status: PUBLIC COURSE LANDING PAGE · Evidence class: DERIVED TEACHING MODEL · Course ID: COURSE-PSP-RECOMP-001 · Last reviewed: 2026-08-11
Static recompilation turns a guest executable into a host program ahead of time. This course explains the semantic contracts that must survive that translation, using open or synthetic examples and a bounded implementation case study. It is useful for a different PSP recompiler too; it is not a recipe for distributing a commercial title.
Course contract
- Use source-owned, synthetic, or permissively licensed fixtures only.
- Keep PSP platform facts, implementation choices, differential evidence, and open hypotheses in separate labels.
- Never publish retail binaries, decrypted modules, generated commercial-title C, private traces, keys, saves, or derived restricted bytes.
- Validate a claim with the smallest test that can fail before it can pass.
Start here
- CH-PSP-MODEL-001 — What a PSP Static Recompiler Must Model — define guest state, memory, control flow, modules, runtime boundaries, and evidence limits.
- CH-ELF-PRX-001 — Parse an ELF/PRX Safely — build a fail-closed reader for headers, segments, module metadata, imports, exports, and relocations.
- CH-GUEST-MEM-001 — Build a Guest Memory Image — deferred until the first two chapters have a reviewed source-owned fixture.
- CH-NID-001 — Reconstruct Imports and NIDs — deferred; the public pages already cover positional import reconstruction.
Roadmap
Later chapters will cover Allegrex decoding and delay slots; CFG and ownership; callable functions versus resume entries; ALU, branch, memory, and VFPU lowering; CpuState and guest memory; an HLE boundary; ThreadMan; display/input; GE; and validation against source-owned tests and hardware. These chapters are deliberately staged instead of promising a twenty-chapter dump without fixtures.
Implementation case study
The current public Nakagawa repository is an experimental title-focused implementation, not a general-purpose emulator. On 2026-08-11 its public main resolved to b365de44171f6c0521e08848c58d6c3957a00ad3. The course uses its public source as a case study: src/rt/recomp.h exposes the load-bearing runtime state, tools/codegen.py separates callable and resumable entry roles, and src/rt/sched.c models cooperative guest-thread scheduling. Those links describe one implementation; they do not define PSP hardware by themselves.
How to use the chapters
Read the chapter, write the exercise against a synthetic fixture, and record what the exercise cannot establish. Then compare the result with the Static Recompilation Architecture, PSP Executable Model, Evidence Standard, and the Prior Art and Sources index.