summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/diimage.cpp')
-rw-r--r--src/emu/diimage.cpp4
1 files changed, 4 insertions, 0 deletions
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