VMManager: Move unknown serial print to UpdateRunningGame()

This commit is contained in:
Stenzek 2023-06-08 18:18:06 +10:00 committed by Connor McLaughlin
parent 642adffeb8
commit 40bd19ccbb
2 changed files with 8 additions and 15 deletions

View File

@ -986,19 +986,6 @@ const GameDatabaseSchema::GameEntry* GameDatabase::findGame(const std::string_vi
{
GameDatabase::ensureLoaded();
std::string serialLower = StringUtil::toLower(serial);
if (serialLower.empty())
return nullptr;
Console.WriteLn(fmt::format("[GameDB] Searching for '{}' in GameDB", serialLower));
const auto gameEntry = s_game_db.find(serialLower);
if (gameEntry != s_game_db.end())
{
Console.WriteLn(fmt::format("[GameDB] Found '{}' in GameDB", serialLower));
return &gameEntry->second;
}
Console.Error(fmt::format("[GameDB] Could not find '{}' in GameDB", serialLower));
return nullptr;
auto iter = s_game_db.find(StringUtil::toLower(serial));
return (iter != s_game_db.end()) ? &iter->second : nullptr;
}

View File

@ -707,7 +707,9 @@ void VMManager::UpdateRunningGame(UpdateGameReason reason)
std::string memcardFilters;
if (s_game_crc == 0)
{
s_game_name = "Booting PS2 BIOS...";
}
else if (const GameDatabaseSchema::GameEntry* game = GameDatabase::findGame(s_game_serial))
{
if (!s_elf_override.empty())
@ -717,6 +719,10 @@ void VMManager::UpdateRunningGame(UpdateGameReason reason)
memcardFilters = game->memcardFiltersAsString();
}
else
{
Console.Warning(fmt::format("Serial '{}' not found in GameDB.", s_game_serial));
}
sioSetGameSerial(memcardFilters.empty() ? s_game_serial : memcardFilters);