The Pi Pico is a capable microcontroller that can do all kinds of fun and/or useful things. In the former vein, [antirez] has ported a ZX Spectrum emulator to the Pi Pico.
ZX2040, as it is known, is a port of [Andre Weissflog’s] existing ZX spectrum emulator. It’s designed for use on the compact embedded Pi Pico platform, using ST77xx TFT displays. To that end, it has a UI optimized for small, low resolution screens and minimal buttons. After all, very few Pi Picos come with a full QWERTY keyboard attached.
Certain hacks are necessary to make it all work; the chip is overclocked to get things humming fast enough. The emulator also runs upscaling or downscaling in realtime as needed. This allows the emulator to run with a variety of displays, almost none of which are a direct match for the ZX Spectrum’s original resolution of 256×192 pixels.
Code is on Github for the curious, including a great run down from [antirez] on everything that makes it tick. If you want to play ZX Spectrum games on a keychain, you’d do well to start here. There are other projects to emulate it on the Pico, too! Video after the break.
Now that it works, it’s time to optimize the code and clean up the upscaler to look less blocky. @antirez can ping me when he’s ready.
> Emulation performances were improved by rewriting video decoding and modifying the Z80 implementation to cheat a bit (well, a lot): many steps of instruction fetching were combined together, slow instructions executed in less cycles, memory accesses done directly inside the Z80 emulation tick, and so forth. This makes the resulting emulator no longer cycle accurate, but otherwise we could go at best at 60% of the speed of real hardware, which is not enough for a nice gaming experience.
Kind of pointless to use a very slow cycle-accurate emulator in the first place then? Without that the Pico would easily be fast enough with no overclocking required, and 99.9% of games will still run perfectly (it’s mostly demoscene stuff that breaks without cycle accuracy).
Seems pretty wall, Spectrum watch anyone?
A Spectrum watch would be awesome! Bonus points if it has a working keyboard like this one: https://hackaday.io/project/178204-the-smallest-keyboard
arduboy now is death
ZX Spectrum?
MSX!
But if so, MSX 2 please! MSX 1 !> ZX Spectrum
Games?
Programming!
Spectrum audio was never hifi but that has to be the worst speaker ever made.