Doom running on Even Realities G2 smart glasses via doomgeneric + WebAssembly.
[doomgeneric C → WASM] → [TypeScript app in iPhone WebView] → [BLE] → [G2 glasses]
↓ ↓
320x200 RGBA scale → dither → 1-bit BMP
↓
576x136 green mono
The Doom engine runs as a WASM module inside the Even App's WebView on your iPhone. Each frame is downscaled, dithered to 1-bit, packed as a BMP, and streamed to the G2 glasses' green micro-LED display over BLE.
- Node.js (v18+)
- Emscripten SDK (for building WASM)
- Even Hub developer access (for deploying to glasses)
- A
doom1.wadfile (the shareware WAD works fine)
# Install dependencies
npm install
# Clone doomgeneric into the wasm/ directory
git clone https://github.com/ozkl/doomgeneric.git wasm/doomgeneric
# Place your WAD file
cp /path/to/doom1.wad wasm/doomgeneric/doomgeneric/doom1.wad
# Build the WASM module (requires Emscripten)
npm run build:wasm
# Copy WASM build output to public/
mkdir -p public/wasm/build
cp wasm/build/* public/wasm/build/
# Start the dev server
npm run dev- Install the Even App on your iPhone
- Log in to Even Hub:
npx evenhub login - Generate a QR code:
npx evenhub qr - Scan the QR with the Even App to load the dev server URL
- The app connects to your glasses and starts streaming Doom frames
- Left side: D-pad (move/turn)
- Right side: FIRE / USE buttons
- Top center: ESC / ENTER
- Single tap → Fire
- Double tap → Use/Open
- Swipe up/down → Forward/Back
- Swipe left/right → Turn
- Long press → Menu (ESC)
- Arrow keys: Move/Turn
- Ctrl: Fire
- Space: Use
- Enter/Escape: Menu
The BLE image protocol currently supports 1-bit 576x136 BMP images. At ~25 KB/s BLE throughput, expect roughly 2-5 FPS on the glasses. The phone-side debug preview runs at full speed.
Dithering modes (configurable in src/main.ts):
bayer— fast, good for motion (default)floyd-steinberg— best static quality, more shimmer during motion
src/
doom/
engine.ts WASM Doom engine loader
input.ts Input mapping (keyboard, touch, R1 ring)
renderer/
dither.ts Dithering algorithms (Floyd-Steinberg, Bayer)
frame-converter.ts RGBA → scaled → dithered → 1-bit BMP pipeline
transport/
packet.ts BLE packet framing (0x15 cmd, syncID, sequencing)
ble-display.ts Frame sending + rate limiting + stats
ui/
debug-canvas.ts Phone-side green mono preview + stats overlay
wasm/
doomgeneric_wasm.c C platform layer for doomgeneric → WASM
Makefile Emscripten build script