Help with SNES Jurassic Park save patch

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.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Help with SNES Jurassic Park save patch

Post by Fisher »

Memblers wrote: Wed Nov 02, 2022 4:19 pm At this point, I would look into the code,
That's what I was afraid of.

Is the FXPAK test made by Ziggy587 any evidence that I may have something wrong with the modification?
If so, what could work on the FXPAK and not on the repro?
A different memory mapping perharps?

Looks like it's time to try some debugging skills.
What emulator is recommended? MesenS?
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Help with SNES Jurassic Park save patch

Post by Fisher »

It looks like the author was kind to share his work on DropBox.
Unfortunately, I don't know if it should work with real hardware, nor how to fix it and apply it to the ROM. :roll:
Can someone please take a look and see if the code is fine and if there's some hardware problem?
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Help with SNES Jurassic Park save patch

Post by Memblers »

Nice, that's easier than disassembling. It is validating save data, 16-bit checksum. That should be good enough for this use.

Looks like the problem is the RAM size. You have a 256kBit (32kByte) RAM. But it's using more RAM than that, save slots 1 and 2 are in bank $70, and slot 3 ends up in bank $71. Nocash SNES specs shows lowROM carts having BRAM at $0000-$7FFF, 32kB.

So it makes sense now why it messing up for you, it's basically wrapped/mirrored and corrupting itself.

I don't know the SNES cart interface well enough, maybe someone else can recommend the best way to expand BRAM on that board.

Code: Select all

!SaveFile1Start = !SRAM+$8C							; Save file 1's data
!SaveFile2Start = !SaveFile1Start+(!SaveFileSize*$01)+$02			; Save file 2's data
!SaveFile3Start = ((!SaveFile1Start+(!SaveFileSize*$02)+$04)&$FF7FFF)+$010000	; Save file 3's data
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Help with SNES Jurassic Park save patch

Post by Fisher »

Oh, that's it!
Thanks, Memblers!!

In the documentation, the author says it needs at least 64k for a single file.
Looks like he means 64 Kbytes! :shock:
Yeah, I've found an SRAM file on GBATemp that's 128 Kbytes.
So I'll need to expand the SRAM instead of shrinking it.

I have a few ideas I can try, probably adding a bigger SRAM ignoring A15, just as a LoROM, may do the trick.
But I would love if someone with better knowledge than me could confirm this or suggest a better solution.
Markfrizb
Posts: 607
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: Help with SNES Jurassic Park save patch

Post by Markfrizb »

There are a few Snes/SFC games that used 512k and even 1mB of sram. It’s handy that the OEM Lo map carts (it’s a SFC horse race game) with the 512k sram is also pinned for 1mB sram. So it’s easily swapped to 1mB as-is). Alliance makes a good low power sram AS6C1008 would do the job.

It’s pinning of the A15&A16 sram addresses, they are linear with the roms pinning in case you want to modify a different cart.
User avatar
Ziggy587
Posts: 174
Joined: Fri Oct 08, 2010 6:08 pm
Location: NY, USA

Re: Help with SNES Jurassic Park save patch

Post by Ziggy587 »

