================================================================================
Breakpoint Save File Format Version 2.02
(C) Copyright 2004 Kris Bleakley
================================================================================


Overview
--------

The Breakpoint Save file shall consist of a number of blocks that represent 
state information for various components of the Super Nintendo Emulator. Each 
block will consist of a header which will contain an identifier and size followed 
by a pre-defined data stream. The format hereby described in this document shall 
define a number of data blocks that should be used as a building block for future 
versions. Future versions should conform to initial documentation as to retain 
backwards compatability.  Individual blocks may appear in any order however blocks 
shall be processed in the order in which they appear in the state file. The 
proposed format or future versions should not include any variables that are 
emulator specific. In the case where a data block is not recognised by the emulator 
it shall be skipped.


Primary Data Blocks
-------------------


Version Information

This block is mandatory and must appear first.

Identifier      "BPS2"
Size            166 Bytes

Block Information
  0x000000  Byte    Version (Minor)
  0x000001  Byte    Version (Major)
  0x000002  Byte    ProductInfo [64]
  0x000042  Byte    Description [64]
  0x000082  Byte    Author [32]  
  0x0000A2  DWord   OS TimeStamp
End Block


Audio Processing Unit (APU)

Identifier      "SAPU"
Size            65563 Bytes

Block Information
  0x000000  Byte    A
  0x000001  Byte    X
  0x000002  Byte    Y
  0x000003  Byte    SP
  0x000004  Word    PC
  0x000006  Byte    P

  0x000007  Byte    APUIO0
  0x000008  Byte    APUIO1
  0x000009  Byte    APUIO2
  0x00000A  Byte    APUIO3

  0x00000B  Byte    SPCREG [16]
  0x00001B  Byte    SPCRAM [65536]
End Block


Central Processing Unit (CPU)

Identifier      "SCPU"
Size            46 Bytes

Block Information
  0x000000  Word    A
  0x000002  Word    X
  0x000004  Word    Y
  0x000006  Word    D
  0x000008  Word    S
  0x00000A  Word    PC
  0x00000C  Byte    PB
  0x00000D  Byte    DB
  0x00000E  Word    P

  0x000010  Byte    NMITIMEN
  0x000011  Byte    WRIO
  0x000012  Byte    WRMPYA
  0x000013  Byte    WRMPYB
  0x000014  Word    WRDIV
  0x000016  Byte    WRDIVB
  0x000017  Word    HTIME
  0x000019  Word    VTIME
  0x00001B  Byte    MDMAEN
  0x00001C  Byte    HDMAEN
  0x00001D  Byte    MEMSEL
  0x00001E  Byte    RDNMI
  0x00001F  Byte    TIMEUP
  0x000020  Byte    HVBJOY
  0x000021  Byte    RDIO
  0x000022  Word    RDDIV
  0x000024  Word    RDMPY
  0x000026  Word    JOY1
  0x000028  Word    JOY2
  0x00002A  Word    JOY3
  0x00002C  Word    JOY4
End Block  


Direct Memory Access (DMA)

Identifier      "SDMA"
Size            128 Bytes

Block Information
  0x000000  Byte    DMAREG [128]
End Block


Digital Sound Processor (DSP)

Identifier      "SDSP"
Size            128 Bytes

Block Information
  0x000000  Byte    DSPREG [128]
End Block


Picture Processing Unit (PPU)

Identifier 	"SPPU"
Size  		1128 Bytes

Block Information
  0x000000  Byte    INIDISP
  0x000001  Byte    OBJSEL
  0x000002  Byte    OAMADDL
  0x000003  Byte    OAMADDH
  0x000004  Byte    OAMDATA [544]
  0x000224  Byte    BGMODE
  0x000225  Byte    MOSAIC
  0x000226  Byte    BG1SC
  0x000227  Byte    BG2SC
  0x000228  Byte    BG3SC
  0x000229  Byte    BG4SC
  0x00022A  Byte    BG12NBA
  0x00022B  Byte    BG34NBA
  0x00022C  Word    BG1HOFS
  0x00022E  Word    BG1VOFS
  0x000230  Word    BG2HOFS
  0x000232  Word    BG2VOFS
  0x000234  Word    BG3HOFS
  0x000236  Word    BG3VOFS
  0x000238  Word    BG4HOFS
  0x00023A  Word    BG4VOFS
  0x00023C  Byte    VMAINC
  0x00023D  Byte    VMADDL
  0x00023E  Byte    VMADDH
  0x00023F  Byte    M7SEL
  0x000240  Word    M7A
  0x000242  Word    M7B
  0x000244  Word    M7C
  0x000246  Word    M7D
  0x000248  Word    M7X
  0x00024A  Word    M7Y
  0x00024C  Byte    CGADD
  0x00024D  Byte    CGDATA [512]
  0x00044D  Byte    W12SEL
  0x00044E  Byte    W34SEL
  0x00044F  Byte    WOBJSEL
  0x000450  Byte    WH0
  0x000451  Byte    WH1
  0x000452  Byte    WH2
  0x000453  Byte    WH3
  0x000454  Byte    WBGLOG
  0x000455  Byte    WOBJLOG
  0x000456  Byte    TM
  0x000457  Byte    TS
  0x000458  Byte    TMW
  0x000459  Byte    TSW
  0x00045a  Byte    CGWSEL
  0x00045B  Byte    CGADSUB
  0x00045C  Word    COLDATA
  0x00045E  Byte    SETINI
  0x00045F  Byte    MPYL
  0x000460  Byte    MPYM
  0x000461  Byte    MPYH
  0x000462  Word    OPHCT
  0x000464  Word    OPVCT
  0x000466  Byte    STAT77
  0x000467  Byte    STAT78
