From the zx-state specification’s header page, read through a summarising fetch tool: “our words”. Multi-byte values are little-endian: the page does not say so, and every real file we read agrees.
Fields
| Offset | Size | Field | Meaning |
|---|---|---|---|
0 | 4 | Magic | The bytes Z X S T |
4 | 1 | Major version | 1 |
5 | 1 | Minor version | See below |
6 | 1 | Machine id | The Spectrum model to switch to on load (below) |
7 | 1 | Flags | Below |
Versions
The header page gives the minor version as 4 while its title says “File Format 1.5”; its revision history says the NTSC 48K and 128Ke machine ids and the alternate-timings flag were added in 1.4. Real files from libspectrum’s tests carry minor versions 3 and 5. The viewer shows the version and reports only a major version other than 1. Version history seen on the block pages: the keyboard joystick byte (1.1), the Z80R flags (1.1), the SCLD block (1.2), the Pentagon 1024’s port $EFF7 (1.3), MEMPTR in Z80R (1.4), the FSET flag (1.5).
Machine ids
| Id | Model | RAM as the viewer treats it |
|---|---|---|
| 0 | 16K ZX Spectrum | 48K style (page 5) |
| 1 | 48K ZX Spectrum or ZX Spectrum+ | 48K style (pages 5, 2, 0) |
| 2 | ZX Spectrum 128 | 128K style |
| 3 | ZX Spectrum +2 | 128K style |
| 4 | ZX Spectrum +2A/+2B | 128K style |
| 5 | ZX Spectrum +3 | 128K style |
| 6 | ZX Spectrum +3e | 128K style |
| 7 | Pentagon 128 | 128K style |
| 8 | Timex Sinclair TC2048 | 48K style |
| 9 | Timex Sinclair TC2068 | 48K style |
| 10 | Scorpion ZS-256 | 128K style, banks 0 to 7 shown |
| 11 | ZX Spectrum SE | 128K style |
| 12 | Timex Sinclair TS2068 | 48K style |
| 13 | Pentagon 512 | 128K style, banks 0 to 7 shown |
| 14 | Pentagon 1024 | 128K style, banks 0 to 7 shown |
| 15 | 48K ZX Spectrum (NTSC) | 48K style |
| 16 | ZX Spectrum 128Ke | 128K style |
The last column is how this viewer maps the pages to memory (our choice, from the page numbers the RAMP page gives per model), not part of the header.
Flags
Bit 0 ($01): alternate timings, one cycle later than normal; it applies to the 16K, 48K and 128K models only. No other bit is defined on the page we read.
Not described
Known, not yet covered
- Nothing known is missing from the header itself.
Unknown
- Whether the byte order is stated anywhere in the specification (the header page does not).