Changes

Snapshot

12,466 bytes added, 7 January
/* SYMB */
18. the memory dump can have size 0 in version 3 and in this case all RAM is described in additional blocks (MEM0-MEM8). If a memory dump has a non-zero size, then it is uncompressed and describes the main 64KB ram immediately followed by the second 64KB ram (if present) (this ram is inside 128KB machines or machines with 64KB from a Dk'Tronics/Dobbertin/Amstrad compatible RAM expansion. Note that CPCEMU can only write a 64K or 128K snapshot.
 
19. JavaCPC uses e0-ff to store an emulator ID (see snapshot V3 for more details)
= Changes and additions in Version 2 from Version 1 =
*CPCEMU uses a simple system to emulate the screen display. It allows the mode to be changed in each of the 6 interrupts that occur during a single 50Hz/60Hz period. These bytes represent the mode in each of these sections, i.e. the screen modes (0,1 or 2) for the interrupts 0..5. More accurate emulators support changing of the screen mode at any point supported by the Amstrad hardware, these emulators should write "0" for all these bytes.
2. A version 2 snapshot can describe up to 512KB of describes Dk'Tronics /Dobbertin compatible RAM in addition to the 64KB base ram. This is a type of RAM expansion which uses the same port and paging mechanism as the extra 64KB inside the 6128. However, the RAM *MUST* be continuous, therefore it's limited to 64KB, 256KB or 512KB additional RAM. The Dk'Tronics silicon disk can't be described on it's own because it's RAM configurations do not start at C4.
The following configurations can be described:
* 64KB base + 256KB extra RAM (e.g. Dk'Tronics 256KB RAM Expansion)
* 64KB base + 512KB extra RAM (e.g. Dk'Tronics 256KB RAM Expansion & Dk'Tronics 256KB Silicon Disk OR X-MEM OR Symbiface 2 OR other device which provides 512KB)
 
JavaCPC uses this value to store up to 4MB of RAM. (e.g. [[CPC4MB]]). This type of ram is Dk'Tronics compatible and has multiple banks of 512KB. This value could be used to describe a 1MB or 2MB expansion as long as it is fully Dk'tronics compatible (e.g. rpalmer's 2MB).
 
3. JavaCPC uses e0-ff to store an emulator ID (see snapshot V3 for more details)
= Changes and additions in Version 3 from Version 2 =
*5 = 464 Plus
*6 = GX4000
|-| 75| n| Disc drive A filename (No$CPC only)
|-
| 99
== Notes ==
 
Notes:
1. This byte in the snapshot represents the last byte written to the printer I/O port (this byte does not include the automatic inversion of the strobe caused by the Amstrad hardware).
4. There is not a terminator chunk. The snapshot reader should determine if there are more chunks based on the size of data remaining to be read from the file.
 
=Version 3 Chunks=
The following chunks are currently defined:
=== MEM0-8 Chunk =CPC+ ==
The MEM0-8 chunks contain at most 64KB of data. The data may be compressed or stored uncompressed. If the size is exactly 65536 bytes the data This chunk is uncompressedsupported by Arnold, otherwise it is compressed. The compression scheme is RLE with 0x0e5 as the control byte. Data is encoded as: * <byte> for a single occurrence of a byte (not 0x0e5) (e.g. 0x013)* 0x0e5WinAPE,<count>,<byte> for multiple occurances of a byte (eNo$CPC and ACE. 0x0e5Arnold,0x04,0x013 for 0x013 repeated 4 times)* 0x0e5,0 for a single 0x0e5 byte (e.g. 0x0e5) The blocks are: * MEM0 - main 64KB ram* MEM1 - c4,c5,c6,c7 configurations (extra 64KB ram in 128KB machines) (256KB Dk'Tronics RAM, X-MEM)* MEM2 - cc,cd,ce,cf configurations (256KB Dk'Tronics RAM, X-MEM)* MEM3 - d4,d5,d6,d7 configurations (256KB Dk'Tronics RAM, X-MEM)* MEM4 - dc,dd,de,df configurations (256KB Dk'Tronics RAM, X-MEM)* MEM5 - e4,e5,e6,e7 configurations (256KB Dk'Tronics Silicon Disk, X-MEM)* MEM6 - ec,ed,ee,ef configurations (256KB Dk'Tronics Silicon Disk, X-MEM)* MEM7 - f4,f5,f6,f7 configurations (256KB Dk'Tronics Silicon Disk, X-MEM)* MEM8 - fc,fd,fe,ff configurations (256KB Dk'Tronics Silicon Disk, X-MEM) NOTE: 1. A snapshot may contain a mix of "standard" memory data (e.g. the data follows the header WinAPE and is uncompressed) and additional MEM blocks as required.2. If the snapshot is not compressed, then up to 128KB ACE will be stored as "standard" memory data, save the additional RAM stored in MEM2-MEM8 blocksblock when Plus configuration enabled.3. If No$CPC will save the snapshot is compressed, then block if the "standard" memory data will Plus features have 0 size and there will be a MEM0 in addition to the additional memory blocks.4. Version 3 doesn't require memory to be continuous. A Dk'tronics silicon disk on it's own can be described with this versionbeen unlocked.
=== When creating a snapshot with several chunks, it is usually a good idea to place the CPC+ Chunk ===one in first position, because some (old) tools and emulators are relying on this and will fail if it is not the case.
{|
| 6805
| Interrupt vector (note 4)
|-
| 8C6
| 1
| Internal
| gate array A0 register value (note 8a)
|-
| 8C6-8C7
| 21
| -
| unused (0)
| 1
| Internal
| gate array A0 register value (note 88b)
|-
| 8F6
| 1
| Internal
| gate array A0 lock: 0=-> locked, 1!=0 -> unlocked (note 9)
|-
| 8F7
d. This value represents the pause prescalar count and the count is between 0..FF. (TO BE CHECKED: down counter? what exactly does it represent)
<br> 8. This value represents the last value written to this I/O port. Winape uses 8a and not 8b. This value has bits 7,6,5 set to 1,0 and 1 respectively. 8b is in the original specification and is written by both ACE and No$CPC.
9. This value represents the lock status of the ASICRMR2. If the ASIC is un-locked then the advanced features and ASIC registers are accessible, RMR2 can't be accessed otherwise it can.
10. This value represents the current unlock sequence state.
| ASIC is waiting for byte from unlock sequence. e.g. if "2", ASIC is waiting for &amp;FF, the first byte of the unlock sequence. if "3" ASIC is waiting for &amp;77, the second byte of the unlock sequence.
|}
 
== DSCA,DSCB ==
 
This chunk is supported by WinAPE and ACE; it is saved only when the related option is enabled.
 
The DSCA block contains the filename of the disc image inserted into drive A. The filename is stored as 8-bit ASCII (any Unicode characters with codes 0x100 or above will be translated to ? and therefore filenames with these characters can't be stored in Snapshots). The length of the block is the length of the filename in bytes.
 
DSCB is similar to DSCA but stores the filename of the disc image inserted into drive B.
 
== TAPE ==
 
This chunk is supported by ACE; it is saved only when the related option is enabled.
 
The TAPE block contains the filename of the tape image inserted. The filename is stored as 8-bit ASCII (any Unicode characters with codes 0x100 or above will be translated to ? and therefore filenames with these characters can't be stored in Snapshots). The length of the block is the length of the filename in bytes.
 
== ROMS ==
 
This chunk is supported by WinAPE and ACE; it is saved only when the related option is enabled.
 
This block contains a list of filenames for each ROM (and cartridge) that is defined. The length of the block is the length for all strings.
 
If a ROM is not defined, a single NUL (0) byte is present, otherwise there is a null terminated 8-bit ASCII string.
 
First in the list is the filename (or internal name) for the cartridge (prefixed with a 'A' character), followed by lower rom and then upper roms 0-31 (WinAPE) or 0-255 (ACE).
 
WinAPE lists internal ROMs by their internal name (the name listed in the drop down when you configure the roms, e.g. OS464).
ACE always put the actual file name, even for internal ROMs (e.g. System/Firmware_v3.rom).
 
After the list of the upper ROMs, ACE also put the names of the internal Basic and AMSDOS ROMs.
Then, the presence of the "CartridgeKeepExtROM" let ACE know if the cartridge ROMs should disable installed external upper ROMs or not (depending on user preferences).
 
NOTE: The selected Multiface ROM is not saved in the snapshot.
 
== INFO ==
 
This chunk is written by No$CPC. It contains an 8-bit ASCII string with the version information for No$CPC.
 
== MEM0-8 ==
 
The MEM0-8 chunks contain at most 64KB of data. The data may be compressed or stored uncompressed. If the size is exactly 65536 bytes the data is uncompressed, otherwise it is compressed. Up to 512KB additional RAM can be stored in a snapshot.
 
The compression scheme is RLE with 0x0e5 as the control byte.
 
Data is encoded as:
 
* <byte> for a single occurrence of a byte (not 0x0e5) (e.g. 0x013)
* 0x0e5,<count>,<byte> for multiple occurances of a byte (e. 0x0e5,0x04,0x013 for 0x013 repeated 4 times)
* 0x0e5,0 for a single 0x0e5 byte (e.g. 0x0e5)
 
The blocks are:
 
* MEM0 - main 64KB ram
* MEM1 - c4,c5,c6,c7 configurations (extra 64KB ram in 128KB machines) (256KB Dk'Tronics RAM, X-MEM)
* MEM2 - cc,cd,ce,cf configurations (256KB Dk'Tronics RAM, X-MEM)
* MEM3 - d4,d5,d6,d7 configurations (256KB Dk'Tronics RAM, X-MEM)
* MEM4 - dc,dd,de,df configurations (256KB Dk'Tronics RAM, X-MEM)
* MEM5 - e4,e5,e6,e7 configurations (256KB Dk'Tronics Silicon Disk, X-MEM)
* MEM6 - ec,ed,ee,ef configurations (256KB Dk'Tronics Silicon Disk, X-MEM)
* MEM7 - f4,f5,f6,f7 configurations (256KB Dk'Tronics Silicon Disk, X-MEM)
* MEM8 - fc,fd,fe,ff configurations (256KB Dk'Tronics Silicon Disk, X-MEM)
 
=== Notes ===
 
1. A snapshot may contain a mix of "standard" memory data (e.g. the data follows the header and is uncompressed) and additional MEM blocks as required.
 
2. If the snapshot is not compressed, then up to 128KB will be stored as "standard" memory data, the additional RAM stored in MEM2-MEM8 blocks.
 
3. If the snapshot is compressed, then the "standard" memory data will have 0 size and there will be a MEM0 in addition to the additional memory blocks.
 
4. Version 3 doesn't require memory to be continuous. A Dk'tronics silicon disk on it's own can be described with this version.
 
5. WinAPE allows a 4MB RAM expansion to be enabled but doesn't save the additional RAM in the snapshot.
 
6. ACE can save additional memory in snapshots (up to 4MB) using the MX?? chunks.
 
== MX09-40 ==
 
This chunk is supported by ACE.
 
MX?? chunks allow snapshots to store up to 4160KB ram.
 
MX?? chunks are following MEM0-8 chunks. They are numbered from 09 to 40 (hexadecimal numbering).
Information are stored compressed like in MEM0-8 chunks.
 
== BRKC ==
 
This chunk is written by ACE when some breakpoints are set. When loading a snapshot, the breakpoints found in this chunk are added to the one already installed.
The number of stored breakpoints in the chunk is given by the chunk size divided by 216 (the size of one breakpoint data structure).
 
{|
|-
| ''Offset (Hex)''
| ''Length''
| ''Description''
|-
| 00
| 1
| Breakpoint type (0:Execution, 1:Memory, 2:I/O port)
|-
| 01
| 1
| Memory access mode (0:R/W, 1:R/O, 2:W/O)
|-
| 02
| 1
| Breakpoint runtime mode (0:Break, 1:Watch)
|-
| 03
| 1
| Breakpoint map type (note 2)
|-
| 04
| 2
| Breakable memory/port (MSB first)
|-
| 06
| 2
| Breakable memory/port mask (MSB first)
|-
| 08
| 1
| Match value
|-
| 09
| 1
| Match value mask
|-
| 0A
| 2
| Breakable memory size (MSB first)
|-
| 0C
| 4
| Breakpoint activation step (MSB first)
|-
| 10
| 128
| Breakpoint condition to match (NULL terminated string) (note 1)
|-
| 90
| 64
| Breakpoint user name (NULL terminated string)
|-
| D0
| 1
| Breakpoint map bank (note 2)
|-
| D1
| 1
| Breakpoint map page (note 2)
|-
| D2
| 6
| Reserved
|-
| D8
| ...
| Same sequence repeated for each breakpoint
|}
 
===Notes===
 
1. The condition is expressed using ACE syntax (similar to BASIC with AND/OR/XOR/NOT/+/-/=...).
Allowed additional syntaxes are:
*&, # or 0x for a hexadecimal number.
*% or &x for a binary number.
*AF, BC, HL, IX... for a 16-bit Z80 register.
*A, B, D, IXh, IXl... for an 8-bit Z80 register.
*FlagC, FlagNC, FlagM... for a Z80 flag.
*LineCount for the line number.
*LineCycle for the µs count on the current line.
*MemPage for the 64K expansion memory page (0-63).
*MemBankMode for the 16K expansion memory bank paging mode (0-7).
*UpperROMOn for the paging state of the upper ROM.
*UpperROMNum for the selected upper ROM number.
*LowerROMOn for the paging state of the lower ROM.
*LowerROMNum for the selected lower ROM number.
*ASICPageOn for the paging state of the I/O ASIC registers page.
 
''Example : FlagC AND (HL=DE OR HL=&5000)''
 
2. The map type determines the memory layout for which the breakpoint is valid.
The meaning of the values for map bank and map page depends on the map type value.
Possible values fir map type are:
* 0: Undefined. Map bank and page are ignored (always 0).
* 1: Main RAM. If map bank is 0, then linear main RAM is considered. If map bank is 1, then main RAM from &c000-&ffff mapped as &4000-&7fff is considered. Map page is ignored (always 0).
* 2: Extension RAM. Map bank is the 16K extension bank number (0-3). Map page is the 64K extension page number (0-31).
* 3: Extension ROM. Map bank is the ROM slot id (0-255). Map page is ignored (always 0).
* 4: Firmware ROM. Map bank and page are ignored (always 0).
* 5: Cartridge ROM. Map bank is the 16K ROM bank number (0-31). Map page is ignored (always 0).
* 6: ASIC I/O Page. Map bank and page are ignored (always 0).
 
== SYMB ==
 
This chunk is written by ACE when some symbols are declared. When loading a snapshot, the symbols found in this chunk are added to the alreading existing ones.
 
{|
|-
| ''Offset (Hex)''
| ''Length''
| ''Description''
|-
| 00
| 1
| Length on the symbol name (n). 0 is an invalid value.
|-
| 01
| n
| Symbol name (note 1).
|-
| n+1
| 1
| Symbol memory map type (note 2).
|-
| n+2
| 1
| Symbol memory map bank (note 2).
|-
| n+3
| 1
| Symbol memory map page (note 2).
|-
| n+4
| 2
| Reserved for future usage, always 0 for now.
|-
| n+6
| 1
| Symbol type (0: absolute, 1: relative).
|-
| n+7
| 2
| Address of the symbol (MSB first).
|-
| ...
| Same sequence repeated until the end of the chunk is reached.
|}
 
===Notes===
 
1. Symbol are (obviously) limited to 255 characters, cannot begin with a number (0-9), and only a limited set of ASCII char is allowed (a-z, A-Z, 0-9, _, .).
 
2. The map type determines the memory layout for which the symbol is valid. The meaning of the values for map bank and map page depends on the map type value.
Possible values fir map type are:
* 0: Undefined. Map bank and page are ignored (always 0).
* 1: Main RAM. If map bank is 0, then linear main RAM is considered. If map bank is 1, then main RAM from &c000-&ffff mapped as &4000-&7fff is considered. Map page is ignored (always 0).
* 2: Extension RAM. Map bank is the 16K extension bank number (0-3). Map page is the 64K extension page number (0-31).
* 3: Extension ROM. Map bank is the ROM slot id (0-255). Map page is ignored (always 0).
* 4: Firmware ROM. Map bank and page are ignored (always 0).
* 5: Cartridge ROM. Map bank is the 16K ROM bank number (0-31). Map page is ignored (always 0).
* 6: ASIC I/O Page. Map bank and page are ignored (always 0).
 
== BRKS ==
 
This chunk is written by WinAPE when some breakpoints are set.
ACE can import breakpoints from this chunk but won't create it (BRKC is used instead).
 
The chunk contains 1 or more breakpoints.
 
Each breakpoint has the form:
* 2 bytes: address (LSB first)
* 1 byte: location (0: base 64K RAM, 1: extended RAM)
* 2 bytes: condition (?)
 
== WABP ==
 
This chunk is written by WinAPE when some breakpoints are set.
The exact details are begin worked out.
 
It seems to be:
 
4 bytes - number of user breakpoints
 
Each user breakpoint:
 
type,
4 byte address
 
Then, 4 bytes - number of memory breakpoints
 
Each memory breakpoint:
 
Then, 4 bytes - number of i/o breakpoints:
 
Each i/o breakpoint:
 
2 bytes flags? (6000 read, a400 write)
2 bytes port addr mask
2 bytes port addr
4 bytes counter
4 bytes condition string length, followed by condition string (not null terminated)
 
== DARS ==
 
This chunk is written by WinAPE when some data areas are set.
 
The number of stored data areas in the chunk is given by the chunk size divided by 10 (the size of one data area data structure).
 
{|
|-
| ''Offset (Hex)''
| ''Length''
| ''Description''
|-
| 00
| 4
| Address (LSB first) (note 1)
|-
| 04
| 4
| Area size (LSB first)
|-
| 08
| 1
| Data type (0=byte,1=word)
|-
| 09
| 1
| Labels (1=marked by user as having labels)
|-
|}
 
=== Notes ===
 
1. Winape's addressing scheme is 4 bytes. The upper 16-bits effectively define the internal 64KB pages it uses.
 
== REMU ==
 
This chunk is written RASM and contains information about symbols and breakpoints.
ACE will import informations from this chunk but won't write it (SYMB and BRKC are used instead).
 
== RM00-FF ==
 
This chunk was introduced by RASM and is supported by ACE; it is saved only when the related option is enabled.
 
The RM00-FF chunks contain at most 16KB of data representing the contents of the related external upper ROMs number. The data may be compressed or stored uncompressed. If the size is exactly 16384 bytes the data is uncompressed, otherwise it is compressed. Up to 2MB of external upper ROMs can be stored in a snapshot.
 
The compression scheme is identical to the one from MEM0-7 chunks.
 
== LOWR ==
 
This chunk was introduced by RASM and is supported by ACE; it is saved only when the related option is enabled.
 
It is similar to the RM00-FF chunks but stored the internal firmware ROM contents.
 
== BASR ==
 
This chunk is supported by ACE; it is saved only when the related option is enabled.
 
It is similar to the RM00-FF chunks but stored the internal Basic ROM contents.
 
== DOSR ==
 
This chunk is supported by ACE; it is saved only when the related option is enabled.
 
It is similar to the RM00-FF chunks but stored the internal AMSDOS ROM contents.
 
== CART ==
 
This chunk is supported by ACE; it is saved only when the related option is enabled.
 
It stores the contents of the inserted cartridge ROM. Extended cartridges are also supported.
 
{|
|-
| ''Offset (Hex)''
| ''Length''
| ''Description''
|-
| 00
| 1
| Type of compression (0: uncompressed, &5E: RLE compressed)
|-
| 01
| 4
| Physical size of the cartridge in bytes, must be 16, 32, 64, 128, 256 or 512KB (MSB first)
|-
| 05
| 2
| Number of cartridges, 1: for normal cartridges, extended cartridges otherwise (MSB first)
|-
| 07
| 2
| Flags, bit 0 set if the external upper ROMs must be disabled, other bits set to 0 (MSB first)
|-
| 09
| x
| Cartridge data contents (either compressed or not depending on type of compression)
|-
|}
 
== PLUG ==
 
This chunk is supported by ACE; it is saved only when the related option is enabled.
 
This chunk stores the names of the plugins which should be enabled for the snapshot.
 
All names are stored one after the other, in the form of binary strings (first byte containing the plugin name length followed by the the actual string).
The names stored are the actual names of the plugins libraries (e.g. "multiface2.acepansion").
 
= Links =
[[Snapshot Archive]]
[[Category:Programming]]
194
edits