End Block


Video Random Access Memory (VRAM)

Identifier      "VRAM"
Size            65536 Bytes

Block Information
  0x000000  Byte    VMDATAL [32768]
  0x008000  Byte    VMDATAH [32768]
End Block


Work Random Access Memory (WRAM)

Identifier      "WRAM"
Size            131075 Bytes

Block Information
  0x000000  Byte    WMADDL
  0x000001  Byte    WMADDM
  0x000002  Byte    WMADDH 
  0x000003  Byte    WMDATA [131072]
End Block


State Reset

Identifier      "SRST"
Size            0 bytes


Secondary Data Blocks (Optional)
--------------------------------


Static Random Access Memory (SRAM)

Identifier      "SRAM"
Size            ?

Block Information
  0x000000  Byte    SMDATA [?]
End Block


Super Accelerator System (SAS)

Identifier      "SAS1"
Size            2148 Bytes

Block Information
  0x000000  Word    A
  0x000002  Word    X
  0x000004  Word    Y
  0x000006  Word    D
  0x000008  Word    S
  0x00000A  Word    PC
  0x00000C  Byte    PB
  0x00000D  Byte    DB
  0x00000E  Word    P

  0x000010  Byte    SFR
  0x000011  Byte    CFR
  0x000012  Word    HCR
  0x000014  Word    VCR
  0x000016  Byte    MR0
  0x000017  Byte    MR1
  0x000018  Byte    MR2
  0x000019  Byte    MR3
  0x00001A  Byte    MR4
  0x00001B  Byte    OF
  0x00001D  Word    VDP
  0x00001E  Byte    VC  

  0x00001F  Byte    CCNT
  0x000020  Byte    SIE
  0x000021  Byte    SIC
  0x000022  Word    CRV
  0x000024  Word    CNV
  0x000026  Word    CIV
  0x000028  Byte    SCNT
  0x000029  Byte    CIE
  0x00002A  Byte    CIC
  0x00002B  Word    SNV
  0x00002D  Word    SIV
  0x00002F  Byte    TMC
  0x000030  Byte    CTR
  0x000031  Word    HCNT
  0x000033  Word    VCNT
  0x000035  Byte    CXB
  0x000036  Byte    DXB
  0x000037  Byte    EXB
  0x000038  Byte    FXB
  0x000039  Byte    BMAPS
  0x00003A  Byte    BMAP
  0x00003B  Byte    SBWE
  0x00003C  Byte    CBWE
  0x00003D  Byte    BWPA
  0x00003E  Byte    SIWP
  0x00003F  Byte    CIWP
  0x000040  Byte    DCNT
  0x000041  Byte    CDMA
  0x000042  Byte    SDA [3]
  0x000045  Byte    DDA [3]
  0x000048  Word    DTC
  0x00004A  Byte    BBF
  0x00004B  Byte    BRF0
  0x00004C  Byte    BRF1
  0x00004D  Byte    BRF2
  0x00004E  Byte    BRF3
  0x00004F  Byte    BRF4
  0x000050  Byte    BRF5
  0x000051  Byte    BRF6
  0x000052  Byte    BRF7
  0x000053  Byte    BRF8
  0x000054  Byte    BRF9
  0x000055  Byte    BRFA
  0x000056  Byte    BRFB
  0x000057  Byte    BRFC
  0x000058  Byte    BRFD
  0x000059  Byte    BRFE
  0x00005A  Byte    BRFF
  0x00005B  Byte    MCNT
  0x00005C  Word    MA
  0x00005E  Word    MB
  0x000060  Byte    VBD
  0x000061  Byte    VDA [3]

  0X000064  Byte    IRAM [2048]
End Block



Suggested Order of Data Blocks
------------------------------

Version Information (BPS2)
Central Processing Unit (CPU)
Direct Memory Access (DMA)
Work Random Access Memory (WRAM)
Picture Processing Unit (PPU)
Video Random Access Memory (VRAM)
Audio Processing Unit (APU)
Digital Sound Processor (DSP)
Static Random Access Memory (SRAM)
Super Accelerator System (SAS)
State Reset (SRST)
 