Anonymous

ZX-State format: Difference between revisions

From Sinclair Wiki
→‎ZXSTSPECTRANETFLASHPAGE: Nope, got that wrong!
(→‎ZXSTSPECTRANETFLASHPAGE: Nope, got that wrong!)
Line 190: Line 190:
This block is used to save and restore the contents of the Spectranet's built-in flash memory.
This block is used to save and restore the contents of the Spectranet's built-in flash memory.


A zx-state file will contain a number of these blocks, normally 32. A [[#ZXSTSPECTRANET|ZXSTSPECTRANET]] block will proceed the first of these blocks.
A zx-state file will contain only one of these blocks. A [[#ZXSTSPECTRANET|ZXSTSPECTRANET]] block will proceed the the blocks.
  // Ram pages are compressed using Zlib
  // Flash memory is compressed using Zlib
  #define ZXSTSFF_COMPRESSED 1
  #define ZXSTSFF_COMPRESSED 1
   
   
Line 199: Line 199:
   ZXSTBLOCK blk;
   ZXSTBLOCK blk;
   WORD wFlags;
   WORD wFlags;
  BYTE chPageNo;
   BYTE chData[1];
   BYTE chData[1];
  } ZXSTSPECTRANETFLASHPAGEBLOCK, *LPZXSTSPECTRANETFLASHPAGEBLOCK;
  } ZXSTSPECTRANETFLASHPAGEBLOCK, *LPZXSTSPECTRANETFLASHPAGEBLOCK;
Line 215: Line 214:
|}
|}


&nbsp;&nbsp; '''chPageNo'''<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Page number of this 4KB flash memory page. For the regular Spectranet, this is 0 - 31.<br />
&nbsp;&nbsp; '''chData'''<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The compressed or uncompressed contents of the Spectranet's flash memory. When uncompressed, this member is exactly 128KB (131,072) bytes in size. When loading [http://www.zlib.org/ Zlib] compressed pages, the compressed size can be obtained by:
&nbsp;&nbsp; '''chData'''<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The compressed or uncompressed contents of the RAM page. When uncompressed, this member is exactly 4KB (4,096) bytes in size. When loading [http://www.zlib.org/ Zlib] compressed pages, the compressed size can be obtained by:
  compressedSize = blk.dwSize - ( sizeof( ZXSTSPECTRANETFLASHPAGEBLOCK ) - sizeof( ZXSTBLOCK ) - 1 );
  compressedSize = blk.dwSize - ( sizeof( ZXSTSPECTRANETFLASHPAGEBLOCK ) - sizeof( ZXSTBLOCK ) - 1 );


49

edits