Show HN: PS2 Games Statically Recompiled To WebAssembly
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

For playersOffer from Amazon

Play games on Amazon Luna for your game nights, included with Prime

  • A rotating selection of games, no download needed
  • Play on TV, laptop or phone
  • Fast, free delivery for your gear, too
Start playing with Prime Free trial · Cancel anytime
As an affiliate, we earn on qualifying purchases.

A GitHub project called ps2-web-recomp translates PlayStation 2 game code ahead of time into C++ and WebAssembly, then recreates the console’s operating-system and hardware functions in the browser. Its developer reports that Gran Turismo 4 and God of War II run in Chrome, but players must provide their own game disc images and performance results are tied to the developer’s laptop and tested settings.

A GitHub project called ps2-web-recomp translates PlayStation 2 game code into WebAssembly so selected titles can run in a browser without a conventional emulator, its developer says. The project has brought up Gran Turismo 4 and God of War II, with reported performance varying by game, resolution and hardware.

The project reads a game’s Emotion Engine executable, recompiles its machine code into C++, and builds that output for WebAssembly. It also reimplements parts of the PS2 operating system and hardware, including graphics, audio and input/output functions. The developer says the graphics system uses WebGPU, while the game runs in a browser page.

According to the report, Gran Turismo 4 runs from startup through its opening movie, menus and races, with sound and memory-card saves stored in the browser. In Chrome on a laptop with an integrated GPU, a race in the PAL version reached 50 frames per second at twice the PS2’s resolution. The developer selected the game as a demanding test because it uses both vector units, has exacting floating-point behavior in replays and license tests, and uses graphics effects that read rendered images back as palettes.

The developer says God of War II was brought up using the same scripts and without title-specific code. Testing it exposed two bugs—one in the recompiler and one in vector-unit timing—and gaps in the recreation of the PS2’s input/output processor. The game now runs from menus through cutscenes into combat, the report says: at the console’s native resolution it holds 60 frames per second in heavy combat in Chrome, while at twice that resolution it ranges from 48 to 60 on the tested laptop. These are developer-reported results, not independent benchmarks.

At a glance
reportWhen: Project details and performance figures…
The developmentA developer has published a project that recompiles PS2 games into WebAssembly and runs them in a browser using a custom recreation of the console’s hardware and software.
Top Steam deals right now
Halo: The Master Chief Collection-75%$9.99
Red Dead Redemption 2-75%$14.99
Grand Theft Auto V Enhanced-56%$19.79
ARC Raiders-50%$19.99
Risk of Rain 2: Alloyed Collective-35%$9.74
Palworld-30%$20.99
Invokyr-25%$9.74
Permafrost-20%$19.99
Live · Steam store (current discounts)

A Different Route to Browser Play

The project matters because it uses static recompilation rather than interpreting every instruction as the game runs. Its generated code translates PS2 executable functions into host code ahead of time, while certain vector-unit programs are compiled ahead of time or translated into WebAssembly when first encountered. The approach may reduce the runtime work associated with interpreting older console instructions, though these two demonstrations do not establish how broadly it will work across the PS2 library.

Browser access could make testing and playing compatible games more convenient, and the reported results show that some demanding PS2 workloads can run on a laptop without a discrete GPU. But the project is not a service that supplies games: users need their own disc image, and compatibility, setup requirements and performance may differ by title, browser and device. The report’s figures describe particular games and configurations, not a general performance guarantee.

Amazon

WebAssembly development kits

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

How the Recompiler Handles PS2 Hardware

PS2 games rely on hardware behaviors that ordinary browser code does not directly provide. The project says its recompiler preserves features such as the Emotion Engine’s 128-bit registers, branch delay slots and distinctive floating-point rules. A lightweight PS2 kernel handles functions including threads, semaphores and interrupts. The game’s own I/O processor modules run on an interpreter, alongside C++ reimplementations of the kernel and libraries they use.

