System: Store game hash as well as serial

This commit is contained in:
Stenzek
2023-05-15 23:38:37 +10:00
parent 7681551544
commit 9aa6c24620
20 changed files with 243 additions and 211 deletions

View File

@ -1284,8 +1284,8 @@ void MainWindow::onViewGamePropertiesActionTriggered()
if (!s_system_valid)
return;
const std::string& path = System::GetRunningPath();
const std::string& serial = System::GetRunningSerial();
const std::string& path = System::GetDiscPath();
const std::string& serial = System::GetGameSerial();
if (path.empty() || serial.empty())
return;

View File

@ -1116,11 +1116,11 @@ void EmuThread::loadState(bool global, qint32 slot)
}
// shouldn't even get here if we don't have a running game
if (!global && System::GetRunningSerial().empty())
if (!global && System::GetGameSerial().empty())
return;
bootOrLoadState(global ? System::GetGlobalSaveStateFileName(slot) :
System::GetGameSaveStateFileName(System::GetRunningSerial(), slot));
System::GetGameSaveStateFileName(System::GetGameSerial(), slot));
}
void EmuThread::saveState(const QString& filename, bool block_until_done /* = false */)
@ -1147,11 +1147,11 @@ void EmuThread::saveState(bool global, qint32 slot, bool block_until_done /* = f
return;
}
if (!global && System::GetRunningSerial().empty())
if (!global && System::GetGameSerial().empty())
return;
System::SaveState((global ? System::GetGlobalSaveStateFileName(slot) :
System::GetGameSaveStateFileName(System::GetRunningSerial(), slot))
System::GetGameSaveStateFileName(System::GetGameSerial(), slot))
.c_str(),
g_settings.create_save_state_backups);
}

View File

@ -848,6 +848,7 @@ QIcon GetIconForRegion(DiscRegion region)
case DiscRegion::NTSC_U:
return QIcon(QStringLiteral(":/icons/flag-uc.svg"));
case DiscRegion::Other:
case DiscRegion::NonPS1:
default:
return QIcon::fromTheme(QStringLiteral("file-unknow-line"));
}