Hi, I've been reading about SRAM types on a very useful page by Sean Young: http://www.msxnet.org/tech/megaroms.html The question I had in mind was: Is a generic SRAM possible? And if it is, what would it look like? An important type of SRAM is the PAC SRAM. I don't think this one is a good target for generalization: 1. The access method is very exotic. Read the page and you'll know what I mean. 2. The contents will be saved in the .PAC format. This is the format used by the FM-PAC ROM to save the SRAM contents to disk. Sean suggested using this format in emulators as well and I agree. Then there is the GM2 SRAM. It is possible to generalize this one. But unlike the other types of SRAM, the GM2 SRAM is divided into banks (8K in 2 banks of 4K). I'm not sure whether generalization is useful here. That leaves the following SRAM types: 1. ASCII/8K with 8K SRAM 1A. SRAM in page #20 as used in Xanadu 1B. SRAM in page #80 as used in Royal Blood 2. ASCII/16K with 2K SRAM as used in Hydlide 2 These types do look a lot alike. We could decide not to generalize them because there are only 3 of them, but I think that if new SRAM cartridges are discovered, there is a pretty good chance they will look like these. So I'll present a way of generalizing them. I suggest you open Sean's page in your browser to understand the descriptions below. === ; Xanadu mapper ; This is a standard ASCII/8K mapper. Banksize=8 Initial[4000]=0 Initial[6000]=1 Initial[8000]=2 Initial[A000]=3 Register[6000/07FF]=4000 Register[6800/07FF]=6000 Register[7000/07FF]=8000 Register[7800/07FF]=A000 ; Xanadu SRAM ; We're using a generic SRAM ; Other valid types are PAC and GM2 (or "Game Master 2" in full?) SRAMType=Generic ; SRAM size is 8 kilobytes SRAMSize=8 ; SRAM is selected if a block number is written with bit 5 set ; (DF = ~20, which means that all other bits are ignored) ; SRAM can be read in any address range that has a mapper register assigned ; to it, for this game that's 4000-BFFF. SRAMBlock=20/DF ; SRAM can be written at 8000-BFFF ; The SRAM contents are mirrored to cover the entire range. SRAMWrite=8000/3FFF === For Royal Blood, it's the same as Xanadu, except for this line: SRAMBlock=80/7F === ; Hydlide 2 mapper Banksize=16 Initial[4000]=0 Initial[8000]=1 Register[6000/07FF]=4000 Register[7000/07FF]=8000 ; Hydlide 2 SRAM ; We're using a generic SRAM SRAMType=Generic ; SRAM size is 2 kilobytes SRAMSize=2 ; SRAM is located in block 10 ; We could write "10/00" instead, following the convention for the Register ; keyword that is equivalent to just "10". SRAMBlock=10 ; SRAM can be written at 8000-BFFF SRAMWrite=8000/3FFF === To Sean: Did I interpret the contents of your page correctly? I'd like some comments on the generic SRAM type. Also, if there is a cartridge using SRAM out there that wasn't covered above, I would very much like to hear it. Bye, Maarten -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
