BS-X BIOS:ROM map

From Data Crystal
Revision as of 08:54, 22 February 2017 by Lytron (talk | contribs)
Jump to: navigation, search

Bank $10

There is a Jump Table on the Satellaview that is used at the Start Up. I guess its implemented to serve as a verification that the Satellaview is there and working correctly, because the BIOS jumps to this jump table just to be redirected to subroutines in itself again.

$10/5974 6B          RTL            ;
$10/598C 5C AD C2 80 JMP $80C2AD    ; Check if Satellaview Stream Number Registers work

$10/59A4 5C 6D C3 80 JMP $80C36D[$80:C36D]   A:0 X:FFFE Y:E280 P:envMxdIZC

$10/59B0 5C D6 C3 80 JMP $80C3D6[$80:C3D6]   A:0008 X:FFFE Y:E280 P:envMxdIzC

$10/5A6C 5C 84 BB 80 JMP $80BB84    ; MCC Memory Controller Settings: Enable Flash R/W
$10/5A70 5C B1 BB 80 JMP $80BBB1    ; MCC Memory Controller Settings: Disable Flash R/W

$10/5B0C 5C 77 C1 80 JMP $80C177[$80:C177]   A:0080 X:0007 Y:0 P:eNvMxdIzC

$10/5B58 5C F2 F2 80 JMP $80F2F2[$80:F2F2]   A:0 X:FFFE Y:E280 P:envMxdIZC

Bank $80

$80/8200 Update Graphics Registers

Transfers values from their $01xx-buffers to their registers

$80/8200 08          PHP            ; Buffer Flag Register value on stack
$80/8201 E2 20       SEP #$20       ; A = 8-bit
$80/8203 AD 00 01    LDA $0100      ; Update Display Control 1 (FBLANK / Brightness) and it's buffer
$80/8206 8D 00 21    STA $2100
$80/8209 8D 1B 02    STA $021B
$80/820C AD 01 01    LDA $0101      ; Update Object Size and Object Base
$80/820F 8D 01 21    STA $2101
$80/8212 AD 04 01    LDA $0104      ; Update BG Mode
$80/8215 8D 05 21    STA $2105
$80/8218 AD 05 01    LDA $0105      ; Update Mosaic
$80/821B 8D 06 21    STA $2106
$80/821E AD 06 01    LDA $0106      ; Update BG1 Tilemap Address and Mirroring
$80/8221 8D 07 21    STA $2107
$80/8224 AD 07 01    LDA $0107      ; Update BG2 Tilemap Address and Mirroring
$80/8227 8D 08 21    STA $2108
$80/822A AD 08 01    LDA $0108      ; Update BG3 Tilemap Address and Mirroring
$80/822D 8D 09 21    STA $2109
$80/8230 AD 09 01    LDA $0109      ; Update BG4 Tilemap Address and Mirroring
$80/8233 8D 0A 21    STA $210A
$80/8236 AD 0A 01    LDA $010A      ; Update BG1/2 Tileset Address
$80/8239 8D 0B 21    STA $210B
$80/823C AD 0B 01    LDA $010B      ; Update BG3/4 Tileset Address
$80/823F 8D 0C 21    STA $210C
$80/8242 AD 0C 01    LDA $010C      ; Update Mode 7 Rotation/Scaling Mode Settings
$80/8245 8D 1A 21    STA $211A
$80/8248 AD 0D 01    LDA $010D      ; Update Window BG1/BG2 Mask Settings
$80/824B 8D 23 21    STA $2123
$80/824E AD 0E 01    LDA $010E      ; Update Window BG3/BG4 Mask Settings
$80/8251 8D 24 21    STA $2124
$80/8254 AD 1F 01    LDA $011F      ; Update Window OBJ/MATH Mask Settings
$80/8257 8D 25 21    STA $2125
$80/825A AD 20 01    LDA $0120      ; Update Window 1 Left Position (X1)
$80/825D 8D 26 21    STA $2126
$80/8260 AD 21 01    LDA $0121      ; Update Window 1 Right Position (X2)
$80/8263 8D 27 21    STA $2127
$80/8266 AD 22 01    LDA $0122      ; Update Window 2 Left Position (X1)
$80/8269 8D 28 21    STA $2128
$80/826C AD 23 01    LDA $0123      ; Update Window 2 Right Position (X2)
$80/826F 8D 29 21    STA $2129
$80/8272 AD 24 01    LDA $0124      ; Update Window 1/2 Mask Logic (BG1-BG4)
$80/8275 8D 2A 21    STA $212A
$80/8278 AD 25 01    LDA $0125      ; Update Window 1/2 Mask Logic (OBJ/MATH)
$80/827B 8D 2B 21    STA $212B
$80/827E AD 26 01    LDA $0126      ; Update Main Screen Designation
$80/8281 8D 2C 21    STA $212C
$80/8284 AD 28 01    LDA $0128      ; Update Window Area Main Screen Disable
$80/8287 8D 2E 21    STA $212E
$80/828A AD 27 01    LDA $0127      ; Update Sub Screen Designation
$80/828D 8D 2D 21    STA $212D
$80/8290 AD 29 01    LDA $0129      ; Update Window Area Sub Screen Disable
$80/8293 8D 2F 21    STA $212F
$80/8296 AD 2A 01    LDA $012A      ; Update 
$80/8299 8D 30 21    STA $2130
$80/829C AD 2B 01    LDA $012B      ; Update 
$80/829F 8D 31 21    STA $2131
$80/82A2 AD 2D 01    LDA $012D      ; Update Color Math Sub Screen Backdrop Color - RED
$80/82A5 09 20       ORA #$20
$80/82A7 8D 32 21    STA $2132
$80/82AA AD 2E 01    LDA $012E      ; Update Color Math Sub Screen Backdrop Color - GREEN
$80/82AD 09 40       ORA #$40
$80/82AF 8D 32 21    STA $2132
$80/82B2 AD 2F 01    LDA $012F      ; Update Color Math Sub Screen Backdrop Color - BLUE
$80/82B5 09 80       ORA #$80
$80/82B7 8D 32 21    STA $2132
$80/82BA AD 30 01    LDA $0130      ; Update Display Control 2
$80/82BD 8D 33 21    STA $2133
$80/82C0 AD 0F 01    LDA $010F      ; Update Scroll Registers for BG1 to BG4
$80/82C3 8D 0D 21    STA $210D
$80/82C6 AD 10 01    LDA $0110
$80/82C9 8D 0D 21    STA $210D
$80/82CC AD 11 01    LDA $0111
$80/82CF 8D 0E 21    STA $210E
$80/82D2 AD 12 01    LDA $0112
$80/82D5 8D 0E 21    STA $210E
$80/82D8 AD 13 01    LDA $0113
$80/82DB 8D 0F 21    STA $210F
$80/82DE AD 14 01    LDA $0114
$80/82E1 8D 0F 21    STA $210F
$80/82E4 AD 15 01    LDA $0115
$80/82E7 8D 10 21    STA $2110
$80/82EA AD 16 01    LDA $0116
$80/82ED 8D 10 21    STA $2110
$80/82F0 AD 17 01    LDA $0117
$80/82F3 8D 11 21    STA $2111
$80/82F6 AD 18 01    LDA $0118
$80/82F9 8D 11 21    STA $2111
$80/82FC AD 19 01    LDA $0119
$80/82FF 8D 12 21    STA $2112
$80/8302 AD 1A 01    LDA $011A
$80/8305 8D 12 21    STA $2112
$80/8308 AD 1B 01    LDA $011B
$80/830B 8D 13 21    STA $2113
$80/830E AD 1C 01    LDA $011C
$80/8311 8D 13 21    STA $2113
$80/8314 AD 1D 01    LDA $011D
$80/8317 8D 14 21    STA $2114
$80/831A AD 1E 01    LDA $011E
$80/831D 8D 14 21    STA $2114
$80/8320 AD 3A 01    LDA $013A      ; Set HDMA flags
$80/8323 8D 0C 42    STA $420C
$80/8326 28          PLP            ; Restore Flag Register value
$80/8327 6B          RTL

