A minimal ZX Spectrum emulator built for one specific job: a fast, flash-free dev loop for testing pico-spec's network peripherals (Gopher, TNFS, FTP, ...) on Linux, without needing a real RP2350 board for every iteration. Not trying to compete with Fuse/ZEsarUX as a general-purpose emulator.
Built on dcrespo3d/MinZX_SDL
(itself on jsanchezv/z80cpp) — the
one genuinely portable, cleanly-decoupled Z80 core in the whole
ESPectrum/pico-zxspectrum/pico-spec lineage (class MinZX : public Z80operations, flat memory/port arrays, zero external singletons).
pico-spec's own Z80 opcode engine was tried first and ruled out: it calls
Ports::/VIDEO::/MemESP::/Config:: directly by name throughout,
not through a swappable interface — a deliberate, reasonable choice for
embedded performance, but it means the engine can't be lifted out without
dragging in most of the emulator.
- Boots a real 48K ROM (confirmed: the actual
© 1982 Sinclair Research Ltdboot screen renders correctly via SDL2/OpenGL). - Kempston joystick: arrow keys + left Alt (fire), standard bit layout,
ported from pico-spec's
Ports.cpp/ESPectrum.cpp. - No text keyboard matrix yet (port 0xFE is stubbed) — BASIC can't be typed into interactively yet.
- No sound yet.
- No network peripherals yet (the actual point of this project) — next up.
This project is explicitly also built for an AI agent to drive and verify, not just a human. Command-line flags inject state directly instead of relying on synthesizing SDL input events (fragile — depends on X11 window focus, unreliable in headless sessions):
--poke ADDR=B1,B2,B3,... poke raw bytes into memory (hex, repeatable)
--pc ADDR set the initial program counter (hex)
--trace-port ADDR print "PORT xxxx = yy" whenever that port's
read value changes (hex)
Example — exercise the Kempston port without a working keyboard matrix,
with a tiny hand-assembled infinite loop (IN A,(0x1F) ; JR back to
itself):
./jase --poke 8000=DB,1F,18,FC --pc 8000 --trace-port 1F
Planned next step: a GDB remote-serial-protocol stub (see fusex's
debugger/gdbserver.c for a reference, ~1366 lines) instead of growing
more ad-hoc flags — real memory/register access, breakpoints, and
single-step, speakable by actual gdb/VS Code or a scripted session.
Plain g++ + SDL2, no Visual Studio project needed on Linux. A Makefile
builds every src/*.cpp (it picks up new files automatically, so there's
nothing to edit here when a source file is added):
sudo apt install libsdl2-dev # if not already present
make
This produces a jase binary in the project root. make clean removes
the build's .o files and the binary.
Needs a real 48K ROM at zx48.rom in the working directory (not included
— copyrighted; not ours to distribute).
The MinZX_SDL.sln/.vcxproj files are for the original Windows/Visual
Studio project this was forked from (see top of this README) — unrelated
to the Makefile, only relevant if you're building on Windows.