The Raspberry Pico / Sharp MZ-80K emulator project
I’ve owned a Pimoroni Pico VGA demo base since the very early days of the Raspberry Pico. I bought it after seeing a couple of videos showing its capabilities, with a vague idea that it might be fun to try to implement an emulator for an 8 bit computer of some kind. After it had arrived, I played with it a couple of times, decided my idea looked too hard, and consigned it to my box of Arduinos, sensors, cables and other short-lived enthusiasms. I probably spent longer soldering the header to the Pico than I did using the VGA board if I’m being honest.
It wasn’t until the launch of the Pico 2 that I thought about this board again. Rather than splash out £4.80 on another piece of electronica that might end up in my cardboard box of doom, I decided to make another attempt to do something useful with my £23.60 investment in the original VGA board and Pico.

After playing with a couple of Sinclair ZX emulators, I had a look for a Sharp MZ series one. There are a number available (there are a couple of very good ones), but they all run on MS Windows, Linux, FPGAs or specialist hardware of some description. Nothing for the Pico. So … that sounded like a challenge to me.
The other thing that’s common across these emulators is that documentation (by the way of code comments or otherwise) is non-existent, patchy or in Japanese (the latter being unsurprising). There’s plenty of information available for the MZ series machines (especially for the MZ-700) but it’s not all in the same place, so it takes significant effort to track it down.
So project aim 1 – whatever I create will be well-documented, not just from an end-user perspective, but the internal workings of the code as well. This means that it will definitely take me some time, as I’m trying to create a MZ-80K emulator from first principles, rather than lashing together other pieces of code.
The one concession to this process that I’m going to make is the Z80 cpu emulation. Earlier this year I bug-fixed the one used by the RC2040, and there are plenty of other good examples available that should work well on Pico hardware.
My first task was to work out what I’d have to write to get a rudimentary emulator for the MZ-80K up and running. As well as the Z80, I’d need modules to emulate the rather odd keyboard, drive the VGA output, implement the 8255, 8253 and logic used to manage timers, memory and devices.
I also needed a way of getting programs in and out of memory. This is rather more important on a MZ-80K emulator than for many other 8 bit machines of the era, as the 4K ROM is used purely to host the SP-1002 monitor.
The monitor only implements five commands, including LOAD. BASIC (or any other language) needs loading into RAM from tape or disk before anything very much can be achieved.
I’m a couple of weeks into the project and I now feel that I understand the way the MZ-80K is constructed well enough to believe that I can achieve what I’m setting out to do. Last night, after much kludging of the skeleton code I’ve written for the various components, I ran SP-5025 BASIC successfully for the first time.

I’m not expecting my progress to be very fast (I’m retired, so I’ve got lots of things on, including my Derbyshire Railway Walks in support of Lymphoma Action, if you’d like to sponsor me a few pennies), but I will make the code available once it’s of reasonable quality. And the documentation, naturally …
Gracias por compartirlo. Gracias