MAD-1 Replacement SRAM Battery Backup?

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

I've read many topics but in the end I never found a solution.

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.
Attachments
sram.png
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: MAD-1 Replacement SRAM Battery Backup?

Post by lidnariq »

I'm a little confused as to why your SRAM is labeled with pin 26 as /RESET (instead of +CE)

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.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

Oh, just disregard the labeling. It is indeed CE2 or +CE as you name it. :P

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?
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: MAD-1 Replacement SRAM Battery Backup?

Post by lidnariq »

Super Metroid was on BA3M... no transistor there.

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)
snes-memory-browser.zip
(2.08 KiB) Downloaded 300 times
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.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

I assume the transistors helps with battery backup. I can scan a 1A3B-XX front and back later.
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? :P
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: MAD-1 Replacement SRAM Battery Backup?

Post by lidnariq »

I meant each of the twelve buttons increases or decreases one of the six hexadecimal digits of the 24-bit address :P
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

Got it, lol.

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.
Attachments
IMG_2807.JPG
IMG_2806.JPG
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: MAD-1 Replacement SRAM Battery Backup?

Post by lidnariq »

Wait a moment, I have three games (FF2us, LoZ:LttP, SMAS) on 1A3B. I don't need pictures...
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
It's instead

Code: Select all

                  +5v
                   |
                 |/
/RESET ---100k---|
                 |↘
                   +-- SRAM +CE
                   |
                  1k
                   |
                  gnd
but I can only guess why the difference. (time constant of the pulldown?)
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

Ah, okay. Didn't know if you had carts so I wanted to make sure.

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.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

Okay, no matter how I solder it, the SRAM won't be recognized. Even tried a new one.

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:
Attachments
ram.png
ram.png (9.45 KiB) Viewed 7433 times
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: MAD-1 Replacement SRAM Battery Backup?

Post by lidnariq »

For the moment, why don't you try entirely disabling the battery backup circuitry, and just connect the SRAM's Vcc and +CE to +5V directly? There's two variables here, and I'm not certain whether they've been decoupled.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

Will try that later.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

Alright, connected VCC and CE+ directly to 5V.
Nintendo logo appears, no anti piracy screen, just a black screen. But it doesn't go on.
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: MAD-1 Replacement SRAM Battery Backup?

Post by lidnariq »

... I think there might be something wrong with your ROM?

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.
Ice Man
Posts: 547
Joined: Fri Jul 04, 2014 2:34 pm

Re: MAD-1 Replacement SRAM Battery Backup?

Post by Ice Man »

I dumped the game using a Retrode, checksum matches. Game works fine. No byte differences to the original ROM.
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. :'(
Post Reply