How PS2Recomp turns console code into a native PC program

PS2Recomp is an experimental tool that converts PlayStation 2 (PS2) game files into C++ code, allowing them to run natively on computers or other devices without relying on slower emulators. The tool converts MIPS commands, supports PS2-specific features, and sets up the environment with a simple configuration file – all you need to do is build the tool with CMake, perform conversions on the ELF game files, and compile the output code in combination with the underlying runtime libraries. Although the tool is not yet fully mature (with limited support for VU1 coprocessors/graphics rendering), it offers many advantages: faster performance on modern hardware, support for game mod development, increased frame rates, and image quality enhancements such as widescreen displays.

For the past two decades or so, people had almost only one option if they wanted to play PlayStation 2 classics on their computers: use an emulator such as PCSX2. Emulators use software to simulate the PS2’s CPU, GPU, and various hardware behaviors, allowing the game to run on modern computers. However, there is always a problem with this approach – it requires a real-time simulation of the entire host hardware, which is demanding on performance and difficult to achieve complete accuracy.

Recent projects have begun to try a different approach: instead of emulating the console, they directly recompile the game code into a computer program. PS2Recomp on GitHub is one such experimental tool.

The goal of PS2Recomp sounds a bit like sci-fi: “translate” the binaries of PlayStation 2 games into C++ code and then compile them into native programs that can run directly on the computer. The PS2’s processor uses the MIPS architecture (Emotion Engine), and game files usually exist as ELF executables. PS2Recomp reads these ELF files, parses the MIPS instructions in them, and converts them into equivalent C++ implementations. Once converted, developers can use CMake to build a system and compile the generated code with a base runtime library to produce a new executable program.

This technique is called Static Recompilation. Unlike traditional simulators that dynamically translate instructions at runtime, it converts host instructions into target platform code during the build phase. In theory, once compiled, the program no longer relies on the emulator and runs directly on a PC, Linux, or even other devices.

Of course, the technology is still in its very early stages. The PS2’s hardware structure is very complex, and in addition to the main CPU, it includes vector processing units (VU0, VU1) as well as a dedicated graphics processor, the Graphics Synthesizer. PS2Recomp currently has limited support for these components, especially the VU1 coprocessor and graphics rendering sections, so not all games can successfully complete the transition. In many cases, developers still need to manually tweak the code or supplement runtime support.

Still, this approach is very attractive. Once a game has successfully recompiled, it is equivalent to getting a new “native version”. Developers can modify and optimize at the code level, such as increasing frame rates, supporting widescreen displays, adding new controls, and even developing various game mods. At the same time, since there is no longer a need to simulate the entire host hardware, the operating efficiency will theoretically be higher than that of traditional simulation methods.

In the longer term, PS2Recomp represents a new idea of preserving and porting old games. In the past, many classic console games relied on emulators to survive, but static recompilation has the potential to make these titles truly native to modern platforms. While this route still requires a lot of engineering work, it has gradually emerged on multiple platforms, such as similar projects for older consoles like the Nintendo 64.

PS2Recomp is still just an experimental tool, but it shows a very interesting possibility: perhaps one day in the future, the “PS2 games” we run on our computers will no longer be simulated, but recompiled, rebuilt, and truly software that belongs to this era.

Github:https://github.com/ran-j/PS2Recomp
Tubing:

Scroll to Top