Mad-1 discrete logic replacement-new thread

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Markfrizb
Posts: 512
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: Mad-1 discrete logic replacement-new thread

Post by Markfrizb » Sat Mar 30, 2013 8:31 am

So are you saying that the mad1 is nothing more than a 139 and SRAM back up .... That's it?

I thought there was more to it than that.....


Mark

tepples
Posts: 21885
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mad-1 discrete logic replacement-new thread

Post by tepples » Sat Mar 30, 2013 8:58 am

Markfrizb wrote:So are you saying that the mad1 is nothing more than a 139 and SRAM back up .... That's it?
The first couple Sunsoft mappers were just a couple 7400 series parts in one package. Perhaps the secret sauce is in the SRAM protection circuit.

User avatar
getafixx
Posts: 364
Joined: Tue Dec 04, 2012 3:28 pm
Location: Canada

Re: Mad-1 discrete logic replacement-new thread

Post by getafixx » Sat Mar 30, 2013 8:11 pm

Markfrizb wrote:So are you saying that the mad1 is nothing more than a 139 and SRAM back up .... That's it?

I thought there was more to it than that.....
Honestly, it doesn't appear to be anything special, just look at its pinout. When you look at the early carts, with the LS139 and the D2145U chip (or other variant), they could technically handle most of the games out there that used standard boards. It just made sense for Nintendo to combine the 2 chips together into one, cutting down on costs and space required in the cart.

So far all the HiROM games that I've tested have worked perfectly (up to 48Mbit), and I anticipate no problems when trying this with a LoROM cart, as it should be basically the same setup (aside from slight rewiring on the '139...yet to be tinkered with).

Now the only thing is to find a more feasible battery controller, as the BA6162 is another one of those obsolete parts. Mark had mentioned the MAX795T chip to me before, which would work perfectly, but it is a little expensive at almost $6 each (sometimes they can be found cheaper on eBay). If I find anything super cheap, and easy to come by, I will necro this post to share it.

User avatar
infiniteneslives
Posts: 2099
Joined: Mon Apr 04, 2011 11:49 am
Location: WhereverIparkIt, USA
Contact:

Re: Mad-1 discrete logic replacement-new thread

Post by infiniteneslives » Sat Mar 30, 2013 8:20 pm

getafixx wrote:Now the only thing is to find a more feasible battery controller, as the BA6162 is another one of those obsolete parts.
They aren't obsolete, but do apparently have large minimum qty. Digikey PN BA6162-ND (use the PN if the link doesn't work...) There are quite a few other battery backup chips available though if one knew exactly how to deem a chip worthy. Those MAX795T are pretty spendy given the simple function...
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers

User avatar
getafixx
Posts: 364
Joined: Tue Dec 04, 2012 3:28 pm
Location: Canada

Re: Mad-1 discrete logic replacement-new thread

Post by getafixx » Sat Mar 30, 2013 8:42 pm

They aren't obsolete, but do apparently have large minimum qty
Well thats kind of it. How many people would be willing to buy 2000 of those chips at once? I know I wouldn't :wink:

I will try and experiment with a few different kinds, and see what i find. Now that I know the proof-of-concept works, its just a matter of finding something compatible.

Markfrizb
Posts: 512
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: Mad-1 discrete logic replacement-new thread

Post by Markfrizb » Sat Mar 30, 2013 8:55 pm

The STM795 (equiv of max 795) is a lot cheaper. I think mouser sells them for $2.38 or close to it...

My question about the mad1's is: all the older carts that are 16m (2x8mbit roms) or smaller, they used the 139.
Anything bigger than 16mbit, the mad1 is used. Mario all stars is a good example. While I question if a 139 + max795 = a mad1, I hope this is true. :)

User avatar
getafixx
Posts: 364
Joined: Tue Dec 04, 2012 3:28 pm
Location: Canada

Re: Mad-1 discrete logic replacement-new thread

Post by getafixx » Sat Mar 30, 2013 9:13 pm

Markfrizb wrote:Anything bigger than 16mbit, the mad1 is used. Mario all stars is a good example.
Au contraire. I have a copy of Mario Allstars here, board SHVC-2A3B-01, which uses 2 rom chips, an LS139 chip.

Pic of board here, using no MAD-1 chip:

http://www.snescentral.com/0/8/8/0881/SHVC-H5-0.jpg

Markfrizb
Posts: 512
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: Mad-1 discrete logic replacement-new thread

Post by Markfrizb » Sat Mar 30, 2013 9:40 pm

getafixx wrote:
Markfrizb wrote:Anything bigger than 16mbit, the mad1 is used. Mario all stars is a good example.
Au contraire. I have a copy of Mario Allstars here, board SHVC-2A3B-01, which uses 2 rom chips, an LS139 chip.

Pic of board here, using no MAD-1 chip:

http://www.snescentral.com/0/8/8/0881/SHVC-H5-0.jpg

That is my point.... All stars is 16m (2x8) and is not using mad1.
Show me a board that is bigger than 16m using a 139 with SRAM......

lidnariq
Posts: 9136
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Mad-1 discrete logic replacement-new thread

Post by lidnariq » Sun Mar 31, 2013 1:54 am

