diff options
author | 2013-02-21 19:56:46 +0000 | |
---|---|---|
committer | 2013-02-21 19:56:46 +0000 | |
commit | 742f7e2ff573ef7f76af3463168d84e3b86eeaae (patch) | |
tree | 357e73011a65a2e96a9c2099725dbb19b35b9fba | |
parent | 0bd44ef97909589fa782db93e16c894790ac4519 (diff) |
Don't save out internally determined settings to .ini files. (nw)
-rw-r--r-- | src/emu/emuopts.c | 3 | ||||
-rw-r--r-- | src/lib/util/options.c | 37 | ||||
-rw-r--r-- | src/lib/util/options.h | 2 |
3 files changed, 24 insertions, 18 deletions
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index b4cb4522071..6109d8ca21e 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -236,6 +236,7 @@ bool emu_options::add_slot_options(bool isfirst) for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next()) { if (slot->fixed()) continue; + bool all_internal = slot->all_internal(); // first device? add the header as to be pretty if (first && isfirst) { @@ -252,7 +253,7 @@ bool emu_options::add_slot_options(bool isfirst) // add the option entry[0].name = slot->device().tag() + 1; entry[0].description = NULL; - entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE; + entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE | all_internal ? OPTION_FLAG_INTERNAL : 0; entry[0].defvalue = (slot->get_slot_interfaces() != NULL) ? slot->get_default_card() : NULL; add_entries(entry, true); diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 1182550fb36..d89ef85190a 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -512,25 +512,28 @@ const char *core_options::output_ini(astring &buffer, const core_options *diff) // otherwise, output entries for all non-command items else if (!curentry->is_command()) { - // look up counterpart in diff, if diff is specified - if (diff == NULL || strcmp(value, diff->value(name)) != 0) + if ( !curentry->is_internal() ) { - // output header, if we have one - if (last_header != NULL) + // look up counterpart in diff, if diff is specified + if (diff == NULL || strcmp(value, diff->value(name)) != 0) { - if (num_valid_headers++) - buffer.catprintf("\n"); - buffer.catprintf("#\n# %s\n#\n", last_header); - last_header = NULL; - } - - // and finally output the data, skip if unadorned - if (!is_unadorned) - { - if (strchr(value, ' ') != NULL) - buffer.catprintf("%-25s \"%s\"\n", name, value); - else - buffer.catprintf("%-25s %s\n", name, value); + // output header, if we have one + if (last_header != NULL) + { + if (num_valid_headers++) + buffer.catprintf("\n"); + buffer.catprintf("#\n# %s\n#\n", last_header); + last_header = NULL; + } + + // and finally output the data, skip if unadorned + if (!is_unadorned) + { + if (strchr(value, ' ') != NULL) + buffer.catprintf("%-25s \"%s\"\n", name, value); + else + buffer.catprintf("%-25s %s\n", name, value); + } } } } diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 8d8ea78a303..28e478afb73 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -70,6 +70,7 @@ const int OPTION_PRIORITY_NORMAL = 100; // normal priority const int OPTION_PRIORITY_HIGH = 150; // high priority const int OPTION_PRIORITY_MAXIMUM = 255; // maximum priority +const UINT32 OPTION_FLAG_INTERNAL = 0x40000000; //************************************************************************** @@ -114,6 +115,7 @@ public: UINT32 flags() const { return m_flags; } bool is_header() const { return type() == OPTION_HEADER; } bool is_command() const { return type() == OPTION_COMMAND; } + bool is_internal() const { return m_flags & OPTION_FLAG_INTERNAL; } bool has_range() const { return (m_minimum && m_maximum); } int priority() const { return m_priority; } |