Skip to content
Italo Dell Areti edited this page May 18, 2026 · 2 revisions

ps1-recomp Wiki

Static recompiler for PlayStation 1 games — translates MIPS R3000A machine code to native C++ for PC.

ps1-recomp reads a PS1 disc image, decodes every MIPS instruction in the game binary, and emits an equivalent C++ function for each MIPS function. The output is linked against an in-tree runtime that simulates the PS1 hardware and produces a native x86-64 executable. The original game code runs at full CPU speed — no interpreter loop.

Status: v0.1.0-alpha — pipeline stable, 557/557 tests green, two games exercised (Rayman boots end-to-end, Crash Bandicoot 1 boots through PsyQ init with a roadmap-tracked workaround).

PS1 ISO/BIN
    │
    ▼
ps1Analyzer  ──►  game_config.toml      (function boundaries + PsyQ signatures)
    │
    ▼
ps1Recomp    ──►  recompiled_out.cpp    (MIPS → C++, ~150k lines per game)
    │
    ▼
ps1Runtime   ──►  Native PC executable  (SDL2 + OpenGL)

Start here

What makes this different

Decision Why
Static, not JIT Translation happens at compile time. No interpreter loop, no runtime codegen. Native CPU speed and trivial debugger support.
Three binaries (Analyzer + Recomp + Runtime) Each phase can be re-run independently. Pipeline is incrementally debuggable. Matches PS2Recomp's model.
HLE for BIOS and PsyQ No Sony code shipped. BIOS A/B/C syscall tables and PsyQ middleware (VSync, DrawSync, DrawOTag, libcd state machine) are native C++ stubs in ps1Runtime/.
Hash-based PsyQ detection The analyzer matches each function body against a SHA-256 database of 3463 signatures from 14 PsyQ SDK versions. This is the project's main divergence from prior PS1 recompilers (manual lists / per-game patches). See PsyQ HLE.
Runtime in-tree Generated code links directly against ps1Runtime_lib. One cmake --build rebuilds the whole pipeline.

Project facts

Source C++20 (CMake 3.20+)
Tests 557 GoogleTest + 8 pytest
License GPL v3
Lineage Inspired by N64Recomp and PS2Recomp; architectural sibling to psxrecomp
Status doc See README.md and ISSUES.md

Clone this wiki locally