diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index 344f672b0a..61bc98449f 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -259,7 +259,6 @@ Path ResolvePBPFile(const Path &filename) { bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) { FileLoader *&fileLoader = *fileLoaderPtr; - // Note that this can modify filename! IdentifiedFileType type = Identify_File(fileLoader, error_string); switch (type) { case IdentifiedFileType::PSP_PBP_DIRECTORY: @@ -402,7 +401,6 @@ bool UmdReplace(const Path &filepath, std::string &error) { loadedFile = ResolveFileLoaderTarget(loadedFile); - std::string errorString; IdentifiedFileType type = Identify_File(loadedFile, &errorString); diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index f2e5d1fbac..9e77bd881c 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -730,7 +730,19 @@ bool IsReadyToStart() { return !g_isLoggingIn; } -void SetGame(const Path &path, FileLoader *fileLoader) { +void SetGame(const Path &path, IdentifiedFileType fileType, FileLoader *fileLoader) { + switch (fileType) { + case IdentifiedFileType::PSP_ISO: + case IdentifiedFileType::PSP_ISO_NP: + // These file types are OK. + break; + default: + // Other file types are not yet supported. + // TODO: Should we show an OSD popup here? + WARN_LOG(ACHIEVEMENTS, "File type of '%s' is not yet compatible with RetroAchievements", path.c_str()); + return; + } + if (g_isLoggingIn) { // IsReadyToStart should have been checked the same frame, so we shouldn't be here. // Maybe there's a race condition possible, but don't think so. diff --git a/Core/RetroAchievements.h b/Core/RetroAchievements.h index ee73a31b58..48c1ec9cdd 100644 --- a/Core/RetroAchievements.h +++ b/Core/RetroAchievements.h @@ -19,6 +19,7 @@ #include "Common/StringUtils.h" #include "Common/CommonTypes.h" +#include "Core/Loaders.h" // for IdentifiedFileType #include "ext/rcheevos/include/rc_client.h" @@ -106,7 +107,7 @@ bool LoginAsync(const char *username, const char *password); void Logout(); bool IsReadyToStart(); -void SetGame(const Path &path, FileLoader *fileLoader); +void SetGame(const Path &path, IdentifiedFileType fileType, FileLoader *fileLoader); void ChangeUMD(const Path &path); // for in-game UMD change void UnloadGame(); // Call when leaving a game. diff --git a/Core/System.cpp b/Core/System.cpp index bb06f06c92..798bb5fa44 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -448,7 +448,7 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) { } #endif - Achievements::SetGame(filename, loadedFile); + Achievements::SetGame(filename, IdentifiedFileType::PSP_ISO, loadedFile); if (!CPU_Init(&g_CoreParameter.errorString, loadedFile)) { *error_string = g_CoreParameter.errorString; diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 16c7991bf3..773af385a0 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -143,7 +143,7 @@ void System_AudioClear() {} void System_AudioPushSamples(const s32 *audio, int numSamples) {} // TODO: To avoid having to define these here, these should probably be turned into system "requests". -void NativeSaveSecret(const char *nameOfSecret, const std::string &data) {} +bool NativeSaveSecret(const char *nameOfSecret, const std::string &data) { return false; } std::string NativeLoadSecret(const char *nameOfSecret) { return ""; } diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 2c4ebdc34d..5dcc952f58 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -1753,7 +1753,7 @@ void System_InputBoxGetString(const std::string &title, const std::string &defau #endif // TODO: To avoid having to define these here, these should probably be turned into system "requests". -void NativeSaveSecret(const char *nameOfSecret, const std::string &data) {} +bool NativeSaveSecret(const char *nameOfSecret, const std::string &data) { return false; } std::string NativeLoadSecret(const char *nameOfSecret) { return ""; } diff --git a/unittest/UnitTest.cpp b/unittest/UnitTest.cpp index d2bc62a04a..ac7b5ba763 100644 --- a/unittest/UnitTest.cpp +++ b/unittest/UnitTest.cpp @@ -104,7 +104,7 @@ void System_AudioClear() {} void System_AudioPushSamples(const s32 *audio, int numSamples) {} // TODO: To avoid having to define these here, these should probably be turned into system "requests". -void NativeSaveSecret(const char *nameOfSecret, const std::string &data) {} +bool NativeSaveSecret(const char *nameOfSecret, const std::string &data) { return false; } std::string NativeLoadSecret(const char *nameOfSecret) { return ""; }