mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Placing reverting options on proper place (nw)
This commit is contained in:
parent
61742dfb4c
commit
d740f275ef
@ -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))
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user