-
Notifications
You must be signed in to change notification settings - Fork 17
Description
The problem
SRAM and "status" saves are currently registered according to the app's title, which is derived from the ROM file's filename. However, this can lead to confusion when different cartridges wind up being given the same title.
For instance, I have Family BASIC in multiple versions. Two of the filenames I have are Family BASIC (Japan) (v3.0).nes, and Family BASIC (Japan) (v2.0a).nes. Both of these, when dropped onto Nesemu, will be given the title "Family Basic"; however, their memory is not compatible. The automatic writing of the sram of one, is liable to corrupt the sram of the other. If I choose the "Save status" menu item in one of them, that save state becomes available via "Load status" in the other; but they are not compatible (Family BASIC v2 will throw an exception if loading the status saved by v3, and emulation for all open apps will cease. The window manager functions will remain responsive, however.)
Similar issues exist for other titles; I often have different ROM editions for the same game, perhaps for two different countries. The countries will appear in the filename in parenthesis (and therefore will be removed from the app title). Usually the two ROMs will be very similar, but it is still very possible for sram corruption (and, especially, save state corruption) to occur.
Proposed fix
I'd like to move away from using the title in the StorageUtil keys, and instead use the value of cartridge.calcHashValue() to derive a key. This is expected to drastically decrease the chances of differing cartridges from sharing the same data.
(I'm happy to do the work on this myself; but I wanted to get your thoughts first.)