Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SRAM: Do not save SRAM if unmodified.
Previously SRAM always created a file in the `persistent` folder, even if its initial contents were never modified. This change only creates the file if the SRAM contents are actually modified. A case where this was particularly bothersome are mappers backed by Flash ROM. It would copy the passed ROM to SRAM and then persist it, and the next time you ran openMSX with an updated ROM (e.g. during development) it would ignore its contents entirely. The user has to manually delete the SRAM file. With this change, the latter situation can still occur, but only if the Flash ROM is being written to (e.g. for a savegame). Also remove the ”SRAM file not found, assuming blank content” message, since it is quite noisy in general and in this case would show up even more frequently. In the future if we would want to reintroduce a message of some kind to indicate the creation of a persistent file, we could consider setting a flag when FileNotFoundException occurs, and then in `SRAM::write()` check for that flag and print a message about creating the SRAM file.
- Loading branch information