[ Spectaculator, ZX Spectrum Emulator ] Home | Downloads | Support [ ZX Spectrum Image ]

Table of contents

The zx-state file format
Block types

Basic information

  • A zx-state file has a file extension of .szx or .zx-state.
  • Structures are byte-packed to save space.
  • All blocks start with a ZXSTBLOCK structure. Any unrecognised blocks should be skipped without reporting an error.
  • All values are stored in little-endian (Intel) format.
  • All character strings are null-terminated.
  • Software must be able to correctly parse current and future versions of this file format that have the same major version number.

    Do not use the chMajorVersion and chMinorVersion values to decide on parsing strategies. Use the ZXSTBLOCK at the beginning of each block to navigate through the file.

  • The following standard Win32 data types are used in this document to describe the various block types:
    TypeMeaning
    BYTEUnsigned 8-bit byte
    CHAR8-bit signed byte used to represent printable characters in a null-terminated string.
    WORDUnsigned 16-bit integer (2 bytes)
    DWORDUnsigned 32-bit integer (4 bytes)
  • The order of the blocks is generally not significant. Your parser should not rely on blocks being in any particular order.

    However, the ZXSTZ80REGS and ZXSTSPECREGS blocks are guaranteed to appear in the file before the remaining hardware state blocks.

  • If your emulator has a piece of hardware enabled that does not appear in the file, it may be safer to disable that hardware automatically to avoid conflicts.

  Copyright © 2001 - 2011 Jonathan Needle Top