
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.
What is inside
The Machine
Part 1, 7 chapters
- The FPGA and Its Cores
- The Z80N
- Memory, Ports and NextRegs
- Interrupts
- DMA
- CTC
- Input
The Picture
Part 2, 11 chapters
- How a Television Draws a Picture
- The Big Picture
- The Frame and the Beam
- Colours and Palettes
- The ULA Layer
- LoRes and Radastan
- Layer 2
- The Tilemap
- Sprites
- Putting It Together
- Raster Effects
The Sound
Part 3, 9 chapters
- How a Computer Makes Sound
- The Big Picture
- The Beeper
- One AY Chip
- TurboSound
- The 8-Bit DACs
- Audio from the Raspberry Pi
- The Mixer
- After the Sum
Talking to the World
Part 4, 4 chapters
- Storage
- UARTs
- Wi-Fi
- 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.
- Download the examples and unzip them.
- In Klive IDE, open the examples folder as a project.
- 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.