{"by":"mikeayles","descendants":49,"id":46051449,"kids":[46054027,46056239,46055649,46053889,46053275,46053002,46060971,46057687,46056368,46053515,46062796,46054605,46054005,46058924,46052954,46054205,46051450,46061969,46055133,46053372,46055158,46055151],"score":362,"text":"I got DOOM running in KiCad by rendering it with PCB traces and footprints instead of pixels.<p>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.<p>How I did it:<p>Started by patching DOOM&#x27;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.<p>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.<p>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&#x2F;destroying objects. Calls pcbnew.Refresh() to update the display.<p>Runs at 10-25 FPS depending on hardware. The bottleneck is KiCad&#x27;s refresh, not DOOM or the data transfer.<p>Also renders to an SDL window (for actual gameplay) and a Python wireframe window (for debugging), so you get three views running simultaneously.<p>Follow-up: ScopeDoom<p>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&#x27;t have a function generator, so I used my MacBook&#x27;s headphone jack instead.<p>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.<p>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).<p>Links:<p>KiDoom GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;MichaelAyles&#x2F;KiDoom\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;MichaelAyles&#x2F;KiDoom</a>, writeup: <a href=\"https:&#x2F;&#x2F;www.mikeayles.com&#x2F;#kidoom\" rel=\"nofollow\">https:&#x2F;&#x2F;www.mikeayles.com&#x2F;#kidoom</a><p>ScopeDoom GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;MichaelAyles&#x2F;ScopeDoom\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;MichaelAyles&#x2F;ScopeDoom</a>, writeup: <a href=\"https:&#x2F;&#x2F;www.mikeayles.com&#x2F;#scopedoom\" rel=\"nofollow\">https:&#x2F;&#x2F;www.mikeayles.com&#x2F;#scopedoom</a>","time":1764108815,"title":"Show HN: KiDoom – Running DOOM on PCB Traces","type":"story","url":"https://www.mikeayles.com/#kidoom"}