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

Table of contents

The zx-state file format
Block types

ZXSTCFRAM

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

A zx-state file will contain a number of these blocks, depending on the model of the ZXCF being emulated (512KB or 1024KB). A ZXSTCF block will proceed the first of these blocks.

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

// ZXCF CompactFlash Interface RAM page
typedef struct _tagZXSTCFRAM
{
  ZXSTBLOCK blk;
  WORD wFlags;
  BYTE chPageNo;
  BYTE chData[1];
} ZXSTCFRAM, *LPZXSTCFRAM;

Members

blk
The block header. The block id is ZXSTBID_CFRAM ('C', 'F', 'R', 'P').
wFlags
Various flags. This can be any combination of:
FlagMeaning
ZXSTCRF_COMPRESSEDIf set, the RAM page data (beginning from chData) will be compressed using the Zlib compression library.
chPageNo
Page number of this 16K RAM page. For the 512KB version of the ZXCF interface, this is 0 - 31. For the 1024KB version, this is 0 - 63.
chData
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( ZXSTCFRAM ) - sizeof( ZXSTBLOCK ) - 1 );

Revision history

Available since version 1.3


  Copyright © 2001 - 2011 Jonathan Needle Top