PS2 Web Recomp: PS2 games recompiled to WebAssembly

PS2 Web Recomp is an open-source project (MIT License) that runs PlayStation 2 games in the browser by translating them ahead of time, instead of emulating the main CPU while you play. It was shared on Hacker News on October 12, 2026.

Facts on this page come from the project's README, as read on October 14, 2026.

How it works

Recompilation. A tool called eerecomp reads the game's executable, follows its control flow to find the functions, and emits C++ for them in units of 16 KiB of guest code. That C++ is compiled to WebAssembly, so the PS2's main CPU, the Emotion Engine, is never interpreted. The output keeps the R5900 CPU's quirks: 128-bit registers and the multimedia instructions that work on them, branch delay slots, and the PS2's floating point unit, which has no infinities or denormals and rounds differently from IEEE.

A small PS2 kernel. The operating system calls the game makes are answered by high-level emulation: threads, semaphores, interrupt handlers and the channel that connects the main CPU to the I/O processor. The I/O processor runs the game's own modules – the sound driver, the disc streaming code and the controller and memory card drivers that ship on the disc – on an interpreter of its R3000 CPU. The disc is read over HTTP Range requests, so only the executable is downloaded up front.

Vector units, graphics and sound. Most 3D work on a PS2 happens in microprograms on vector unit 1. Those seen during a test run are compiled ahead of time into SIMD C++; any new one is translated into a WebAssembly module on the spot. The Graphics Synthesizer's 4 MB of video memory lives on the GPU, and drawing is done by WebGPU compute shaders, at one, two or three times the native resolution. The sound chip is reimplemented with its 48 voices, and movies are decoded by an implementation of the PS2's MPEG-2 decoder.

Which games run?

Two games have been brought up so far:

God of War II also found two bugs Gran Turismo 4 never triggered. One was in the recompiler: when a branch was the last instruction of a 16 KiB unit, the next instruction could run twice. The other was in vector unit timing: the game's microcode reads clip flags three instructions after the instruction that sets them, while the model made them visible only after four. It also needed an I/O processor hardware timer for its sound driver, a boot path like the BIOS gives, a module loaded from memory instead of the disc, and a DMA mode the first game never used. Each fix is generic, so the next game benefits.

How it was made fast

Why you can't play it on a website

The project's README is explicit: the generated C++ and the built WebAssembly are translations of the game's executable, so they belong to the game's owners – keep them on your own machine and do not publish them. It also warns that anyone who can reach the server can load the game. That is why we do not host PS2 Web Recomp games, and why you should be wary of any site that does.

If you want to play a disc image you own in the browser right now, ourbrowser emulator takes a different route: it is an emulator, and your file is read locally without being uploaded.

What you need to try it yourself

One script, port.sh, does the whole job: it reads the boot program named on the disc, translates it, then runs the game headless a few times to discover functions reached through pointers, adding them until a run finds no new ones. God of War II goes from disc image to page in three and a half minutes on an 8-core laptop. A step-by-step guide based on our own local tests is coming.

Saves and controls

The page keeps a memory card in the browser's storage, so progress survives a reload, and can export or import it as a .ps2 file in the layout PCSX2 uses. On a keyboard, Z, X, A and S are cross, circle, square and triangle; Enter and Backspace are start and select; the arrow keys are the D-pad. Gamepads work through the browser, phones get on-screen controls, and the same build can also run in a native window.

Recompilation vs emulation

PS2 Web RecompBrowser emulator (Play!)
Main CPUTranslated ahead of time to WebAssemblyEmulated while you play
Per-game workEach game is ported once on your machineLoad any supported disc image
What a website hostsNothing – the project says the output belongs to the game's owners and must stay on your machineOnly the emulator; you load your own file locally

A separate project with a similar name, PS2Recomp(GPL-3.0), is a static recompiler and runtime for making native PC ports rather than browser builds.

PS2 Web Recomp FAQ

Can I play PS2 Web Recomp games online?

No. The project produces a web page on your own machine from a disc image you own. Its README says the generated code belongs to the game's owners and must not be published, so the builds are meant to stay on your own machine.

Which games does PS2 Web Recomp support?

Two games have been brought up so far: Gran Turismo 4 and God of War II. Other games can be tried with the same scripts, but most will stop at something not implemented yet.

Is PS2 Web Recomp an emulator?

Partly. The main CPU code is translated ahead of time into WebAssembly instead of being emulated, while the rest of the console – the operating system, the I/O processor, the vector units, graphics and sound – is handled by an emulation runtime.

Does it work on a Mac?

The scripts build on macOS on Apple silicon (with a newer bash than the system one), and Chrome and Edge have WebGPU on macOS. Everything has been run on Linux on x86-64.

What happens if I try a game that is not supported?

It will most likely stop at a system call or I/O processor library function that nobody has implemented yet – logged as "[sys] unhandled syscall" or "[iop] missing <library> #<n>" – or use a graphics feature the renderer does not handle yet.

Source: snuri00/ps2-web-recomp on GitHub.