Placing reverting options on proper place (nw)

This commit is contained in:
Miodrag Milanovic 2014-06-03 13:03:14 +00:00
parent 61742dfb4c
commit d740f275ef
3 changed files with 10 additions and 15 deletions

View File

@ -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))
{

View File

@ -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);
}

View File

@ -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