Disclaimer: This document shall remain credit-free as its a compilation of the work of many people. Likewise it will probably not be maintained or updated by its original author. Please note that this information is only speculation and not guaranteed correct. ====================================================================== Background http://www.dmc.mq.edu.au/mwark/warchive/Mia/mia-video-games.html BS-X Cart We know that it has a 32KB SRAM + Battery, 512KB PSRAM, MMC, and R/W capabilities to the actual flash card. The cards are programmed for 16 Mbits. The MMC seems to have 11-14 R/W registers mapped at $01-$0E:5000. They seem to take values of either $00 or $80. The existence of $00,$09,$0A,$0B,$0F:5000 is unknown. $01 changes the ROM mapping between the flash card and the PSRAM. - Images 512KB or smaller (PartSize ROMs) are copied by the BIOS into the PSRAM region to probably avoid wearing down the contents of the card. - $00 = Card, $80 = PSRAM $02 maps the contents of $01 into LoROM / HiROM mapping. - A bit in the header tells the BIOS to flip the setting - $00 = LoROM, $80 = HiROM $03 is unknown. - It seems to enable a PSRAM mirror at $60-$6F:0000-FFFF. - It might enable a PSRAM mirror at $70-$77:0000-FFFF. - $00 = Off, $80 = On. $04 is unknown. - The BIOS does turn it off so it is used. $05 maps ROM to $40-$4F:0000-FFFF - $00 = PSRAM, $80 = ROM $06 maps ROM to $50-$5F:0000-FFFF - $00 = PSRAM, $80 = ROM $07 maps the LoROM BIOS to $00-$1F:8000-FFFF. - $00 = ROM, $80 = BIOS $08 maps the LoROM BIOS to $80-$9F:8000-FFFF. - $00 = ROM, $80 = BIOS $0C/$0D are used to access the flash hardware registers. - Turns on registers at $C0:0000,2AAA,5555 and $C0:FF00-FF1F $0E updates the memory map. - $80 = Commit $10-$17:5000-5FFF is 32KB SRAM. - $10-$15 stores code vectors and system information like time,gender,name. - $16-$17 is battery-backed RAM for use by the games. $20-$3F:5000-5FFF is empty. $20-$3F:6000-7FFF mirrors $70-$77:6000-7FFF PSRAM. $70-$77:0000-FFFF is 512KB PSRAM but could quite possibly be toggled by $03. $78-$7D is not PSRAM. Probably empty. $C0-$FF:0000-FFFF is the flash card or PSRAM as determined by $01. - The usage of 16Mbit mirroring is probably in force. ====================================================================== BS-X Modem It has registers from $2188-$219F. Communication is by the bus only. The unit contains a data and voice decoder -- SoundLink? 2188-2189 (r/w): Test register 218E-218F (r/w): Transmission number 2190 (r): Unknown [status register] 2191 (w): Strobe assertion register 2192 (w): Strobe negation register 2192 (r): Data register 2193 (r): Transmission status (Data ready when bits 2 and 3 clear) 2194 (w): Unknown 2199 (r/w): Unknown [modem protocol strings] 2192 Data format: ?? ?? ?? ?? ?? 01 01 00 00 00 cc aa bb ?? ?? ?? ?? ?? aa = minutes, bb = hours cc = seconds? Many games that use the modem poll St. Giga for the time ($2192). They each have their own starting times and react differently appropriately. As a side-note, a write to $218F affects it by: // ? BSX_Base.reg218E >>= 1; BSX_Base.reg218E = BSX_Base.reg218F - BSX_Base.reg218E; BSX_Base.reg218F >>= 1; If the games don't see the right value, they seem to assume that St.Giga is no longer functional. ======================================================================= BS Header and BIOS xFC0-xFCF = title xFD0-xFD3 = internal size (32MBit max) xFD4-xFD5 = ? xFD6 = month [4 bits], ? xFD7 = day [5 bits], ? xFD8 = hirom/lorom [8 bits?] (&0xef, ==0x20 --> LoROM) xFD9 = type [4 bits], ? (type&1 --> no SoundLink, else {$2197 |= 0x80}, type&2 --> PartSize {<1MB}) xFDA = maker xFDB = ? xFDC-xFDD = checksum xFDE-xFDF = inverse checksum Checksum: Sum all bytes in ROM minus header The BIOS has certain criteria to check for BS games: 1. Maker must be 0x33. 2. xFD4-xFD5 must not be 0x8000. 3. Checksum/Inverse must be good. The BIOS performs a full checksum calculation to verify the data before transferring control to it. You may see some writes to $C0:0000,2AAA,5555 which grants access to "subchannel" information about the card vendor and write priveleges. Once a game is loaded, the BIOS --somtimes-- marks the header as dirty: 1. Setting bit $80 of xFD5. 2. Setting bit $80 of xFD9. Hardware tests should be done at the town screen as zero BS-X activity is detected here. Bad dump I know that many BS images have bad headers, including Ancient Stone Tablets. Bad = BIOS won't load it. What could be causing the walls to go bad is largely debatable. Theory 1: Missing data Given that the cards are programmed for 8Mbits, it seems hard that there is more data not dumped. A checksum verification on 16/32Mbits takes a very long time on a 65816. Theory 2: Corrupt image It's possible that data needs to be uploaded to the PSRAM which I'm not detecting. We know that the header is bad but the contents of Marvelous work fine. The APU jumps to uninitialised space and eventually hits a stop command. Theory 3: Incorrect mapping I haven't seen anything on what's mapped at $48-$4F. It could be a ROM/PSRAM mirror. I tried playing around with the mirroring but came up with bad nametable results. I don't know of anyone who has it on flash. If someone does, trying it out on the real hardware would be nice.