76

A DOOM vector engine for rendering in KiCad, and over an audio jack

I don’t care how this makes the world a better place, because it just does.

an hour agomlhpdx

This is just a meme now. Doom running on X. I don't get it but congratulations on your very whimsical accomplishment!

36 minutes agodjmips

This is a little different from most "Doom on X" projects, because the accomplishment is less about the hardware (it's just a normal computer) and more about turning a circuit-board designer into a real-time game display.

26 minutes agosethaurus

That's very cool. A very good use of your free time. The world needs more whimsy!

19 minutes agodjmips

Of course I love this. DOOM forever.

an hour agorobbru

I got DOOM running in KiCad by rendering it with PCB traces and footprints instead of pixels.

Walls are rendered as PCB_TRACK traces, and entities (enemies, items, player) are actual component footprints - SOT-23 for small items, SOIC-8 for decorations, QFP-64 for enemies and the player.

How I did it: Started by patching DOOM's source code to extract vector data directly from the engine. Instead of trying to render 64,000 pixels (which would be impossibly slow), I grab the geometry DOOM already calculates internally - the drawsegs[] array for walls and vissprites[] for entities.

Added a field to the vissprite_t structure to capture entity types (MT_SHOTGUY, MT_PLAYER, etc.) during R_ProjectSprite(). This lets me map 150+ entity types to appropriate footprint categories.

The DOOM engine sends this vector data over a Unix socket to a Python plugin running in KiCad. The plugin pre-allocates pools of traces and footprints at startup, then just updates their positions each frame instead of creating/destroying objects. Calls pcbnew.Refresh() to update the display.

Runs at 10-25 FPS depending on hardware. The bottleneck is KiCad's refresh, not DOOM or the data transfer.

Also renders to an SDL window (for actual gameplay) and a Python wireframe window (for debugging), so you get three views running simultaneously.

Follow-up: ScopeDoom

After getting the wireframe renderer working, I wanted to push it somewhere more physical. Oscilloscopes in X-Y mode are vector displays - feed X coordinates to one channel, Y to the other. I didn't have a function generator, so I used my MacBook's headphone jack instead.

The sound card is just a dual-channel DAC at 44.1kHz. Wired 3.5mm jack → 1kΩ resistors → scope CH1 (X) and CH2 (Y). Reused the same vector extraction from KiDoom, but the Python script converts coordinates to ±1V range and streams them as audio samples.

Each wall becomes a wireframe box, the scope traces along each line. With ~7,000 points per frame at 44.1kHz, refresh rate is about 6 Hz - slow enough to be a slideshow, but level geometry is clearly recognizable. A 96kHz audio interface or analog scope would improve it significantly (digital scopes do sample-and-hold instead of continuous beam tracing).

Links: KiDoom GitHub: https://github.com/MichaelAyles/KiDoom ScopeDoom GitHub: https://github.com/MichaelAyles/ScopeDoom KiDOOM Write-up: https://www.mikeayles.com/#kidoom ScopeDOOM Write-up: Https://www.mikeayles.com/#scopedoom

4 hours agomikeayles

Love ScopeDoom!

KiDoom I don't fully get. The website says "All components connected to a shared net; the PCB could be sent to a fab house (it just wouldn't do anything useful)" but I don't see any of the component pins hooked up in the demo video.

15 minutes agosho_hn

One of my to-do-one-day projects is an audio jack display system out of a Microcontroller.

Was never quite sure if I should raw XY it or soft modem so I could decode on a web page on a handy device.

an hour agoLerc

> raw XY it or soft modem

How about analog raster scan? a.k.a. slow-scan TV? [0] Like how they returned the live television images from the Apollo missions. (They only had 1 MHz of bandwidth for everything - voice, computer up and downlink, telemetry, and TV. Standard analog broadcast TV was 6 MHz. So they reduced the scan rate to 10 frames per second instead of 60, and halved the horizontal line resolution -- that could fit in 500 kHz.)

Most modern SSTV standards are super-narrowband, designed to fit into just a few hundred Hertz for amateur radio. But what if you had the full 20 kHz of bandwidth of a nice audio channel? With 100 horizontal lines per frame, and 1 frame per second -- that is about 200 cycles per horizontal line, or enough to resolve, in theory, 100 vertical lines on each horizontal line. I.e., 100 x 100 pixels (ish) at 1 fps.

[0] https://en.wikipedia.org/wiki/Slow-scan_television