diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index aa1180131a..5a1c41072b 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1565,15 +1565,23 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch, sys_log.notice("Version: APP_VER=%s VERSION=%s", version_app, version_disc); { - if (!m_db_config && (m_config_mode == cfg_mode::database_config || m_config_mode == cfg_mode::custom)) + if (m_config_mode == cfg_mode::database_config || m_config_mode == cfg_mode::custom) { - // Get database config if possible. This only happens if the database config hasn't been set by the UI (e.g. if booted with no-gui). - // We only know the title_id for sure at this point, so it doesn't make sense to retrieve it earlier. - m_db_config = Emu.GetCallbacks().get_database_config(m_title_id); - } + if (!m_db_config) + { + // Get database config if possible. This only happens if the database config hasn't been set by the UI (e.g. if booted with no-gui). + // We only know the title_id for sure at this point, so it doesn't make sense to retrieve it earlier. + m_db_config = Emu.GetCallbacks().get_database_config(m_title_id); + } - // We add the database configuration if it is set, unless we are using a mode that specifically selects a different configuration. - bool add_database_config = m_db_config && !m_db_config->empty() && (m_config_mode == cfg_mode::database_config || m_config_mode == cfg_mode::custom || m_config_mode == cfg_mode::continuous); + // We add the database configuration if it is set, unless we are using a mode that specifically selects a different configuration. + m_add_database_config = m_db_config && !m_db_config->empty(); + } + else if (m_config_mode != cfg_mode::continuous) + { + // Reset flag unless in continuous mode + m_add_database_config = false; + } if (m_config_mode == cfg_mode::custom_selection || (m_config_mode == cfg_mode::continuous && !m_config_path.empty())) { @@ -1617,7 +1625,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch, { g_cfg.name = config_path; m_config_path = config_path; - add_database_config = false; // A custom config exists. Do not add the database config. + m_add_database_config = false; // A custom config exists. Do not add the database config. break; } @@ -1626,7 +1634,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch, } } - if (add_database_config && m_db_config && !m_db_config->empty()) + if (m_add_database_config && m_db_config && !m_db_config->empty()) { // Add database config sys_log.notice("Applying database config"); diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index f613bb94d6..8bee2dc7a5 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -172,6 +172,7 @@ class Emulator final bool m_continuous_mode = false; bool m_has_gui = true; + bool m_add_database_config = false; bool m_state_inspection_savestate = false;