Skip to content

Guides ​

A restorer's workbench: a game CD under a magnifying lamp, hex dumps and format diagrams

These guides describe how the ENCORE projects rebuild old PC games as faithful, from-scratch reimplementations that run on the gasm WebAssembly runtime. They are distilled from nine projects — Return Fire, Grand Theft Auto, Interstate '76, Colin McRae Rally 2.0, Need for Speed: Porsche Unleashed, Sheep, Oni, Ballance and Babo Violent 2 — and every recommendation points at the commit, file or document it came from. They are written for developers starting a reimplementation of their own, and for the coding agents that do much of the work: almost every commit in these projects carries an agent session trailer.

Who this is for ​

  • Developers who own a game they care about and want it to keep running, on every platform, from the original disc.
  • Agent operators who need rules, commands and checks precise enough that an unattended session produces faithful code rather than plausible code.
  • Contributors to an existing ENCORE project who want to know why the conventions are what they are.

The guides assume you can read C and x86 disassembly, or are willing to learn on the job. They do not assume prior experience with gasm.

The lifecycle of a reimplementation ​

Every project went through the same stages, in roughly this order. Each stage ends with something a machine can check.

  1. Pick the game and the approach. Function-by-function port from disassembly (most projects), a script runtime for an engine game (Ballance runs Virtools behaviour graphs), or a source port when the code is released (Babo Violent 2). See Choosing an approach.
  2. Pin the binary. One executable, identified by size and CRC-32, refused with a clear message if it differs. Every address in the project is only valid for that build.
  3. Inventory. Map the executable by address range, name functions in a TSV that is the single source of truth, estimate effort in kilobytes of code, write an ordered port plan with a check per step.
  4. Formats. Decode every file the game reads and prove it: one summary hash over the whole disc, asserted by a test and confirmed by an independent reader.
  5. Port. Function by function, in the original's call order, citing every address, reading tables from the user's executable at run time, keeping every quirk.
  6. Verify. Deterministic headless runs with frame and audio hashes, identical across runners and data sources; differential execution of the original's machine code where precision matters.
  7. Platform. Map DirectDraw, Direct3D, DirectSound, DirectInput and the rest onto gasm's small ABI, in one backend file.
  8. Ship. A browser player that reads the user's own disc, native bundles for macOS, Linux and Windows, a documentation site.

The guides ​

Start here ​

GuideWhat it covers
Choosing an approachPort from disassembly, script runtime or source port; what each costs and when it fits
Anatomy of a projectRepository layout, the portable core, the CMake platform switch, what is git-ignored

Reading the original ​

GuideWhat it covers
Reverse engineering workflowGhidra headless, names as data, full decompile dumps, inventory by address range, cross-build name transfer
Porting function by functionCiting addresses, own-words rule, pending stubs, struct layouts, keeping quirks, reading the exe at run time
File formats and game dataReference decoders, summary hashes, disc images, installers and cabinets read in place

Getting it right ​

GuideWhat it covers
Determinism and verificationHeadless hashes, golden values, cross-runner parity, differential testing in Unicorn, replays as tests
Floating point and the compilerx87 precision and rounding modes, NaN compares, constants by their bits, FMA contraction, CRT rand and qsort

The platform ​

GuideWhat it covers
Building for gasmSDK pin, toolchain, frame model, blocking loops versus state machines, stack size, Asyncify
Graphics, audio, inputDirectDraw and Direct3D on video_present, gasm:gl and gasm:gfx; DirectSound mixers; DirectInput scan codes
NetworkingDirectPlay, WinSock and custom protocols over WebSockets and gasm-relay; rewriting a server
Modern additionsWidescreen, high resolution, skins and upscalers as opt-in layers that leave the default hashes unchanged

Shipping ​

GuideWhat it covers
Browser player, releases, docsThe play page, OPFS import, saves export, release workflow and bundles, the documentation site, wording
Working with agentsWhat made AGENTS.md effective, commit discipline, unattended-run rules, and a full AGENTS.md template
Lessons learnedThe cross-project lessons, grouped, each with its evidence
Theory of operationThe document every port ends with: how the game was designed and how it works

Agent skills

The same material is packaged as agent skills: procedural, command-level instructions an agent loads when it starts a project, ports a function, decodes a format or cuts a release. The guides explain why; the skills say what to do next.

ENCORE ships no game code or data — bring your own copy. All games are trademarks of their respective owners; ENCORE is not affiliated with them. Each project is GPL-3.0 and runs on gasm.