Real-hardware debugging: driving a ZX Spectrum Next over serial

dzrp.py is a standalone DZRP client that debugs a REAL Spectrum Next from a shell — no VS Code, no DeZog extension. It loads .nex programs over the wire, patches breakpoints, waits for hits, and reads registers, memory, ports and NextRegs. Fully scriptable, which makes it the silicon ground-truth oracle for conformance questions the VHDL alone can't settle (first proven on TX-1696 / work item #169, 2026-07-16, where a single session found a root cause that two days of VHDL geometry analysis had missed).

This complements the two zxplay_go debuggers (see ../DEBUGGER.md): same methodology — breakpoint, inspect, compare — but the target is the real machine, so emulator-vs-silicon A/B runs use the same probe addresses on both sides.

Hardware setup

Usage

python3 dzrp.py init                 # handshake (prints dezogif version)
python3 dzrp.py regs                 # registers + MMU slots
python3 dzrp.py md 0xB168 12         # memory hex dump
python3 dzrp.py loadnex game.nex     # parse + transfer + set SP/PC (paused)
python3 dzrp.py cont                 # start/resume
python3 dzrp.py sniff                # wait for/print pause notifications
python3 dzrp.py sizetest             # link health check (escalating writes)

campaign / campaign-resume are a worked example (the TX-1696 session): load, breakpoint an always-hit address to prove the machinery, re-arm onto the question address, wait. Copy that shape for new investigations. Every wire frame is hex-logged to dzrp.log.

Protocol facts (learned the hard way — trust these over the spec)

Verified against dezogif v2.2.1 (DZRP 2.1.0) source and live use:

Constraints and safety