ZX Spectrum Emulator
Tech Stack: C, CMake, SDL, Lua
Source: github.com/colinbarry/spectrum-emulator
Source: github.com/colinbarry/z80
The Sinclair Research ZX Spectrum was an inexpensive and popular British
8-bit computer of the 80s, known for its graphics (either 15 garish
colours, or monochrome), rubber keys, and fantastic game selection.
This project is an ongoing experiment into trying to recreate the hardware
in software, to understand exactly how the computer worked. Currently, compatibility
is good, with most programs seeming to work OK, and both the 48K and later
128K models are supported. There is currently no sound support at all, and
memory contention is not emulated (although in practise, this doesn't seem
to make much difference.)
The core of the emulator is the Zilog Z80. This was a popular 8-bit
microprocessor based on the Intel 8080 chip. It is backwards compatible
with the Intel chip, but adds a large number of additional opcodes and
features.I accurately emulate the processor including undocumented
features (which some programs do rely upon).
The z80 library uses two test suites:
- Zexdoc/Zexall programs. These are z80 machine code programs which have been executed on real hardware. We compare the value of a checksum genereated on real hardware with the checksum computed on the emulator to ensure compatibility.
- FUSE tests. This barrage of tests checks the result of every individual opcode. The CMake test suite include Lua code that generates the test harness from the FUSE data.