Appearance
Debugging
When something looks wrong, use the CLI before guessing.
Inspect CPU registers:
bash
zxs regsRead memory:
bash
zxs mem read 0x8000 --len 64Add a breakpoint and run until it is hit:
bash
zxs break add 0x8000
zxs run --until-break --json
zxs disasm PC --count 16Watch screen attribute writes:
bash
zxs watch add --write 0x5800-0x5aff
zxs run --until-watch --jsonTrace hot spots:
bash
zxs trace --frames 5Snapshot and File Inspection
Inspection commands can read a session, .sna, .z80, or raw --bin source without mutating the project state.
bash
zxs snapshot info game.z80
zxs snapshot ram game.z80 --out game.ram
zxs snapshot mem game.z80 0x4000 --len 32
zxs gfx screen --z80 game.z80 --out screen.png
zxs gfx attrs --z80 game.z80 --out attrs.png
zxs gfx find --z80 game.z80
zxs scan --z80 game.z80 --opcode "ED B0"
zxs xref 0x5c00 --z80 game.z80If zxs is not installed globally, run advanced commands through the project script:
bash
npm run zxs -- regs
npm run zxs -- trace --frames 5Triage Order
Start with the cheapest signal:
- Rebuild and capture the exact assembler error or run JSON.
- Inspect
status,likelyCause, registers, and the current PC. - Inspect the screen as text or PNG.
- Use breakpoints or watches around the failing address or screen region.
- Add a test that preserves the fix.
For Spectrum-specific details, read the generated project's local docs/reference/ files. The most common starting points are common-bugs.md, screen-layout.md, keyboard-input.md, and attributes-and-colour.md.