diff options
Diffstat (limited to 'src/frontend/mame/mameopts.cpp')
-rw-r--r-- | src/frontend/mame/mameopts.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp index 05981854cef..84d1f6a313f 100644 --- a/src/frontend/mame/mameopts.cpp +++ b/src/frontend/mame/mameopts.cpp @@ -321,6 +321,11 @@ bool mame_options::parse_command_line(emu_options &options, std::vector<std::str if (!options.parse_command_line(args, OPTION_PRIORITY_CMDLINE, error_string)) return false; + // in order to evaluate softlist options, we need to fish any hashpath variable out of INI files; this is + // because hashpath in particular can affect softlist evaluation + if (options.software_name()[0] != '\0' && options.read_config()) + populate_hashpath_from_ini_files(options); + // identify any options as a result of softlists auto softlist_opts = evaluate_initial_softlist_options(options); @@ -690,3 +695,24 @@ bool mame_options::parse_one_ini(emu_options &options, const char *basename, int return result; } + +//------------------------------------------------- +// populate_hashpath_from_ini_files +//------------------------------------------------- + +void mame_options::populate_hashpath_from_ini_files(emu_options &options) +{ + // create temporary emu_options for the purposes of evaluating the INI files + emu_options temp_options; + std::string temp_error_string; + temp_options.set_value(OPTION_SYSTEMNAME, options.system_name(), OPTION_PRIORITY_MAXIMUM, temp_error_string); + temp_options.set_value(OPTION_INIPATH, options.ini_path(), OPTION_PRIORITY_MAXIMUM, temp_error_string); + + // read the INIs into temp_options + parse_standard_inis(temp_options, temp_error_string); + + // and fish out hashpath + const auto entry = temp_options.get_entry(OPTION_HASHPATH); + if (entry) + options.set_value(OPTION_HASHPATH, entry->value(), entry->priority(), temp_error_string); +} |