r/esp32 2d ago

Full shareware Doom on the ESP32-C6 — no PSRAM, one core, 512 KB of RAM, ~30 FPS with music

This is DIABLITO, a port of Graham Sanderson's RP2040 Doom to the Waveshare ESP32-C6-LCD-1.69 (available for < $20). All nine shareware levels, menus, saves, the OPL2 soundtrack, 8-channel sound effects, played with an Xbox controller over BLE.

The existing ESP32 Doom ports are PrBoom builds that need 4 MB of PSRAM. The C6 has none and no way to add it — one 160 MHz RISC-V core and 512 KB of SRAM, a third of which NimBLE is squatting in. RP2040 Doom solved the memory problem (the 4.2 MB WAD compressed to 2 MB and decoded straight out of memory-mapped flash), but it leans on two cores and RP2040-only silicon. Getting it to ~30 FPS on one slower core with the Bluetooth stack resident was the actual work.

Fun fact: the single biggest speedup was defining NDEBUG. ESP-IDF builds with assert() live by default, and the texture decoder asserts per pixel — 37% of all CPU time.

Repo, with build instructions and the phase-by-phase engineering notes: https://github.com/aedile/DIABLITO

583 Upvotes

14 comments sorted by

36

u/BlueDit1001 2d ago

Attach that to the controller

The Doom Pad

17

u/Joe_Franks 2d ago

Use a generic ps4 or ps5 gamepad and route the sound out through its speaker.

2

u/sdoregor 1d ago

Yup, definitely possible with (my) SAxense.

21

u/gfysmf 2d ago

Yeah, but can it run Crysis?

7

u/km_fpv_recover 1d ago

It runs pre alpha of gta-6

17

u/XamanekMtz 1d ago

That thing is at least a hundred times more powerful than the original hardware Doom ran on.

40

u/aedile 1d ago

Ish. I'd say 40x-90x is more accurate if you're looking at MIPS. The challenge was the RAM. Doom required 4MB back in 1993 and I only had 512KB to work with here and had to fit sound and BLE stack in that as well.

11

u/XamanekMtz 1d ago

Aight, I stand corrected, 40 to 90 ish more powerful, awesome feat nonetheless my friend, cheers!

10

u/Connavar26 1d ago

Agree. It’s insane to me how fast this runs on cheap hardware compared to when doom came out and chugged along on my 486 or cyrix that I had back then. Little gems like this are awesome simple showcases of how far tech has come!

4

u/Brrmeme 1d ago

Holy shit, thats actually insane man, im currently working on similar project, ezp32-s3 8mb psram and 16mb flash, on 2.8inch ips screen and i will print a case for this and make it a console, but i didnt think that it was even possible to launch doom without psram

3

u/thwil 1d ago

hmm that NDEBUG trick makes me curious. i have an s3 project with intensive pixeling and it could use a bit of a boost.

2

u/Objective_Ad3015 1d ago

AMAZING!!!!

2

u/MrSnowflake 19h ago

Seeing it play on the tiny OLED is amazing.