I’m now the proud author of a hand-rolled retro demoscene intro that runs on a stock 128Kb Spectrum. It features all those late 80s tropes: A smooth scrolltext (with ‘leet custom fonts!), a three-channel AY soundtrack, bouncing VU meters and the essential parallax starfield. It’s currently 10287 bytes of code, or 19552 bytes as a complete tape image - which, given I’ve been working on this since December 13th last year, means my average rate of code-production is a paltry ~ 455 bytes per week!
This blog post is a technical overview of how I got there, some cool tricks I picked up, and everything I had to learn (and re-learn) about the Speccy and Z80 assembly along the way.
Pricing constraints brought further limitations. The ZX Spectrum had no dedicated sprite generation ICs. This was in contrast to other emerging micro-computers of the period, such as the Commodore 64. The Spectrum’s Z80 CPU and ULA would do all the graphical heavy lifting. The ULA or Un-committed Logic Array is similar in function, but not in implementation to today’s CPLD’s where the work of many TTL logic chips is combined into one IC. The Spectrum’s minimal graphics processing hardware and constrained 16k of RAM led to Altwasser’s’ invention of an extremely efficient and somewhat esoteric display system.
The conceived design was unique, allowing Sinclair Research and Richard Altwasser to patent the implementation. The Spectrum set aside 6912 Bytes of RAM to be used for a display file and an attribute array. The display file holds 256×192 pixel data in 32×24 characters blocks, taking 6144 bytes of RAM, leaving 768 bytes for the attribute array. The attribute array stores colour information for each character block. One byte per block holds foreground and background colours, plus a blink value for on or off. This is an excellent space saving solution for displaying coloured text, though slightly limiting in advanced graphics usage.