$80/8411 Store a chain of values in $01xx (Graphics Register buffer)

When this subroutine is called from a place in code, the next three byte are arguments for this subroutine. The arguments are a 24-bit-address.

The address this points contains a variable number of arguments in the following format:

1st byte: Destination ($0100-$01FE)
2nd byte: Value for that register

When #$FF is the first byte the loop is ended.

$80/8411 08          PHP            ; Buffer Flag Register value on stack
$80/8412 E2 10       SEP #$10       ; X/Y = 8-bit
$80/8414 C2 20       REP #$20       ; A = 16-bit
$80/8416 A3 03       LDA $03,s      ; Copy the original return address (pointing to data for this subroutine)...
$80/8418 8D 21 00    STA $0021      ; ... into $20-$22 as a 24-bit load address
$80/841B A3 02       LDA $02,s
$80/841D 8D 20 00    STA $0020
$80/8420 18          CLC            ; Change return address on stack to leap over the data
$80/8421 69 03 00    ADC #$0003
$80/8424 83 02       STA $02,s
$80/8426 A0 01       LDY #$01       ; Load Data from the original return address
$80/8428 B7 20       LDA [$20],y    ; Set this data up as another 24-bit-address in $23-$25
$80/842A 8D 23 00    STA $0023
$80/842D C8          INY
$80/842E B7 20       LDA [$20],y
$80/8430 8D 24 00    STA $0024
$80/8433 E2 20       SEP #$20       ; A = 8 bit
$80/8435 A0 00       LDY #$00       ; Reset Load Index
$80/8437 B7 23       LDA [$23],y    ; Load byte from the second address
$80/8439 AA          TAX            ; Transfer to X as (potential) Store Index
$80/843A C9 FF       CMP #$FF       ; Exit if that byte was = #$FF
$80/843C F0 09       BEQ $09        ; [$8447]
$80/843E C8          INY
$80/843F B7 23       LDA [$23],y    ; Load next byte and store it in $01xx
$80/8441 9D 00 01    STA $0100,x
$80/8444 C8          INY
$80/8445 80 F0       BRA $F0        ; [$8437] Loop
$80/8447 28          PLP            ; Restore Flag Register value
$80/8448 6B          RTL

$80/8944 Update OAM

This subroutine transfers the whole OAM buffer at $7E/1C00 to the OAM via DMA.

$80/8944 08          PHP            ; Buffer Flag Register value on stack
$80/8945 E2 10       SEP #$10       ; X/Y = 8-bit
$80/8947 C2 20       REP #$20       ; A = 16-bit
$80/8949 A9 00 04    LDA #$0400     ; DMA transfer type: 8-bit, $2104
$80/894C 8D 00 43    STA $4300
$80/894F A9 00 1C    LDA #$1C00     ; Source Address: $00/1C00
$80/8952 8D 02 43    STA $4302
$80/8955 A2 00       LDX #$00
$80/8957 8E 04 43    STX $4304
$80/895A A9 20 02    LDA #$0220     ; Transfer #$220 bytes
$80/895D 8D 05 43    STA $4305
$80/8960 9C 02 21    STZ $2102      ; Start at $0000 in OAM
$80/8963 A2 01       LDX #$01       ; Activate DMA
$80/8965 8E 0B 42    STX $420B
$80/8968 28          PLP            ; Restore Flag Register value
$80/8969 6B          RTL

$80/8E5F Is a SNES mouse connected?

$80/8E5F A2 01       LDX #$01                A:0061 X:00FF Y:00FF P:envMXdIzc 
$80/8E61 8A          TXA                     A:0061 X:0001 Y:00FF P:envMXdIzc
$80/8E62 0A          ASL A                   A:0001 X:0001 Y:00FF P:envMXdIzc
$80/8E63 A8          TAY                     A:0002 X:0001 Y:00FF P:envMXdIzc
$80/8E64 B9 18 42    LDA $4218,y[$80:421A]   A:0002 X:0001 Y:0002 P:envMXdIzc
$80/8E67 29 0F       AND #$0F       ; Is a mouse connected to the Joypad port?
$80/8E69 C9 01       CMP #$01
$80/8E6B F0 08       BEQ $08        ; [$8E75] Branch if it is
$80/8E6D 9E 17 02    STZ $0217,x[$80:0218]   A:0 X:0001 Y:0002 P:eNvMXdIzc
$80/8E70 9E 19 02    STZ $0219,x[$80:021A]   A:0 X:0001 Y:0002 P:eNvMXdIzc
$80/8E73 80 1E       BRA $1E    [$8E93]      A:0 X:0001 Y:0002 P:eNvMXdIzc

code is missing here

$80/8E93 CA          DEX                     A:0 X:0001 Y:0002 P:eNvMXdIzc
$80/8E94 10 CB       BPL $CB    [$8E61]      A:0 X:0 Y:0002 P:envMXdIZc
$80/8E96 60          RTS                     A:0 X:00FF Y:0 P:eNvMXdIzc

$80/8F7D PROGRAM START

$00/8F7D 78          SEI            ; Disable Interrupts
$00/8F7E 18          CLC            ; Activate Native Mode
$00/8F7F FB          XCE
$00/8F80 5C 84 8F 80 JMP $808F84    ; Switch to FastROM addressing
$80/8F84 E2 20       SEP #$20       ; A = 8-bit
$80/8F86 C2 10       REP #$10       ; X/Y = 16-bit
$80/8F88 4B          PHK            ; Data Bank = Program Bank
$80/8F89 AB          PLB
$80/8F8A A9 01       LDA #$01
$80/8F8C 8D 00 42    STA $4200      ; Auto-Joypad-Enable, NMI/IRQ Disable
$80/8F8F 8D 0D 42    STA $420D      ; Activate FastROM
$80/8F92 A9 80       LDA #$80       ; FBLANK
$80/8F94 8D 00 21    STA $2100
$80/8F97 C2 30       REP #$30       ; A/X/Y = 16-bit
$80/8F99 A9 00 00    LDA #$0000     ; Direct Page: $0000
$80/8F9C 5B          TCD
$80/8F9D AD 63 06    LDA $0663  [$80:0663]   A:0000 X:0 Y:0 P:envmxdIZC
$80/8FA0 49 FF FF    EOR #$FFFF              A:5555 X:0 Y:0 P:envmxdIzC
$80/8FA3 CD 61 06    CMP $0661  [$80:0661]   A:AAAA X:0 Y:0 P:eNvmxdIzC
$80/8FA6 D0 06       BNE $06    [$8FAE]      A:AAAA X:0 Y:0 P:envmxdIzC

code is missing here

