ZX-State format: Difference between revisions
m (Add category) |
(Move ULAplus SZX block definition here (as I'm going to add some more in a bit).) |
||
Line 8: | Line 8: | ||
Early versions of libspectrum (prior to 1.0.0) contained a bug which caused the A and A' registers to be swapped with F and F', respectively, when loading or saving in the SZX format. Current versions of libspectrum detect "libspectrum: 0.5.0" and earlier versions strings and correct for this. | Early versions of libspectrum (prior to 1.0.0) contained a bug which caused the A and A' registers to be swapped with F and F', respectively, when loading or saving in the SZX format. Current versions of libspectrum detect "libspectrum: 0.5.0" and earlier versions strings and correct for this. | ||
== Format extensions == | |||
With the official specification being somewhat stalled, some emulators have added ''unofficial'' extensions to the format. These include: | |||
=== ZXSTPALETTE === | |||
The state of the ULA registers found in the [[ULAplus|64 colour replacement ULA]]. This block may be present for any machine. | |||
// Palette Block flags | |||
#define ZXSTPALETTE_DISABLED 0 | |||
#define ZXSTPALETTE_ENABLED 1 | |||
// Palette Block. Contains the palette register values | |||
typedef struct _tagZXSTPALETTEBLOCK | |||
{ | |||
ZXSTBLOCK blk; | |||
BYTE chFlags; | |||
BYTE chCurrentRegister; | |||
BYTE chPaletteRegs[64]; | |||
} ZXSTPALETTEBLOCK, *LPZXSTPALETTEBLOCK; | |||
==== Members ==== | |||
'''blk'''<br /> The block header. The block id is ZXSTBID_PALETTE ('P', 'L', 'T', 'T').<br /> '''chFlags'''<br /> A flags that indicates if the palette is enabled or if the normal display mode is in use. This can be one of: | |||
{|cellspacing="1" cellpadding="1" border="1" width="100%" | |||
|'''Flag''' | |||
|'''Meaning''' | |||
|- | |||
|ZXSTPALETTE_DISABLED | |||
|Normal palette mode with BRIGHT and FLASH | |||
|- | |||
|ZXSTPALETTE_ENABLED | |||
|64 colour palette mode | |||
|} | |||
<br /> '''chCurrentRegister'''<br /> The currently selected palette register (0-63).<br /> '''chPaletteRegs'''<br /> The current values of the palette registers. | |||
[[Category:Emulator Snapshot File Formats]] | [[Category:Emulator Snapshot File Formats]] |
Revision as of 20:08, 13 August 2017
ZX-State (SZX) format
ZX-State is the preferred snapshot format for Spectaculator and Fuse. It is usually used with the extension .SZX. Fuse unofficially uses the mimetype x-spectrum-szx for the format (although this could potentially change to x-spectrum-zxstate or x-spectrum-zx-state).
See the official ZX-State documentation and also the draft of the next version.
Support for the format is implemented in libspectrum (used by Fuse), Zero, ZXDS, SpecEmu and Spin.
Early versions of libspectrum (prior to 1.0.0) contained a bug which caused the A and A' registers to be swapped with F and F', respectively, when loading or saving in the SZX format. Current versions of libspectrum detect "libspectrum: 0.5.0" and earlier versions strings and correct for this.
Format extensions
With the official specification being somewhat stalled, some emulators have added unofficial extensions to the format. These include:
ZXSTPALETTE
The state of the ULA registers found in the 64 colour replacement ULA. This block may be present for any machine.
// Palette Block flags #define ZXSTPALETTE_DISABLED 0 #define ZXSTPALETTE_ENABLED 1 // Palette Block. Contains the palette register values typedef struct _tagZXSTPALETTEBLOCK { ZXSTBLOCK blk; BYTE chFlags; BYTE chCurrentRegister; BYTE chPaletteRegs[64]; } ZXSTPALETTEBLOCK, *LPZXSTPALETTEBLOCK;
Members
blk
The block header. The block id is ZXSTBID_PALETTE ('P', 'L', 'T', 'T').
chFlags
A flags that indicates if the palette is enabled or if the normal display mode is in use. This can be one of:
Flag | Meaning |
ZXSTPALETTE_DISABLED | Normal palette mode with BRIGHT and FLASH |
ZXSTPALETTE_ENABLED | 64 colour palette mode |
chCurrentRegister
The currently selected palette register (0-63).
chPaletteRegs
The current values of the palette registers.