Source f3a550b7

PS2 Web Recomp setup

Generate build commands

Prepare a private local build, then check the output of extraction, exploration, compilation, hosting and one scene test.

On this page

Check the build host

Already using a recent upstream checkout? See the 26 October native-play and patch notes. The builder below deliberately retains the manual’s fixed revision.

Prepare the build commands

Use your own disc image and the original snuri00 repository. Choose a new clone or start inside one you already have. The commands check out the same revision used by this manual.

Local command builder

Prepare commands for your file

Enter text below to prepare Bash commands. This tool does not run commands, inspect an ISO or upload files.

For a new clone, start in its parent folder. For an existing clone, start inside that repository; the commands will not clone it again. Both use reviewed revision f3a550b797de04b6380394e52532c03902bb03c4. Review your local changes before switching revisions; Git may refuse a conflicting checkout.

Use a short name such as gt4 for this game's directory.

Replace the example with your absolute Linux or macOS path, such as /Users/you/Games/My Game.iso. Relative paths start inside the cloned ps2-web-recomp folder, after cd. Replace a leading ~/ with your full home path; quoted paths do not expand it.

Choose a slug and replace the example image path, then build commands.
Example commands for a new clone

New-clone command reference

git clone --no-checkout https://github.com/snuri00/ps2-web-recomp.git &&
cd ps2-web-recomp &&
git fetch origin f3a550b797de04b6380394e52532c03902bb03c4 &&
git checkout --detach f3a550b797de04b6380394e52532c03902bb03c4 &&
scripts/port.sh mygame "/home/you/Games/My Game.iso" &&
python3 scripts/serve.py build/web-mygame games/mygame/disc.iso

Replace the path before using the example. The && chain stops if any step fails. For an existing clone, use the builder’s existing-clone option instead of running clone again.

Where the build outputs go

The server needs two inputs: the compiled web directory and the matching disc path. A completed native build does not supply the web directory when you used --native-only.

Four build stages connect the owned disc, exploration screenshots, browser output directory and local server.
Editorial diagram. Follow the files on your machine from the disc image to the served page. The slug mygame is an example. Based on the reviewed upstream revision f3a550b797de; this is a guide illustration, not a captured game test. Open full diagram.
Read the diagram as text
  1. The port script reads the disc boot program. The working game directory is games/mygame/.
  2. Exploration records missing function entries and screenshots in games/mygame/shots/. New entries can require another translation pass.
  3. The browser build is written to build/web-mygame/. Native-only mode skips it.
  4. The server takes the web directory and matching games/mygame/disc.iso as separate inputs and serves the game at localhost:8620.

Build-stage checkpoints

The port script extracts the disc’s boot program, translates it, explores execution in a native runner and builds the browser output. The first three checkpoints below happen inside port.sh; they are not separate commands to run by hand. Paths use the example slug mygame.

  1. 1

    Extract the boot program

    The script reads the boot entry from the disc’s SYSTEM.CNF. GT4 has an additional executable-extraction path handled by the script.

    Expected path
    games/mygame/disc/, including SYSTEM.CNF and the selected boot program.
    Check before retrying
    Keep the first extraction error and confirm the image path and disc revision. Do not substitute an executable name from another release.
    Disc and file-path checks →
  2. 2

    Explore the game’s execution

    Headless runs collect function addresses and vector microprograms that static analysis did not find. Automated Start/Cross inputs may stop at a menu rather than reach gameplay.

    Expected evidence
    games/mygame/explore.log and games/mygame/shots/.
    Check before retrying
    Read the first useful error and look at the last screenshots. Preserve that log before another run replaces it. More frames help only if the input sequence reaches new code.
    Missing entry or runtime-service checks →
  3. 3

    Compile the browser output

    The default port invocation builds the web output after exploration. The native-only option deliberately skips this part.

    Expected path
    build/web-mygame/. The default workflow also builds build/native-mygame/.
    Check before retrying
    Keep the first compiler or dependency error. A created folder alone is not evidence that the browser build completed.
    Build environment and useful logs →
  4. 4

    Serve the build and matching disc

    Use scripts/serve.py from the repository and open http://localhost:8620/. The server supplies isolation headers and the Range requests used for disc streaming.

    Expected evidence
    A local game document, its response headers and successful disc requests in that page’s network panel.
    Check before retrying
    Verify the supplied games/mygame/disc.iso path. An HTML response does not prove that the disc endpoint or shared-memory prerequisites work.
    Check the actual local page →
  5. 5

    Test one scene, then a save

    Record boot, menus, one repeatable scene, sound and controls separately. Save in the game, export a card backup, reload the same local origin and check the save.

    Expected evidence
    Your stopping point, exact release/settings and an exported memory-card file that you keep outside browser storage.
    Check before retrying
    Do not turn one working scene into a whole-game claim. An apparently empty card first calls for a hostname, port and profile check.
    Memory-card backup procedure →

Sources: upstream porting workflow, port.sh at the reviewed revision and hosting notes. These are expected outputs, not a game build performed by this site.

If exploration stops at a menu

The default exploration sends Start and Cross periodically. Inspect games/mygame/shots before increasing the run length: more frames do not supply a missing menu choice. --press replaces the input sequence and --frames changes the run length. Keep the original log and change one variable at a time.

A missing function entry can require another exploration path. An unhandled syscall or missing IOP library is a runtime service gap. Use the log-family table to distinguish them.

Apple silicon notes

The macOS scripts need Bash newer than the system’s bundled 3.2. Upstream lists brew install bash cmake ninja sevenzip; check which interpreter actually launches the script. The native runner uses wgpu-native with Metal on Apple silicon.

Rebuilds and the native-only option

scripts/build_web.sh mygame rebuilds the web output. Appending --native-only to the port invocation skips the browser build and Emscripten installation. The windowed native runner needs SDL2 development files. Its output can help diagnosis, but it does not establish browser compatibility.

Porting instructions · native runner · private-build scope.

Newer source: native play, patches and changing code

Editorial source check: . This section summarizes the official README at 79d8eab9b7f8, revised 26 October. The command builder and earlier instructions remain at f3a550b797de. We inspected documentation and source text; we did not build or play these changes.

Choose the output you need

The newer README documents --native-only for a native build that skips the browser output and Emscripten installation. A windowed native run needs SDL2 development files. Its build/native-mygame/ps2run executable takes the game’s extracted executable, disc path, --window and --memcard options. Use the executable path printed for your disc; another game’s example path is not interchangeable.

A native window does not validate WebGPU or isolation in a browser. For browser play, retain the web output and use the web-build and server checkpoints. The newer README says the native card layout matches exported browser cards; keep an exported backup before moving a card between runtimes. The author explicitly says Steam Deck use has not been tried.

Keep patch identity with your build

The newer porting notes describe PCSX2-format .pnach input and named sections through --pnach and --pnach-section. The script prints the game CRC. Match the patch to your game and retain the selected section names with the build log: patches to executable code are applied before translation, so adding a patch only after compilation does not reproduce that build.

Exploration can capture changing code

The same source describes collecting distinct executable images for games that unpack code into a reused memory window, with Kingdom Hearts II as its example. This explains why the explored path matters; it is not a Kingdom Hearts II playthrough or compatibility certification. Keep the scene, input sequence and first failure with your runtime error report, rather than treating a new source mechanism as proof that a game completes.

Read the exact native-run instructions and source-review scope for this newer revision. Do not copy its new flags into an older checkout without checking that checkout’s own script help.