From b84397f786f177bc0e215a9d76f2454045ac71fa Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 19 Feb 2019 20:45:57 -0500 Subject: Make -nonvram_save also inhibit saving of "battery" NVRAM for image devices --- docs/source/commandline/commandline-all.rst | 3 ++- src/emu/diimage.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2