From a72b3e4ae676858b3a79350912e6b627dd204b17 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 26 Dec 2017 14:04:39 -0500 Subject: [PATCH] Add option to disable saving NVRAM on exit --- src/emu/emuopts.cpp | 7 +++++-- src/emu/emuopts.h | 2 ++ src/emu/machine.cpp | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 0cb37e6895e..b14192119bc 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -51,7 +51,7 @@ const options_entry emu_options::s_option_entries[] = // output directory options { nullptr, nullptr, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" }, { OPTION_CFG_DIRECTORY, "cfg", OPTION_STRING, "directory to save configurations" }, - { OPTION_NVRAM_DIRECTORY, "nvram", OPTION_STRING, "directory to save nvram contents" }, + { OPTION_NVRAM_DIRECTORY, "nvram", OPTION_STRING, "directory to save NVRAM contents" }, { OPTION_INPUT_DIRECTORY, "inp", OPTION_STRING, "directory to save input device logs" }, { OPTION_STATE_DIRECTORY, "sta", OPTION_STRING, "directory to save states" }, { OPTION_SNAPSHOT_DIRECTORY, "snap", OPTION_STRING, "directory to save/load screenshots" }, @@ -200,6 +200,10 @@ const options_entry emu_options::s_option_entries[] = { OPTION_RAMSIZE ";ram", nullptr, OPTION_STRING, "size of RAM (if supported by driver)" }, { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" }, + { OPTION_LANGUAGE ";lang", "English", OPTION_STRING, "display language" }, + { OPTION_NVRAM_SAVE ";nvwrite", "1", OPTION_BOOLEAN, "save NVRAM on exit" }, + + { nullptr, nullptr, OPTION_HEADER, "SCRIPTING OPTIONS" }, { OPTION_AUTOBOOT_COMMAND ";ab", nullptr, OPTION_STRING, "command to execute after machine boot" }, { OPTION_AUTOBOOT_DELAY, "0", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" }, @@ -207,7 +211,6 @@ const options_entry emu_options::s_option_entries[] = { OPTION_PLUGINS, "1", OPTION_BOOLEAN, "enable LUA plugin support" }, { OPTION_PLUGIN, nullptr, OPTION_STRING, "list of plugins to enable" }, { OPTION_NO_PLUGIN, nullptr, OPTION_STRING, "list of plugins to disable" }, - { OPTION_LANGUAGE ";lang", "English", OPTION_STRING, "display language" }, { nullptr, nullptr, OPTION_HEADER, "HTTP SERVER OPTIONS" }, { OPTION_HTTP, "0", OPTION_BOOLEAN, "HTTP server enable" }, diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 60de574bb22..e079b7082f1 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -168,6 +168,7 @@ #define OPTION_UI_FONT "uifont" #define OPTION_UI "ui" #define OPTION_RAMSIZE "ramsize" +#define OPTION_NVRAM_SAVE "nvram_save" // core comm options #define OPTION_COMM_LOCAL_HOST "comm_localhost" @@ -444,6 +445,7 @@ public: const char *ui_font() const { return value(OPTION_UI_FONT); } ui_option ui() const { return m_ui; } const char *ram_size() const { return value(OPTION_RAMSIZE); } + bool nvram_save() const { return bool_value(OPTION_NVRAM_SAVE); } // core comm options const char *comm_localhost() const { return value(OPTION_COMM_LOCAL_HOST); } diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index 76db56ce02d..1199d2e6f9e 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -372,7 +372,8 @@ int running_machine::run(bool quiet) // save the NVRAM and configuration sound().ui_mute(true); - nvram_save(); + if (options().nvram_save()) + nvram_save(); m_configuration->save_settings(); } catch (emu_fatalerror &fatal)