games/keep: an original game in C for the Z-80 using the sprites - twelve
rooms, guards that patrol, see along rows and columns and shoot, keys and
locked doors, gold, ammunition and a crown to steal. gen.py holds the art
and castle map and checks reachability; test-keep.py runs it in z80emu on
a model of the board's ports, takes screenshots and has a bot play it
through. keep.bas loads KEEPGAME at 8600h and CALLs it.
Ports 88h/89h read keys held down (ps2_keystate), the monitor writes
Intel HEX records typed at its prompt, and tools/send-hex.py sends a
whole file and saves it as a memory file. Testbench covers both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Monitor: the CPU gets an NMI (taken at an instruction start, or from
HALT) raised by the Pause key, BASIC's MONITOR, two hardware breakpoint
comparators or a step counter. It enters through a trampoline at 0066h
(the same bytes in BASIC's ROM and the monitor's, basic/tramp.s) that
switches in a 32 KB monitor bank over 0000-7FFF. The monitor (monitor/,
C) runs on the terminal's new alternate screen (CSI ?47 h/l, a second
screen page; graphics hidden) and shows registers, flags, a disassembly
from PC, the stack and memory. Commands: Enter/S n step, O step over,
G/X go, B breakpoint, D/M windows, E edit, R registers, and SAVE/LOAD/
DIR for memory files. The disassembler covers every opcode;
monitor/test-disasm.py round-trips all forms through sdasz80. Lockstep
CPU tests still match the reference emulator.
BASIC: MONITOR, CALL addr, BSAVE "N",start,len and BLOAD "N"[,addr]
(memory files: load address then bytes). The DATE clock moves to
F3F8h so the monitor can date files. F000-F3F7 is kept free for
machine code (program area 21076 bytes).
Serial: SW1:0 = 10 is now 921600 and 11 is 3 Mbaud. A 17 KB burst to
BASIC lists back identical at both on the board. send-bas.py reads
the echo while sending; unread, it could stall the PC's flow control.
Ctrl-Alt-Del in Z-80 mode restarts the Z-80 like BTND.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Terminal engine rewritten for VT220: scroll regions, IL/DL/ICH/DCH/ECH,
SU/SD, origin mode, insert mode, tab stops, DEC special graphics with
G0/G1 and SO/SI, DECSC/DECRC, DECSTR, RIS, DECALN, DECLL LEDs
- Replies to DA, secondary DA, DSR and CPR over the UART
- 16-colour SGR (256-colour and RGB approximated), bold, underline,
blink, reverse and conceal; cells are now 18 bits
- Smooth scrolling (SW8 or DECSCLM): the region slides per frame and
rows are moved during vertical blanking; XON/XOFF holds the host back
- Keyboard: DECCKM, keypad application mode, F5-F12, VT220 Home/End,
Alt as ESC prefix
- basys3 terminfo entry (vt220 + 16 colours, 30 lines)
- Flash script reboots the FPGA from flash after programming
- Testbench covers replies, modes, attributes, editing and smooth scroll
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- VGA 640x480@60 text display, 8x16 CP437 font ROM from Linux console fonts
- USB HID keyboard (PS/2 via onboard PIC24), scan code set 2 to ASCII
with xterm sequences for cursor/editing keys
- UART RX/TX with switch-selectable baud, local echo option
- Terminal engine: control codes, deferred wrap, hardware scroll,
VT100/ANSI subset (cursor moves, erase, reverse video, cursor hide)
- Vivado build/program/flash scripts and xsim whole-design testbench
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>