Skip to content

Unraveling the ZX Spectrum Next

Volume 1: The Hardware, as a Programmer Sees It

by István Novák, the author of Klive IDE

How the ZX Spectrum Next works inside, and how to program it: the Z80N, memory and NextRegs, the display layers, the sound chips and the mixer, and the ports that reach the world. Written while building Klive's Next emulator, from the documentation, the real machine and the FPGA source.

Free to download. The examples are a Klive IDE project: unzip it, open the examples folder and choose Run.

341pages, in colour
4 parts31 chapters
27 demosin one .nex program
Klive IDEproject, ready to run

What is inside

The Machine

Part 1, 7 chapters

  1. The FPGA and Its Cores
  2. The Z80N
  3. Memory, Ports and NextRegs
  4. Interrupts
  5. DMA
  6. CTC
  7. Input

The Picture

Part 2, 11 chapters

  1. How a Television Draws a Picture
  2. The Big Picture
  3. The Frame and the Beam
  4. Colours and Palettes
  5. The ULA Layer
  6. LoRes and Radastan
  7. Layer 2
  8. The Tilemap
  9. Sprites
  10. Putting It Together
  11. Raster Effects

The Sound

Part 3, 9 chapters

  1. How a Computer Makes Sound
  2. The Big Picture
  3. The Beeper
  4. One AY Chip
  5. TurboSound
  6. The 8-Bit DACs
  7. Audio from the Raspberry Pi
  8. The Mixer
  9. After the Sum

Talking to the World

Part 4, 4 chapters

  1. Storage
  2. UARTs
  3. Wi-Fi
  4. Real-Time Clock

The examples

Every chapter that has something to show has a demo. They are built into one program, book-demos.nex: a menu by part, then the part's demos in book order. Each demo puts back what it changed and returns to the menu.

  1. Download the examples and unzip them.
  2. In Klive IDE, open the examples folder as a project.
  3. Choose Run: Klive builds the program, boots NextZXOS and loads it.

On a real Next, copy book-demos.nex to the SD card and open it from the NextZXOS Browser. The demos never write to the SD card, the cores' flash, the Wi-Fi module or the clock.

27 demos

  • The MachineCore Version, Four Speeds, Pattern Fill, Bank Window, Fourteen Voices, DMA Versus LDIR, Stopwatch, Input Monitor
  • The PictureBeam Clock, Palette Cycle, ULA Modes, Big Pixels, Layer 2 Resolutions, Tile Scroller, Sprite Swarm, Layer Order, Copper Sky
  • The SoundTwo Voices, Envelope Shapes, Nine Channels, Drum Hit, Pi Audio, Jack Wrap
  • Talking to the WorldSD Sector, Serial Echo, AT Probe, Clock

Why this book

The official documentation of the Next says what each register does and leaves the reader to work out how the pieces fit. István Novák worked it out while emulating the machine in Klive IDE: from the documents, from experiments on the real hardware and from the public FPGA source. The book shows how and why things work, not only what they are, starting with the machine and going on to the picture, the sound and the way the Next talks to the world.

Get the book

The PDF and the examples, free.