Getting started
PS2 Web Recomp Quick Start
This guide takes you from the project source to a local browser build, using your own game disc image.
On this page
Prerequisites #
Install the following tools on your build machine before continuing. Their names below link to the official downloads where available.
- Git, CMake, Ninja
- A C++20 compiler. Upstream prefers clang; another compatible C++20 compiler can also be used.
- Python 3 and 7-Zip if your game disc image is inside a .7z archive.
- A disc image of a PS2 game you own. Game data is not included in the project.
Check your tools
Open a terminal on your Linux or macOS build machine and run each command. Each should print a version. If a command is missing, install that tool before continuing. If you use another C++20 compiler, check its version in place of clang++.
git --version
cmake --version
ninja --version
python3 --version
command -v bash
bash --version
clang++ --versionExpected result: each command is available, and the requirements below are met. A version banner alone does not establish that the selected toolchain can build this project.
cmake --version- CMake must be at least 3.20, as required by this source snapshot. Upgrade an older version before building; printing any version is not enough.
command -v bashbash --version- On Apple silicon macOS, upstream requires a Bash newer than the system 3.2. Check both the path and the version selected from PATH after installing Homebrew Bash. A newer installed shell is not useful if the scripts still select the system shell.
- C++20 and the standard library
- The build probes for a compiler with the <format> header. Upstream scripts/cxx.sh recommends clang 17+ with libc++ or GCC 13+ when no candidate passes. If the probe fails, install a matching compiler and standard library, or set CXX to the intended compiler; a version banner alone does not test <format>.
Read the pinned CMake requirement ↗ · Read the upstream compiler probe ↗
Allow roughly 300 MB per game for generated code and builds, in addition to your disc image. The first browser build also downloads the Emscripten SDK and runtime dependencies.
macOS on Apple silicon
The scripts need a newer Bash than the system Bash 3.2. With Homebrew already installed, the upstream README gives this command for Bash, CMake, Ninja, and 7-Zip. You still need Git, Python 3, and a C++20 compiler.
brew install bash cmake ninja sevenzipGet the source #
Both options below get the exact source snapshot reviewed for this guide. Choose Git or ZIP, then follow the same build steps.
Open a terminal in the folder where you keep your projects, then run:
git clone https://github.com/snuri00/ps2-web-recomp.git
cd ps2-web-recomp
git checkout --detach 6526f4803d98e10de50bea3af104a4d26e9df033
git rev-parse HEADExpected result: git rev-parse HEAD prints 6526f4803d98e10de50bea3af104a4d26e9df033. The detached checkout keeps the source aligned with this guide; it does not establish successful game playback.
Download the reviewed commit directly from the original GitHub repository. Git is not needed to download or extract the ZIP, but remains a build dependency.
Download source ZIP- Extract the downloaded archive. Its default folder name is ps2-web-recomp-6526f4803d98e10de50bea3af104a4d26e9df033. On Windows, right-click the ZIP and choose Extract All.
- To continue building, put the extracted project on your Linux or macOS build machine. Open a terminal in the directory containing that folder, then run:
cd ps2-web-recomp-6526f4803d98e10de50bea3af104a4d26e9df033
chmod +x scripts/*.shOn Linux or macOS, restore executable permissions to the shell scripts after extracting, especially if you extracted the archive on Windows.
Keep this archive with its revision in the filename. It is a fixed snapshot; a newer upstream archive may differ from this guide.
Both options get the source code. The ZIP is not a ready-to-play game or a Windows installer. The build toolchain still lists Git as a dependency.
Looking for the latest development version?
The links and commands above use the reviewed snapshot. Upstream main can change after this review. If you choose it, follow its own README, record its commit, and recheck build and compatibility conditions.
Open upstream main (may differ from this guide) ↗Build a game #
In the project folder, place a disc image you own named My Game.iso, or replace that filename in the command with the path to your image. Keep the quotes around paths with spaces. Run this from inside the project folder:
scripts/port.sh mygame "My Game.iso"The script extracts the boot program, translates the game code, runs exploratory passes, and generates the browser build. Let it finish before starting the server. A different game may stop at an unsupported console feature.
Expected result: the script finishes and creates the output paths below. Their presence alone does not establish that the game is playable.
| Path | Contents |
|---|---|
build/web-mygame/ | Generated browser files, including ps2web.html. |
games/mygame/disc.iso | The local disc-image path used by the server. A plain ISO is linked here by the script. |
games/mygame/explore.log | Output from the last headless exploration pass; inspect its halt reason or missing-function messages. |
games/mygame/shots/ | Frame captures from the last exploration pass, showing the point reached by those automated inputs. |
mygame is the local name used for this example. If you choose another name, use it consistently in the build and server paths.
Check how far the exploration reached
- Inspect games/mygame/explore.log for the first useful halt reason, missing syscall or IOP message. Keep the source commit with any error excerpt.
- Open the images in games/mygame/shots/ to see the stage reached by the last exploration pass. A title screen or menu does not establish that gameplay was explored.
- After serving the generated build, manually check the intended scene in the browser. Record the game release, browser, settings and furthest stage reached separately from the automated exploration.
tail -n 60 games/mygame/explore.logThe default exploration presses Start at frame 300 and Cross every 300 frames thereafter. It may not reach the scene you need. --press replaces the default inputs; --frames changes the length of each exploration pass. The example below is illustrative, not a tested input sequence for every game.
scripts/port.sh mygame "My Game.iso" --press 300:start --press 900:cross --frames 7200Rerunning port.sh regenerates this game's output. Adjust the inputs for your own game, then inspect the resulting log and captures again. A screenshot or successful build is not proof of a complete playthrough.
Source and further details ↗Start the local server #
After the build completes, run the following from the same project folder. Keep this terminal open while playing:
python3 scripts/serve.py build/web-mygame games/mygame/disc.isoExpected result: the terminal prints a localhost address and stays running. Use that address on the same machine; do not double-click the HTML file.
On that same machine, open a WebGPU-capable browser and visit http://127.0.0.1:8620/.
Play and controls #
The upstream project supports keyboard input and browser-compatible gamepads. Here are the basic keyboard controls:
After opening the local page, focus the game canvas and try Start. Record how far your game reaches; a title outside the documented examples may stop at an unimplemented feature.
| PS2 control | Keyboard |
|---|---|
| Cross / Circle / Square / Triangle | Z / X / A / S |
| Start / Select | Enter / Backspace |
| D-pad | Arrow keys |
| Fullscreen | F |
Troubleshooting #
What if the terminal says Git is not recognized?
Git is missing or the terminal cannot find it. Use the source ZIP to download the project without Git, or install Git and reopen the terminal. Installing Git on Windows does not add a Windows build workflow for this project.
Can I run the ZIP after extracting it?
The ZIP contains the code used to build the software. It is not a compiled game or an installer. You still need the build tools, your own game data, and the upstream build steps.
The page cannot find a WebGPU adapter
Start with an up-to-date Chrome or Edge browser on Windows or macOS and check that graphics acceleration is available. The upstream README has separate Linux browser instructions. Without a usable WebGPU adapter, the software renderer is too slow for normal 3D gameplay.
The page fails when I open the HTML file
Start scripts/serve.py with both the generated web folder and your disc-image path. Open the localhost address it prints, and keep the server terminal running. The server supplies HTTP range requests and the cross-origin isolation headers the browser build uses.
The build reports an unhandled syscall or missing IOP function
The project is experimental. An unhandled syscall or missing IOP library can indicate game support that has not been implemented. Gran Turismo 4 and God of War II are upstream demos; another title is not guaranteed to work. Check the upstream issue tracker and include the relevant error when reporting a problem.