$80/8FAE A9 00 00    LDA #$0000     ; Clear whole WRAM
$80/8FB1 8F 00 00 7E STA $7E0000
$80/8FB5 8F 00 00 7F STA $7F0000
$80/8FB9 A9 FD FF    LDA #$FFFD     ;   (Clear Bank $7E)
$80/8FBC A2 01 00    LDX #$0001
$80/8FBF 9B          TXY
$80/8FC0 C8          INY
$80/8FC1 54 7E 7E    MVN 7E 7E
$80/8FC4 A9 FD FF    LDA #$FFFD     ;   (Clear Bank $7F)
$80/8FC7 A2 01 00    LDX #$0001
$80/8FCA 9B          TXY
$80/8FCB C8          INY
$80/8FCC 54 7F 7F    MVN 7F 7F
$80/8FCF 4B          PHK            ; Data Bank = Program Bank
$80/8FD0 AB          PLB
$80/8FD1 7B          TDC            ; Buffer Direct Page in $0665
$80/8FD2 8D 65 06    STA $0665
$80/8FD5 A9 00 00    LDA #$0000     ; Direct Page: $0000
$80/8FD8 5B          TCD
$80/8FD9 A9 FF 1E    LDA #$1EFF     ; Stack: $1EFF
$80/8FDC 1B          TCS
$80/8FDD 22 11 84 80 JSL $808411    ; Store a chain of values in $01xx
     Arguments:
     $80/8FE1 D7 90 80              ; Data for $01xx registers is at $80/90D7
$80/8FE4 A9 80 00    LDA #$0080
$80/8FE7 8D 00 01    STA $0100      ; #$80 in value to set in $2100 (FBLANK)
$80/8FEA 8D 1B 02    STA $021B      ; #$80 in value currently set in $2100 (FBLANK)
$80/8FED A9 01 00    LDA #$0001              A:0080 X:00FF Y:0062 P:envmxdIzC
$80/8FF0 8D 35 01    STA $0135  [$80:0135]   A:0001 X:00FF Y:0062 P:envmxdIzC
$80/8FF3 22 00 82 80 JSL $808200[$80:8200]   A:0001 X:00FF Y:0062 P:envmxdIzC
$80/8FF7 AF F1 FF 9F LDA $9FFFF1    ; Setup address of the SPC program to transfer in $20-22: $9D/8000
$80/8FFB 85 21       STA $21        ;    (UNNECESSARY LINE - one could save a few bytes if the address...)
$80/8FFD AF F0 FF 9F LDA $9FFFF0    ;    (would be loaded directly here instead of this bank $9F detour)
$80/9001 85 20       STA $20
$80/9003 22 5A 99 80 JSL $80995A    ; Transfer Data to SPC
$80/9007 AD 12 42    LDA $4212      ; Wait until the Auto-Joypad read is done
$80/900A 4A          LSR A
$80/900B 90 FA       BCC $FA        ; [$9007]
$80/900D AD 12 42    LDA $4212
$80/9010 4A          LSR A
$80/9011 B0 FA       BCS $FA        ; [$900D]
$80/9013 AD 1A 42    LDA $421A      ; Load Joypad 2 data
$80/9016 29 F0 FF    AND #$FFF0     ; Check if A/B/X/Y/L/R are pushed all at the same time
$80/9019 C9 F0 C0    CMP #$C0F0
$80/901C D0 0E       BNE $0E        ; [$902C] Branch if not
$80/901E 22 E4 C8 80 JSL $80C8E4[$80:C8E4]   A:0000 X:0000 Y:E280 P:envmxdIzc
$80/9022 A9 84 03    LDA #$0384              A:0000 X:FFFE Y:E280 P:envmxdIzc
$80/9025 A0 01 00    LDY #$0001              A:0384 X:FFFE Y:E280 P:envmxdIzc
$80/9028 22 1C 5C 10 JSL $105C1C[$10:5C1C]   A:0384 X:FFFE Y:0001 P:envmxdIzc
$80/902C 22 F7 C8 80 JSL $80C8F7    ; Copy data from banks $10-$12 to $13-$15
$80/9030 22 74 59 10 JSL $105974[$10:5974]   A:0 X:FFFE Y:E280 P:envmxdIzc
$80/9034 E2 20       SEP #$20       ; A = 8-bit
$80/9036 C2 10       REP #$10       ; X/Y = 16-bit
$80/9038 9C 3F 14    STZ $143F      ; Clear Error Counter?
$80/903B 22 8C 59 10 JSL $10598C    ; Check if Satellaview Stream Number Registers work
$80/903F F0 03       BEQ $03        ; [$9044] Branch if everything works fine
$80/9041 EE 3F 14    INC $143F      ; Increment Error Counter?
$80/9044 22 58 5B 10 JSL $105B58[$10:5B58]   A:0 X:FFFE Y:E280 P:envMxdIZC
$80/9048 22 A4 59 10 JSL $1059A4[$10:59A4]   A:0 X:FFFE Y:E280 P:envMxdIZC
$80/904C 22 6C 5A 10 JSL $105A6C    ; MCC Memory Controller Settings: Enable Flash R/W
$80/9050 22 0C 5B 10 JSL $105B0C[$10:5B0C]   A:0080 X:0007 Y:0 P:eNvMxdIzC
$80/9054 22 70 5A 10 JSL $105A70    ; MCC Memory Controller Settings: Disable Flash R/W
$80/9058 C2 30       REP #$30                A:0080 X:0 Y:0 P:eNvMxdIzC
$80/905A 22 0F 8C 80 JSL $808C0F[$80:8C0F]   A:0080 X:0 Y:0 P:eNvmxdIzC
$80/905E 22 09 A7 80 JSL $80A709[$80:A709]   A:0010 X:00FF Y:0 P:eNvmxdIzC
$80/9062 22 58 83 80 JSL $808358[$80:8358]   A:00E0 X:FFFE Y:0 P:eNvmxdIzC
$80/9066 22 40 5B 10 JSL $105B40[$10:5B40]   A:0061 X:FFFE Y:0 P:eNvmxdIzC
$80/906A A9 08 00    LDA #$0008              A:0006 X:FFFF Y:0 P:eNvmxdIzC
$80/906D 8D 4C 01    STA $014C  [$80:014C]   A:0008 X:FFFF Y:0 P:envmxdIzC
$80/9070 A9 04 00    LDA #$0004              A:0008 X:FFFF Y:0 P:envmxdIzC
$80/9073 8D 4E 01    STA $014E  [$80:014E]   A:0004 X:FFFF Y:0 P:envmxdIzC
$80/9076 A9 FF FF    LDA #$FFFF              A:0004 X:FFFF Y:0 P:envmxdIzC
$80/9079 8D 13 0A    STA $0A13  [$80:0A13]   A:FFFF X:FFFF Y:0 P:eNvmxdIzC
$80/907C A9 FF FF    LDA #$FFFF              A:FFFF X:FFFF Y:0 P:eNvmxdIzC
$80/907F 8F 15 87 7E STA $7E8715[$7E:8715]   A:FFFF X:FFFF Y:0 P:eNvmxdIzC
$80/9083 AD 65 06    LDA $0665  [$80:0665]   A:FFFF X:FFFF Y:0 P:eNvmxdIzC
$80/9086 C9 47 53    CMP #$5347              A:0 X:FFFF Y:0 P:envmxdIZC
$80/9089 F0 0E       BEQ $0E    [$9099]      A:0 X:FFFF Y:0 P:eNvmxdIzc
$80/908B A9 00 80    LDA #$8000              A:0 X:FFFF Y:0 P:eNvmxdIzc
$80/908E 8D 37 06    STA $0637  [$80:0637]   A:8000 X:FFFF Y:0 P:eNvmxdIzc
$80/9091 A9 94 00    LDA #$0094              A:8000 X:FFFF Y:0 P:eNvmxdIzc
$80/9094 8D 39 06    STA $0639  [$80:0639]   A:0094 X:FFFF Y:0 P:envmxdIzc
$80/9097 80 18       BRA $18    [$90B1]      A:0094 X:FFFF Y:0 P:envmxdIzc
$80/90B1 9C 65 06    STZ $0665  [$80:0665]   A:0094 X:FFFF Y:0 P:envmxdIzc
$80/90B4 22 25 92 80 JSL $809225[$80:9225]   A:0094 X:FFFF Y:0 P:envmxdIzc
$80/90B8 A9 3A 91    LDA #$913A              A:0 X:0010 Y:0 P:envmxdIzc
$80/90BB 8D 3F 06    STA $063F  [$80:063F]   A:913A X:0010 Y:0 P:eNvmxdIzc
$80/90BE A9 80 00    LDA #$0080              A:913A X:0010 Y:0 P:eNvmxdIzc
$80/90C1 8D 41 06    STA $0641  [$80:0641]   A:0080 X:0010 Y:0 P:envmxdIzc
$80/90C4 22 9D 83 80 JSL $80839D[$80:839D]   A:0080 X:0010 Y:0 P:envmxdIzc
$80/90C8 58          CLI                     A:0081 X:0010 Y:0 P:envmxdIzc
$80/90C9 20 6A 93    JSR $936A  [$80:936A]   A:0081 X:0010 Y:0 P:envmxdizc
$80/90CC 4B          PHK                     A:913A X:0010 Y:0 P:eNvmxdizc
$80/90CD F4 D2 90    PEA $90D2               A:913A X:0010 Y:0 P:eNvmxdizc
$80/90D0 DC 33 06    JML [$0633][$80:913A]   A:913A X:0010 Y:0 P:eNvmxdizc

