Skip to content
Tech News
← Back to articles

A graphical desktop for the ZX Spectrum

read original get ZX Spectrum Next (Issue 2) Computer → more articles
Why This Matters

This project is a striking demonstration of squeezing a full GEM-like graphical desktop—complete with overlapping windows, menus, and a mouse-driven UI—onto a 1982 ZX Spectrum 48K, running on real hardware rather than an emulator. It matters to the tech industry as a reminder of what careful, hardware-aware engineering can achieve under extreme constraints, and it offers concrete performance data valuable to retrocomputing and embedded developers. For consumers and hobbyists, it's a nostalgic yet technically rigorous tribute to classic computing ambitions once thought impossible on such limited machines.

Key Takeaways
Worth a Look

ZX Spectrum Next (Issue 2) Computer — If reading about pushing a graphical desktop into 48K of Z80 assembly gets your retro-computing itch going, the ZX Spectrum Next lets you actually run and tinker with Spectrum-era code on modern, expandable hardware. It's a perfect way to experiment with low-level tricks like the ones described in this article while enjoying compatibility with classic Spectrum software. Great for hobbyists who want hands-on experience with the platform that inspired this desktop project.

See ZX Spectrum Next (Issue 2) Computer on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.

ZX Desk

A graphical desktop for the ZX Spectrum 48K, written in Z80 assembly.

Overlapping windows with a z order and focus, pull down menus, a heap, an event queue, a storage layer with swappable backends, dialogues, controls, a notepad, a clock, a calendar, a two pane file manager, and a settings panel that actually changes things. It all fits in 48K on a machine from 1982, and it can drag a window inside a single 69,888 T state frame.

It runs on the real thing, not just an emulator.

Why

Back in the eighties I wanted an Atari ST and couldn't afford one. What I really wanted was GEM: the desktop, the windows, the menu bar that was always there, the feeling that the machine was a place rather than a prompt. I had a Spectrum instead, and I spent a long time wondering how much of that you could do on it. I started writing bits of it, and never finished.

So this is that, finished. It isn't a port of GEM and doesn't pretend to be. It's what the idea turns into when you push it up against a 3.5 MHz Z80, 48K of RAM, a one bit display with attribute clash, and a video chip that steals cycles from the CPU while it paints. A lot of the answers turned out to be more interesting than the question, and nearly all of them came from measuring the machine rather than reasoning about it.

It's a fun project and a labour of love, and the reason it's written up at this length is that the measurements are the useful bit. If you're building something on this hardware, the numbers below cost me a lot of evenings. They're yours.

What it does today

Windows Overlapping, z ordered, movable, resizable, with title bar, close box and grip. Focus is the front of the z order, so raising and focusing are one action. Menus A permanent menu bar with pull downs, save under, and hit testing. Input Kempston mouse, Kempston joystick, and the full keyboard matrix decoded across three tables with repeat. All of it arrives as events. Events A sixteen slot ring. The main loop contains no window specific code. Storage A registry of backends behind six vectors. RAM, tape (via the real ROM loader), and the 128K's spare banks as a RAM disk. esxDOS has a reserved id. Memory A real heap with an owner byte, 8,112 bytes, allocating window buffers sized to their windows. Applications A descriptor with init, event and paint, plus per instance state swapped in and out. Notepad, clock, calendar, commander, about. Persistence Settings written to storage with a magic byte and a version, and read back at boot.

... continue reading