diff options
author | 2019-02-19 20:45:57 -0500 | |
---|---|---|
committer | 2019-02-19 20:47:39 -0500 | |
commit | b84397f786f177bc0e215a9d76f2454045ac71fa (patch) | |
tree | a17a732ed20c0fdfe2dc66bac1ed845d116e3020 | |
parent | f31246981ae185956bfe01710f3612a376a3000e (diff) |
Make -nonvram_save also inhibit saving of "battery" NVRAM for image devices
-rw-r--r-- | docs/source/commandline/commandline-all.rst | 3 | ||||
-rw-r--r-- | src/emu/diimage.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst index d7026de24b9..acbd9b50099 100644 --- a/docs/source/commandline/commandline-all.rst +++ b/docs/source/commandline/commandline-all.rst @@ -2412,7 +2412,8 @@ Core Misc Options Save the NVRAM contents when exiting machine emulation. By turning this off, you can retain your previous NVRAM contents as any current changes made will - not be saved. + not be saved. Turning this option off will also unconditionally suppress the + saving of .nv files associated with some types of software cartridges. The default is ON (**-nvram_save**). diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index ed0f6ae35f4..d6d0a5e5247 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -670,6 +670,10 @@ void device_image_interface::battery_load(void *buffer, int length, void *def_bu void device_image_interface::battery_save(const void *buffer, int length) { assert_always(buffer && (length > 0), "Must specify sensical buffer/length"); + + if (!device().machine().options().nvram_save()) + return; + std::string fname = std::string(device().machine().system().name).append(PATH_SEPARATOR).append(m_basename_noext.c_str()).append(".nv"); // try to open the battery file and write it out, if possible |