diff options
Diffstat (limited to 'src/emu/emuopts.cpp')
-rw-r--r-- | src/emu/emuopts.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index d891aae1d73..11938000fe7 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -23,16 +23,16 @@ const options_entry emu_options::s_option_entries[] = { // unadorned options - only a single one supported at the moment - { OPTION_SYSTEMNAME, NULL, OPTION_STRING, NULL }, - { OPTION_SOFTWARENAME, NULL, OPTION_STRING, NULL }, + { OPTION_SYSTEMNAME, nullptr, OPTION_STRING, nullptr }, + { OPTION_SOFTWARENAME, nullptr, OPTION_STRING, nullptr }, // config options - { NULL, NULL, OPTION_HEADER, "CORE CONFIGURATION OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE CONFIGURATION OPTIONS" }, { OPTION_READCONFIG ";rc", "1", OPTION_BOOLEAN, "enable loading of configuration files" }, { OPTION_WRITECONFIG ";wc", "0", OPTION_BOOLEAN, "writes configuration to (driver).ini on exit" }, // seach path options - { NULL, NULL, OPTION_HEADER, "CORE SEARCH PATH OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE SEARCH PATH OPTIONS" }, { OPTION_MEDIAPATH ";rp;biospath;bp", "roms", OPTION_STRING, "path to ROMsets and hard disk images" }, { OPTION_HASHPATH ";hash_directory;hash", "hash", OPTION_STRING, "path to hash files" }, { OPTION_SAMPLEPATH ";sp", "samples", OPTION_STRING, "path to samplesets" }, @@ -44,7 +44,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" }, // output directory options - { NULL, NULL, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" }, { OPTION_CFG_DIRECTORY, "cfg", OPTION_STRING, "directory to save configurations" }, { OPTION_NVRAM_DIRECTORY, "nvram", OPTION_STRING, "directory to save nvram contents" }, { OPTION_INPUT_DIRECTORY, "inp", OPTION_STRING, "directory to save input device logs" }, @@ -54,17 +54,17 @@ const options_entry emu_options::s_option_entries[] = { OPTION_COMMENT_DIRECTORY, "comments", OPTION_STRING, "directory to save debugger comments" }, // state/playback options - { NULL, NULL, OPTION_HEADER, "CORE STATE/PLAYBACK OPTIONS" }, - { OPTION_STATE, NULL, OPTION_STRING, "saved state to load" }, + { nullptr, nullptr, OPTION_HEADER, "CORE STATE/PLAYBACK OPTIONS" }, + { OPTION_STATE, nullptr, OPTION_STRING, "saved state to load" }, { OPTION_AUTOSAVE, "0", OPTION_BOOLEAN, "enable automatic restore at startup, and automatic save at exit time" }, - { OPTION_PLAYBACK ";pb", NULL, OPTION_STRING, "playback an input file" }, - { OPTION_RECORD ";rec", NULL, OPTION_STRING, "record an input file" }, - { OPTION_MNGWRITE, NULL, OPTION_STRING, "optional filename to write a MNG movie of the current session" }, - { OPTION_AVIWRITE, NULL, OPTION_STRING, "optional filename to write an AVI movie of the current session" }, + { OPTION_PLAYBACK ";pb", nullptr, OPTION_STRING, "playback an input file" }, + { OPTION_RECORD ";rec", nullptr, OPTION_STRING, "record an input file" }, + { 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 { OPTION_DUMMYWRITE, "0", OPTION_BOOLEAN, "indicates if a snapshot should be created if each frame" }, #endif - { OPTION_WAVWRITE, NULL, OPTION_STRING, "optional filename to write a WAV file of the current session" }, + { OPTION_WAVWRITE, nullptr, OPTION_STRING, "optional filename to write a WAV file of the current session" }, { OPTION_SNAPNAME, "%g/%i", OPTION_STRING, "override of the default snapshot/movie naming; %g == gamename, %i == index" }, { OPTION_SNAPSIZE, "auto", OPTION_STRING, "specify snapshot/movie resolution (<width>x<height>) or 'auto' to use minimal size " }, { OPTION_SNAPVIEW, "internal", OPTION_STRING, "specify snapshot/movie view or 'internal' to use internal pixel-aspect views" }, @@ -73,7 +73,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_BURNIN, "0", OPTION_BOOLEAN, "create burn-in snapshots for each screen" }, // performance options - { NULL, NULL, OPTION_HEADER, "CORE PERFORMANCE OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE PERFORMANCE OPTIONS" }, { OPTION_AUTOFRAMESKIP ";afs", "0", OPTION_BOOLEAN, "enable automatic frameskip selection" }, { OPTION_FRAMESKIP ";fs(0-10)", "0", OPTION_INTEGER, "set frameskip to fixed value, 0-10 (autoframeskip must be disabled)" }, { OPTION_SECONDS_TO_RUN ";str", "0", OPTION_INTEGER, "number of emulated seconds to run before automatically exiting" }, @@ -83,7 +83,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_REFRESHSPEED ";rs", "0", OPTION_BOOLEAN, "automatically adjusts the speed of gameplay to keep the refresh rate lower than the screen" }, // rotation options - { NULL, NULL, OPTION_HEADER, "CORE ROTATION OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE ROTATION OPTIONS" }, { OPTION_ROTATE, "1", OPTION_BOOLEAN, "rotate the game screen according to the game's orientation needs it" }, { OPTION_ROR, "0", OPTION_BOOLEAN, "rotate screen clockwise 90 degrees" }, { OPTION_ROL, "0", OPTION_BOOLEAN, "rotate screen counterclockwise 90 degrees" }, @@ -93,7 +93,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_FLIPY, "0", OPTION_BOOLEAN, "flip screen upside-down" }, // artwork options - { NULL, NULL, OPTION_HEADER, "CORE ARTWORK OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE ARTWORK OPTIONS" }, { OPTION_ARTWORK_CROP ";artcrop", "0", OPTION_BOOLEAN, "crop artwork to game screen size" }, { OPTION_USE_BACKDROPS ";backdrop", "1", OPTION_BOOLEAN, "enable backdrops if artwork is enabled and available" }, { OPTION_USE_OVERLAYS ";overlay", "1", OPTION_BOOLEAN, "enable overlays if artwork is enabled and available" }, @@ -102,7 +102,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_USE_MARQUEES ";marquee", "1", OPTION_BOOLEAN, "enable marquees if artwork is enabled and available" }, // screen options - { NULL, NULL, OPTION_HEADER, "CORE SCREEN OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE SCREEN OPTIONS" }, { OPTION_BRIGHTNESS "(0.1-2.0)", "1.0", OPTION_FLOAT, "default game screen brightness correction" }, { OPTION_CONTRAST "(0.1-2.0)", "1.0", OPTION_FLOAT, "default game screen contrast correction" }, { OPTION_GAMMA "(0.1-3.0)", "1.0", OPTION_FLOAT, "default game screen gamma correction" }, @@ -110,7 +110,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_EFFECT, "none", OPTION_STRING, "name of a PNG file to use for visual effects, or 'none'" }, // vector options - { NULL, NULL, OPTION_HEADER, "CORE VECTOR OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE VECTOR OPTIONS" }, { OPTION_ANTIALIAS ";aa", "1", OPTION_BOOLEAN, "use antialiasing when drawing vectors" }, { OPTION_BEAM_WIDTH_MIN, "1.0", OPTION_FLOAT, "set vector beam width minimum" }, { OPTION_BEAM_WIDTH_MAX, "1.0", OPTION_FLOAT, "set vector beam width maximum" }, @@ -118,15 +118,15 @@ const options_entry emu_options::s_option_entries[] = { OPTION_FLICKER, "0", OPTION_FLOAT, "set vector flicker effect" }, // sound options - { NULL, NULL, OPTION_HEADER, "CORE SOUND OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE SOUND OPTIONS" }, { OPTION_SAMPLERATE ";sr(1000-1000000)", "48000", OPTION_INTEGER, "set sound output sample rate" }, { OPTION_SAMPLES, "1", OPTION_BOOLEAN, "enable the use of external samples if available" }, { OPTION_VOLUME ";vol", "0", OPTION_INTEGER, "sound volume in decibels (-32 min, 0 max)" }, // input options - { NULL, NULL, OPTION_HEADER, "CORE INPUT OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE INPUT OPTIONS" }, { OPTION_COIN_LOCKOUT ";coinlock", "1", OPTION_BOOLEAN, "enable coin lockouts to actually lock out coins" }, - { OPTION_CTRLR, NULL, OPTION_STRING, "preconfigure for specified controller" }, + { OPTION_CTRLR, nullptr, OPTION_STRING, "preconfigure for specified controller" }, { OPTION_MOUSE, "0", OPTION_BOOLEAN, "enable mouse input" }, { OPTION_JOYSTICK ";joy", "1", OPTION_BOOLEAN, "enable joystick input" }, { OPTION_LIGHTGUN ";gun", "0", OPTION_BOOLEAN, "enable lightgun input" }, @@ -143,7 +143,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_COIN_IMPULSE, "0", OPTION_INTEGER, "set coin impulse time (n<0 disable impulse, n==0 obey driver, 0<n set time n)" }, // input autoenable options - { NULL, NULL, OPTION_HEADER, "CORE INPUT AUTOMATIC ENABLE OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE INPUT AUTOMATIC ENABLE OPTIONS" }, { OPTION_PADDLE_DEVICE ";paddle", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a paddle control is present" }, { OPTION_ADSTICK_DEVICE ";adstick", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if an analog joystick control is present" }, { OPTION_PEDAL_DEVICE ";pedal", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a pedal control is present" }, @@ -154,38 +154,38 @@ const options_entry emu_options::s_option_entries[] = { OPTION_MOUSE_DEVICE, "mouse", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a mouse control is present" }, // debugging options - { NULL, NULL, OPTION_HEADER, "CORE DEBUGGING OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE DEBUGGING OPTIONS" }, { OPTION_VERBOSE ";v", "0", OPTION_BOOLEAN, "display additional diagnostic information" }, { OPTION_LOG, "0", OPTION_BOOLEAN, "generate an error.log file" }, { OPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" }, { OPTION_DEBUG ";d", "0", OPTION_BOOLEAN, "enable/disable debugger" }, { OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" }, - { OPTION_DEBUGSCRIPT, NULL, OPTION_STRING, "script for debugger" }, + { OPTION_DEBUGSCRIPT, nullptr, OPTION_STRING, "script for debugger" }, // comm options - { NULL, NULL, OPTION_HEADER, "CORE COMM OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE COMM OPTIONS" }, { OPTION_COMM_LOCAL_HOST, "0.0.0.0", OPTION_STRING, "local address to bind to" }, { OPTION_COMM_LOCAL_PORT, "15112", OPTION_STRING, "local port to bind to" }, { OPTION_COMM_REMOTE_HOST, "127.0.0.1", OPTION_STRING, "remote address to connect to" }, { OPTION_COMM_REMOTE_PORT, "15112", OPTION_STRING, "remote port to connect to" }, // misc options - { NULL, NULL, OPTION_HEADER, "CORE MISC OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "CORE MISC OPTIONS" }, { OPTION_DRC, "1", OPTION_BOOLEAN, "enable DRC cpu core if available" }, { OPTION_DRC_USE_C, "0", OPTION_BOOLEAN, "force DRC use C backend" }, { OPTION_DRC_LOG_UML, "0", OPTION_BOOLEAN, "write DRC UML disassembly log" }, { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" }, - { OPTION_BIOS, NULL, OPTION_STRING, "select the system BIOS to use" }, + { OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" }, { OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, { 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", NULL, OPTION_STRING, "size of RAM (if supported by driver)" }, + { 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", NULL, OPTION_STRING, "command to execute after machine boot" }, + { 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", NULL, OPTION_STRING, "lua script to execute after machine boot" }, - { NULL } + { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" }, + { nullptr } }; @@ -218,7 +218,7 @@ 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 == NULL) + if (cursystem == nullptr) return false; machine_config config(*cursystem, *this); @@ -228,7 +228,7 @@ bool emu_options::add_slot_options(bool isfirstpass) // create the configuration int starting_count = options_count(); slot_interface_iterator iter(config.root_device()); - for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next()) + for (const device_slot_interface *slot = iter.first(); slot != nullptr; slot = iter.next()) { // skip fixed slots if (slot->fixed()) @@ -236,7 +236,7 @@ bool emu_options::add_slot_options(bool isfirstpass) // first device? add the header as to be pretty if (isfirstpass && first) - add_entry(NULL, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); first = false; // retrieve info about the device instance @@ -246,13 +246,13 @@ bool emu_options::add_slot_options(bool isfirstpass) // add the option UINT32 flags = OPTION_STRING | OPTION_FLAG_DEVICE; const char *defvalue = slot->default_option(); - if (defvalue != NULL) + if (defvalue != nullptr) { const device_slot_option *option = slot->option(defvalue); - if (option != NULL && !option->selectable()) + if (option != nullptr && !option->selectable()) flags |= OPTION_FLAG_INTERNAL; } - add_entry(name, NULL, flags, defvalue, true); + add_entry(name, nullptr, flags, defvalue, true); } } return (options_count() != starting_count); @@ -268,17 +268,17 @@ void emu_options::update_slot_options() { // look up the system configured by name; if no match, do nothing const game_driver *cursystem = system(); - if (cursystem == NULL) + if (cursystem == nullptr) return; machine_config config(*cursystem, *this); // iterate through all slot devices slot_interface_iterator iter(config.root_device()); - for (device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next()) + for (device_slot_interface *slot = iter.first(); slot != nullptr; slot = iter.next()) { // retrieve info about the device instance const char *name = slot->device().tag() + 1; - if (exists(name) && slot->first_option() != NULL) + if (exists(name) && slot->first_option() != nullptr) { std::string defvalue; slot->get_default_card_software(defvalue); @@ -286,7 +286,7 @@ void emu_options::update_slot_options() { set_default_value(name, defvalue.c_str()); const device_slot_option *option = slot->option(defvalue.c_str()); - set_flag(name, ~OPTION_FLAG_INTERNAL, (option != NULL && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); + set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); } } } @@ -304,18 +304,18 @@ 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(); - if (cursystem == NULL) + if (cursystem == nullptr) return; 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 != NULL; image = iter.next()) + for (const device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) { // first device? add the header as to be pretty if (first && isfirstpass) - add_entry(NULL, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); first = false; // retrieve info about the device instance @@ -326,7 +326,7 @@ void emu_options::add_device_options(bool isfirstpass) // add the option if (!exists(image->instance_name())) - add_entry(option_name.c_str(), NULL, OPTION_STRING | OPTION_FLAG_DEVICE, NULL, true); + add_entry(option_name.c_str(), nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, nullptr, true); } } @@ -339,7 +339,7 @@ void emu_options::remove_device_options() { // iterate through options and remove interesting ones entry *nextentry; - for (entry *curentry = first(); curentry != NULL; curentry = nextentry) + for (entry *curentry = first(); curentry != nullptr; curentry = nextentry) { // pre-fetch the next entry in case we delete this one nextentry = curentry->next(); @@ -373,7 +373,7 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_ // add device options and reparse add_device_options(true); - if (name != NULL && exists(name)) + 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); @@ -399,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, NULL, NULL); + bool result = parse_slot_devices(argc, argv, error_string, nullptr, nullptr); update_cached_options(); return result; } @@ -426,7 +426,7 @@ void emu_options::parse_standard_inis(std::string &error_string) // if we have a valid system driver, parse system-specific INI files const game_driver *cursystem = system(); - if (cursystem == NULL) + if (cursystem == nullptr) return; // parse "vertical.ini" or "horizont.ini" @@ -446,7 +446,7 @@ void emu_options::parse_standard_inis(std::string &error_string) machine_config config(*cursystem, *this); screen_device_iterator iter(config.root_device()); - for (const screen_device *device = iter.first(); device != NULL; device = iter.next()) + for (const screen_device *device = iter.first(); device != nullptr; device = iter.next()) { // parse "raster.ini" for raster games if (device->screen_type() == SCREEN_TYPE_RASTER) @@ -502,7 +502,7 @@ const game_driver *emu_options::system() const { std::string tempstr; int index = driver_list::find(core_filename_extract_base(tempstr, system_name(), true).c_str()); - return (index != -1) ? &driver_list::driver(index) : NULL; + return (index != -1) ? &driver_list::driver(index) : nullptr; } @@ -557,10 +557,10 @@ bool emu_options::parse_one_ini(const char *basename, int priority, std::string // parse the file osd_printf_verbose("Parsing %s.ini\n", basename); std::string error; - bool result = parse_ini_file(file, priority, OPTION_PRIORITY_DRIVER_INI, error); + bool result = parse_ini_file((core_file&)file, priority, OPTION_PRIORITY_DRIVER_INI, error); // append errors if requested - if (!error.empty() && error_string != NULL) + if (!error.empty() && error_string != nullptr) strcatprintf(*error_string, "While parsing %s:\n%s\n", file.fullpath(), error.c_str()); return result; |