It is currently Fri Oct 20, 2017 1:57 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: MMC3 RAM Protect
PostPosted: Tue Jul 05, 2016 2:02 pm 
Offline

Joined: Sun Jan 31, 2016 9:55 pm
Posts: 31
I'm working on implementing some save data using battery-backed PRGRAM. I understand that save data can be corrupted by the console during power off, which is why games like Zelda told you to hold down reset while turning the console off.

I'm using the MMC3, which has RAM protection facilities. The register $A001-$BFFF (odd) will only allow writes to RAM if its highest 2 bits are %10. I keep the RAM read-only by setting it to %11, and only enable writes when necessary. These bits are often ignored by emulators (FCEUX and Nintendulator do, Nestopia doesn't). Has anyone tested if this is enough to prevent the console from overwriting values in RAM? Or do I need to keep 3 copies of the data and checksums?

I'll run some tests with my EverDrive -- I believe that the way it implements battery-backed saves it is possible to corrupt it. I will check that first.


Top
 Profile  
 
 Post subject: Re: MMC3 RAM Protect
PostPosted: Tue Jul 05, 2016 2:26 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6286
Location: Seattle
PRG RAM corruption comes from the contents of the 2A03's bus going squirrelly when power is removed. It just takes a moment where +5V is slowly sinking, and some of the address lines are received as low just a little earlier, for a random read to become a write.

This is, unfortunately, probably not the sort of situation that you could model with the Everdrive or any other flashcart.

Is the MMC3 powered by the battery in the relevant cartridges? If it is, since PRG RAM /WE goes through the MMC3, then it seems likely that the "read only" state should be good enough to protect the RAM.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group