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

TL;DR

Before you orderOffer from Amazon

Get the latest gadgets delivered free with Prime

  • Fast, free delivery on millions of items
  • Prime Video, Amazon Music and more included
  • Member-only deals all year
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

A project shared on GitHub and presented as a Show HN post uses static recompilation and browser APIs to run PlayStation 2 games without a conventional emulator. Its authors report that Gran Turismo 4 and God of War II run in Chrome, but users must supply their own game disc images, and the results depend on the title, browser and hardware.

Developers behind ps2-web-recomp have published a project that statically recompiles PlayStation 2 game code into WebAssembly, allowing selected games to run in a browser without a conventional emulator. They report that Gran Turismo 4 and God of War II reach playable sections in Chrome, using a browser-based reimplementation of PS2 hardware and WebGPU for graphics.

The project’s GitHub report says its tool reads a game’s executable, analyzes its control flow and translates the PlayStation 2’s Emotion Engine machine code into C++, which is then compiled to WebAssembly. The resulting page links that code to software that reimplements parts of the console’s operating system and hardware. The repository does not include game data: users supply a disc image, which the page reads in part through HTTP range requests.

Gran Turismo 4 is the first title the developers brought up this way. They say it runs from boot through its opening movie, menus and races, with music, sound effects and browser-stored memory-card saves. For the PAL version, they report 50 frames per second in Chrome on a laptop with integrated graphics, at twice the PS2’s resolution. The project’s recording is the basis for that performance claim.

The developers say God of War II also runs through menus and cutscenes into combat. They report 60 frames per second in heavy combat at native PS2 resolution in Chrome, and 48 to 60 frames per second at twice that resolution on the same class of integrated GPU. The second game exposed bugs not triggered by Gran Turismo 4, including one in the recompiler and one involving vector-unit timing, as well as missing input/output processor features. The report says these were addressed, but does not provide independent testing.

At a glance
announcementWhen: Recently presented on GitHub and Show H…
The developmentThe developers of ps2-web-recomp published a method for statically recompiling PlayStation 2 games into WebAssembly and reported playable browser builds of Gran Turismo 4 and God of War II.
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
Core Keeper-40%$11.99
Risk of Rain 2: Alloyed Collective-35%$9.74
Palworld-30%$20.99
Permafrost-20%$19.99
Live · Steam store (current discounts)

What Browser-Based Recompilation Enables

The project shows a different route to making older console games playable in a browser: instead of interpreting the original CPU instructions continuously as a traditional emulator might, it translates executable code ahead of time and pairs it with implementations of the hardware systems games rely on. That approach may make demanding titles practical on ordinary machines, although the two reported games do not establish compatibility across the PS2 library.

It also illustrates how much work sits beyond translating a game’s main processor code. The developers describe separate handling for the PS2’s vector units, graphics memory, sound processor, movies, input/output processor and timing behavior. For readers, the key distinction is that a game running in a browser is not simply a WebAssembly conversion: it depends on a substantial console-specific software stack, browser features such as WebGPU, and access to the game’s data.

Amazon

PlayStation 2 disc images for PC

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

How the PS2 Code Reaches WebAssembly

The project is described as a sibling to psp-web-recomp, which uses a similar method for PSP games. Its compiler, eerecomp, emits C++ in units of 16 KiB of guest code. The authors say it preserves PS2-specific behavior such as 128-bit registers, branch delay slots and the console’s unusual floating-point rules. They also describe recompiling vector-unit microprograms into SIMD C++, with programs encountered for the first time translated into WebAssembly while the page is running.

Graphics are handled through WebGPU compute shaders, with the PS2 Graphics Synthesizer’s 4 MB of video memory kept in its native layout on the GPU. The developers say the renderer implements console-specific texturing, palette, blending and depth behavior; a software renderer serves as a reference. Sound is handled through a reimplementation of the SPU2, while an implementation of the PS2’s MPEG-2 decoder handles movies. These components matter because games can rely on timing and rendering details, not just processor instructions.

