What is 'PS2Recomp', a project to recompile PlayStation 2 games so that they can run on PC?



Rather than running PlayStation 2 games on an emulator, ' PS2Recomp ' analyzes the game's executable files and converts them into code that will run in a modern environment, resulting in games that run in a manner close to native. Inspired by '

N64Recomp ,' the project is still in the experimental stage and far from completion, but if successful, it has attracted attention as it could fundamentally change the way PS2 games are preserved and reused.

GitHub - ran-j/PS2Recomp: Playstation 2 Static Recompiler & Runtime Tool to make native PC ports
https://github.com/ran-j/PS2Recomp

Playstation 2 Recompilation Project Is Absolutely Incredible – RedGamingTech
https://redgamingtech.com/playstation-2-recompilation-project-is-absolutely-incredible/

While the PS2 boasts many classic games, its console generation is aging, and playing them on modern 4K TVs requires ingenuity, such as combining RGB component cables with a high-quality upscaler. Instead, PCs have become popular, and emulators like PCSX2 have improved the experience by increasing the internal resolution, stabilizing the frame rate, and using texture packs.

However, in order to run an emulator, you need to obtain the BIOS from the actual machine, and since it only imitates the operation, it cannot reproduce the real experience 100%, and there are some game titles that are not supported.



So, as a further step, the project 'PS2Recomp' aims to recompile existing PS2 games for modern platforms and run them natively on Windows and Linux desktop PCs.

PS2Recomp is a tool that statically recompiles PlayStation 2

ELF files and converts them into C++ code. The generated C++ code is built with a modern compiler and linked to an execution runtime, aiming to run on PCs etc. without relying on traditional emulation. However, at the time of writing this article, it is still in the experimental stage and may not work as expected.



It works by extracting functions, symbols, and relocations from the input PS2 ELF file, decoding the instructions of the PlayStation 2's CPU, the Emotion Engine , and replacing them with equivalent C++ code, then recompiling it to generate a runtime to run the code. The conversion is very verbatim, and configuration is done using a TOML file , which also allows you to specify input files, output destinations, whether to output a single file or multiple files, functions to stub or skip, and instruction patches.

It supports the MIPS R5900 instruction set in C++, as well as 128-bit multimedia instructions specific to the PS2, macro mode support for Vector Unit 0 (VU0), relocation and overlay processing, and function stubbing and skipping. Building requires CMake 3.20 or later and a C++20-compatible compiler, with support for SSE4 or AVX equivalent for 128-bit arithmetic.

PS2Recomp removes frame rate limitations without breaking physics and collision detection, which are common issues with emulators, and is expected to run on lower spec hardware than emulators. It will also make it easier to support modern devices like Xbox controllers.

However, to run the recompiled code, a runtime is required to provide memory management, system call processing, and handling of PS2-specific hardware. While basic runtime libraries are included, hardware elements such as the PS2's unique GPU, the Graphics Synthesizer, require external implementation. Furthermore, due to limited microcode support for the Vector Unit 1 (VU1), it is possible that PS2-specific features may remain incomplete or unsupported.


by Yaca2671

PS2Recomp is still in the early stages of development and is being developed as an open source project under the GPL-3.0 license . At the time of writing, there are no playable games available, but you can create a build and try it out from the official GitHub.

RedGamingTech, a gaming news site, points out that this type of recompilation approach has already been successful in the Nintendo 64 community, leading to improvements in visuals and gameplay, as well as future plans to introduce ray tracing, and states that if a native version were to be realized for the PS2 as well, it would bring us closer to the ideal form of preservation and re-experience, including controller compatibility.

RedGamingTech also mentioned that the PS2's Emotion Engine is a proprietary MIPS R5900-based CPU, and that it is configured with two VUs, a Graphics Synthesizer, 32MB of memory, and 4MB of eDRAM. They commented, 'Although the project is incomplete and work remains to be done, the unique architecture of the PS2 makes PS2 Recomp well worth the effort.'

in Software,   Game, Posted by log1i_yk