doom-on-github

Doom on GitHub Contribution Graph

A high-performance port of Doom designed specifically to run on the GitHub contribution graph (53x39 resolution). Built with WebAssembly and DoomGeneric.

Overview

This project runs the Doom engine inside a Web Worker and renders its output directly onto the GitHub contribution grid. It leverages DoomGeneric for portability and Emscripten for WebAssembly compilation.

Key Features


Architecture

1. The Engine (doomgeneric_github.c)

Custom doomgeneric backend tailored for the GitHub environment:

2. The Build Pipeline

3. The Controller (worker.js)

Acts as the “Host OS” for the WASM module:


Build & Test

Prerequisites

Compiling

To rebuild the engine from scratch:

make -f Makefile.emscripten clean
make -f Makefile.emscripten

Testing Locally

  1. Start a local server at the root:
    python -m http.server 8080
    
  2. Open your browser to http://localhost:8080/test/index.html.
  3. Press Shift+F5 to force a clean load.

ABI Specification

Exported Symbols

| Symbol | Type | Description | | :— | :— | :— | | _main | Function | Entry point. Initializes engine state. | | _DG_Github_Init | Function | Resets framebuffer and input queue. | | _DG_Github_Input | Function | Injects key event (key, pressed). | | _DG_GetFramebufferPtr| Function | Returns pointer to the 2067-byte pixel array. | | _doomgeneric_Tick | Function | Executes one game tick (1/35th sec). |

Framebuffer Format


Acknowledgments