Skip to content

gasm — the runtime under every exhibit ​

Built for gasm

gasm ("game assembly") is a portable game runtime. A game is compiled once to a single WebAssembly module — the guest — and thin per-platform runners give it a small, stable binary interface for video, audio, input, assets, graphics, networking, saves and the clipboard. The same .wasm runs natively on macOS, Linux and Windows (wasmtime with wgpu or ANGLE), in browsers (WebAssembly with WebGPU or WebGL 2), and headless in Node, with bit-identical game state on all of them.

It is MIT-licensed, still versioned as an experimental proof of concept (ABI version 0, release 0.16.1 at the time of writing), and developed alongside the ENCORE ports: several of its features exist because a port needed them.

DOOM on gasm with the sharp filterGodot 4.7 3D on gasm:glScummVM playing Beneath a Steel Sky, upscaled with xBRThe browser player running ScummVM

The gasm wing ​

gasm carries two classics of its own: DOOM (doomgeneric, with OPL music) and ScummVM, the reimplementation of the engines behind LucasArts' SCUMM adventures and many others. Both run in the browser from the gasm demos.

DOOM running on gasm
gasm wing · 1993

DOOM

id Software

doomgeneric (from id's released source) with Chocolate Doom's OPL music player and saves in gasm storage.

You bring: Any IWAD — the freely distributable shareware doom1.wad, DOOM II, Freedoom

ScummVM running on gasm
gasm wing · 2001

ScummVM

The ScummVM team

The reimplementation of the engines behind LucasArts' SCUMM adventures, Humongous games, Beneath a Steel Sky, Drascula and many more, with a gasm backend.

You bring: Your own adventure games; Beneath a Steel Sky (freeware) is in the demo

Why ENCORE targets it ​

One build, every platform. A port is one .wasm plus a runner. Desktop bundles for macOS (universal), Linux (x86_64 and arm64) and Windows, and the browser player on every project site, all run the same module.

Determinism as a property of the platform. The runner drives frames: the guest exports gasm_frame, called once per fixed timestep, with input sampled between calls. That makes every frame a pure step — which is exactly what a faithful port needs to be tested. gasm's own test suite asserts identical FNV-1a hashes of the video, audio and GPU-upload streams across wasmtime JIT and AOT, V8, and four operating system targets; the ports do the same with their own frames. See Determinism and verification.

A sandbox that fits "bring your own copy". There is no filesystem. Game data is mounted read-only by the runner — natively with --asset-dir <your CD folder> or --asset cd=<image.iso>, in the browser by picking a folder or disc image that is read locally or imported once into the browser's private storage. Network access and saved files go through the player's consent.

Graphics APIs the originals can be mapped onto. gasm:gl is OpenGL ES 3.0 with WebGL 2's rules, which is what Direct3D 7 and OpenGL 1.x games are translated to; gasm:gfx is a WebGPU subset; software-rendered games just present a framebuffer. See Graphics, audio, input.

Not a lock-in ​

Every ENCORE port keeps all calls into gasm in a single backend file; the rest of the code is portable C. A native build of the same code already exists in each project for tools, sanitizers and debuggers, and a fully native platform backend — SDL, a console SDK — is a contained piece of work where WebAssembly performance is not enough (wasm runs roughly 1.5–1.6× slower than native in gasm's measurements).

Using it ​

sh
gasm-run opengta.wasm --asset-dir /path/to/your/game     # a folder
gasm-run openrf.wasm --asset cd=ReturnFire.iso           # a disc image

The badge, for projects built on it:

md
[![Built for gasm](https://gasm.emdzej.pl/badge/built-for-gasm-flat.svg)](https://gasm.emdzej.pl)

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.