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

Table of contents

The zx-state file format
Block types

ZXSTOPUSDISK

Each disk drive connected to the Opus Discovery disk interface will have one of these blocks, if a disk is inserted. They follow the ZXSTOPUS block which identifies the number of drives.

// Associated Opus Discovery disk images

// Disk image types
#define ZXSTOPDT_OPD           0
#define ZXSTOPDT_OPU           1
#define ZXSTOPDT_FLOPPY0       2
#define ZXSTOPDT_FLOPPY1       3

// Flags
#define ZXSTOPDF_EMBEDDED      1
#define ZXSTOPDF_COMPRESSED    2
#define ZXSTOPDF_WRITEPROTECT  4

typedef struct _tagZXSTOPUSDISK
{
  ZXSTBLOCK blk;
  DWORD dwFlags;
  BYTE chDriveNum;
  BYTE chCylinder;
  BYTE chDiskType;
  union {
    CHAR szFileName[1];
    BYTE chDiskImage[1];
  };
} ZXSTOPUSDISK, *LPZXSTOPUSDISK;

Members

blk
The block header. The block id is ZXSTBID_OPUSDISK ('O', 'D', 'S', 'K').
dwFlags
Various flags. This can be a combination of:
FlagMeaning
ZXSTOPDF_EMBEDDEDThe actual disk image is embedded in this block.
ZXSTOPDF_COMPRESSEDIf ZXSTOPDF_EMBEDDED is also set, the disk image in this block is compressed using the Zlib compression library.
ZXSTOPDF_WRITEPROTECTSpecifies whether or not the disk image is write-protected.
chDriveNum
Specifies the drive to insert this disk image into (0-1).
chCylinder
The cylinder the drive heads are currently over (0-86).
chDiskType
Specifies the type of disk image. This can be one of:
ValueMeaning
ZXSTOPDT_OPDThe disk image is in the .opd format.
ZXSTOPDT_OPUThe disk image is in the .opu format.
ZXSTOPDT_FLOPPY0Real disk mode. Instead of using disk images, drive chDriveNum should use the first real 3½" floppy disk drive in a system. In Windows, this is the A: drive.

Note: szFileName and chDiskImage are unused.

ZXSTOPDT_FLOPPY1Real disk mode. Instead of using disk images, drive chDriveNum should use the second real 3½" floppy disk drive in a system. In Windows, this is the B: drive.

Note: szFileName and chDiskImage are unused.

szFileName
The file name of the disk image which should be opened and inserted into this drive, if the disk image is not embedded.
chDiskImage
If the disk image is embedded, this member is the (possibly compressed) disk image to be inserted into this drive.

Remarks

These blocks follow the ZXOPUS block which identifies the number of drives.

When loading this block, you should use the chDiskType member to determine the disk image format, rather than the file extension of szFileName. This is especially important since these members are not valid when chDiskType is ZXSTOPDT_FLOPPYx.

Revision history

Available since version 1.4


  Copyright © 2001 - 2011 Jonathan Needle Top