diff options
author | 2011-01-17 15:40:31 +0000 | |
---|---|---|
committer | 2011-01-17 15:40:31 +0000 | |
commit | 4725df36ac14570ab44644ccb3bc3f138043842a (patch) | |
tree | 2fbb799a9111aa98033a37120690a4371dda93ef /src | |
parent | 9fd74516f66f8e41cb611746b7e63a4dea06b575 (diff) |
Fixed some long standing issues with image device config (no whatsnew)
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/emuopts.c | 2 | ||||
-rw-r--r-- | src/emu/machine.c | 2 | ||||
-rw-r--r-- | src/emu/mame.c | 6 | ||||
-rw-r--r-- | src/lib/util/options.c | 8 | ||||
-rw-r--r-- | src/lib/util/options.h | 3 |
5 files changed, 15 insertions, 6 deletions
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index a6a754ae989..87711b45be8 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -256,7 +256,7 @@ void image_add_device_options(core_options *opts, const game_driver *driver) /* add the option */ memset(entry, 0, sizeof(entry)); entry[0].name = dev_full_name; - options_add_entries(opts, entry); + options_add_entries(opts, entry, TRUE); index++; } diff --git a/src/emu/machine.c b/src/emu/machine.c index e644d1e53ba..f60ed8c533c 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -231,8 +231,6 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o running_machine::~running_machine() { - // clear flag for added devices - options_set_bool(&m_options, OPTION_ADDED_DEVICE_OPTIONS, FALSE, OPTION_PRIORITY_CMDLINE); } diff --git a/src/emu/mame.c b/src/emu/mame.c index 9e1607cc05a..58b301ceccc 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -214,6 +214,10 @@ int mame_execute(osd_interface &osd, core_options *options) global_free(machine); global_free(config); global_machine = NULL; + if (firstrun) { + // clear flag for added devices + options_set_bool(options, OPTION_ADDED_DEVICE_OPTIONS, FALSE, OPTION_PRIORITY_CMDLINE); + } // reset the options mame_opts = NULL; @@ -565,7 +569,7 @@ static int parse_ini_file(core_options *options, const char *name, int priority) mame_file *file; /* update game name so depending callback options could be added */ - if (priority==OPTION_PRIORITY_DRIVER_INI) { + if (priority==OPTION_PRIORITY_DRIVER_INI || priority==OPTION_PRIORITY_SOURCE_INI) { options_force_option_callback(options, OPTION_GAMENAME, name, priority); } diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 705d4dfda2f..2d53f86aa39 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -309,7 +309,7 @@ int options_equal(core_options *opts1, core_options *opts2) current options sets -------------------------------------------------*/ -int options_add_entries(core_options *opts, const options_entry *entrylist) +int options_add_entries(core_options *opts, const options_entry *entrylist, int force) { /* loop over entries until we hit a NULL name */ for ( ; entrylist->name != NULL || (entrylist->flags & OPTION_HEADER); entrylist++) @@ -333,7 +333,7 @@ int options_add_entries(core_options *opts, const options_entry *entrylist) match = find_entry_data(opts, astring_c(data->links[i].name), FALSE); /* if so, throw away this entry and replace the data */ - if (match != NULL) + if ((force == FALSE) && (match != NULL)) { /* free what we've allocated so far */ for (i = 0; i < ARRAY_LENGTH(data->links); i++) @@ -384,6 +384,10 @@ int options_add_entries(core_options *opts, const options_entry *entrylist) return TRUE; } +int options_add_entries(core_options *opts, const options_entry *entrylist) +{ + return options_add_entries(opts,entrylist,FALSE); +} /*------------------------------------------------- options_set_option_default_value - change the diff --git a/src/lib/util/options.h b/src/lib/util/options.h index ea6ba5b0c76..0d8f9c4a751 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -151,6 +151,9 @@ int options_equal(core_options *opts1, core_options *opts2); /* add a set of entries to an options collection */ int options_add_entries(core_options *opts, const options_entry *entrylist); +/* add a set of entries to an options collection, and force recreation if true */ +int options_add_entries(core_options *opts, const options_entry *entrylist, int force); + /* set the default value for a particular option entry */ int options_set_option_default_value(core_options *opts, const char *name, const char *defvalue); |