PS2Recomp is a static recompiler that translates PlayStation 2 ELF binaries into C++ code for native PC execution.
The tool addresses the challenge of porting PS2 games to PC by parsing PS2 ELF files, decoding MIPS R5900 instructions, and generating equivalent C++ code that executes on modern hardware. It works through a pipeline of modules: ps2xAnalyzer scans binaries and generates configuration, ps2xRecomp performs the actual instruction-to-C++ translation, ps2xRuntime provides memory management and syscall dispatch, and ps2xIOP handles R3000A IRX execution with a virtual kernel. The translation is literal—each MIPS instruction maps directly to a C++ operation—and supports PS2-specific features like MMI and VU0 macros. The runtime uses relocation symbols to bind function calls when available, falls back to address-based lookup for unresolved jumps, and handles syscalls through encoded immediates or register values.
Adoption suits developers working on PS2 game preservation or porting who have access to game binaries and are willing to invest in configuration and testing. The project provides both a preferred workflow using Ghidra for symbol extraction and a fallback approach for binaries with debug symbols. It requires CMake 3.20 or later, a C++20 compiler (primarily tested with MSVC), and host CPU support for SSE4 or AVX. The tool generates configurable stubs for unimplemented functions, allows selective skipping of code sections, and supports instruction-level patching through TOML configuration.
Development shows active experimentation with recent work on relocation-symbol auto-binding at call sites, generic return handlers for stripped games, and discovery of internal static entry points. The project maintains detailed documentation including a wiki and Ghidra integration instructions, indicating sustained effort toward usability for the reverse-engineering workflow.