Graphics are handled through WebGPU compute shaders that reproduce the Graphics Synthesizer’s texture, palette, blending and depth behavior. The developer says the renderer keeps the console’s 4 MB of video memory in GPU memory and includes a software rasterizer as a reference. Audio and movie playback are also addressed through reimplementations of the SPU2 sound hardware and the console’s MPEG-2 decoder. The repository is described as a sibling project to psp-web-recomp, which applies a similar method to PSP games.

The report also describes performance work that followed an initial race running at 3 frames per second at native resolution. Replacing the software rasterizer with WebGPU rendering and compiling vector-unit programs raised the reported rate to about 70 frames per second in that test. The developer later reduced graphics dispatches from about 650 to about 80 per frame by reorganizing work, and used a GPU cache to reduce data sent per frame by about 60 percent. These figures describe stages and optimizations in the developer’s testing, not a standardized comparison.

“No game data is included here. You bring a disc image of a game you own, and the scripts in this repository turn it into a web page on your machine.”

— The ps2-web-recomp GitHub report

Amazon

PlayStation 2 game discs

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Compatibility and Accuracy Remain Open

The report does not give a compatibility list or say how many other games have been tested. It also does not provide independent verification of the frame-rate results, identify the laptop model, or specify browser versions beyond Chrome. Performance may change with different GPUs, browsers and resolution settings.

Some precision differences remain possible: the developer says vector-unit arithmetic uses the host’s arithmetic, which can differ from the PS2’s in the last bit. The report does not establish whether that difference affects gameplay or results in other titles. It also does not detail the complete installation process, system requirements, or how memory-card data can be backed up or transferred. The project requires users to provide game images; the report does not explain how users should create them or address legal rules in different jurisdictions.

Amazon

WebGPU compatible graphics cards

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Further Tests Will Define Reach

The repository provides the scripts and implementation for further testing, and the developer’s report describes God of War II as exposing bugs and missing I/O processor features that were not encountered with Gran Turismo 4. The next evidence to watch for is broader testing across games, fixes to compatibility issues, and clearer documentation of setup and hardware requirements. The source does not announce a release schedule or promise specific additional titles.

For now, the project is best understood as a technical demonstration with two reported game bring-ups, not a finished browser catalog. Whether the method can support a wider range of PS2 games—and how reliably it performs on other machines—remains to be established.

Amazon

browser-based game controllers

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is ps2-web-recomp?

It is a project that recompiles PlayStation 2 game executables into C++ and WebAssembly, then runs them in a browser with software that recreates parts of the PS2 system.

Which games does the report say are running?

The developer reports bringing up Gran Turismo 4 and God of War II. The source does not provide a broader compatibility list.

Does the project include PS2 games?

No. The GitHub report says users must supply their own game disc images; it says the project does not include game data.

How fast do the games run?

In the developer’s Chrome tests on a laptop with an integrated GPU, the PAL version of Gran Turismo 4 reached 50 frames per second at twice the PS2 resolution. God of War II reportedly held 60 frames per second in heavy combat at native resolution and ran at 48 to 60 at twice the resolution. These are specific, developer-reported results rather than independent benchmarks.

Is this a conventional PS2 emulator?

The project describes a different method: it translates game code ahead of time into WebAssembly and reimplements PS2 system functions, rather than relying solely on an emulator that interprets the console’s instructions during play.

Source: hn

HALLOWEEN

Halloween Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Olivia Rodrigo Surges In Global Coverage

Olivia Rodrigo’s media coverage has surged, with GDELT recording 31 mentions in the recent reporting window, indicating increased international interest.

Porting My 1993 Amiga Game To Godot, With An LLM Reading The 68000 Assembly

A developer successfully ported a 1993 Amiga game to Godot with the help of an LLM reading 68000 assembly, completing the process in a single evening.

Former NBA Star Dwyane Wade’s Son, Zaire, Arrested on Suspicion of Domestic Violence

Zaire Wade, son of NBA legend Dwyane Wade, was arrested on suspicion of domestic violence. Details are still emerging; the case is under investigation.

Game 2: Both Teams Destroy Barracks?

Both teams reportedly destroyed barracks during Game 2, raising questions about strategic shifts and game dynamics. Details remain unconfirmed.