From d740f275ef0ad2bce2c4dfb21ba9dcdf0a129cb5 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 3 Jun 2014 13:03:14 +0000 Subject: [PATCH] Placing reverting options on proper place (nw) --- src/emu/clifront.c | 2 ++ src/emu/emuopts.c | 17 ++--------------- src/emu/mame.c | 6 ++++++ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/emu/clifront.c b/src/emu/clifront.c index 42bd7468ae3..c58b792fa0a 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -197,6 +197,8 @@ int cli_frontend::execute(int argc, char **argv) throw emu_fatalerror(MAMERR_FATALERROR, NULL); } } + + m_options.parse_standard_inis(option_errors); // parse the command line, adding any system-specific options if (!m_options.parse_command_line(argc, argv, option_errors)) { diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index 6d59d276928..944f1180e9f 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -373,22 +373,9 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], astring &error_stri bool emu_options::parse_command_line(int argc, char *argv[], astring &error_string) { - // remember the original system name - astring old_system_name(system_name()); - // parse as normal - bool result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); - - // if the system name changed, fix up the device options - if (old_system_name != system_name()) - { - // remove any existing device options - remove_device_options(); - result = parse_slot_devices(argc, argv, error_string, NULL, NULL); - if (exists(OPTION_RAMSIZE) && old_system_name.len()!=0) - set_value(OPTION_RAMSIZE, "", OPTION_PRIORITY_CMDLINE, error_string); - } - return result; + core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); + return parse_slot_devices(argc, argv, error_string, NULL, NULL); } diff --git a/src/emu/mame.c b/src/emu/mame.c index efaf73b9776..65bf242cf49 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -180,7 +180,13 @@ int mame_execute(emu_options &options, osd_interface &osd) // check the state of the machine if (new_driver_pending) { + astring old_system_name(options.system_name()); options.set_system_name(new_driver_pending->name); + astring error_string; + if (old_system_name != options.system_name()) { + options.remove_device_options(); + options.set_value(OPTION_RAMSIZE, "", OPTION_PRIORITY_CMDLINE, error_string); + } firstrun = true; } else