BBC Micro Emulator Snapshot Proposal

NOTE: The proposal as it stands has one element that I believe to be required in the snapshot, but is not currently present. That is the state of the screen-size bits written to port B of the system VIA. I will update the snapshot proposal as soon as I have time.

Here's my current proposal for a BBC emulator snapshot format. I already have several of these working.

All snapshot files have the extension .sst. Currently the files are 33044 bytes long, ordered as follows :

1. Magic number, bytes 0x0000 to 0x0001

Stored lo/hi. Value always 0x0bbc.

2. Version number, bytes 0x0002 to 0x0003

Stored lo/hi. Value currently 0x0001

3. User RAM, bytes 0x0004 to 0x8003

Stored in address order. No provision is currently made for RAM stored in paged areas. I think this should be addressed in a later version of the specification.

4. CPU state, bytes 0x8004 to 0x8013

    0x00  A
    0x01  X
    0x02  Y
    0x03  SR
    0x04  SP
    0x05  PC (lo)
    0x06  PC (hi)
    0x07  No. of outstanding IRQ's.

0x08 to 0x0f are reserved for future use. I always like to have a little slack to take up for when I find out I've forgotten something. It's less work to take up a spare byte than to move everything about.

5. ADC state, bytes 0x8014 to 0x801b

    0x00         register 0
    0x01 to 0x07 reserved.

Bytes 0x01 to 0x07 will need to be used, but until there's a meaningful ADC emulation, they're unused.

6. ACIA state, bytes 0x801c to 0x8023

    0x00  Write control register
    0x01  Transmit Data register
    0x02  Status register
    0x03  Read Data register.
    0x04  Transmit IRQ outstanding.
    0x05  Receive IRQ outstanding.

    0x06,0x07 reserved for expansion.

7. Keyboard state, bytes 0x8024 to 0x8083

    0x00 to 0x4f  current status of all keys, in internal key number order
                  0x01 == pressed, 0x00 == released.

    0x50 to 0x57  reserved for expansion

    0x58          CAPS LOCK led status ( 0x00 == off, other == on )
    0x59          SHIFT LOCK led status ( 0x00 == off, other == on )

    0x5a to 0x5f  reserved for expansion

8. ROM select register state, bytes 0x8084 to 0x808b

    0x00         ROM select register (&FE30)
    0x01 to 0x07 reserved.

9. Serial ULA state, bytes 0x808c to 0x8093

    0x00         register 0
    0x01 to 0x07 reserved.

10. System VIA, bytes 0x8094 to 0x80b3

    0x00  ORB/IRB
    0x01  ORA/IRA
    0x02  DDRB
    0x03  DDRA
    0x04  T1CL
    0x05  T1CH
    0x06  T1LL
    0x07  T1LH
    0x08  T2CL
    0x09  T2CH
    0x0a  SR
    0x0b  ACR
    0x0c  PCR
    0x0d  IFR
    0x0e  IER
    0x0f  ORA/IRA (non-handshaking, a duplicate of 0x01)
    0x10  T2LL
    0x11  Reserved
    0x12  Reserved
    0x13  Reserved
    0x14  Reserved
    0x15  Reserved
    0x16  Reserved
    0x17  Reserved
    0x18  T2 interrupts enabled flag (non-zero for enabled)
    0x19  Reserved
    0x1a  Reserved
    0x1b  Reserved
    0x1c  Reserved
    0x1d  Reserved
    0x1e  Reserved
    0x1f  Reserved

11. User VIA, bytes 0x80b4 to 0x80d3

    As for System VIA.

12. Video ULA, bytes 0x80d4 to 0x80f3

    0x00 to 0x0f  Current colour map.
    0x10          Register 0
    0x11 to 0x1f  reserved.

13. CRTC, bytes 0x80f4 to 0x8113

    0x00 to 0x11  Registers 0 through 17, in order
    0x12 to 0x13  reserved
    0x14          currently accessible register
    0x15 to 0x1f  reserved.

This specification doesn't deal with contents of sideways RAM/ROM, the Fred/Jim memory-mapped IO areas, the Tube ULA, the Econet interface or the disk interface. I see these as being more appropriate for a later version when code has been produced and we know what needs to be saved.

Please mail comments to the BBC Micro emulators mailing list.