diff options
author | 2011-11-09 10:28:30 +0000 | |
---|---|---|
committer | 2011-11-09 10:28:30 +0000 | |
commit | e0f276b74bfeb2804d476fc3e8b254990a1ccaa3 (patch) | |
tree | ad330cd1bc6087ace6cdc2bb2c096f2d15212ecb /src | |
parent | 7c00fd2a52849905a602a25dbced178ccb21e72d (diff) |
Change order of parsing in emu_options, so first all slot devices are set and then image devices.
Also update lib/util/options.c so now parsing is not stopped on first unknown parameter, this way order of options in command line is not important for dynamic options (no whatsnew)
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/emuopts.c | 8 | ||||
-rw-r--r-- | src/lib/util/options.c | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index b347ed02205..87d781589cf 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -337,7 +337,6 @@ void emu_options::remove_device_options() bool emu_options::parse_slot_devices(int argc, char *argv[], astring &error_string, const char *name, const char *value) { remove_device_options(); - add_device_options(true); if (name && exists(name)) { set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string); } @@ -345,12 +344,12 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], astring &error_stri bool result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); while (add_slot_options(isfirst)) { result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); - add_device_options(false); if (name && exists(name)) { set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string); } isfirst = false; } + add_device_options(true); result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); return result; } @@ -470,14 +469,13 @@ void emu_options::set_system_name(const char *name) assert(!error); // remove any existing device options remove_device_options(); - // then add the options - add_device_options(true); bool isfirst = true; while (add_slot_options(isfirst)) { - add_device_options(false); isfirst = false; } + // then add the options + add_device_options(true); } } diff --git a/src/lib/util/options.c b/src/lib/util/options.c index ed1a62a6f6c..88c173c1c65 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -346,6 +346,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri // iterate through arguments int unadorned_index = 0; + bool retVal = true; for (int arg = 1; arg < argc; arg++) { // determine the entry name to search for @@ -358,7 +359,9 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri if (curentry == NULL) { error_string.catprintf("Error: unknown option: %s\n", curarg); - return false; + retVal = false; + if (!is_unadorned) arg++; + continue; } // process commands first @@ -391,7 +394,7 @@ bool core_options::parse_command_line(int argc, char **argv, int priority, astri // set the new data validate_and_set_data(*curentry, newdata, priority, error_string); } - return true; + return retVal; } |