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.
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.