{"id":49182264,"url":"https://github.com/franckferman/doom-wasm","last_synced_at":"2026-04-23T02:01:12.541Z","repository":{"id":350363813,"uuid":"1206492191","full_name":"franckferman/doom-wasm","owner":"franckferman","description":"Doom (1993) compiled to WebAssembly. Minimal interface (14 functions). Fork of jacobenget/doom.wasm with improved build system and optional autostart patch.","archived":false,"fork":false,"pushed_at":"2026-04-10T02:03:29.000Z","size":2715,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T03:23:52.058Z","etag":null,"topics":["doom","game","retro","wasm","webassembly"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/franckferman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-10T01:08:27.000Z","updated_at":"2026-04-10T02:03:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/franckferman/doom-wasm","commit_stats":null,"previous_names":["franckferman/doom-wasm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/franckferman/doom-wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2Fdoom-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2Fdoom-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2Fdoom-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2Fdoom-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franckferman","download_url":"https://codeload.github.com/franckferman/doom-wasm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckferman%2Fdoom-wasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32162611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"online","status_checked_at":"2026-04-23T02:00:06.710Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doom","game","retro","wasm","webassembly"],"created_at":"2026-04-23T02:01:11.726Z","updated_at":"2026-04-23T02:01:12.535Z","avatar_url":"https://github.com/franckferman.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# doom-wasm\n\nDoom (1993) compiled to WebAssembly. Runs natively in any browser with just a `\u003ccanvas\u003e` element.\n\nFork of [jacobenget/doom.wasm](https://github.com/jacobenget/doom.wasm), built on top of [doomgeneric](https://github.com/ozkl/doomgeneric).\n\n- Minimal WASM interface: 10 imports, 4 exports (surface area of 14 functions)\n- Doom shareware Episode 1 (DOOM1.WAD) embedded in the binary\n- Optional auto-start patch to skip menus and launch directly into gameplay\n- Improved browser example with fullscreen canvas and pixel-perfect scaling\n- Wrapper Makefile with build, serve, patch, and check targets\n\n## Quick Start\n\n### Build from Source\n\n**Requirements**: Docker, Python 3, Git, curl\n\n```bash\nmake                    # build doom.wasm (default, with menus)\nmake build-patched      # build with autostart (skip menus, direct E1M1)\nmake serve              # build + serve browser example on localhost:8080\n```\n\nFirst build takes ~10 minutes (Binaryen compiles from source). Subsequent builds ~2 minutes.\n\nOutput: `build/doom.wasm`\n\n### Autostart Patch\n\nSkip title/menu screens and launch directly into Episode 1, Map 1 (Hurt Me Plenty difficulty):\n\n```bash\nmake patch              # apply autostart\nmake unpatch            # revert to default menus\nmake check              # show current patch state\n```\n\n### All Makefile Targets\n\n```bash\nmake                    # build doom.wasm (default menus)\nmake build-patched      # build with autostart patch\nmake serve              # build + serve browser example\nmake patch              # apply autostart patch\nmake unpatch            # revert autostart patch\nmake check              # show build status and patch state\nmake clean              # clean build artifacts\nmake distclean          # remove everything (build + dev envs)\n```\n\n## WASM Interface\n\nThe module exposes a minimal interface of 14 functions, keeping integration simple.\n\n### Imports (host provides)\n\n| Module | Function | Signature | Description |\n|--------|----------|-----------|-------------|\n| `loading` | `onGameInit` | `(i32, i32) -\u003e ()` | Called with framebuffer width and height |\n| `loading` | `wadSizes` | `(i32, i32) -\u003e ()` | Report WAD count and total byte size (no-op = use embedded shareware) |\n| `loading` | `readWads` | `(i32, i32) -\u003e ()` | Copy WAD data into WASM memory |\n| `ui` | `drawFrame` | `(i32) -\u003e ()` | New frame ready: pointer to ARGB pixel buffer |\n| `runtimeControl` | `timeInMilliseconds` | `() -\u003e (i64)` | Current time in milliseconds (BigInt) |\n| `console` | `onInfoMessage` | `(i32, i32) -\u003e ()` | Info message from engine (pointer, length) |\n| `console` | `onErrorMessage` | `(i32, i32) -\u003e ()` | Error message from engine (pointer, length) |\n| `gameSaving` | `sizeOfSaveGame` | `(i32) -\u003e (i32)` | Size of save data for a given slot |\n| `gameSaving` | `readSaveGame` | `(i32, i32) -\u003e (i32)` | Read save game data from slot |\n| `gameSaving` | `writeSaveGame` | `(i32, i32, i32) -\u003e (i32)` | Write save game data to slot |\n\n### Exports (host calls)\n\n| Function | Signature | Description |\n|----------|-----------|-------------|\n| `initGame` | `() -\u003e ()` | Initialize the engine |\n| `tickGame` | `() -\u003e ()` | Advance one game frame (call at 35 FPS) |\n| `reportKeyDown` | `(i32) -\u003e ()` | Report a key press |\n| `reportKeyUp` | `(i32) -\u003e ()` | Report a key release |\n\n### Exported Key Constants\n\n`KEY_LEFTARROW`, `KEY_RIGHTARROW`, `KEY_UPARROW`, `KEY_DOWNARROW`, `KEY_FIRE`, `KEY_USE`, `KEY_SHIFT`, `KEY_TAB`, `KEY_ESCAPE`, `KEY_ENTER`, `KEY_BACKSPACE`, `KEY_ALT`, `KEY_STRAFE_L`, `KEY_STRAFE_R`\n\n## Controls\n\n| Key | Action |\n|-----|--------|\n| Arrow keys | Move and turn |\n| Ctrl | Fire weapon |\n| Space | Open doors, activate switches |\n| Shift | Run |\n| Alt + arrows | Strafe (lateral movement) |\n| 1-7 | Switch weapon |\n| Tab | Automap |\n| Esc | Menu |\n\n## Examples\n\n| Example | Description | Runtime |\n|---------|-------------|---------|\n| `examples/browser/` | Minimal browser implementation (fullscreen canvas) | Any modern browser |\n| `examples/native/` | Native implementation with SDL + Wasmtime | C compiler, SDL2 |\n| `examples/python/` | Python implementation with PyGame + Wasmtime | Python 3, PyGame |\n\nEach example supports custom WAD loading and game saving (except the browser example which demonstrates the minimal integration).\n\n## Project Structure\n\n```\ndoom-wasm/\n  Makefile              # wrapper with build/serve/patch targets\n  Makefile.build        # upstream build system (Docker + WASI SDK + Binaryen)\n  scripts/\n    patch-autostart.sh  # apply/revert autostart patch\n  src/                  # WASM-specific C source (doom_wasm.c, imports bridge)\n  doomgeneric/          # doomgeneric engine (portable Doom source)\n  utils/                # build utilities (WAD embedding, interface printing)\n  examples/             # browser, native, and python examples\n  CHANGELOG.md          # changes from upstream\n  LICENSE               # AGPL-3.0\n```\n\n## Build System\n\nThe build pipeline:\n\n1. **WAD download**: Doom shareware WAD from [doomwiki.org](https://doomwiki.org/wiki/DOOM1.WAD)\n2. **WAD embedding**: Python script converts WAD to C source (compiled into the binary)\n3. **WASM compilation**: [WASI SDK](https://github.com/WebAssembly/wasi-sdk) via Docker\n4. **Post-processing**: [Binaryen](https://github.com/WebAssembly/binaryen) tools merge WASI trampolines, deduplicate exports, and add key constants\n\n## License\n\n- Doom source code: GNU GPL v2 ([id Software](https://github.com/id-Software/DOOM))\n- doomgeneric: MIT ([ozkl](https://github.com/ozkl/doomgeneric))\n- doom.wasm upstream: AGPL-3.0 ([jacobenget](https://github.com/jacobenget/doom.wasm))\n- This fork: AGPL-3.0\n- DOOM1.WAD (shareware): Freely distributable by id Software\n\n## Credits\n\n- [id Software](https://github.com/id-Software/DOOM) for the original Doom source code\n- [ozkl/doomgeneric](https://github.com/ozkl/doomgeneric) for the portable Doom abstraction layer\n- [jacobenget/doom.wasm](https://github.com/jacobenget/doom.wasm) for the minimal WASM compilation approach\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranckferman%2Fdoom-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranckferman%2Fdoom-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranckferman%2Fdoom-wasm/lists"}