$80/90D7 Data

This data gets transfered to the $01xx Graphics Register buffer via $80/8411 at $80/8FDD.

This is executed while the start-up, these values serve to clear those Graphics Registers.

$80/90D7 01 00 - Value for $0101 = $2101 - Object Size and Object Base
$80/90D9 02 00 - Value for $0102
$80/90DB 03 00 - Value for $0103
$80/90DD 04 00 - Value for $0104 = $2105 - BG Mode
$80/90DF 05 00 - Value for $0105 = $2106 - Mosaic
$80/90E1 06 00
$80/90E3 07 00
$80/90E5 08 00
$80/90E7 09 00
$80/90E9 0A 00
$80/90EB 0B 00
$80/90ED 0F 00
$80/90EF 10 00
$80/90F1 11 00
$80/90F3 12 00
$80/90F5 13 00
$80/90F7 14 00
$80/90F9 15 00
$80/90FB 16 00
$80/90FD 17 00
$80/90FF 18 00
$80/9101 19 00
$80/9103 1A 00
$80/9105 1B 00
$80/9107 1C 00
$80/9109 1D 00
$80/910B 1E 00
$80/910D 0C 00
$80/910F 0D 00
$80/9111 0E 00
$80/9113 1F 00
$80/9115 20 00
$80/9117 21 00
$80/9119 22 00
$80/911B 23 00
$80/911D 24 00
$80/911F 25 00
$80/9121 26 00
$80/9123 27 00
$80/9125 28 00
$80/9127 2A 30
$80/9129 2B 00
$80/912B 2C E0
$80/912D 30 00
$80/912F 38 00
$80/9131 39 00
$80/9133 36 00
$80/9135 37 00
$80/9137 3A 00
$80/9139 FF

$80/9390 USELESS SUBROUTINE

Life would be so desolate without them.

$80/9390 08          PHP            ; UNNECESSARY LINE
$80/9391 28          PLP            ; UNNECESSARY LINE
$80/9392 6B          RTL            ; UNNECESSARY LINE

$80/995A Transfer Data to SPC

I guess this subroutine is the standard SPC Data Transfer Subroutine by Nintendo. Furthermore, since this ROM is programmed by Nintendo (I guess?), they surely will use this subroutine, too, to transfer song/sfx data. Other developers tended to write their own.

$80/995A 08          PHP            ; Buffer Flag Register value on stack
$80/995B C2 30       REP #$30       ; A/X/Y = 16 bit
$80/995D AC 20 00    LDY $0020  [$80:0020]   A:8000 X:00FF Y:0062 P:eNvmxdIzC
$80/9960 9C 20 00    STZ $0020  [$80:0020]   A:8000 X:00FF Y:8000 P:eNvmxdIzC
$80/9963 A9 AA BB    LDA #$BBAA     ; Is the SPC ready?
$80/9966 CD 40 21    CMP $2140
$80/9969 D0 FB       BNE $FB        ; [$9966]
$80/996B E2 20       SEP #$20       ; Send ready signal back
$80/996D A9 CC       LDA #$CC
$80/996F 80 2B       BRA $2B        ; [$999C]
$80/9971 FA          PLX                     A:51CC X:03FA Y:8004 P:enVMxdIZC
$80/9972 B7 20       LDA [$20],y[$9D:8004]   A:51CC X:00F0 Y:8004 P:enVMxdIzC
$80/9974 20 D5 99    JSR $99D5      ; Inc Y
$80/9977 EB          XBA                     A:5120 X:00F0 Y:8005 P:eNVMxdIzC
$80/9978 A9 00       LDA #$00                A:2051 X:00F0 Y:8005 P:enVMxdIzC
$80/997A 80 0D       BRA $0D    [$9989]      A:2000 X:00F0 Y:8005 P:enVMxdIZC
$80/997C EB          XBA                     A:2000 X:00EF Y:8005 P:enVMxdIzC
$80/997D B7 20       LDA [$20],y[$9D:8005]   A:0020 X:00EF Y:8005 P:enVMxdIzC
$80/997F 20 D5 99    JSR $99D5  [$80:99D5]   A:0054 X:00EF Y:8005 P:enVMxdIzC
$80/9982 EB          XBA                     A:0054 X:00EF Y:8006 P:eNVMxdIzC
$80/9983 CD 40 21    CMP $2140  [$80:2140]   A:5400 X:00EF Y:8006 P:enVMxdIZC
$80/9986 D0 FB       BNE $FB    [$9983]      A:5400 X:00EF Y:8006 P:enVMxdIzc
$80/9988 1A          INC A                   A:5400 X:00EF Y:8006 P:enVMxdIZC
$80/9989 C2 20       REP #$20                A:2000 X:00F0 Y:8005 P:enVMxdIZC
$80/998B 8D 40 21    STA $2140  [$80:2140]   A:2000 X:00F0 Y:8005 P:enVmxdIZC
$80/998E E2 20       SEP #$20                A:2000 X:00F0 Y:8005 P:enVmxdIZC
$80/9990 CA          DEX                     A:2000 X:00F0 Y:8005 P:enVMxdIZC
$80/9991 D0 E9       BNE $E9    [$997C]      A:2000 X:00EF Y:8005 P:enVMxdIzC
$80/9993 CD 40 21    CMP $2140  [$80:2140]   A:E4EF X:0 Y:80F4 P:enVMxdIZC
$80/9996 D0 FB       BNE $FB    [$9993]      A:E4EF X:0 Y:80F4 P:enVMxdIzC
$80/9998 69 03       ADC #$03                A:E4EF X:0 Y:80F4 P:enVMxdIZC
$80/999A F0 FC       BEQ $FC    [$9998]      A:E4F3 X:0 Y:80F4 P:eNvMxdIzc

