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

Table of contents

The zx-state file format
Block types


The state of the virtual cassette recorder and its contents.

// Cassette Recorder state
#define ZXSTTP_EMBEDDED     1

typedef struct _tagZXSTTAPE
  WORD wCurrentBlockNo;
  WORD wFlags;
  DWORD dwUncompressedSize;
  DWORD dwCompressedSize;
  CHAR szFileExtension[16];
  BYTE chData[1];


The block header. The block id is ZXSTBID_ZXTAPE ('T', 'A', 'P', 'E').
The current block number (ie. the position of the virtual tape head) starting from 0.

For .wav and .voc files, Spectaculator splits these up into 5 second chunks. wCurrentBlockNo will refer to one of these chunks.

Various flags indicating whether a tape file is embedded in this block or linked to on disk. This can be a combination of:
ZXSTTP_EMBEDDEDThere is a tape file embedded in this block. The actual data begins at chData.
ZXSTTP_COMPRESSEDThe embedded tape file in this block has been compressed by the Zlib compression library
For Zlib compressed tape files, this is the size in bytes they uncompress to. This value is undefined if the tape file is not embedded.
The size of the data at chData.
File extension (case insensitive) of an embedded tape file. This value is undefined if the tape file is not embedded.

Special case: Warajevo .tap files are represented by "tapw".

The data stored here is one of:
File namechData is the file name of a linked tape file.
dwCompressedSize is the length of the file name.
Embedded tape fileIf the ZXSTTP_EMBEDDED bit in wFlags is set, chData is an embedded tape file.

If the ZXSTTP_COMPRESSED bit in wFlags is also set, the embedded file will be compressed using the Zlib compression libarary.

dwCompressedSize contains the size of the compressed data at chData.

dwUncompressedSize contains the size of the expanded data.

These two values will be the same if the embedded file isn't compressed.


If there is no tape file in the cassette recorder, this block is not written to the file.

Revision history

Available since version 1.0

  Copyright © 2001 - 2011 Jonathan Needle Top