Mirage Microdriver: Difference between revisions
(Document the existence of v2 Microdrivers) |
(→Snapshot format: Mention SNA format) |
||
Line 41: | Line 41: | ||
The third block is memory from $602A to the address given at offset $003C. Once the block has been loaded, the compression table is expanded, starting with the last entry and working back. | The third block is memory from $602A to the address given at offset $003C. Once the block has been loaded, the compression table is expanded, starting with the last entry and working back. | ||
The Microdriver snapshot format forms the basis of the [[SNA format]] used by emulators. | |||
== ROM layout == | == ROM layout == |
Revision as of 22:46, 10 August 2015
The Mirage Microdriver is a peripheral that allows loading and saving of ZX Spectrum snapshots from/top tape, and if a ZX Interface 1 with Microdrives is attached, Microdrives.
The Microdriver contains an 8k ROM, 2k RAM (decoding is incomplete, so it is mapped at $2000, $2800, $3000 and $3800) and an NMI button.
Memory paging
When the NMI button is pressed, the Microdriver is paged into the bottom 16k of the address space. At the end of the NMI handler, it is switched out by an instruction fetch at $2000.
During the NMI handler, the Microdriver makes calls to the Spectrum ROM by calling $3800 (the instruction fetch switches the Microdriver out), calling the ROM routine, and calling $386D (the instruction fetch switches the Microdriver back in).
Snapshot format
Microdriver snapshots are saved either to tape or to Microdrive. A tape snapshot is saved as two or three separate blocks; a Microdrive snapshot is a single file.
The first block is $0588 bytes long:
$0000 Magic number: 'Microdriver © 1985 M.B.Daniells' $001F Either $20 (screen is included) or $00 (screen is omitted) $0020 Always 0 $0021 I $0022 HL' $0024 DE' $0026 BC' $0028 AF' $002A HL $002C DE $002E BC $0030 IY $0032 IX $0034 IFF2 [Only bit 2 is defined: 1 for EI, 0 for DI] $0035 R $0036 AF $0038 SP $003A Interrupt mode: 1 or 2 $003B Interface 1 paged flag: $C9 if Interface 1 paged in, $71 if 48k BASIC ROM paged in $003C Maximum address used by compressed snapshot. $003E Compression table. Used to replace up to 8 runs of bytes with a single byte. Each entry: dw address of byte in compressed snapshot dw uncompressed length $005E Memory from $5B00-$6029
The second block, if present, is the screen, not compressed: $1B00 bytes.
The third block is memory from $602A to the address given at offset $003C. Once the block has been loaded, the compression table is expanded, starting with the last entry and working back.
The Microdriver snapshot format forms the basis of the SNA format used by emulators.
ROM layout
The address and data lines are connected to the Microdriver's ROM chip in an order that makes the physical layout of the circuit board easy, rather than matching signals. This means if the ROM is dumped using an EPROM programmer, its contents need to be decoded.
Spectrum | Microdriver |
---|---|
D0 | D2 |
D1 | D4 |
D2 | D1 |
D3 | D6 |
D4 | D7 |
D5 | D0 |
D6 | D5 |
D7 | D3 |
A0 | A0 |
A1 | A1 |
A2 | A2 |
A3 | A10 |
A4 | A9 |
A5 | A5 |
A6 | A4 |
A7 | A3 |
A8 | A6 |
A9 | A7 |
A10 | A8 |
A11 | A11 |
A12 | A12 |
Version 2
A second version of the Microdriver exists, with an updated ROM image. A changes list was provided for this version. Little is currently known regarding the workings of this version. Information above is for version 1 of the interface.