Natsumi, a big thank you for pointing out the dc.l $0000 after the SRAM portion. That wasn't affecting the SRAM, but instead the region settings. Regardless, thank you for quickly pointing out that mistake
I also tested the ROM in BizHawk (neat emulator, btw, thanks for showing that to me!) and it worked before I made the changes to the header code.
Eke, that scan is exactly what I believe I needed.
Just to make sure I'm understanding all of this, and using that scan, for a typical 8KB SRAM, using battery backup, should be:
Code: Select all
dc.b 'RA', %1?1[Type]000, %00100000
dc.b $20000*, $20ABCD
A few questions about the random syntax:
The ?: In the scan, it mentions volatile and non-volatile RAM. Is battery backed SRAM considered non-volatile because it's backed up by a battery, or volatile because if the battery isn't present (or dead), the data is lost on power off? Maybe both depending if a battery is actually used or not? All of the examples I've seen use 111 and not 101, so I'm going to assume that it doesn't really matter and External/SRAM is always handled by code, or SRAM utilizing a battery is non-volatile.
[Type]: Depending on the SRAM configuration, it will either be ODD (11), EVEN (10), or WORD (00), typically. The exceptions would be games that use Serial EEPROMS (such as Evander Holyfield and Wily Wars; I also found Eke's document on Serial EEPROM's). A quick question about Serial EEPROMs: is the code to read and write to Serial EEPROM's the same as standard SRAM, and the hardware configuration deals with the different type, or is there more to it than that?
* and ABCD: The * would either be the odd or even byte, depending on the write mode, right? I suppose it really doesn't matter since if you're writing to the ODD byte, you can't use the even "0" address and have to start at 1 anyway, and if you're writing to the EVEN byte, then using an odd to start off with would just reduce the amount of SRAM available to you.
Now a question about setting the SRAM size - what is the proper way to calculate it? The example in the scan shows for 8k, the end address is $203FFF, a difference of 3FFF, which is 16383 in decimal, or 2 KB. Or is it really 16k, but since the example is using ODD, it's halved and referenced as 8k instead, which would really be 1 KB?
If I understand all of that right (or most of it), if I wanted to use a 256kb SRAM chip, the ending address would be $23FFFF, right?
Thanks for these noobish questions, I really appreciate it
One final question: For the region settings, do the letters have to be in a specific position, or order? For example, worldwide is JUE, but if I wanted just Europe, would it be 'E', or ' E', and if I wanted Japan and Europe, would it be "J E' or 'JE'?