Annoying, it seems like AS6C1008 is the only real choice anyway. As far as what I can find currently available on DigiKey/Mouser, in terms of something that's 5v tolerant with an ultra low standby current draw. There's other 5v parts available, but AS6C1008 is the only one I can find that has a 1 μA current rating in standby mode. Or am I missing any other choices? I made an adapter board around another SRAM model, but realized the current draw in standby is too high. The next lowest current draw I could find was 15 μA, which would be only about 1.5 years (compared to the AS6C1008's 25 years). At least, that's all I could find for capacities 256k or more.

Voultar's Super RAMJOB might be perfect for your Jurassic Park cart, since it's meant to upgrade the 256k onboard SRAM to 1 Meg using the AS6C1008.

https://oshpark.com/shared_projects/bP8Mftis
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Help with SNES Jurassic Park save patch

Post by Fisher »

Thanks guys!
I've found an Amic LP621024D-70LL SRAM on a board that was going to be discarded.
Not sure if it's a good option, stand by power consumption should be aroud 50 ua, but it's what I have for now.
Had put it on place of the old chip insulating the upper pair of pins of each row and the CE2 pin, that I've plugged into the cart's Vcc, plugging the Vcc from the MAD chip straight into the SRAM's Vcc.

Connected A15 and A16 following the ROM pins as confirmed.
Here's a badly taken picture of the mess:
20221104_235311.jpg
Hopefully I did connect the CE2 pin correctly and the battery won't be drained by tomorrow.

Did a quick play and it seems fine.
I think it needs more testing, but seems ok.
20221104_235446.jpg
Did a 0% try and the last save isn't corrupted.
It also wasn't lost after powering off for a while and powering on again.

So my only doubt by now is about CE2, should I leave it on the cartridge's Vcc, connect it to the main Vcc that comes from the MAD or other thing?
User avatar
Ziggy587
Posts: 174
Joined: Fri Oct 08, 2010 6:08 pm
Location: NY, USA

Re: Help with SNES Jurassic Park save patch

Post by Ziggy587 »

You'll have to read the datasheet for the SRAM that you're using to confirm how to control CE2, but I don't think you can leave it permanently connected high or low.

https://mousebitelabs.com/2019/05/18/cu ... tion/#sram

The above link explains it well. You need a transistor so that CE2 can be high during normal operation but pulled low when the console is powered off. You need CE2 pulled low so the SRAM will enter its standby mode which draws the least amount of current.

By the way, if your current draw is 50 μA then a 220 mAh CR2032 will only last about 6 months.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Help with SNES Jurassic Park save patch

Post by Fisher »

Ziggy587 wrote: Sat Nov 05, 2022 7:49 am You'll have to read the datasheet for the SRAM
Ok, I took a look at the datasheet, let's see if I got it right:
Captura de tela em 2022-11-05 14-52-25.png
It talks about standby mode, not data retention, which should be different.
But it looks like I either should pull /CE1 high or CE2 low without caring about the other.
Ziggy587 wrote: Sat Nov 05, 2022 7:49 am You need a transistor so that CE2 can be high during normal operation but pulled low when the console is powered off. You need CE2 pulled low so the SRAM will enter its standby mode which draws the least amount of current.
Thank you. That's a very nice explanation, but doesn't the MAD chip already does something like that?
I'll try to find a 6264 board and check the CE2 pin, I think they should function more or less the same.

This table tells about the data retention current:
Captura de tela em 2022-11-05 14-50-33.png
If I did get it correctly, the current should be 2μA which would give about 12 years, correct?

And this one talks about the stand-by mode current:
Captura de tela em 2022-11-05 15-07-41.png
It's not clear to me what differentiates one mode from the other, maybe the Vcc voltage?
In this mode, the battery should last a lot less, as stated by Ziggy587.

Maybe adding 2 AA batteries to the cartridge should be a good idea? :D
But I think the best solution should be a FeRAM...

So thank you guys and please, help to correct me if I'm not getting everything correctly.
Thanks in advance.
Markfrizb
Posts: 607
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: Help with SNES Jurassic Park save patch

Post by Markfrizb »

You’ll have a hard time finding a 1mB 5v Fram.
Connect the CE2 line to reset (cart edge 26) or MAD1 pin9.

It’s like a “power good” indicator. The carts with 64k on it are pinned this way but since a 256k sram doesn’t have a CE2, it won’t be pinned on a 2A5M pcb. Nintendo did this to help with sram power-on/off corruptions. The Alliance sram is one of the best.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Help with SNES Jurassic Park save patch

Post by Fisher »

Markfrizb wrote: Sat Nov 05, 2022 11:58 am You’ll have a hard time finding a 1mB 5v Fram.
Yeah, the 1mb ones I've found uses the SPI bus.
The biggest one I've found is 256kb.
Not a really bad idea to make a board with 4 ICs, 2 on each side and a demux, but since this one is a one-off and I really can't spend much money on my hobby I'm leaving this as a suggestion to someone else who may have the same idea.
Markfrizb wrote: Sat Nov 05, 2022 11:58 am Connect the CE2 line to reset (cart edge 26) or MAD1 pin9.
Although it seems to be working fine, I did as suggested,
WhatsApp Image 2022-11-06 at 15.58.15.jpeg
I think I could make that wire less visible, but not without removing at least 1 chip.
Since I think I've already stressed enough this PCB, I'm leaving it this way.
Better be safe than sorry!
Not sure if the size of the wire would cause some weird or strange problem, but let's see what happens after a while...

So it all seems perfectly fine for now.
It's time to finally finish this game!!
Thank you, guys!
You're awesome!!
Post Reply