Deeply Optimized MSX Emulation On ESP32-S3 With VGA Output

ESP32-S3 board with VGA and audio output during development. (Credit: Ivan Svarkovsky)
ESP32-S3 board with VGA and audio output during development. (Credit: Ivan Svarkovsky)

The ESP32-S3 is by many metrics quite the powerful little computer, which has led to it being used even for things like emulating retro consoles and similar. Here [Ivan Svarkovsky]’s S3-MSX-PC project pushes the envelope by taking the multi-system Retro-Go project’s MSX component and optimizing it for the ESP32-S3’s Xtensa Lx7 CPU cores.

The project involves an ESP32-S3 as the core, requiring at least 8 MB of PSRAM (N16R8 configuration) to match the tested configuration. Any software is loaded into PSRAM before it’s executed, with the MSX1, MSX2 and MSX2+ supported.

For audio you have to wire up your own PDM filters to connect to the two GPIO pins that are used for audio output, while VGA output is handled by a basic 2-bit R-2R RGB222 DAC. For input devices you can use any USB keyboard, while software is added via the web interface or directly onto an SD card.

The Technical Deep Dive section goes into more detail as to what exactly got changed – with the blessing of the fMSX author – in the original fMSX core, such as targeting the Lx7 core’s cache dimensions and optimizing hot paths to avoid bottlenecks. Memory accesses were aligned for Xtensa and moving certain data from Flash to RAM was another change, along with the prevention of pipeline flushing due to certain branching decisions.

Considering that MSX specifications are based on a Z80 core, it’s not so crazy that one of these ESP32-S3 MCUs can effectively emulate them. The Retro-Go project itself claims to cover a whole swath of Nintendo and Sega consoles, as well as others, making it almost too easy to do some retrogaming without even having to drag out a Raspberry Pi SBC or so.

The turntable in question, or at least the same model.

Vintage Turntable Gets Brain Transplant And Home Assistant Integration

When [Marsupial] picked up a vintage Sansusi P-L45 turntable, he figured it would be an easy fix: a few capacitors, a belt or two, and maybe a new cartridge, the usual. But it turned out the electronics were fried, which set the stage for an upgrade that turned it into what may be the world’s only ESP32-driven, Home Assistant integrated, linear tracking turntable.

That last bit, the linear tracking, is why the turntable originally had a microprocessor in the first place: rather than an arm that pivots along the groove naturally, fancy turntables towards the end of the golden era of vinyl slid the needle along a linear track at a variable speed to follow the spiral groove on the record. You can see that in action in the demo video below, though it’s of a working version owned by [BFinks].

The fancy linear mechanism required electronic control to match the speed to the RPM, and in the example of Sansusi’s P-L45, that was provided by an NEC microcontroller on a daughter-board labelled “F4992 CPU”. CPU is a grandiose title, perhaps, but that’s irrelevant since the chip on the board was deader than disco.

That meant [Marsupial] had some reverse engineering to do — figuring out exactly what that chip did to drive this board, in order to replicate its behavior on an ESP32-S3. Luckily the golden era of vinyl correlated with the golden era of service manuals, and the manuals are still available, so [Marsupial] had a big leg up on that. After making the turntable work like stock, what else to do with the extra capability of the ESP32 than plug it into HA and make it really automatic?

Of course it wasn’t quite that easy: a new daughter-board was created that needed to do level shifting to the ESP32’s modern 3.3 V logic as well as hardware debounce on some inputs. The whole saga is very well documented on [Marsupial]’s blog WeAreAllGeeks. The link here takes you to the overview, but he’s got a lot more info on other pages — and of course links to the firmware and PCB design if you happen to have a Sansusi turntable in need of a brain transplant.

Vinyl lovers will appreciate this project much more than the last ESP32 “turntable” we featured, which was anything but. If you want to get into records but don’t have a turntable, you can always make your own.

Continue reading “Vintage Turntable Gets Brain Transplant And Home Assistant Integration”

A tiny, rectangular, 3D-printed box with an e-paper display and a fortune cookie design beneath it. The fortune reads: "Your next firmware update will both solve and create problems."

E-Fortune Cookie Will Humble, But Never Crumble

Will your next project be a success? Only time will tell, but if you build [gokux]’s tiny ESP32 fortune cookie, we predict that, at the very least, there won’t be any crumbs involved.

After briefly entertaining the idea of shoving an ESP32 in a standard fortune cookie, [gokux] thought better of it and came up with this instead. Once shaken, this small gadget displays a fortune on its e-paper screen. It can store over 3,000 fortunes and works entirely offline, so you’re never without an oracle.

Inside you’ll find a Seeed Xiao ESP32-S3 Plus and a matching e-paper display board. [gokux] is detecting the shakes with an MPU-6050 accelerometer, and powers everything with a small Li-Po pouch.

If you tire of the fortunes that shake out, the small buttons on the left side will get you into the other modes, which are a dice roller and a coin flipper. Again, you just shake the thing until you get what you want. Be sure to check it out in the video after the break.

Want to know how an MPU-6050 works, and what it looks like under the hood? Yeah, we thought so.

Continue reading “E-Fortune Cookie Will Humble, But Never Crumble”

A render of the moon, on a circular display.

Put The Moon On Your Desk

Most people take the Moon for granted, not considering its slow cycle where the sun gradually illuminates different parts of it. A recent project from [Karsten Mueller] helps you keep our nearest celestial neighbor in mind by putting a tiny version on your desk. (German)

