From PS2 machine code to a web page

An open-source project is demonstrating a new route for running PlayStation 2 software in a browser: statically recompiling a game's machine code instead of placing the entire console behind a conventional emulator. PS2 Web Recomp translates the PlayStation 2 Emotion Engine executable into C++, compiles that output to WebAssembly and links it to reimplemented system and hardware services. Graphics are rendered with WebGPU.

The developer says no game data is included in the repository. Users must supply a disc image for a game they own, after which the project's scripts build a web page locally. That boundary makes the repository a technical toolkit rather than a distribution channel for commercial game files.

Gran Turismo 4 was the first title used to bring up the system. It presents a demanding test because it depends on both vector units, unusual floating-point behavior and graphics techniques that reinterpret rendered images. According to the project's published results, the game now proceeds from boot through menus and races with sound, music and browser-based memory-card saving. A PAL race reached its target 50 frames per second in Chrome on a laptop's integrated graphics at twice the original resolution.

God of War II was then processed through the same scripts without game-specific code. That second test exposed previously unseen gaps in recompilation, vector-unit timing and the input/output processor implementation. The developer reports 60 frames per second during heavy combat at the console's resolution, with performance ranging from 48 to 60 frames per second at twice that resolution on the same class of hardware.

Rebuilding specialized console behavior

The project preserves architectural details that games expect, including the R5900 processor's 128-bit registers, branch delay slots and nonstandard floating-point behavior. It models operating-system facilities such as threads, semaphores, interrupts and communication with the console's input/output processor. Game-supplied modules for sound, disc access, controllers and memory cards run through an R3000 interpreter, while surrounding libraries are reimplemented.

Graphics Synthesizer memory remains on the GPU in native layouts. WebGPU compute shaders reproduce texturing, palettes, blending and depth tests, while a software rasterizer provides a reference for checking output. The runtime also reimplements the SPU2 audio system and the console's MPEG-2 movie decoder.

Performance work reduced GPU dispatches, cached repeated texture uploads and moved emulation away from the page's main thread. The result is an ambitious browser runtime that is still a developer project, but already shows how ahead-of-time translation and modern web graphics can make complex console software practical without packaging a complete traditional emulator.