-
Notifications
You must be signed in to change notification settings - Fork 0
Static Recompiler
This page maps the implementation concepts that turn PSP code into generated C. It does not replace the deeper PSP format and binary-translation research on the research site.
The loader and build orchestration identify the user-supplied ELF/PRX modules, their bases, sections, BSS metadata, and supported relocation records. tools/prxload.py produces a flat guest image; the build manifest keeps module identity and generated artifacts separate from private input bytes.
PSP imports are represented by library metadata, NID tables, and positional stub slots. tools/imports.py reconstructs that information for codegen and runtime registration. A name or numeric NID is an identity clue, not proof that the operation is implemented. Missing or uncertain operations stay visible.
tools/analyze.py reconstructs function boundaries and control-flow metadata. Nakagawa distinguishes:
- callable entries that begin a function under the normal call contract;
- resume/interior entries that re-enter an existing function with live state;
- indirect targets discovered from tables or computed control flow;
- unresolved or ambiguous targets that must remain conservative.
Function ownership is separate from โwhat address was reached.โ This prevents an interior entry or adjacent function from being incorrectly emitted with the wrong prologue/epilogue assumptions.
tools/codegen.py consumes the loader, import, and analysis products and emits C that operates on the shared CpuState. Generated functions are split into dynamic chunks. Translation-specific compatibility overrides are narrow semantic debt: they require evidence, a regression or bounded route, and a retirement criterion.
Work on the generator, analyzer, loader, runtime, or testsโnot on generated C. When a generated function looks wrong, inspect the earliest divergence, verify the source inputs and manifest, then regenerate and compare the resulting output.
Deeper references:
- PSP Executable Model
- Imports and NIDs
- Callable Functions vs Resume Entries
- PRX relocation and GP identity
- Allegrex execution model
- VFPU architecture
- Static Recompilation Architecture
Next: Architecture โ Verification and Testing.
Home ยท Current Status ยท Getting Started ยท Research site ยท Public repository
Public-source project manual. Users supply their own lawful inputs; no proprietary game content is distributed.
- ๐ Home
- ๐ Current Status
- ๐ Getting Started
โถ๏ธ Build and Run- ๐งญ Repository Tour
- ๐๏ธ Architecture
- ๐ Static Recompiler
- ๐งฉ Runtime and HLE
- ๐ผ๏ธ Graphics and Display
- ๐ Audio and Media
- ๐งช Verification and Testing
- ๐ฉบ Debugging
- ๐ฎ Hardware Research
- ๐ง Development Workflow
- ๐ค Contributing
- ๐ Publication and Provenance
- ๐ Research and Documentation
- โ FAQ
- ๐ Research Home
- ๐๏ธ Knowledge Base
- ๐ Evidence Standard
- ๐ฌ Hardware Replication