The device itself is made with a circular display, an ESP32-S3, and a simple 3D printed case. But the interesting part is the software — it’s not just a moon phase display, it actually takes your local time, latitude and longitude into account. The resulting image is an approximation of what the moon looks like if you were to look at it, even if you wouldn’t actually be able to see it, such as when it is obscured by the Earth or barely visible during the daylight sky. Initially the project actually used a photograph of the Moon that [Karsten] personally snapped, but there’s also an option to pull the imagery from NASA.

The original write-up is in German, but there’s also an English page for the project on Hackaday.io, and the source is available on GitHub if you’d like to put one together yourself.

A black screen with green text is shown. The green text logs events from a VPN gateway.

Running A VPN Gateway On An ESP32

If you need a VPN gateway to access your home network, the fastest and most cost-effective way is probably by using a Raspberry Pi Zero. But in [Samir Makwana]’s view, an ESP32-S3 is just as capable for moderate use, and in some respects even superior.

This was possible thanks to the MicroLink project, which is a full implementation of a Tailscale client for the ESP32 family. In some ways the ESP32 worked better than a Raspberry Pi: it boots in two seconds rather than thirty, draws 0.5 Watts rather than 1.5, and there’s no chance of it failing due to a corrupted SD card. Compared to a Raspberry Pi, however, which can be set up as a Tailscale client in a few minutes, this took several hours to get running. The biggest issue was making sure that there was enough memory available for TLS handshakes, which was solved by enabling the ESP32’s PSRAM.

Once the VPN client is running, the ESP32 can be used as an SSH jump machine to access other devices on the home network, without needing to expose those machines to the open Internet. The ESP32 also hosts an HTTP server which can send a wake-on-LAN magic packet to another device on the local network, letting unused devices sleep without impairing their availability.

The ESP32 doesn’t provide much bandwidth — streaming video would cause issues — but it works well enough for lightweight applications. If you’re wanting to stream video from an ESP32, though, it is technically possible.

Wipeout Clone Runs Native On ESP32-S3

Psygnosis’s 1995 game Wipeout is remembered for two things: being one of the greatest games of all time, and taking advantage of the then-new PlayStation’s capacity for 3D graphics. The ESP32-S3 might not be your first choice to replace Sony’s iconic console, but [Michael Biggins] a.k.a. [PhonicUK] is working on doing just that, with his own clone of Wipeout on the Expressif MCU. 

It’s actually not that crazy when you think about it. The PlayStation had a 32-bit RISC processor, and the ESP32-S3 is a 32-bit RISC processor. The PlayStation’s was only good for about 30 Million Instructions Per Second (MIPS) but it had a graphics co-processor to help out with the polygons — the ESP32-S3 has two cores that can help each other, which combine to about 300 MIPS. In terms of RAM, the board in use has 8 MB of PSRAM, while the faster 512 kB on the chip is used, in effect, as video ram.

The demo is very impressive, especially considering he’s fit in three computer players. He’s also got it blasting out 60 frames per second, which is probably double what the original Wipeout ran on the PS1. Part of that is the two cores in action: he’s got them working together on the interlaced video output, one sending while the other finishes the second half of the frame. Each half of the video gets dedicated space in the internal memory. Using a 480×320 pixel display doesn’t hurt for speed, either. Sure, it’s paltry by modern standards, but the original Wipeout got by with even fewer pixels — and it didn’t run on a microcontroller. Granted it’s a beefy micro, but we really love how [Michael] is pushing its limits here.

Right now there’s just the Reddit thread and the demo video below. [Michael] is considering sharing the source code for his underlying 3D engine under an open license. We do hope he shares the code, as there are surely tricks in there some of us here could learn from. If it’s all old hat to you, perhaps you’d rather spend a weekend learning raytracing.

Continue reading Wipeout Clone Runs Native On ESP32-S3″

ESP32 Weather Display Runs Macintosh System 3

It seems like everybody takes their turn doing an ESP32-based weather display, and why not? They’re cheap, they’re easy, and you need to start somewhere. With the Cheap Yellow Display (CYD) and modules like it, you don’t even need to touch hardware! [likeablob] had the CYD, and he’s showing weather on it, but the Cydintosh is a full Macintosh Plus Emulator running on the ESP32.

Honey, I stretched the Macintosh!

The weather app is his own creation, written with the Retro68k cross-compiler, but it looks like something out of the 80s even if it’s getting its data over WiFi. The WiFi connection is, of course, thanks to the whole thing running on an ESP32-S3. Mac Plus emulation comes from [evansm7]’s Micro Mac emulator, the same one that lives inside the RP2040-based PicoMac that we covered some time ago. Obviously [likeablob] has added his own code to get the Macintosh emulator talking to the ESP32’s wireless hardware, with a native application to control the wifi connection in System 3.3. As far as the Macintosh is concerned, commands are passed to the ESP32 via memory address 0xF00000, and data can be read back from it as well. It’s a straightforward approach to allow intercommunication between the emulator and the real world.

The touchpad on the CYD serves as a mouse for the Macintosh, which might not be the most ergonomic given the Macintosh System interface was never meant for touchscreens, but evidently it’s good enough for [likeablob]. He’s built it into a lovely 3D printed case, whose STLs are available on the GitHub repository along with all the code, including the Home Assistant integration.