Fix database config application in continuous mode
This commit is contained in:
+17
-9
@@ -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);
|
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).
|
if (!m_db_config)
|
||||||
// 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);
|
// 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.
|
// 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);
|
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()))
|
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;
|
g_cfg.name = config_path;
|
||||||
m_config_path = 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;
|
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
|
// Add database config
|
||||||
sys_log.notice("Applying database config");
|
sys_log.notice("Applying database config");
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ class Emulator final
|
|||||||
|
|
||||||
bool m_continuous_mode = false;
|
bool m_continuous_mode = false;
|
||||||
bool m_has_gui = true;
|
bool m_has_gui = true;
|
||||||
|
bool m_add_database_config = false;
|
||||||
|
|
||||||
bool m_state_inspection_savestate = false;
|
bool m_state_inspection_savestate = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user