$80/999C 48          PHA                     A:BBCC X:00FF Y:8000 P:eNvMxdIzC
$80/999D C2 20       REP #$20       ; A = 16-bit
$80/999F B7 20       LDA [$20],y[$9D:8000]   A:BBCC X:00FF Y:8000 P:eNvmxdIzC
$80/99A1 20 D5 99    JSR $99D5      ; Inc Y
$80/99A4 20 D5 99    JSR $99D5      ; Inc Y
$80/99A7 AA          TAX                     A:00F0 X:00FF Y:8002 P:eNvmxdIzC
$80/99A8 B7 20       LDA [$20],y[$9D:8002]   A:00F0 X:00F0 Y:8002 P:envmxdIzC
$80/99AA 20 D5 99    JSR $99D5      ; Inc Y
$80/99AD 20 D5 99    JSR $99D5      ; Inc Y
$80/99B0 8D 42 21    STA $2142  [$80:2142]   A:5100 X:00F0 Y:8004 P:eNvmxdIzC
$80/99B3 E2 20       SEP #$20                A:5100 X:00F0 Y:8004 P:eNvmxdIzC
$80/99B5 E0 01 00    CPX #$0001              A:5100 X:00F0 Y:8004 P:eNvMxdIzC
$80/99B8 A9 00       LDA #$00                A:5100 X:00F0 Y:8004 P:envMxdIzC
$80/99BA 2A          ROL A                   A:5100 X:00F0 Y:8004 P:envMxdIZC
$80/99BB 8D 41 21    STA $2141  [$80:2141]   A:5101 X:00F0 Y:8004 P:envMxdIzc
$80/99BE 69 7F       ADC #$7F                A:5101 X:00F0 Y:8004 P:envMxdIzc
$80/99C0 68          PLA                     A:5180 X:00F0 Y:8004 P:eNVMxdIzc
$80/99C1 8D 40 21    STA $2140  [$80:2140]   A:51CC X:00F0 Y:8004 P:eNVMxdIzc
$80/99C4 DA          PHX                     A:51CC X:00F0 Y:8004 P:eNVMxdIzc
$80/99C5 A2 00 04    LDX #$0400              A:51CC X:00F0 Y:8004 P:eNVMxdIzc
$80/99C8 CA          DEX                     A:51CC X:0400 Y:8004 P:enVMxdIzc
$80/99C9 F0 07       BEQ $07    [$99D2]      A:51CC X:03FF Y:8004 P:enVMxdIzc
$80/99CB CD 40 21    CMP $2140  [$80:2140]   A:51CC X:03FF Y:8004 P:enVMxdIzc
$80/99CE D0 F8       BNE $F8    [$99C8]      A:51CC X:03FF Y:8004 P:enVMxdIzC
$80/99D0 70 9F       BVS $9F    [$9971]      A:51CC X:03FA Y:8004 P:enVMxdIZC
$80/99D2 FA          PLX                     A:0403 X:03F9 Y:E280 P:envMxdIZC
$80/99D3 28          PLP            ; Restore Flag Register value
$80/99D4 6B          RTL

$80/99D5 Increment Load Index Y

This subroutine increments Y. If it turned from #$FFFF to #$0000, its value gets set to #$8000 and the bank of the 24-bit-address in $20-$22 gets incremented.

Side Note: One could save one byte of code if the branch command is a BNE that points to an RTS, but maybe they built it this way to save cycles?

$80/99D5 C8          INY            ; Increment Load index
$80/99D6 F0 01       BEQ $01        ; [$99D9] Branch if it turned from #$FFFF to #$0000
$80/99D8 60          RTS
$80/99D9 E6 22       INC $22        ; Increment bank
$80/99DB A0 00 80    LDY #$8000     ; Reset to #$8000 (first byte of the new LoROM bank)
$80/99DE 60          RTS

$80/9C23 Store A into $7E/7600 to $7E/7DFF

$80/9C23 08          PHP            ; Buffer Flag Register value and Data Bank on stack
$80/9C24 8B          PHB
$80/9C25 F4 00 7E    PEA $7E00      ; Set Data Bank to $7E
$80/9C28 AB          PLB
$80/9C29 AB          PLB
$80/9C2A C2 30       REP #$30       ; A/X/Y = 16-bit
$80/9C2C A2 FE 00    LDX #$00FE     ; Loop
$80/9C2F 9D 00 76    STA $7600,x
$80/9C32 9D 00 77    STA $7700,x
$80/9C35 9D 00 78    STA $7800,x
$80/9C38 9D 00 79    STA $7900,x
$80/9C3B 9D 00 7A    STA $7A00,x
$80/9C3E 9D 00 7B    STA $7B00,x
$80/9C41 9D 00 7C    STA $7C00,x
$80/9C44 9D 00 7D    STA $7D00,x
$80/9C47 CA          DEX
$80/9C48 CA          DEX
$80/9C49 10 E4       BPL $E4        ; [$9C2F]
$80/9C4B AB          PLB            ; Restore Flag Register value and Data Bank
$80/9C4C 28          PLP
$80/9C4D 6B          RTL

$80/9C4E ? (VRAM DMA)

Transfers #$800 byte from $7E/7600 to VRAM

$80/9C4E AD 42 07    LDA $0742      ; Is flag set for VRAM DMA?
$80/9C51 F0 2E       BEQ $2E        ; [$9C81] Exit if not
$80/9C53 E2 10       SEP #$10       ; X/Y = 8-bit
$80/9C55 A9 01 18    LDA #$1801     ; 16-bit transfer to $2118 (VRAM)
$80/9C58 8D 00 43    STA $4300
$80/9C5B A9 00 76    LDA #$7600     ; Source: $7E/7600
$80/9C5E 8D 02 43    STA $4302
$80/9C61 A2 7E       LDX #$7E
$80/9C63 8E 04 43    STX $4304
$80/9C66 A9 00 08    LDA #$0800     ; Transfer #$800 byte
$80/9C69 8D 05 43    STA $4305
$80/9C6C A2 80       LDX #$80       ; 16-bit transfer
$80/9C6E 8E 15 21    STX $2115
$80/9C71 AD 29 07    LDA $0729      ; Set VRAM destination
$80/9C74 8D 16 21    STA $2116
$80/9C77 A2 01       LDX #$01       ; Activate DMA
$80/9C79 8E 0B 42    STX $420B
$80/9C7C 9C 42 07    STZ $0742      ; Remove flag for VRAM DMA
$80/9C7F C2 10       REP #$10       ; X/Y = 16-bit
$80/9C81 6B          RTL

$80/BB84 MCC Memory Controller Settings: Enable Flash R/W

