diff options
Diffstat (limited to 'src/emu/emuopts.cpp')
-rw-r--r-- | src/emu/emuopts.cpp | 70 |
1 files changed, 30 insertions, 40 deletions
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 97e107ebb49..aa1b0482edc 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -11,7 +11,6 @@ #include "emu.h" #include "emuopts.h" #include "drivenum.h" -#include "softlist.h" #include <ctype.h> @@ -43,7 +42,6 @@ const options_entry emu_options::s_option_entries[] = { OPTION_FONTPATH, ".", OPTION_STRING, "path to font files" }, { OPTION_CHEATPATH, "cheat", OPTION_STRING, "path to cheat files" }, { OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" }, - { OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" }, // output directory options { nullptr, nullptr, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" }, @@ -51,7 +49,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_NVRAM_DIRECTORY, "nvram", OPTION_STRING, "directory to save nvram contents" }, { OPTION_INPUT_DIRECTORY, "inp", OPTION_STRING, "directory to save input device logs" }, { OPTION_STATE_DIRECTORY, "sta", OPTION_STRING, "directory to save states" }, - { OPTION_SNAPSHOT_DIRECTORY, "snap", OPTION_STRING, "directory to save/load screenshots" }, + { OPTION_SNAPSHOT_DIRECTORY, "snap", OPTION_STRING, "directory to save screenshots" }, { OPTION_DIFF_DIRECTORY, "diff", OPTION_STRING, "directory to save hard drive image difference files" }, { OPTION_COMMENT_DIRECTORY, "comments", OPTION_STRING, "directory to save debugger comments" }, @@ -61,9 +59,6 @@ const options_entry emu_options::s_option_entries[] = { OPTION_AUTOSAVE, "0", OPTION_BOOLEAN, "enable automatic restore at startup, and automatic save at exit time" }, { OPTION_PLAYBACK ";pb", nullptr, OPTION_STRING, "playback an input file" }, { OPTION_RECORD ";rec", nullptr, OPTION_STRING, "record an input file" }, - { OPTION_RECORD_TIMECODE, "0", OPTION_BOOLEAN, "record an input timecode file (requires -record option)" }, - { OPTION_EXIT_AFTER_PLAYBACK, "0", OPTION_BOOLEAN, "close the program at the end of playback" }, - { OPTION_MNGWRITE, nullptr, OPTION_STRING, "optional filename to write a MNG movie of the current session" }, { OPTION_AVIWRITE, nullptr, OPTION_STRING, "optional filename to write an AVI movie of the current session" }, #ifdef MAME_DEBUG @@ -182,8 +177,11 @@ const options_entry emu_options::s_option_entries[] = { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" }, { OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" }, { OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, - { OPTION_UI, "cabinet", OPTION_STRING, "type of UI (simple|cabinet)" }, + { OPTION_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, + { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" }, { OPTION_RAMSIZE ";ram", nullptr, OPTION_STRING, "size of RAM (if supported by driver)" }, + { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, + { OPTION_UI_MOUSE, "0", OPTION_BOOLEAN, "display ui mouse cursor" }, { OPTION_AUTOBOOT_COMMAND ";ab", nullptr, OPTION_STRING, "command to execute after machine boot" }, { OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" }, @@ -207,8 +205,6 @@ emu_options::emu_options() , m_joystick_contradictory(false) , m_sleep(true) , m_refresh_speed(false) -, m_slot_options(0) -, m_device_options(0) { add_entries(emu_options::s_option_entries); } @@ -219,17 +215,18 @@ emu_options::emu_options() // options for the configured system //------------------------------------------------- -bool emu_options::add_slot_options(const software_part *swpart) +bool emu_options::add_slot_options(bool isfirstpass) { // look up the system configured by name; if no match, do nothing const game_driver *cursystem = system(); if (cursystem == nullptr) return false; - - // create the configuration machine_config config(*cursystem, *this); // iterate through all slot devices + bool first = true; + + // create the configuration int starting_count = options_count(); slot_interface_iterator iter(config.root_device()); for (const device_slot_interface *slot = iter.first(); slot != nullptr; slot = iter.next()) @@ -239,8 +236,9 @@ bool emu_options::add_slot_options(const software_part *swpart) continue; // first device? add the header as to be pretty - if (m_slot_options++ == 0) + if (isfirstpass && first) add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + first = false; // retrieve info about the device instance const char *name = slot->device().tag() + 1; @@ -257,15 +255,6 @@ bool emu_options::add_slot_options(const software_part *swpart) } add_entry(name, nullptr, flags, defvalue, true); } - - // allow software lists to supply their own defaults - if (swpart != nullptr) - { - std::string featurename = std::string(name).append("_default"); - const char *value = swpart->feature(featurename.c_str()); - if (value != nullptr && (*value == '\0' || slot->option(value) != nullptr)) - set_default_value(name, value); - } } return (options_count() != starting_count); } @@ -276,7 +265,7 @@ bool emu_options::add_slot_options(const software_part *swpart) // depending of image mounted //------------------------------------------------- -void emu_options::update_slot_options(const software_part *swpart) +void emu_options::update_slot_options() { // look up the system configured by name; if no match, do nothing const game_driver *cursystem = system(); @@ -301,8 +290,8 @@ void emu_options::update_slot_options(const software_part *swpart) } } } - while (add_slot_options(swpart)) { } - add_device_options(); + while (add_slot_options(false)) { } + add_device_options(false); } @@ -311,7 +300,7 @@ void emu_options::update_slot_options(const software_part *swpart) // options for the configured system //------------------------------------------------- -void emu_options::add_device_options() +void emu_options::add_device_options(bool isfirstpass) { // look up the system configured by name; if no match, do nothing const game_driver *cursystem = system(); @@ -320,12 +309,14 @@ void emu_options::add_device_options() machine_config config(*cursystem, *this); // iterate through all image devices + bool first = true; image_interface_iterator iter(config.root_device()); for (const device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) { // first device? add the header as to be pretty - if (m_device_options++ == 0) + if (first && isfirstpass) add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + first = false; // retrieve info about the device instance std::string option_name; @@ -357,10 +348,6 @@ void emu_options::remove_device_options() if ((curentry->flags() & OPTION_FLAG_DEVICE) != 0) remove_entry(*curentry); } - - // reset counters - m_slot_options = 0; - m_device_options = 0; } @@ -369,7 +356,7 @@ void emu_options::remove_device_options() // and update slot and image devices //------------------------------------------------- -bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_string, const char *name, const char *value, const software_part *swpart) +bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_string, const char *name, const char *value) { // an initial parse to capture the initial set of values bool result; @@ -377,13 +364,15 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_ core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); // keep adding slot options until we stop seeing new stuff - m_slot_options = 0; - while (add_slot_options(swpart)) + bool isfirstpass = true; + while (add_slot_options(isfirstpass)) + { core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); + isfirstpass = false; + } // add device options and reparse - m_device_options = 0; - add_device_options(); + add_device_options(true); if (name != nullptr && exists(name)) set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string); core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); @@ -391,7 +380,7 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_ int num; do { num = options_count(); - update_slot_options(swpart); + update_slot_options(); result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); } while (num != options_count()); @@ -410,7 +399,7 @@ bool emu_options::parse_command_line(int argc, char *argv[], std::string &error_ { // parse as normal core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); - bool result = parse_slot_devices(argc, argv, error_string); + bool result = parse_slot_devices(argc, argv, error_string, nullptr, nullptr); update_cached_options(); return result; } @@ -534,10 +523,11 @@ void emu_options::set_system_name(const char *name) // remove any existing device options and then add them afresh remove_device_options(); - while (add_slot_options()) { } + if (add_slot_options(true)) + while (add_slot_options(false)) { } // then add the options - add_device_options(); + add_device_options(true); int num; do { num = options_count(); |