| |
The map for the ramcart is something like this:
0x400000-0x4FFFFF - memory size register (read only)
0x600000-0x6FFFFF - SRAM (mirrored)
0x7FFFF0-0x7FFFFF - Write register (write 1 to make SRAM writeable)
To decode that I used a 74LS138 plus the partial decoding for higher lines done by the megadrive hardware (cart chip select signal, as you mentioned).
To decode 0x7FFFF0-F I used a pair of 8 input NAND (74LS30) ports "ORED" with a 74LS32, which is also used along a JK flip-flop (74LS74) to control the write protection register. This register is implemented so the bit gets set (no write) after the 68k get a reset pulse. I've been using this cart for a while now and it works fine ...
And the most curious thing about it is the fact it is a 128k SRAM cart, so it has doubled capacity over the original cart sold by sega. SCD bios support carts with size up to 512kb. It's just a matter of putting the correct ID in the ID register.
0/nothing=8k; 1=16k; 2=32k; 3=64k; 4=128k; 5=256k; 6=512k
7=error (_No Format is put on the screen). I believe that there's also a value for a 1m ram cart, but for being used as work ram for expansion (DRAM memory), but I didn't got much biased on testing this much, as a such type of expansion is near the useless as no game were ever made for using a such type of work ram expansion... 
|