home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 3
/
AUCD3.iso
/
funland
/
emulators
/
spectrum
/
speccy
/
!Spectrum
/
PCsnaps
/
SpecUtils
/
SnapInfo
< prev
next >
Wrap
Text File
|
1993-09-04
|
5KB
|
160 lines
.Z80 files
The .Z80 files are a slightly packed Spectrum memory dump format. A .Z80 file
starts off with a 30-byte header-block. In this block, the status of the
emulated Z80 processor at the point at which the Z80-emulator was stopped by
the user is specified. A few extra environmental variables complete the
header.
Byte Length Description
0 1 A register
1 1 F register
2 2 BC register pair (LSB, i.e. C, first)
4 2 HL register pair
6 2 Program counter
8 2 Stack pointer
10 1 Interrupt register
11 1 Refresh register (Bit 7 is not significant!)
12 1 Bit 0 : Bit 7 of the R-register
Bit 1-3: Border colour
Bit 4 : 1=SamRom switched in
Bit 5 : 1=Block of data is 'squeezed'
Bit 6-7: No meaning
13 2 DE register pair
15 2 BC' register pair
17 2 DE' register pair
19 2 HL' register pair
21 1 A' register
22 1 F' register
23 2 IY register (Again LSB first)
25 2 IX register
27 1 Interrupt flipflop, 0=DI, otherwise EI
28 1 IFF2 (not particularly important...)
29 1 Bit 0-1: Interrupt mode (0, 1 or 2)
Bit 2 : 1=Issue 2 emulation
Bit 3 : 1=Double interrupt frequency
Bit 4-5: 1=High video synchronisation
3=Low video synchronisation
0,2=Normal
Bit 6-7: 0=Cursor/Protek/AGF joystick
1=Kempston joystick
2=Sinclair 1 joystick
3=Sinclair 2 joystick
After these 30 bytes, a memory dump of the emulated Spectrum follows,
consisting of the bytes at address 16384 up to 65535. The first versions of
the Spectrum Emulator just dumped the full 48K after the header. These
versions therefore produced .Z80 files that were 49182 bytes (=48K + 30
bytes) in length. The shareware versions of the Emulator all use a slightly
different method of storing the 48K datablock, thereby reducing the size of
the .Z80 files. In effect, the method consists of finding all sequences of
equal bytes, and replacing them by a code of four bytes, "ED ED xx yy" which
tells that byte yy is to repeated xx times. An example will make it clear:
ED 00 44 ED ED 05 00 02 ... (.Z80 file)
is translated back into
ED 00 44 00 00 00 00 00 02 ... (Spec-memory)
Obviously, only sequences of length at least 4 will be coded, for otherwise
there would be no gain in the number of stored bytes. Sequences of 'ED' are
treated separately: the minimum length of an 'ED'-sequence to be coded is 2,
to avoid problems when translating back. And lastly, if a single 'ED' is
encountered, thus an 'ED' followed by a different byte, then this byte
following the 'ED' will not be included in a block. This is done to avoid 'ED
00 00 00 00 00' to be translated into 'ED ED ED 05 00' which would not be
translated back correctly. This particular sequence of bytes will be coded
into 'ED 00 ED ED 04 00'.
The snapshot file format
========================
This format (filetype .SNA) is the format used by the Mirage
Microdriver "Dump" command. It is also used by Peter McGavin's
Spectrum emulator for the Amiga.
Byte offset Contents
0 i register
1 l' register
2 h' register
3 e' register
4 d' register
5 c' register
6 b' register
7 f' register
8 a' register
9 l register
10 h register
11 e register
12 d register
13 c register
14 b register
15 iy low register
16 iy high register
17 ix low register
18 ix high register
19 bit 2 contains iff2
20 r register
21 flags register
22 a register
23 sp low register
24 sp high register
25 interrupt mode (0, 1 or 2)
26 border colour (0..7).
27..49178 48 kbytes ram dump
Since Peter's emulator stores rubbish in byte 26 JPP sets the
border to black if byte 26 is larger than 7.
ARC SPECULATOR
================
Snapshots are 64.25k long!!!! The first 256 bytes hold the processor state
(and other details?). The next 65536 bytes contain a complete image of the
whole spectrum memory map, including the ROM!
Note that the program counter stored value is 256 less than the actual value?
00: = REG A
04: = REG F?
08: = REG B
0C: = REG C
10: = REG D
14: = REG E
18: = REG H
1C: = REG L
20: = PC LO
21: = PC HI -1
28: = SP LO
29: = SC HI
9C: = BORDER COLOUR
A4: = Imode?
BE: = REG I
BF: = IFF ??
EC: = REG A'
ED: = REG F'?
F0: = REG B'
F1: = REG C'
F4: = REG D'
F5: = REG E'
F6: = REG H'
F7: = REG L'
F8: = REG IX LO
F9: = REG IX HI
FC: = REG IY LO
FD: = REG IY HI
??: = Refresh register