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

Table of contents

The zx-state file format
Block types

ZXSTTAPE

The state of the virtual cassette recorder and its contents.

// Cassette Recorder state
#define ZXSTTP_EMBEDDED     1
#define ZXSTTP_COMPRESSED   2

typedef struct _tagZXSTTAPE
{
  ZXSTBLOCK blk;
  WORD wCurrentBlockNo;
  WORD wFlags;
  DWORD dwUncompressedSize;
  DWORD dwCompressedSize;
  CHAR szFileExtension[16];
  BYTE chData[1];
} ZXSTTAPE, *LPZXSTTAPE;

Members

blk
The block header. The block id is ZXSTBID_ZXTAPE ('T', 'A', 'P', 'E').
wCurrentBlockNo
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.

wFlags
Various flags indicating whether a tape file is embedded in this block or linked to on disk. This can be a combination of:
FlagMeaning
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
dwUncompressedSize
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.
dwCompressedSize
The size of the data at chData.
szFileExtension
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".

chData
The data stored here is one of:
TypeDescription
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.

Remarks

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