diff options
author | 2017-04-16 13:08:57 -0400 | |
---|---|---|
committer | 2017-04-16 13:08:57 -0400 | |
commit | c108986639334be4f524964a5b5f377b6dab4e17 (patch) | |
tree | 46f0f1d801db80b39f106a3090ad0593540420fa /src/lib/util/options.cpp | |
parent | f451ebd5f71884da575f8c20c29fdf3792e6c89c (diff) |
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.
Diffstat (limited to 'src/lib/util/options.cpp')
-rw-r--r-- | src/lib/util/options.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
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 |