Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

G2 Doom

Doom running on Even Realities G2 smart glasses via doomgeneric + WebAssembly.

Architecture

[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.

Prerequisites

Setup

# 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

Running on G2 Glasses

  1. Install the Even App on your iPhone
  2. Log in to Even Hub: npx evenhub login
  3. Generate a QR code: npx evenhub qr
  4. Scan the QR with the Even App to load the dev server URL
  5. The app connects to your glasses and starts streaming Doom frames

Controls

Phone Touchscreen

  • Left side: D-pad (move/turn)
  • Right side: FIRE / USE buttons
  • Top center: ESC / ENTER

R1 Ring

  • Single tap → Fire
  • Double tap → Use/Open
  • Swipe up/down → Forward/Back
  • Swipe left/right → Turn
  • Long press → Menu (ESC)

Keyboard (debug mode)

  • Arrow keys: Move/Turn
  • Ctrl: Fire
  • Space: Use
  • Enter/Escape: Menu

Performance Notes

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

Project Structure

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

About

Does it run Doom though?

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages