ZX Spectrum Next Raspberry Pi project showcase

By David Crookes. Posted

In the 1980s, the ZX Spectrum range of 8-bit computers quickly became legendary. It boasted no more than 128kB of RAM (16kB on the original model), a Zilog Z80 CPU running at just 3.5MHz, and a palette of up to 16 colours, two of which were black. Yet the humble ‘Speccy’ encouraged a generation of bedroom programmers and underpinned a flourishing British video games industry.

Now it’s returning in a new, enhanced form called the ZX Spectrum Next, and Raspberry Pi Zero has proven invaluable in its development. David Crookes explains.

“For me, the goal has been to encourage a new generation of bedroom coders,” says legendary games developer Jim Bagley, who is among a group of Spectrum fans behind the project. Jim has been programming games professionally for the past 31 years and is a key member of the specnext.com team dedicated to bringing back the ZX Spectrum.

Jim Bagley is a legendary games developer and ones of the leading lights behind bringing back the ZX Spectrum

With 3113 Kickstarter backers handing over £723,390 in cash, many others potentially share that dream.

Work has certainly progressed well. “When the Next was first announced three years ago, it was intended to be a normal Spectrum with an SD card and a Raspberry Pi Zero as an extender,” Jim explains. “Raspberry Pi was going to be used to add extra features such as hardware sprites and hardware scrolling so that newcomers would find it easier to code the computer and get the wow factor of getting something running instantly on the screen.”

During the Kickstarter campaign, however, a large field-programmable gate array (FPGA) was announced for the Next – a configurable integrated circuit which allowed the hardware sprites, scrolling, and other advanced features to be incorporated within the machine itself. “It freed up Raspberry Pi Zero to do something else,” Jim says. So the developers began to play around.

It will work with CRT and VGA monitors, as well as more modern screens, thanks to the support of a HDMI output

Load and run

One of the initial ideas was to recreate the feel of loading a game from tape – generating the series of scratchy, beepy, high-pitched noises which could be heard as a program was ingested into the computer. On the original hardware, this was accompanied by a loading image slowly building on the screen and animated stripy borders.

Rather than have Next users connect a cassette deck, the developers had a cunning plan. “We thought it would be a good idea to have commands sent back and forth between the Next and Raspberry Pi Zero,” Jim says. This developed into a tool allowing a TZX file (a format that stores an exact copy of a ZX Spectrum tape) to be uploaded from an SD card to Raspberry Pi Zero. By sending it back down to the new-gen Speccy through an audio-in pin, the Next would be fooled into thinking it’s loading a cassette. “It gives the original feeling of loading from tape,” Jim affirms.

The ZX Spectrum Next contains a Z80 processor on an FPGA, 1MB of RAM expandable to 2MB,
hardware sprites, 256 colours, RGB/VGA/HDMI video output, and three AY-3-8912 audio chips

Are you there, SID?

Having a Raspberry Pi Zero accompanying the Next has also enabled other audio delights. A Sound Interface Device (SID) emulator has been developed that allows audio created for Commodore’s SID programmable sound generator chip to be played on the Next.

It will also be possible to enjoy Atari ST audio files and tunes created using music trackers on the Commodore Amiga. “We can send the audio through a GPIO pin and it goes straight to the FPGA, where it’s mixed with the audio of the Next,” Jim explains. To achieve all of this, the developers have used DietPi to create a new OS called NextPi. “It remains a fully functioning Raspberry Pi Zero that is running at the same time as the Next, but we wanted the Next to be more in control.”

Games made specially for the Next are saved as .NEX files which load directly to the computer via a
SD card. Since the games are 768kB in size (or 1792kB for the 2MB models), it would take too long to route them via Raspberry Pi Zero

The most recent extra use for the Next’s Raspberry Pi Zero is the ability to connect the latter to its own display. “It’s possible to send screens to Raspberry Pi Zero so that you can have a dual screen,” Jim says. “This means you could have a game being played on the Next, with a global map or stats shown via Raspberry Pi Zero.”

The team is now looking to get USB controllers to work via Raspberry Pi Zero, allowing them to be read by the Next. “We’d also like Raspberry Pi Zero to help with 3D maths so you can take vertices, have them rotated, and passed back,” Jim says. In the meantime, the team is readying the new computer for a January release and a new Kickstarter is being planned for those who didn’t pledge the first time around. We’re certainly looking forward to seeing where it – and RaspberryPi – goes next.

Rather than simply emulate the Spectrum, the Next uses a field-programmable gate array chip that acts as a Z80 processor with the addition of advanced features

Raspberry Pi loading

1. Games in the file format TZX – a tape format used for preservation purposes – need to be saved on to an SD card and inserted into the ZX Spectrum Next. 

Games are installed on the ZX Spectrum Next from an SD Card

2. A game can then be selected via the Next computer’s built-in Browser mode. Raspberry Pi Zero will be instructed to load the game’s data from the SD card.

Select a game in the ZX Spectrum Next’s Browser mode and Raspberry Pi Zero instructs it to load from the SD card.

3. Raspberry Pi Zero sends the data back to the ZX Spectrum Next as audio and this generates the once-familiar loading noise and loading screen ahead of the game running.

Raspberry Pi sends data to the ZX Spectrum as audio, resulting in the familiar electronic loading sounds of 80s computer games

Looking for some more retro gaming joy? You could always: code your own retro games console, build your own retro game with PICO-8, indulge in an entire issue of The MagPi dedicated to retro gaming or this incredible hardback 'Code The Classics' guide, brand-new from Raspberry Pi Press for a more £12?

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.