From c108986639334be4f524964a5b5f377b6dab4e17 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Sun, 16 Apr 2017 13:08:57 -0400 Subject: More options refactoring This should address outstanding concerns with PR#2231. I'm trying to turn emu_options into a self contained structure that encapsulates behaviors related to options, including the gymnastics pertaining to image/slot loading and interactions with get_default_card_software() and "just works". When the MAME 0.186 development cycle starts up, I hope to take this further. I want to make core_options::entry an abstract base class so that the entries associated with image options and slot options can derive from it. This will eliminate the current need for emu_options to directly expose maps for image and slot options. For now, I'm in stabilization mode, and I hope to get things working for a stable 0.185 release. --- src/lib/util/options.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/lib/util/options.cpp') diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index 16b62f9c91f..b835d0fa681 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -565,9 +565,21 @@ std::string core_options::output_ini(const core_options *diff) const for (entry &curentry : m_entrylist) { const char *name = curentry.name(); - const char *value = name && override_get_value(name, overridden_value) - ? overridden_value.c_str() - : curentry.value(); + const char *value; + switch (override_get_value(name, overridden_value)) + { + case override_get_value_result::NONE: + default: + value = curentry.value(); + break; + + case override_get_value_result::SKIP: + continue; + + case override_get_value_result::OVERRIDE: + value = overridden_value.c_str(); + break; + } bool is_unadorned = false; // check if it's unadorned -- cgit v1.2.3-70-g09d2