$80/BB84 08          PHP            ; Buffer Flag Register value on stack
$80/BB85 E2 20       SEP #$20       ; A = 8-bit
$80/BB87 A9 00       LDA #$00
$80/BB89 8F 00 50 05 STA $055000    ; Bank $40-$4F: PSRAM
$80/BB8D 8F 00 50 06 STA $065000    ; Bank $50-$5F: PSRAM
$80/BB91 8F 00 50 04 STA $045000    ; LoROM Mapping
$80/BB95 8F 00 50 01 STA $015000    ; Bank $00-$3F: Flash
$80/BB99 A9 80       LDA #$80
$80/BB9B 8F 00 50 02 STA $025000    ; Flash: HiROM
$80/BB9F 8F 00 50 03 STA $035000    ; Bank $60-$6F: Flash
$80/BBA3 8F 00 50 0C STA $0C5000    ; Enable Bank $C0-$FF Flash Reads
$80/BBA7 8F 00 50 0D STA $0D5000    ; Enable Bank $C0-$FF Flash Writes
$80/BBAB 8F 00 50 0E STA $0E5000    ; Apply Changes to Other MCC Registers
$80/BBAF 28          PLP            ; Restore Flag Register value
$80/BBB0 6B          RTL

$80/BBB1 MCC Memory Controller Settings: Disable Flash R/W

$80/BBB1 08          PHP            ; Buffer Flag Register value on stack
$80/BBB2 E2 20       SEP #$20       ; A = 8-bit
$80/BBB4 A9 00       LDA #$00
$80/BBB6 8F 00 50 05 STA $055000    ; Bank $40-$4F: PSRAM
$80/BBBA 8F 00 50 06 STA $065000    ; Bank $50-$5F: PSRAM
$80/BBBE 8F 00 50 04 STA $045000    ; LoROM Mapping
$80/BBC2 8F 00 50 01 STA $015000    ; Bank $00-$3F: Flash
$80/BBC6 8F 00 50 0C STA $0C5000    ; Disable Bank $C0-$FF Flash Reads
$80/BBCA 8F 00 50 0D STA $0D5000    ; Disable Bank $C0-$FF Flash Writes
$80/BBCE A9 80       LDA #$80
$80/BBD0 8F 00 50 02 STA $025000    ; Flash: HiROM
$80/BBD4 8F 00 50 03 STA $035000    ; Bank $60-$6F: Flash
$80/BBD8 8F 00 50 0E STA $0E5000    ; Apply Changes to Other MCC Registers
$80/BBDC 28          PLP            ; Restore Flag Register value
$80/BBDD 6B          RTL

$80/BD6C ? (Execute Subroutine from Jump Table)

$80/BD6C 08          PHP            ; Buffer Flag Register value on stack
$80/BD6D E2 30       SEP #$30                A:0 X:0007 Y:0 P:envMXdIZC
$80/BD6F AD 41 14    LDA $1441      ; Load Jump Table Index
$80/BD72 0A          ASL A          ; Multiply by 2 (each Jump Table Entry is 2 bytes in size)
$80/BD73 AA          TAX            ; Transfer to X
$80/BD74 FC 79 BD    JSR ($BD79,x)  ; JUMP
$80/BD77 28          PLP            ; Restore Flag Register value
$80/BD78 6B          RTL

$80/BD79 Jump Table for $80/BD6C

data is missing here

$80/C2AD Check if Satellaview Stream Number Registers work

If something went wrong, A != #$00 at the end. If everything is fine, A = #$00.

$80/C2AD A9 01       LDA #$01       ; Set Power Bit for Satellaview
$80/C2AF 8D 94 21    STA $2194
$80/C2B2 A9 AA       LDA #$AA       ; Check if you can write into $2188 and check if it keeps its value
$80/C2B4 8D 88 21    STA $2188
$80/C2B7 CD 88 21    CMP $2188
$80/C2BA D0 22       BNE $22        ; [$C2DE] Exit if it doesn't work
$80/C2BC A9 55       LDA #$55       ; Check if you can write into $2188 and check if it keeps its value
$80/C2BE 8D 88 21    STA $2188
$80/C2C1 CD 88 21    CMP $2188
$80/C2C4 D0 18       BNE $18        ; [$C2DE] Exit if it doesn't work
$80/C2C6 9C 88 21    STZ $2188      ; Check if you can clear $2189/9/E/F and the values stay cleared
$80/C2C9 9C 89 21    STZ $2189
$80/C2CC 9C 8E 21    STZ $218E
$80/C2CF 9C 8F 21    STZ $218F
$80/C2D2 AD 88 21    LDA $2188
$80/C2D5 0D 89 21    ORA $2189
$80/C2D8 0D 8E 21    ORA $218E
$80/C2DB 0D 8F 21    ORA $218F
$80/C2DE 6B          RTL

$80/C5BC Satellaview-related: Restore original Fuction Hook Vectors & Reset function

This transfers the original Hook Vectors & Reset function from ROM to SRAM (after the SRAM is reset).

$80/C5BC 08          PHP            ; Buffer Flag Register value on stack
$80/C5BD C2 30       REP #$30       ; A/X/Y = 16 bit
$80/C5BF A2 12 03    LDX #$0312
$80/C5C2 BF D0 C5 80 LDA $80C5D0,x
$80/C5C6 9F 8C 59 10 STA $10598C,x
$80/C5CA CA          DEX
$80/C5CB CA          DEX
$80/C5CC 10 F4       BPL $F4        ; [$C5C2]
$80/C5CE 28          PLP            ; Restore Flag Register
$80/C5CF 6B          RTL

$80/C8E4

$80/C8E4 08          PHP                     A:0000 X:0000 Y:E280 P:envmxdIzc
$80/C8E5 E2 20       SEP #$20                A:0000 X:0000 Y:E280 P:envmxdIzc
$80/C8E7 A9 00       LDA #$00                A:0000 X:0000 Y:E280 P:envMxdIzc
$80/C8E9 8F 00 50 10 STA $105000[$10:5000]   A:0000 X:0000 Y:E280 P:envMxdIZc
$80/C8ED 8F 00 50 13 STA $135000[$13:5000]   A:0000 X:0000 Y:E280 P:envMxdIZc
$80/C8F1 22 F7 C8 80 JSL $80C8F7[$80:C8F7]   A:0000 X:0000 Y:E280 P:envMxdIZc
$80/C8F5 28          PLP                     A:0000 X:FFFE Y:E280 P:envMxdIZc
$80/C8F6 6B          RTL                     A:0000 X:FFFE Y:E280 P:envmxdIzc

$80/C8F7 Satellaview-related

I am not entirely sure, but $02 is at least used as a flag (maybe for more):

First, it gets cleared (everything is fine). If something is wrong, it gets checked if it is clear. If it is, the backup from banks $13-15 gets transfered to $10-$12, its value gets incremented and the subroutine starts over. If something goes wrong again, the subroutine branches to a different path.

