Bay Street Wire
Tech & BusinessOpinion

Browser as Console: The Technical Magic of PS2 Web Recomp

Portrait of Theo Lindqvist
Theo Lindqvistconsumer gadgets & hardwareOct 12AI
Browser as Console: The Technical Magic of PS2 Web Recomp

AI-generated image · Bay Street Wire

By ditching clunky emulator wrappers for static recompilation and WebGPU, a new project is turning the web browser into a legitimate PlayStation 2 machine.

As first reported on **Hacker News**, a new project called **PS2 Web Recomp** is attempting to kill the paradigm of wrestling with heavy emulator wrappers to play legacy hardware in a browser. Instead of traditional emulation, it uses static recompilation to effectively turn the browser into a PlayStation 2 console.

The project works by translating a game's Emotion Engine machine code ahead of time into C++, which is then compiled to WebAssembly. This code is linked against a reimplementation of the PS2's hardware and operating system that utilizes WebGPU for rendering. Because the scripts in the repository turn a user's own disc image into a web page on their local machine, the browser effectively becomes the hardware.

**The Technical Feat**

The project's approach to performance handles the PS2's quirks—such as 128-bit registers, branch delay slots, and a specific floating point unit that differs from IEEE standards—directly in the generated code.

Key technical pillars include: * **Vector Units:** Microprograms are compiled into SIMD C++ ahead of time, while new programs encountered during gameplay are translated into WebAssembly modules on the fly. * **Graphics:** The GPU houses the Graphics Synthesizer's 4 MB of video memory. Drawing is handled by WebGPU compute shaders, allowing the system to support internal resolutions up to three times the native PS2 output (reaching 48 to 50 fps on integrated GPUs). * **The Kernel:** A small PS2 kernel handles threads and semaphores, while the I/O processor runs the game's own IRX modules via an R3000 CPU interpreter.

**Real-World Performance**

To prove the concept, the developer targeted *Gran Turismo 4*, one of the system's most demanding titles. On a laptop with an integrated GPU using Chrome, the game runs at full speed (50 fps for the PAL release) at twice the native resolution.

*God of War II* was also successfully ported. While it required no game-specific code, it revealed bugs in the recompiler and vector unit timing. In heavy combat, the title maintains 60 fps at native resolution in Chrome, dipping to between 48 and 60 fps when running at twice the resolution on the same integrated GPU.

**Opinion: The End of the Wrapper**

In my view, this is the direction all legacy gaming should go. By moving the heavy lifting to static recompilation and leveraging WebGPU, we move past the 'emulator-in-a-box' feel. When a browser can handle *Gran Turismo 4* at double resolution on integrated graphics, the need for clunky, third-party wrapper software vanishes. We aren't just simulating a console; we are effectively rebuilding it within the web stack.

Sources

More from Theo Lindqvist