ZX Spectrum Next

Demos and experiments for the ZX Spectrum Next, written in Boriel ZX BASIC, Z80 assembly and C. Free downloads, ready to run from the NextZXOS Browser.

Czech Flag Demo

Build 2026-09-09 Z80 · 28 MHz 768 KB RAM 3× AY (TurboSound)
Czech Flag demo on ZX Spectrum Next: waving Czech flag with the title CZECH REPUBLIC and the fact HIGHEST PEAK: SNĚŽKA, 1,603 M over a dusk sky with clouds
The flag waves over a cloudy sky while facts about the Czech Republic fly in as hardware sprites.
Czech Flag demo intro: the letters of CZECH REPUBLIC flying in from the screen edges over the waving flag
Intro: letters fly in one by one from the screen edges.

A waving Czech flag with the national anthem, made as a small showcase of what the Next's hardware can do: full-screen Layer 2 graphics, hardware sprites, tilemap blending and three AY sound chips, all driven from Boriel ZX BASIC with a few Z80 assembly routines for the time-critical parts.

Waving, anti-aliased flag

240×160 flag on Layer 2 320×256 with quarter-pixel edges. Every column moves on a sine wave, redrawn by a Z80 routine in the bottom border and blanking gap at 50 Hz, touching only pixels near colour boundaries.

Anthem on three AY chips

“Kde domov můj” via TurboSound: melody with envelope, vibrato, portamento, sub-octave and echo on the first AY, bass/tenor/alto accompaniment on the second, chorus on the third.

Sky from dusk to night

Pre-rendered sky with clouds in 48 colours from a 9-bit palette. During the anthem the palette shifts in eight steps from dusk into night.

Wave shading

A 40×32 tilemap over the flag carries a shade per column according to the wave height, mixed with Layer 2 in the S(L+U-5) blend mode.

Flying sprite text

Each letter is a 16×16 hardware sprite with a 1-px outline and Czech diacritics. The title and 22 rotating facts about the Czech Republic (in English, made for exhibitions) fly in from the screen edges.

Boriel ZX BASIC + Z80

Written in Boriel ZX BASIC; the wave, sprite movement and sound run as inline Z80 assembly so everything fits into the blanking gap. CPU at 28 MHz.

Controls

SPACEPause / resume the anthem
RPlay the anthem again from the start (after it finishes, the hint “PRESS R TO REPLAY THE ANTHEM” appears)

Download

Download czech_flag.zip
35 KB Build 2026-09-09 Binaries only, no source
Keep both files together. The program looks for czech_flag.sky next to itself and then in /czech_flag/ on the SD card. Without it the demo still runs, but the sky stays black.

How to Run

Requires a ZX Spectrum Next (or a compatible clone) running NextZXOS with a core that supports the 320×256 Layer 2 mode (core 3.x). Base 768 KB RAM is enough.

On a real ZX Spectrum Next

1

Unpack the archive onto the SD card

Copy the whole czech_flag folder with both files to the root of the Next's SD card, so you end up with /czech_flag/czech_flag.nex and /czech_flag/czech_flag.sky.

2

Start it from the Browser

Boot into NextZXOS, open the Browser, enter the czech_flag folder, select czech_flag.nex and press Enter. The anthem starts right away, letters fly in and the sky slowly darkens.

In an emulator

1

Copy the files to the emulated SD card

Put both files into a czech_flag folder on the SD image or the folder your emulator exposes as the card. For an .hdv/.img image this can be done with mtools (FAT partition offset 32256 on the standard 2 GB image):

mcopy -i "cspect-next-2gb.hdv@@32256" czech_flag/czech_flag.nex czech_flag/czech_flag.sky ::/czech_flag/
2

Boot and run

Start the emulator with the image attached and launch czech_flag.nex from the Browser as on real hardware. The demo was developed and recorded in MAME:

mame specnext_ks3 -noautosave -window -hard1 cspect-next-2gb.hdv

CSpect and ZEsarUX with NextZXOS on the mounted card work the same way.

Nothing to hear? The anthem uses all three AY chips, so make sure TurboSound is enabled in your emulator and the audio output is not muted. Press R to restart the anthem at any time.

Built with Boriel ZX BASIC (zxbc --arch=zxnext) and packed with a small NEX builder. Hardware details: SpecNext Wiki.

Back to main page