SRAM

From Data Crystal
Revision as of 12:49, 20 March 2021 by Phonymike (talk | contribs) (fixed wikipedia link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Antiquity

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

Checksum

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.

Other Uses

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.

External Links

More non-ROM hacking specific information can be found at Wikipedia's Static_random-access_memory article.