I made a thing! I built an ESP32 emulator that can run Doom in the browser
Video: Doom shareware on a real ESP32-S3 + ILI9341 on a breadboard, then the exact same firmware running in my emulator in the browser.
Demo (no sign-up): https://flomotion.app/schematic/3214c185-666a-42e0-9c09-ed17b9079799
Chip: ESP32-S3
Picked the S3 for the octal PSRAM (heap and .bss live there) and native USB OTG, which drives a PS5 DualSense as a USB-host gamepad. 16 MB flash, 240 MHz, DevKitC-1.
Libraries
- Based on Espressif's esp32-doom (Sprite_tm's PrBoom port), since it's already built around ESP32 constraints.
- Ported it to ESP-IDF 5.5 / CMake for the S3.
- Display: the port's own SPI LCD driver on the IDF spi_master, not TFT_eSPI or LovyanGFX. ILI9341 at 320x240 on SPI2 with DMA at 26 MHz, with the 8-bit framebuffer converted to RGB565 in DMA chunks.
- usb_host_hid for the gamepad, plus 8 push buttons on GPIO.
Hurdles
- Old PrBoom C code on a modern toolchain: needed -fcommon, and .bss had to move into PSRAM to fit.
- The WAD sits in a raw 4 MB flash partition and is memory-mapped once instead of per lump.
- The timing had to move to esp_timer.
- Moved the display pins so the breadboard jumpers run straight. A slower 10 MHz SPI build for long jumpers was tried and reverted.
The emulator
Written from scratch in Rust, compiled to WASM. It emulates the Xtensa LX7 cores, octal PSRAM, SPI2 DMA and the ILI9341, enough to boot unmodified ESP-IDF 5.5 firmware. Getting Doom playable needed a JIT that compiles Xtensa code to WASM: compiled blocks chained inside WASM, compiled interrupt/window-exception paths, and shared code compiled once (22 MB down to 8 MB of WASM per run, half the host CPU).
Full disclosure: Claude Opus 5.5 wrote all of the emulator's Rust code.
No sound yet, the audio calls are stubs.
Doom shareware © id Software




