summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/emuopts.c8
-rw-r--r--src/lib/util/options.c7
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;
}