Depending on relative costs, something like this simple PNP BJT circuit:
exact resistors depend on bjt
exact resistors depend on bjt
power-fail-detection.png (788 Bytes) Viewed 6004 times
might well be cheaper than a "real" battery detection circuit. It could be directly connected to a 6264's +CE input, or an extra 74HC138/9 could be used to convert it for a RAM with only one select.

Power switchover is something I'd need to think about more, but the ba6162 appears fairly simple.

The big difference in behaviors seems to be that the ba6162 provides hysteresis.

User avatar
getafixx
Posts: 364
Joined: Tue Dec 04, 2012 3:28 pm
Location: Canada

Re: Mad-1 discrete logic replacement-new thread

Post by getafixx » Sun Mar 31, 2013 8:11 am

Markfrizb wrote:That is my point.... All stars is 16m (2x8) and is not using mad1.
Show me a board that is bigger than 16m using a 139 with SRAM......
Oh I see, I figured you were saying it uses the MAD-1. Later revisions of that board did use it, once Nintendo started using that decoder in all their boards. Also, in all fairness, the SNES didn't really start releasing games larger than 16M until 93-94 (AFAIK), and by then had already come out with the MAD-1.

The functions of the MAD-1, as it looks, is an Address Decoder, SRAM controller, and a (2x) ROM Decoder all built into one. So, if you split the functions between 1 or 2 LS139 decoders and an SRAM controller, all you're doing is using 2-3 chips instead of one...still looks like it was just a space and cost saving measure to me.

Mark, what other functions do you figure the MAD-1 had? Do you see a reason why this setup with the '139 couldn't work?

tepples
Posts: 21885
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mad-1 discrete logic replacement-new thread

Post by tepples » Sun Mar 31, 2013 9:30 am

getafixx wrote:How many people would be willing to buy 2000 of those chips at once? I know I wouldn't :wink:
Perhaps if people would develop high-quality NES games that are long enough to need battery save, bunnyboy might be willing to keep them in stock on retrousb.com.

Perhaps the bigger (over 16 Mbit) games were also later games, manufactured after the MAD-1 was designed. And perhaps it had to do with the fact that PRG RAM had to be decoded specially so as not to overlap PRG ROM.

User avatar
infiniteneslives
Posts: 2099
Joined: Mon Apr 04, 2011 11:49 am
Location: WhereverIparkIt, USA
Contact:

Re: Mad-1 discrete logic replacement-new thread

Post by infiniteneslives » Sun Mar 31, 2013 9:35 am

lidnariq wrote: Power switchover is something I'd need to think about more, but the ba6162 appears fairly simple.
I know the ba6162 gets more fancy, but shouldn't a pair of Schottky diode should be sufficient?
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers

User avatar
whicker
Posts: 228
Joined: Sun Dec 13, 2009 11:37 am
Location: Wisconsin

Re: Mad-1 discrete logic replacement-new thread

Post by whicker » Sun Mar 31, 2013 11:17 am

infiniteneslives wrote:
lidnariq wrote: Power switchover is something I'd need to think about more, but the ba6162 appears fairly simple.
I know the ba6162 gets more fancy, but shouldn't a pair of Schottky diode should be sufficient?
No, because of the chip select blocking to avoid data corruption. You want to avoid writes during Reset/powerup and powerdown.

Yes anybody can come up with a pullup and pulldown resistor and diode solution, but it would drain the battery much, much faster.

Nintendo learned first-hand of save data corruption on the NES, and I'm sure their management wanted to progress from some boilderplate statement of "hold reset while powering off the unit" to avoid save data corruption. I wonder how many children got into slapping fights because their friend "stupidly" didn't hold reset while powering off :)

Markfrizb
Posts: 512
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: Mad-1 discrete logic replacement-new thread

Post by Markfrizb » Sun Mar 31, 2013 11:19 am

getafixx wrote:
Markfrizb wrote:That is my point.... All stars is 16m (2x8) and is not using mad1.
Show me a board that is bigger than 16m using a 139 with SRAM......
Oh I see, I figured you were saying it uses the MAD-1. Later revisions of that board did use it, once Nintendo started using that decoder in all their boards. Also, in all fairness, the SNES didn't really start releasing games larger than 16M until 93-94 (AFAIK), and by then had already come out with the MAD-1.

The functions of the MAD-1, as it looks, is an Address Decoder, SRAM controller, and a (2x) ROM Decoder all built into one. So, if you split the functions between 1 or 2 LS139 decoders and an SRAM controller, all you're doing is using 2-3 chips instead of one...still looks like it was just a space and cost saving measure to me.

Mark, what other functions do you figure the MAD-1 had? Do you see a reason why this setup with the '139 couldn't work?

I honestly don't know but I did look at the MAD1 Truth table from NOCASH's site and it didn't look like the 139's truth table.....

tepples
Posts: 21885
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mad-1 discrete logic replacement-new thread

Post by tepples » Sun Mar 31, 2013 12:00 pm

whicker wrote:Nintendo learned first-hand of save data corruption on the NES, and I'm sure their management wanted to progress from some boilderplate statement of "hold reset while powering off the unit" to avoid save data corruption.
Then perhaps the permanent solution is to find some unused area of flash twice as big as the SRAM, copy that area to SRAM on power-on, and copy SRAM to flash whenever the game saves. I say "twice as big" to work around the possibility of power loss while copying.

Post Reply