I'm trying to make my own carts for 27c160/27c322 EPROM at the moment (flash will follow once SRAM works) with battery backup function. While the carts itself work fine, the SRAM doesn't.
I'm trying to use a 74LS139, Capacitors, Diodes, Resistors and of course the CR2032 battery.
This is for LoROM but it doesn't work. Super Metroid for example gives me the Anti Piracy screen cause it can't find the SRAM.
Is there another way to do this? I've read about MAX795/STM795 or even BA6162 but those are nearly impossible to obtain nor would I know how to work with them properly.
Logic attached as an image.
I mean, that's a fine connection.
Is the correct memory region when A15 and /ROMSEL are low, A20 and A21 are high? (I guess that's what nocash says)
Anyway, using a "real" battery controller won't help things if the game can't even find the RAM. A "real" battery controller should only help if you're losing data on power failure.
Usually I never had any problems saving the games (tested Legend of Zelda and various SMW Hacks) when wiring the 74LS139 like this on original boards to allow games up to 32MBit (using 27c322) to be saved on the 64KB SRAM found on SHVC-1A3B-XX boards with just a 32 pin MaskROM.
I will test that tomorrow and see if A20 and A21 are high and A15 and /ROMSEL are low.
Though, the 1A3B board series had a transistor on board. Could that be the problem in my logic?
Interestingly, the 1A3B-01 doesn't have the BJT, although all the later ones do. Not clear what it's doing without a picture of the back.
I wrote a memory explorer for the SNES some number of months ago. You could use it to make sure that the RAM is where you believe it should be (instead of open bus) Use all twelve buttons on controller 1 to change the view window.
Note: this program actually tries to show the SST39 Identification page, by writing the correct unlock sequence to ROM. It shouldn't be a problem if you're either not using Flash, or if you disconnect /WR while using it.
I think I got 1A3B-01 and later revisions here. Have to check.
As for your program, I will test that as well but how would I press all 12 buttons? I mean, how to press all 4 D-Pad buttons at once?
Anyway, I was able to get a SHVC-1A3B-XX board. Sadly I didn't find any 01 revisions without transistor.
My scanner didn't like them so I had to take a picture. Hope this helps with the transistor logic.
The BJT is an NPN (2SC2021) (C=+5V, B=R3, E=R2) in common-collector configuration (voltage buffer/current amplifier)
R2 pulls down RAM pin 26 (+CE).
R3 goes to /RESET (cart pin 26)
In other words, rather than just being
Code: Select all
/RESET ----+--- SRAM +CE | 100k | gnd
Code: Select all
+5v | |/ /RESET ---100k---| |↘ +-- SRAM +CE | 1k | gnd
Hm, interesting. Might give that 2SC2021 a chance and see if it changes anything as well as adjusting the connections properly.
Will report back later how it went.
Connected it like an original 1A3B but I must be something missing.
Also added the 10nF capacitor to the 74'139 as it was causing problems without one on other games but still no change.
Here's how I wired it:
- ram.png (9.45 KiB) Viewed 4758 times
In Super Metroid (JU), there's code starting at ROM 0x698 to copy 8K of cart RAM (from 0x700000) to SNES-internal RAM, then clears cart RAM, then fills the cart RAM mirror at at 0x702000 with garbage, then makes sure it can read the same garbage from 0x700000 (and here's when the anti-piracy warning would pop up), and finally copies the backup back to cart RAM.
It then calls a routine at ROM 0x80A0 (5a22 0x8180a0) to calculate the checksum of each of the save slots... and calls a routine at ROM 0x286 to initialize a save slot ... and after that "1994" should appear.
Also dumped the game with an Arduino Cart Dumper from sanni. Same results. No byte differences.
I don't think it's the ROM now. I'm sure I'm missing something but I have yet to find out what.
I will send you pictures of the current PCB. Maybe the error can be found that way.
EDIT: I mean it's unlikely but maybe I got 2 faulty RAMs here? Or can the EPROM still be defective even if I can dump the game just fine?
Either way, I will try a new board as well.
EDIT2: Just noticed I grounded 27c322's /CE line. I added it back to SNES /CE line as well as RAM /OE but still freezes after the Nintendo logo. I'm starting to get lost here but I don't want to give up either. :'(