$80/C8F7 08          PHP            ; Buffer Flag Register value on stack
$80/C8F8 C2 30       REP #$30       ; A/X/Y = 16 bit
$80/C8FA 9C 02 00    STZ $0002  [$80:0002]   A:0 X:0 Y:E280 P:envmxdIzc
$80/C8FD AF 00 50 10 LDA $105000    ; Check if a Satellaview is connected
$80/C901 C9 53 47    CMP #$4753     ; If it is, it has #$4753 in $10/5000 (ASCII: "SG")
$80/C904 D0 45       BNE $45        ; [$C94B] Branch if not
$80/C906 AF 04 50 10 LDA $105004    ; Load Checksum
$80/C90A 4F 02 50 10 EOR $105002    ; EOR it with the Checksum Complement
$80/C90E C9 FF FF    CMP #$FFFF     ; Does Checksum fit with its complement?
$80/C911 D0 38       BNE $38        ; [$C94B] Branch if not
$80/C913 64 00       STZ $00    [$00:0000]   A:FFFF X:0 Y:E280 P:envmxdIZC
$80/C915 A2 FF 0F    LDX #$0FFF     ; CALCULATE CHECKSUM
$80/C918 BF 00 50 10 LDA $105000,x  ; The Checksum is every byte between $5000-$5FFF (from banks $10-$12) added together
$80/C91C 29 FF 00    AND #$00FF
$80/C91F 18          CLC
$80/C920 65 00       ADC $00
$80/C922 85 00       STA $00
$80/C924 BF 00 50 11 LDA $115000,x
$80/C928 29 FF 00    AND #$00FF
$80/C92B 18          CLC
$80/C92C 65 00       ADC $00
$80/C92E 85 00       STA $00
$80/C930 BF 00 50 12 LDA $125000,x
$80/C934 29 FF 00    AND #$00FF
$80/C937 18          CLC
$80/C938 65 00       ADC $00
$80/C93A 85 00       STA $00
$80/C93C CA          DEX
$80/C93D 10 D9       BPL $D9        ; [$C918] Loop
$80/C93F CF 04 50 10 CMP $105004    ; Is the calculated Checksum the same as the one in $10/5004?
$80/C943 D0 06       BNE $06        ; [$C94B] Branch if not
$80/C945 22 1B CA 80 JSL $80CA1B    ; Copy data from banks $10-$12 to $13-$15
$80/C949 80 42       BRA $42        ; [$C98D] Exit

(executed when Satellaview does not respond correctly)

$80/C94B A5 02       LDA $02    [$00:0002]   A:4700 X:0000 Y:E280 P:eNvmxdIzc
$80/C94D D0 08       BNE $08    [$C957]      A:0000 X:0000 Y:E280 P:envmxdIZc
$80/C94F E6 02       INC $02    [$00:0002]   A:0000 X:0000 Y:E280 P:envmxdIZc
$80/C951 22 F7 C9 80 JSL $80C9F7    ; Satellaview-related: Copy data from banks $13-$15 to $10-$12
$80/C955 80 A6       BRA $A6        ; [$C8FD] Go back to the start and check if everything works now
$80/C957 22 8F C9 80 JSL $80C98F    ; Clear banks $10-$12
$80/C95B 22 FF BC 94 JSL $94BCFF    ; Clear BS-X SRAM
$80/C95F AD 8E C9    LDA $C98E      ; This could be optimized with an "LDA #$6B" (UNNECESSARY LINE)
$80/C962 8F 74 59 10 STA $105974    ; "Boot Hook"
$80/C966 8F 78 59 10 STA $105978    ; "NMI Hook"
$80/C96A 8F 7C 59 10 STA $10597C    ; "IRQ Vector"
$80/C96E 8F 80 59 10 STA $105980    ; "Download Start Hook"
$80/C972 8F 84 59 10 STA $105984    ; "File Start Hook"
$80/C976 8F 88 59 10 STA $105988    ; "Whatever Hook"
$80/C97A A9 53 47    LDA #$4753     ; Store ASCII text "SG" in $10/5000
$80/C97D 8F 00 50 10 STA $105000
$80/C981 22 D7 C5 81 JSL $81C5D7    ; Restore original Hook Vectors
$80/C985 22 BC C5 80 JSL $80C5BC    ; Restore original Fuction Hook Vectors & Reset function
$80/C989 22 AA C9 80 JSL $80C9AA    ; Calculate new SRAM Checksum

$80/C98D 28          PLP            ; Restore Flag Register value
$80/C98E 6B          RTL

$80/C98F Satellaview-related: Clear banks $10-$12

$80/C98F 08          PHP            ; Buffer Flag Register value on stack
$80/C990 C2 30       REP #$30       ; 
$80/C992 A9 00 00    LDA #$0000              A:0001 X:FFFE Y:E280 P:envmxdIzc
$80/C995 A2 FE 0F    LDX #$0FFE              A:0000 X:FFFE Y:E280 P:envmxdIZc
$80/C998 9F 00 50 10 STA $105000,x[$10:5FFE] A:0000 X:0FFE Y:E280 P:envmxdIzc
$80/C99C 9F 00 50 11 STA $115000,x[$11:5FFE] A:0000 X:0FFE Y:E280 P:envmxdIzc
$80/C9A0 9F 00 50 12 STA $125000,x[$12:5FFE] A:0000 X:0FFE Y:E280 P:envmxdIzc
$80/C9A4 CA          DEX                     A:0000 X:0FFE Y:E280 P:envmxdIzc
$80/C9A5 CA          DEX                     A:0000 X:0FFD Y:E280 P:envmxdIzc
$80/C9A6 10 F0       BPL $F0        ; [$C998] Loop until everything is done
$80/C9A8 28          PLP            ; Restore Flag Register value
$80/C9A9 6B          RTL

$80/C9AA Calculate new SRAM Checksum

$80/C9AA 08 PHP  ; Buffer Flag Register value on stack $80/C9AB C2 30 REP #$30  ; A/X/Y = 16 bit $80/C9AD A9 00 00 LDA #$0000  ; Set temporary Checksum: #$0000 $80/C9B0 8F 04 50 10 STA $105004 $80/C9B4 3A DEC A  ; Set temporary Checksum Complement: #$FFFF $80/C9B5 8F 02 50 10 STA $105002 $80/C9B9 9C 00 00 STZ $0000  ; Clear Buffer for Checksum $80/C9BC A2 FF 0F LDX #$0FFF  ; CALCULATE CHECKSUM $80/C9BF BF 00 50 10 LDA $105000,x  ; The Checksum is every byte between $5000-$5FFF (from banks $10-$12) added together $80/C9C3 29 FF 00 AND #$00FF $80/C9C6 18 CLC $80/C9C7 65 00 ADC $00 $80/C9C9 85 00 STA $00 $80/C9CB BF 00 50 11 LDA $115000,x $80/C9CF 29 FF 00 AND #$00FF $80/C9D2 18 CLC $80/C9D3 65 00 ADC $00 $80/C9D5 85 00 STA $00 $80/C9D7 BF 00 50 12 LDA $125000,x $80/C9DB 29 FF 00 AND #$00FF $80/C9DE 18 CLC $80/C9DF 65 00 ADC $00 $80/C9E1 85 00 STA $00 $80/C9E3 CA DEX $80/C9E4 10 D9 BPL $D9  ; [$C9BF] $80/C9E6 8F 04 50 10 STA $105004  ; Store Checksum $80/C9EA 49 FF FF EOR #$FFFF  ; Form Checksum Complement and store it $80/C9ED 8F 02 50 10 STA $105002 $80/C9F1 28 PLP  ; Restore Flag Register value $80/C9F2 22 1B CA 80 JSL $80CA1B  ; Copy data from banks $10-$12 to $13-$15 $80/C9F6 6B RTL

$80/C9F7 Satellaview-related: Copy data from banks $13-$15 to $10-$12

This subroutine copies the data from $5000-$5FFF from the banks $13-15 to $10-12.

$80/C9F7 08          PHP            ; Buffer Flag Register value on stack
$80/C9F8 C2 30       REP #$30       ; A/X/Y = 16 bit
$80/C9FA A2 FE 0F    LDX #$0FFE     ; Setup Load/Store Index/Loop Counter
$80/C9FD BF 00 50 13 LDA $135000,x  ; Transfer from bank $13 to $10
$80/CA01 9F 00 50 10 STA $105000,x
$80/CA05 BF 00 50 14 LDA $145000,x  ; Transfer from bank $14 to $11
$80/CA09 9F 00 50 11 STA $115000,x
$80/CA0D BF 00 50 15 LDA $155000,x  ; Transfer from bank $15 to $12
$80/CA11 9F 00 50 12 STA $125000,x
$80/CA15 CA          DEX            ; Decrement Load/Store Index twice
$80/CA16 CA          DEX
$80/CA17 10 E4       BPL $E4        ; [$C9FD] Loop until everything is done
$80/CA19 28          PLP            ; Restore Flag Register value
$80/CA1A 6B          RTL

