Module spectrusty_formats::sna

source ·
Expand description

SNA snapshot format utilities.

48k SNA file (LSB first):

offsetsizedescription
01register: I
16registers: HL’, DE’, BC’
72registers: AF’
96registers: HL, DE, BC
154registers: IY, IX
191interrupt flags: bit 1=IFF1, bit 2=IFF1)
201register: R
214registers: AF
234register: SP
251interrupt mode: 0=IM0, 1=IM1, 2=IM2
261border color: 0..=7
2749152bytes: RAM 16384..=65535

Total size: 49179 bytes

128k extended SNA file:

offsetsizedescription
02748k SNA header
2716384bytes: RAM page 1, bank 5
1641116384bytes: RAM page 2, bank 2
3279516384bytes: RAM page 3, currently paged bank
491792register: PC
491811byte: last OUT to 0x7ffd
491821byte: TR-DOS ROM 1=paged, 0=not paged
49183*16384bytes: remaining RAM banks in ascending order

Total size:

  • 131103 bytes if RAM page 3 is not one of bank 5 or bank 2
  • 147487 bytes if RAM page 3 is bank 5 or bank 2 (included twice)

Constants

The length in bytes of the 48k SNA file.

Functions

Loads an SNA file from rd into the provided snapshot loader implementing SnapshotLoader.
Loads a 48k SNA file from rd into the provided snapshot loader implementing SnapshotLoader.
Reads a 48k SNA file and inserts its content into provided memory and configures the Cpu. Returns a border color on success.
Saves an SNA file into wr from the provided reference to a snapshot struct implementing SnapshotCreator.