ZX Desk brings overlapping GUI to 48K Spectrum
ZX Desk is an open-source graphical desktop environment designed for the 1982 Sinclair ZX Spectrum 48K, written entirely in Z80 assembly language. Inspired by GEM, it fits overlapping z-ordered windows, pull-down menus, an 8KB heap allocator, and a 16-slot event queue into 48K of memory, optimized to drag windows smoothly inside a single 69,888 T-state frame.
While modern desktop software routinely consumes gigabytes of RAM on web-view wrappers, ZX Desk is a masterclass in low-level engineering and empirical optimization under severe 8-bit hardware constraints.
- –Real-time frame discipline: Window dragging executes within a single 69,888 T-state 50Hz frame on authentic hardware using strict beam scheduling and interrupt synchronization.
- –Debunking platform folklore: Empirical measurements on real silicon showed that ULA memory contention adds only 14.7% overhead to screen writes rather than the widely assumed 50% penalty.
- –Counter-intuitive bottlenecks: Hardware profiling revealed that text string rendering accounts for half of window draw time, while per-row address math and register swapping vastly outweigh raw pixel fill throughput.
- –Robust systems design: Implements modular device abstraction layers, table-driven control rendering, and a memory heap designed to eliminate 16-bit address wraparound bugs.
DISCOVERED
1h ago
2026-09-19
PUBLISHED
4h ago
2026-09-19
RELEVANCE
AUTHOR
graemep