Pi Pico Gets A ZX Spectrum Emulator

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.

8 thoughts on “Pi Pico Gets A ZX Spectrum Emulator

  1. > 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).

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.