Difference between revisions of "SRAM"
m (fixed wikipedia link)
|Line 11:||Line 11:|
== External Links ==
== External Links ==
Latest revision as of 07:49, 20 March 2021
Many classic games use a battery powered SRAM to store progress data when the system is powered off. Also known as Static RAM, Save RAM, or Battery-backed RAM. Games like The Legend of Zelda for the NES, or Super Mario World on the SNES. This was before non-volatile flash based hardware was used to store data without needing a battery (think PlayStation memory card).
Due to the inevitable possibility of the battery dying and leading to corrupt data, most/all games that use SRAM to store game progress also employ code that performs a checksum on the data. This is often accomplished by adding all of the bytes together, and storing the resulting number in the SRAM. If any of the data were corrupted, the checksum would not match, and the game will often erase the save data completely and start over. Due to this, if editing a SRAM file, you must also know the checksum routine, and edit the checksum accordingly. If not, a modified SRAM file will show up as blank when loaded into a game. Each game is free to use their own checksum routine.
Since the SRAM is data written directly from the game itself, SRAM files (often ending with .srm) are compatible across most emulators and real hardware cartridges. SRAM differs from emulator savestates, which are unique to each emulator. Savestate files hold all of the data in all the different parts of the emulated system, plus various status registers that the emulator author needs to save. While SRAM holds only data that the game designers intended to save.
As a copy protection, Capcom used a battery-backed SRAM to store decryption keys for its CPS-2 system arcade games. Once the battery dies, and the decryption keys are lost, the game is no longer playable. Nowadays, there are fixes for this problem.
More non-ROM hacking specific information can be found at Wikipedia's Static_random-access_memory article.