Sinclair ZX Spectrum
Production-ready patterns for Sinclair ZX Spectrum development
Rendering
5 patternsAttribute Writing
Write colours directly to attribute memory for fast, flicker-free graphics without touching pixel data.
Character Printing
Print ASCII characters to the screen using the ROM character set. Direct display file access for fast text rendering.
Numeric Display
Convert a number (0-99) to two ASCII digits and print them. Essential for scores and counters.
Progress Bar (BASIC)
Horizontal progress bar with colour thresholds — blue through yellow, red, to white. Useful for health, temperature, or timers.
Seven-Segment Digits (BASIC)
Draw large seven-segment display digits using PLOT/DRAW. Cell-aligned with 1px outline. 10 DATA strings define all digits 0-9.
Input
1 patternAudio
1 patternPhysics
1 patternFramework
4 patternsGame Loop (HALT)
Frame-synchronised game loop using the HALT instruction. Locks to 50Hz for consistent timing across all Spectrums.
Screen Frame (BASIC)
Draw a 1-cell border around the play area with title and footer bars. The standard game screen layout.
State Machine Loop
Organise game flow with distinct states (title, playing, game over). Clean separation of game phases.
Text Utilities (BASIC)
Centre text on any row and clear rows — two tiny subroutines used in every BASIC game.