We frequently cross by ESP32 builds on this website in favor of Raspberry Pi (opens in new tab) or RP2040 (opens in new tab)-based slices of genius, however we couldn’t let this one go. The brainchild of Jeroen Domburg of spritesmods.com (opens in new tab) and dropped at our consideration by Hackaday (opens in new tab), the tiny microcontroller inside this 3D-printed pinball machine seems to be able to extra than simply flinging just a few steel balls.Â
That’s as a result of it’s operating an X86 emulator highly effective sufficient to set Digital Illusions’ 1992 DOS basic Pinball Fantasies in movement. The programming a part of the construct sounds fairly difficult, as Domburg was confronted with code that contained feedback in three languages, some in-jokes, and a few gaps.Â
“Pinball Fantasies was completely written in hand-coded x86 meeting,” Domburg writes in his exceptionally detailed write-up (opens in new tab) of the undertaking. “As I meant [to] use an ESP32S3 because the thoughts of the tiny pinball desk, I could not use that straight; the Xtensa core in that chip would not know what to make of x86 directions. So my preliminary thought was to slowly convert the code to C: assemble the x86 meeting information, hyperlink them to a framework of C information, then slowly convert routines from meeting to C till all the factor was transformed and all I had left was clear C code.”
In fact, that didn’t work out, so Domburg modified tack, decoding the code as if it had been written for a selected VM, then emulating that machine. Utilizing an 8086 emulator written in C, he added the graphics, IO and DOS calls the sport makes use of and no extra. Domburg found alongside the way in which that whereas it solely shows a slice of the desk the place the ball is, all the pinball deck is stored in reminiscence, that means it may be tweaked to show the entire desk in order for you.
The {hardware} included an ESP32-S3, which sports activities a dual-core 240MHz Xtensa LX7 processor, half a meg of RAM, and comes with a helpful built-in parallel LCD interface. That show is a 320×640 LCD, plus a bit amp and speaker for audio and a few buttons to offer enter. Optionally available extras embrace a second LCD and a plunger to provide the genuine pinball startup movement. The case is 3D printed, and if you wish to have a go at constructing one, you’ll discover much more info on Domburg’s Github (opens in new tab).