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

Table of contents

The zx-state file format
Block types


This block is used to save and restore the contents of the ZXATASP's built-in RAM.

A zx-state file will contain a number of these blocks, depending on the model of the ZXATASP being emulated (128KB or 512KB). A ZXATASP block will precede the first of these blocks.

// Ram pages are compressed using Zlib
#define ZXSTAF_COMPRESSED       1

// ZXATASP IDE Interface RAM page
typedef struct _tagZXSTATARAM
  WORD wFlags;
  BYTE chPageNo;
  BYTE chData[1];


The block header. The block id is ZXSTBID_ATARAM ('A', 'T', 'R', 'P').
Various flags. This can be any combination of:
ZXSTAF_COMPRESSEDIf set, the RAM page data (beginning from chData) will be compressed using the Zlib compression library.
Page number of this 16KB RAM page. For the 128KB version of the ZXATASP interface, this is 0 - 7. For the 512KB version, this is 0 - 31.
The actual compressed or uncompressed memory page data. When uncompressed, this member is exactly 16KB (16,384) bytes in size.

When loading Zlib compressed pages, the compressed size can be obtained by:

compressedSize = blk.dwSize - ( sizeof( ZXSTATARAM ) - sizeof( ZXSTBLOCK ) - 1 );

Revision history

Available since version 1.3

  Copyright © 2001 - 2011 Jonathan Needle Top