A ZX Spectrum emulator for your BBC Master 128.
This is not a joke! This will genuinely execute ZX Spectrum programs on your BBC Master 128, by executing the Z80 code and emulating the Spectrum’s hardware.
This is not a joke! But if you ran it, you probably wouldn’t believe me.
stuff/qnd_emu
- Z80 emulator parts by Marat Fayzullin (consult Marat
Fayzullin’s emulator page for licence details). main.cpp code by me
(MIT licence).
Rest of stuff
folder: consult each folder in turn to discover
licence terms.
Remainder: GPL v2.
Watch this space.
This repo exists so I can share code conveniently between OS X and Windows, and I’m too cheap for a proper GitHub subscription. So it’s not really set up for other people to build with just yet.
But, if you have python 2.7, BeebAsm (build the _tom
branch of my
BeebAsm repo), my Beeb tools, and you use 65Link with your Master, you
might be able to tweak a few paths and have it work. You’re on your
own for now, though!
Pre-pre-alpha WIP prototype.
With no emulated interrupts occurring, it boots the 48K ZX Spectrum ROM to the “(C) 1982 Sinclair Research Ltd” message. The register log matches a quick’n’dirty PC-based Spectrum emulator I cobbled together (see the stuff/qnd_emu folder) using Marat Fayzullin’s Z80 code, which I assume is at least roughly correct. So it looks like things roughly work, sort of.
With vblank interrupts occurring - essential to get the keyboard working - the emulated system gets stuck somewhere between the memory test and the message. Clearly some bugs remain…
I’ve reached the limit of what I feel like debugging on an ordinary 2MHz system, so next step is to get some Windows/Linux time, running B-Em with the speed limiter turned off (and some means of easily getting megabytes of log data into a PC file).
Watch this space.
I don’t even remember. But why not?
Terrible. So terrible, I haven’t even bothered putting in any kind of performance counters. But, going by eye, it looks about 3% real speed.
This is actually even worse than it sounds.
Download a video of ZX running (~100MBytes).
This shows ZX load, run, and execute enough of the Spectrum ROM to get to the initial copyright message.
(The bar on the left hand side of the screen represents the TV scan-out process. One frame, the bar is filled with white; the next, it is filled with black. Yes - I did say it was slow…)
Currently? No. There are too many emulation bugs (it doesn’t even boot the standard ROM 100% properly…), there’s no tape loading support, and I haven’t implemented save state loading yet.
Eventually? No. It will be way too slow.
Not without a lot of work. The current code uses 4 banks of sideways RAM (for the Z80 memory), all of main RAM, all of shadow RAM, and relies on the Master’s fancy shadow RAM banking system. Oh… and I might also have used some of the 65C12 instructions…
With enough (112K?) sideways RAM it could be feasible, with work.
I have a crazy plan, but I’m not sure it will help that much :(
But so far, even the ordinary version doesn’t work properly, so… no support yet.