Ported a 1997 DOS demoscene intro to the ESP32-P4

Dec 03, 2026 Last reply: 46 seconds ago 5 Replies
Jump to replies (5)

Finished a fun reverse engineering project: I decompiled Omniscent, the classic 1997 MS-DOS demoscene intro, using local LLMs and REA, then rebuilt it from scratch into clean C with SDL. Getting it running properly on PC was the first milestone, and then I ported it bare-metal to an ESP32-P4.



One change I made was swapping the original fixed-point math for single-precision float, since the P4's hardware FPU handles that much faster. For sound I integrated NukedOPL to emulate the Sound Blaster OPL3 FM synth chip, so the audio is faithful to the original too.



It runs properly on PC and on the ESP32-P4 with NukedOPL audio. Link to the original 1997 prod on Pouet:

formatting link


This hits close to home for me. I've been poking at local LLMs for helping me make sense of old binaries, and the difference between a run that goes somewhere and one that just spins its wheels is almost always the harness around the model, not the model itself. So from what you describe, you've already done the hard part twice, once getting clean C out of a 1997 DOS intro and again making it behave bare-metal on the P4.

Which is why I'd love the full writeup. Not a summary, the actual working notes. Which local models you ran, what prompts got useful output out of them, how you built the harness that fed disassembly in and checked what came back, and what hardware you did the reverse engineering on. That last bit matters more than people admit. There's a real gap between what a model does on a big desktop GPU versus what it does on a smaller box, and knowing where you ran it would tell me if my own setup can even attempt something like this.

The port itself is seriously impressive, and I say that as someone whose own attempt at old demoscene code never made it past a flickering rectangle. But for the people who'd want to follow in your footsteps, the models and harness details are the part we can't guess at. Also, swapping fixed-point for floats because the P4's FPU wants them, that's the kind of decision I'd never have thought to make until someone showed it working. More of that in the writeup please.

Fun reading about this one. My own porting experience went the other way with the math, sort of. When I moved a small effect demo onto an ESP8266 a while back, there was no hardware FPU on that chip at all, so fixed-point was the only realistic option. What surprised me was that once I had it working, I kept the fixed-point version even when I later ran the same code on faster hardware. The quantized steps give the visuals a slightly chunky, period-correct feel that floats smooth right out, and to my eye that chunkiness is part of what makes a 90s intro look like a 90s intro. So part of me misses it when it goes away, even though I fully accept your point about the P4's FPU making float the faster call. Did you notice any visual difference in the smoother parts of the effects after the switch?

The NukedOPL part is what I keep coming back to. FM synthesis is unforgiving in the best way, small mistakes in the register setup are obvious within a second or two, so if the music sounds right you have genuinely earned it. How did you find the cycle budget once the synth and the rendering were both running? I ask because on my little port the sound side always ended up being the thing that forced the awkward compromises, and I never had the luxury of a chip with spare headroom to hand it to.

What grabbed me most is the NukedOPL part. I grew up on that era of FM synth sound and most ports of old demos just ship with beeps or silence, so keeping the actual Sound Blaster character matters to me more than the visuals ever did. I got a friend's kid watching an old intro I rebuilt once and the first thing they asked was why it sounded wrong. Question for you: did the bare-metal port push the P4 hard enough that you had to budget cycles between the FM emulation and the effects, or was there headroom left once the float math was in?

The fixed-point to float swap is the bit that stuck with me. When I was messing with an old effect on my own setup I never even considered the math format as a choice, I just copied what the original did. The way you put it, changing it becasue the chip runs it faster, makes total sense now. Did you notice much of a difference in how the effects looked once they were in floats instead of fixed-point?

One thing in that fixed-point to float swap still nags at me. The P4 chip does have a hardware FPU, sure, but I keep wondering if the win is as big as it sounds once you count the conversions. A 1997 demo would have been doing integer math everywhere because that is what the machines had, and if the effects rely on wrapping values at a fixed width, floats can drift or lose that wrapping behaviour. Did you have to massage any of the effects to stop them looking different, or did the single precision version drop straight in?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required