Hasty Briefsbeta

Bilingual

ZX Spectrum System Tour: Text Mode – Bumbershoot Software

3 hours ago
  • Sinclair BASIC can coexist with machine code via SAVE/LOAD with CODE, CLEAR to reserve memory, and USR function to call routines.
  • The Z80 memory map on 48K Spectrum: ROM at $0000-$3FFF, graphics RAM at $4000-$5AFF, and the rest is RAM; IY register points to system variables at $5C3A and must not be modified.
  • Text output uses RST $10 to print characters; control codes $10-$17 replicate BASIC text commands (INK, PAPER, etc.) and AT takes two arguments.
  • User-defined graphics (UDG) are stored at the address pointed by IY+65; you can load custom character data (8 bytes each) into that area.
  • System variables ATTR-T, MASK-T, ATTR-P, MASK-P, and P-FLAGS control text attributes; the ROM routine CLS at $0D6B clears the screen and resets temporary colors.
  • Keyboard input can be read via interrupt-driven scanning (LAST-K, FLAGS) or direct I/O port reading; joystick reading uses port $1F for Kempston.
  • A complete example program demonstrates clearing the screen, loading custom graphics, printing formatted text, and waiting for a keypress, producing a smaller binary than the BASIC equivalent.

Related

Loading…