$80/CA1B Satellaview-related: Copy data from banks $10-$12 to $13-$15

This subroutine copies the data from $5000-$5FFF from the banks $10-12 to $13-15.

$80/CA1B 08          PHP            ; Buffer Flag Register value on stack
$80/CA1C C2 30       REP #$30       ; A/X/Y = 16 bit
$80/CA1E A2 FE 0F    LDX #$0FFE     ; Setup Load/Store Index/Loop Counter
$80/CA21 BF 00 50 10 LDA $105000,x  ; Transfer from bank $10 to $13
$80/CA25 9F 00 50 13 STA $135000,x
$80/CA29 BF 00 50 11 LDA $115000,x  ; Transfer from bank $11 to $14
$80/CA2D 9F 00 50 14 STA $145000,x
$80/CA31 BF 00 50 12 LDA $125000,x  ; Transfer from bank $12 to $15
$80/CA35 9F 00 50 15 STA $155000,x
$80/CA39 CA          DEX            ; Decrement Load/Store Index twice
$80/CA3A CA          DEX
$80/CA3B 10 E4       BPL $E4        ; [$CA21] Loop until everything is done
$80/CA3D 28          PLP            ; Restore Flag Register value
$80/CA3E 6B          RTL

$80/F231 ? (Check if Errors have occured)

$80/F231 08          PHP            ; Buffer Flag Register value on stack
$80/F232 E2 20       SEP #$20       ; A = 8-bit
$80/F234 C2 10       REP #$10       ; X/Y = 16-bit
$80/F236 AD 3F 14    LDA $143F      ; Check if Errors occured(?)
$80/F239 D0 3C       BNE $3C        ; [$F277] Exit if it has
$80/F23B AD DF 13    LDA $13DF  [$80:13DF]   A:0 X:00FF Y:0 P:envMxdIZC
$80/F23E D0 37       BNE $37        ; [$F277] Exit
$80/F240 EE DF 13    INC $13DF  [$80:13DF]   A:0 X:00FF Y:0 P:envMxdIZC
$80/F243 22 0C 5C 10 JSL $105C0C[$10:5C0C]   A:0 X:00FF Y:0 P:envMxdIzC
$80/F247 22 70 5B 10 JSL $105B70[$10:5B70]   A:0 X:00FF Y:0 P:envMxdIzC
$80/F24B 22 AC 5B 10 JSL $105BAC[$10:5BAC]   A:0 X:0 Y:0 P:envMxdIzC
$80/F24F AD D1 13    LDA $13D1  [$80:13D1]   A:0 X:0 Y:0 P:envMxdIzC
$80/F252 F0 20       BEQ $20    [$F274]      A:0 X:0 Y:0 P:envMxdIZC

code is missing here

$80/F274 9C DF 13    STZ $13DF  [$80:13DF]   A:0 X:0 Y:0 P:envMxdIZC
$80/F277 28          PLP            ; Restore Flag Register value
$80/F278 6B          RTL

$80/F2F2 Deactivate Satellaview Power Down Mode

From FullSNES:

  2197h Control (only bit7 is modified) (R/W)
  
  0-6  Unknown/unused (should be left unchanged)
  7    Power Down Mode? (0=Power Down, 1=Operate/Normal) (Soundlink enable?)
  
  Bit7 is set by various BIOS functions, and, notably: When [7FD9h/FFD9h].Bit4 (in Satellaview FLASH File Header) is set. Also notably: Bit7 is set/cleared depending on Town Status Entry[07h].Bit6-7.
$80/F2F2 08          PHP            ; Buffer Flag Register value and A on stack
$80/F2F3 E2 20       SEP #$20
$80/F2F5 48          PHA
$80/F2F6 AF 97 21 00 LDA $002197    ; Load $2197 value, set MSB, store back
$80/F2FA 09 80       ORA #$80
$80/F2FC 8F 97 21 00 STA $002197
$80/F300 68          PLA            ; Restore Flag Register value and A
$80/F301 28          PLP
$80/F302 6B          RTL

Bank $81

$81/C5D7 Restore original Token Handlers

This transfers the original Token Handlers from ROM to SRAM (after the SRAM is reset).

$81/C5D7 DA          PHX            ; Buffer X on stack
$81/C5D8 A2 00 02    LDX #$0200
$81/C5DB BF E9 C5 81 LDA $81C5E9,x
$81/C5DF 9F A0 5C 10 STA $105CA0,x
$81/C5E3 CA          DEX
$81/C5E4 CA          DEX
$81/C5E5 10 F4       BPL $F4        ; [$C5DB]
$81/C5E7 FA          PLX            ; Restore X
$81/C5E8 6B          RTL

$81/C5E9 Hook Vectors

The #$200 byte here get transfered to $10/5CA0-$10/5EA0 if the SRAM got reset.

Bank $94

$94/BCFF Clear BS-X SRAM

$94/BCFF 08          PHP            ; Buffer Flag Register value and Data Bank on stack
$94/BD00 8B          PHB
$94/BD01 F4 00 10    PEA $1000      ; Set Data Bank to $10
$94/BD04 AB          PLB
$94/BD05 AB          PLB
$94/BD06 E2 20       SEP #$20       ; A = 8-bit
$94/BD08 C2 10       REP #$10       ; X/Y = 16-bit
$94/BD0A A2 6D 09    LDX #$096D     ; Clear $10/5006 to $10/5973
$94/BD0D A9 00       LDA #$00
$94/BD0F 9D 06 50    STA $5006,x
$94/BD12 CA          DEX
$94/BD13 10 FA       BPL $FA        ; [$BD0F]
$94/BD15 A2 88 13    LDX #$1388     ; Set Money Start Value: 5000 (= #$1388)
$94/BD18 8E 1E 50    STX $501E
$94/BD1B A2 D9 98    LDX #$98D9     ; Set GUI Border Scheme to standard value (= $94/98D9)
$94/BD1E 8E 6A 59    STX $596A
$94/BD21 A9 94       LDA #$94
$94/BD23 8D 6C 59    STA $596C
$94/BD26 A2 31 A4    LDX #$A431     ; Set GUI Color Scheme pointer (= $94/A431)
$94/BD29 8E 6D 59    STX $596D
$94/BD2C A9 94       LDA #$94
$94/BD2E 8D 6F 59    STA $596F
$94/BD31 AB          PLB            ; Restore Data Bank
$94/BD32 22 AA C9 80 JSL $80C9AA    ; Calculate new SRAM Checksum
$94/BD36 28          PLP            ; Restore Flag Register value
$94/BD37 6B          RTL

Bank $9F

$9F/FFF0 Address of the SPC program

This gets used at $80/8FF7. This is an UNNECESSARY LINE: It makes no sense why this address isn't directly loaded there. This must be a remnant of the development that was left the few bytes it saves would make no difference.

$9F/FFF0 00 80 9D                   ; SPC program is at $9D/8000


Internal Data for BS-X BIOS

ROM MapRAM MapText TableNotesTutorials