Show HN: PS2 games statically recompiled to WebAssembly

301 points · 156 comments on HN · read original →

Points and comments are a snapshot, not live.

Static recompilation translates PS2 machine code to C++ and WebAssembly, letting Gran Turismo 4 and God of War II run in a browser with a WebGPU renderer.

The project recompiles the PS2's Emotion Engine code ahead of time into C++ compiled to WebAssembly. The I/O processor and hardware are emulated by a runtime using WebGPU. GPU compute shaders bin and rasterize triangles with the Graphics Synthesizer's rules. Gran Turismo 4 runs at full speed (50 FPS) at twice native resolution on a laptop iGPU. God of War II runs at 60 FPS at native resolution, needing no game-specific code but revealing two bugs and missing IOP pieces. The repository provides scripts to convert a disc image into a web page; no game data is included. The page uses SharedArrayBuffer for threading and requires cross-origin isolation.

What commenters are saying

Commenters were impressed by the technical achievement, particularly handling the PS2's timing-sensitive hardware without cycle-accurate emulation. The author explained that blocks subtract instruction counts from a budget, interrupts are delivered at block boundaries, and vector unit pipeline delays are modeled. Some questioned the feasibility of pressure-sensitive analog input for racing games with digital controllers. Others noted that browser WebGPU support limits the project, and that native versions for Steam Deck already run via standard emulation. A minor discussion arose about porting to legacy OpenGL 2.1 hardware, deemed impractical.