Merge pull request #21176 from hrydgard/achievements-config-fix

Make it possible to have RetroAchievements enabled in a game config.
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2026-01-30 14:21:18 +01:00
commit be0899e2cf
4 files changed
+24 -5

No files matched your search

+4 -1
View File
@@ -627,7 +627,10 @@ void Initialize() {
INFO_LOG(Log::Achievements, "Achievements are disabled, not initializing.");
return;
}
_assert_msg_(!g_rcClient, "Achievements already initialized");
if (g_rcClient) {
INFO_LOG(Log::Achievements, "Achievements already initialized");
return;
}
g_rcClient = rc_client_create(read_memory_callback, server_call_callback);
if (!g_rcClient) {
+1
View File
@@ -502,6 +502,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin
}
InstallExceptionHandler(&Memory::HandleFault);
return true;
}
+18 -4
View File
@@ -209,7 +209,7 @@ bool EmuScreen::bootAllowStorage(const Path &filename) {
}
void EmuScreen::ProcessGameBoot(const Path &filename) {
if (!bootPending_) {
if (!bootPending_ && !readyToFinishBoot_) {
// Nothing to do.
return;
}
@@ -230,6 +230,13 @@ void EmuScreen::ProcessGameBoot(const Path &filename) {
return;
}
if (readyToFinishBoot_) {
// Finish booting.
bootComplete();
readyToFinishBoot_ = false;
return;
}
std::string error_string = "(unknown error)";
const BootState state = PSP_InitUpdate(&error_string);
@@ -263,10 +270,9 @@ void EmuScreen::ProcessGameBoot(const Path &filename) {
coreState = CORE_RUNNING_CPU;
}
bootComplete();
Achievements::Initialize();
// Reset views in case controls are in a different place.
RecreateViews();
readyToFinishBoot_ = true;
return;
case BootState::Off:
// Gotta start the boot process! Continue below.
@@ -430,6 +436,9 @@ void EmuScreen::bootComplete() {
g_Config.TimeTracker().Start(gameID);
bootIsReset_ = false;
// Reset views in case controls are in a different place.
RecreateViews();
}
EmuScreen::~EmuScreen() {
@@ -448,6 +457,11 @@ EmuScreen::~EmuScreen() {
PSP_Shutdown(true);
}
// If achievements are disabled in the global config, let's shut it down here.
if (!g_Config.bAchievementsEnable) {
Achievements::Shutdown();
}
_dbg_assert_(coreState == CORE_POWERDOWN);
System_PostUIMessage(UIMessage::GAME_SELECTED, "");
+1
View File
@@ -157,6 +157,7 @@ private:
bool startDumping_ = false;
#endif
bool autoLoadFailed_ = false; // to prevent repeat reloads
bool readyToFinishBoot_ = false;
};
bool MustRunBehind();