Introduction
A TZX file is a copy of a cassette tape for the Sinclair ZX Spectrum. Most Spectrum
software was sold on tape, and TZX is the format used to preserve it. Emulators play a
TZX file as if it were the tape. A .tzx file dropped on any page of this site opens in the explorer,
which lists every block with its parameters and shows the ordinary data blocks as the files they hold.
The simpler ZX Spectrum TAP format only stores the bytes of
standard tape blocks. TZX also describes the timing of the sound itself: the lengths of
pilot tones, sync pulses and bits. That lets it hold the turbo loaders and copy protection
that many commercial games used. Amstrad CPC tapes use the same format with the extension
.cdt.
Structure
The file starts with a 10-byte header: the text ZXTape!, the byte
1A, then the major and minor version numbers. Blocks (see
data blocks and
control and information blocks) follow until the end of
the file. Each block starts with an ID byte that says what it is and how long it is.
Common blocks are 10 for a standard speed data block, as the Spectrum’s own
loader writes it, 11 for a turbo speed block with its own timings,
12 for a pure tone, 13 for a sequence of pulses, 14
for pure data, 20 for a pause, 21 and 22 to start
and end a group, and 30 and 32 for a text description and
archive information such as title and publisher.
0HeaderZXTape!,1A, major and minor version10 bytes10Block an ID byte, then the block’s own fields and datarepeated
Not described
Known, not yet covered
- Reference: the deprecated custom info (block 35) types the specification lists, such as the POKEs, instructions, Spectrum screen, ZX-Edit document and picture blocks, and the deprecated snapshot block’s contents (control blocks).
- Viewer: the explorer lists every block of revision 1.20 (and the deprecated ones by their length) with its parameters. It reads the standard speed blocks, and the turbo and pure data blocks that use the ROM's pulse lengths, as TAP blocks (headers, BASIC, code opened as Z80, screens as pictures). It does not decode the pulses of blocks 15, 18 and 19 or of turbo blocks with other timings (their bytes are shown as bytes), does not play the tape or follow jumps, loops and calls (it shows where a jump goes), shows the deprecated blocks 16, 17, 34 and 40 by their length only, and does not decode custom info (35). It has not been run in a browser by its author.
Checked
- The list of blocks and the length of every data block of the TZX files on the machine used to build the explorer (the files of libspectrum's tests and two game tapes) are equal to what libspectrum reads; of libspectrum's invalid test files, those it refuses are shown with a problem. The block layouts were also compared with the specification text on zasm's copy (revision 1.20, read through a summarising tool): no difference from the tables on these pages was found.
Also used for
- CD-Text file – The titles, performers and codes of an audio CD as 18-byte CD-Text packs.
- CorelDRAW template – CorelDRAW's working file: RIFF chunks in older versions, a ZIP archive since X4.
- Tyrian credits – The game Tyrian's end credits: 131 encrypted Pascal strings, one for each line.
Links
Software
- Fuse – ZX Spectrum emulator that plays TZX tapes (Windows, macOS, Linux)
- ZEsarUX – emulator of the Spectrum and other machines (Windows, macOS, Linux)
- Spectaculator – ZX Spectrum emulator that plays TZX tapes (Windows)