mirror of
https://github.com/holub/mame
synced 2025-06-04 20:06:28 +03:00
Made quicklaunch work for slot/image devices (no whatsnew)
This commit is contained in:
parent
c7cb84ca5a
commit
4add4516fe
@ -218,10 +218,9 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
// mount only if not already mounted
|
// mount only if not already mounted
|
||||||
if (strlen(option)==0) {
|
if (strlen(option)==0) {
|
||||||
astring val;
|
astring val;
|
||||||
astring error;
|
|
||||||
val.printf("%s:%s",m_options.software_name(),swpart->name);
|
val.printf("%s:%s",m_options.software_name(),swpart->name);
|
||||||
m_options.set_value(image->brief_instance_name(), val.cstr(), OPTION_PRIORITY_CMDLINE, error);
|
// call this in order to set slot devices according to mounting
|
||||||
assert(!error);
|
m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.cstr());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -296,11 +296,13 @@ void emu_options::add_device_options(bool isfirst)
|
|||||||
option_name.printf("%s;%s", image->instance_name(), image->brief_instance_name());
|
option_name.printf("%s;%s", image->instance_name(), image->brief_instance_name());
|
||||||
|
|
||||||
// add the option
|
// add the option
|
||||||
entry[0].name = option_name;
|
if (!exists(image->instance_name())) {
|
||||||
entry[0].description = NULL;
|
entry[0].name = option_name;
|
||||||
entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE;
|
entry[0].description = NULL;
|
||||||
entry[0].defvalue = NULL;
|
entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE;
|
||||||
add_entries(entry, true);
|
entry[0].defvalue = NULL;
|
||||||
|
add_entries(entry, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,6 +327,32 @@ void emu_options::remove_device_options()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// parse_slot_devices - parse the command line
|
||||||
|
// and update slot and image devices
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
bool isfirst = true;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// parse_command_line - parse the command line
|
// parse_command_line - parse the command line
|
||||||
// and update the devices
|
// and update the devices
|
||||||
@ -342,16 +370,7 @@ bool emu_options::parse_command_line(int argc, char *argv[], astring &error_stri
|
|||||||
if (old_system_name != system_name())
|
if (old_system_name != system_name())
|
||||||
{
|
{
|
||||||
// remove any existing device options
|
// remove any existing device options
|
||||||
remove_device_options();
|
result = parse_slot_devices(argc, argv, error_string, NULL, NULL);
|
||||||
add_device_options(true);
|
|
||||||
bool isfirst = true;
|
|
||||||
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);
|
|
||||||
isfirst = false;
|
|
||||||
}
|
|
||||||
result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -215,6 +215,7 @@ public:
|
|||||||
// parsing wrappers
|
// parsing wrappers
|
||||||
bool parse_command_line(int argc, char *argv[], astring &error_string);
|
bool parse_command_line(int argc, char *argv[], astring &error_string);
|
||||||
void parse_standard_inis(astring &error_string);
|
void parse_standard_inis(astring &error_string);
|
||||||
|
bool parse_slot_devices(int argc, char *argv[], astring &error_string, const char *name, const char *value);
|
||||||
|
|
||||||
// core options
|
// core options
|
||||||
const char *system_name() const { return value(OPTION_SYSTEMNAME); }
|
const char *system_name() const { return value(OPTION_SYSTEMNAME); }
|
||||||
|
Loading…
Reference in New Issue
Block a user