From 7e11c0968d9612463e4c836a6bc22a54c4b580d9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 5 Dec 2022 17:56:36 +1100 Subject: [PATCH] frontend: Load INI files for the 'empty' driver that runs under the system selection menu. --- src/frontend/mame/mame.cpp | 2 +- src/frontend/mame/mameopts.cpp | 79 ++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/frontend/mame/mame.cpp b/src/frontend/mame/mame.cpp index 5d8420c9f49..5cfe2a5b243 100644 --- a/src/frontend/mame/mame.cpp +++ b/src/frontend/mame/mame.cpp @@ -266,7 +266,7 @@ int mame_machine_manager::execute() m_options.revert(OPTION_PRIORITY_INI); std::ostringstream errors; - mame_options::parse_standard_inis(m_options, errors); + mame_options::parse_standard_inis(m_options, errors, system); } // otherwise, perform validity checks before anything else diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp index c6031308592..c2840f21d26 100644 --- a/src/frontend/mame/mameopts.cpp +++ b/src/frontend/mame/mameopts.cpp @@ -46,50 +46,53 @@ void mame_options::parse_standard_inis(emu_options &options, std::ostream &error if (!cursystem) return; - // parse "vertical.ini" or "horizont.ini" - if (cursystem->flags & ORIENTATION_SWAP_XY) - parse_one_ini(options, "vertical", OPTION_PRIORITY_ORIENTATION_INI, &error_stream); - else - parse_one_ini(options, "horizont", OPTION_PRIORITY_ORIENTATION_INI, &error_stream); - - switch (cursystem->flags & machine_flags::MASK_TYPE) + if (&GAME_NAME(___empty) != cursystem) // hacky - this thing isn't a real system { - case machine_flags::TYPE_ARCADE: - parse_one_ini(options, "arcade", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); - break; - case machine_flags::TYPE_CONSOLE: - parse_one_ini(options ,"console", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); - break; - case machine_flags::TYPE_COMPUTER: - parse_one_ini(options, "computer", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); - break; - case machine_flags::TYPE_OTHER: - parse_one_ini(options, "othersys", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); - break; - default: - break; - } + // parse "vertical.ini" or "horizont.ini" + if (cursystem->flags & ORIENTATION_SWAP_XY) + parse_one_ini(options, "vertical", OPTION_PRIORITY_ORIENTATION_INI, &error_stream); + else + parse_one_ini(options, "horizont", OPTION_PRIORITY_ORIENTATION_INI, &error_stream); - machine_config config(*cursystem, options); - for (const screen_device &device : screen_device_enumerator(config.root_device())) - { - // parse "raster.ini" for raster games - if (device.screen_type() == SCREEN_TYPE_RASTER) + switch (cursystem->flags & machine_flags::MASK_TYPE) { - parse_one_ini(options, "raster", OPTION_PRIORITY_SCREEN_INI, &error_stream); + case machine_flags::TYPE_ARCADE: + parse_one_ini(options, "arcade", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); + break; + case machine_flags::TYPE_CONSOLE: + parse_one_ini(options ,"console", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); + break; + case machine_flags::TYPE_COMPUTER: + parse_one_ini(options, "computer", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); + break; + case machine_flags::TYPE_OTHER: + parse_one_ini(options, "othersys", OPTION_PRIORITY_SYSTYPE_INI, &error_stream); + break; + default: break; } - // parse "vector.ini" for vector games - if (device.screen_type() == SCREEN_TYPE_VECTOR) + + machine_config config(*cursystem, options); + for (const screen_device &device : screen_device_enumerator(config.root_device())) { - parse_one_ini(options, "vector", OPTION_PRIORITY_SCREEN_INI, &error_stream); - break; - } - // parse "lcd.ini" for lcd games - if (device.screen_type() == SCREEN_TYPE_LCD) - { - parse_one_ini(options, "lcd", OPTION_PRIORITY_SCREEN_INI, &error_stream); - break; + // parse "raster.ini" for raster games + if (device.screen_type() == SCREEN_TYPE_RASTER) + { + parse_one_ini(options, "raster", OPTION_PRIORITY_SCREEN_INI, &error_stream); + break; + } + // parse "vector.ini" for vector games + if (device.screen_type() == SCREEN_TYPE_VECTOR) + { + parse_one_ini(options, "vector", OPTION_PRIORITY_SCREEN_INI, &error_stream); + break; + } + // parse "lcd.ini" for lcd games + if (device.screen_type() == SCREEN_TYPE_LCD) + { + parse_one_ini(options, "lcd", OPTION_PRIORITY_SCREEN_INI, &error_stream); + break; + } } }