The team’s performance account describes a large optimization effort. An early Gran Turismo 4 race ran at about three frames per second at native resolution with software rendering and an interpreted vector unit. After moving rendering to WebGPU and compiling vector programs, the authors say it reached about 70 frames per second natively. They also report reducing graphics dispatches from around 650 to around 80 per frame, and cutting data sent to the GPU per frame by about 60% with a cache. These are project-reported measurements, not results from an independent benchmark.

“No game data is included here. You bring a disc image of a game you own.”

— The ps2-web-recomp developers

Amazon

WebAssembly game controller

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Compatibility and Performance Limits

The available source does not establish how many other PS2 games work, how often titles need fixes, or whether the two demonstrations perform similarly on different computers and browsers. Reported frame rates are tied to Chrome and a laptop with integrated graphics, and the report does not provide independent measurements or a broader hardware test. Performance also changes with rendering resolution: the developers say Gran Turismo 4 falls to 23 frames per second at three times native resolution.

It is also unclear from the supplied material how complete the reimplementation is across the console’s hardware and software features, or what setup and compatibility requirements apply to a user’s disc image. The project says God of War II exposed issues that the first game did not, suggesting that success with two titles cannot by itself confirm broad compatibility. The source identifies the games as ones users must provide, but does not discuss legal rules for making or using disc images in different jurisdictions.

Amazon

browser-based PS2 emulator

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Further Games and Testing

The immediate next step is wider testing: whether more games can be brought up with the same tools, what bugs those titles expose, and how performance varies across browsers and graphics hardware. The project’s report describes God of War II as working without game-specific code, but says the game still revealed shortcomings in shared system components. Additional titles could test how far that common implementation goes.

Readers can follow development through the ps2-web-recomp GitHub repository and its demonstration recording. The source material does not give a release schedule, a compatibility list, or a date for further milestones, so it is not yet clear when the project may support more games or how its browser builds will change.

Amazon

PlayStation 2 game storage device

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Does the project run PS2 games in a browser?

Yes, for the two titles reported so far. The developers say Gran Turismo 4 and God of War II run in Chrome through static recompilation and browser-based hardware implementations. The source does not establish compatibility with the full PS2 library.

Does the repository include the games?

No. The developers say no game data is included. Users supply a disc image, which the browser page reads as needed.

How does the project differ from a conventional emulator?

It translates the game’s executable code ahead of time into C++ and then WebAssembly, rather than relying only on continuous interpretation of the original CPU instructions. It still reimplements PS2 operating-system and hardware functions needed by the games.

What performance did the developers report?

For a PAL Gran Turismo 4 build, they report 50 frames per second at twice PS2 resolution in Chrome on a laptop with integrated graphics. For God of War II, they report 60 frames per second in heavy combat at native resolution and 48 to 60 at twice native resolution. These are project-reported results, not independent benchmarks.

What is not yet known?

The project report does not say how many other games work, how broadly the results carry across browsers and hardware, or when further compatibility updates will arrive. The reported demonstrations cover two games.

Source: hn

COLUMBUS DAY / I

Columbus Day / Indigenous Peoples' Day Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

The Work By Valve’s Timur Kristóf On Improving Old AMD GPUs On Linux

Timur Kristóf presented work on AMDGPU driver fixes that help older GCN 1.0 and 1.1 graphics cards run Linux workloads, including games.

Zenless Zone Zero Enters The Steam Most-played Chart

The game has reached the Steam most-played chart, peaking at over 10,000 players, marking a significant rise in its player base.

2XKO

Search interest in 2XKO spikes sharply, prompting widespread speculation about its significance in gaming. Details remain unconfirmed.

Atari Surges In Global Coverage

Search interest and media mentions of Atari have spiked significantly, with 18 mentions this week, indicating a notable increase in global coverage.