QEMU Z80 Target

I have written a Z80 target for QEMU (an emulator using dynamic recompilation), mainly as a learning exercise. It currently emulates the 48K ZX Spectrum.

To build it, you will first need to apply a patch to the QEMU source (from CVS). After applying the patch, you will need to place a copy of the 48K ZX Spectrum ROM in the pc-bios directory. If you only wish to compile the Z80 target, you will save time when compiling if you pass ‘--target-list=z80-softmmu’ to the configure script.

To boot the emulator, you'll first need to create a test disk image. (This is a requirement of QEMU that I'll try to remove later.) To do this, run ‘qemu-img create hda.img 1M’. You can now boot the system using ‘qemu-system-z80 -hda hda.img’. Alternatively, depending on your OS, you may be able to run ‘qemu-system-z80 -hda /dev/null’, or some equivalent command.

Note that if you modify some of the files in the target-z80, directory, make misses some dependencies, so you'll have to run make clean. In particular, if you alter CPUZ80State and forget to run make clean, you may find that the build appears to be successful, but qemu-system-z80 crashes. Please send patches to the address given below!

Many thanks to those on #spin that helped me with some of the debugging! Thanks also to Ulrich Hecht for the improved version of the patch.

An older version that applies to QEMU 0.9.0 is also available.

Screenshots

ZX Spectrum reset sequence in QEMU ZX Spectrum startup screen in QEMU

TODO list


Stuart Brady

Valid XHTML 1.1