diff --git a/core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp b/core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp index 4e7c77100317..0a31bae46a03 100644 --- a/core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp +++ b/core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp @@ -71,7 +71,7 @@ int APS5_VABI sceNpTrophy2GetGameIcon(int context, int handle, void* buffer, siz if (size != nullptr) { *size = NP_TROPHY2_ICON_SIZE_NONE; } - throw std::runtime_error(std::string(__func__) + ": icon file not found"); + return SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND; } int APS5_VABI sceNpTrophy2RegisterUnlockCallback(void* callback, void* userdata) { diff --git a/core/libs/prx/libSceNpTrophy2/src/GroupInfo.cpp b/core/libs/prx/libSceNpTrophy2/src/GroupInfo.cpp index d06dc60177cd..bfcf3829aa60 100644 --- a/core/libs/prx/libSceNpTrophy2/src/GroupInfo.cpp +++ b/core/libs/prx/libSceNpTrophy2/src/GroupInfo.cpp @@ -117,7 +117,7 @@ int APS5_VABI sceNpTrophy2GetGroupIcon(int context, int handle, int group_id, vo if (size != nullptr) { *size = NP_TROPHY2_ICON_SIZE_NONE; } - throw std::runtime_error(std::string(__func__) + ": icon file not found"); + return SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND; } } diff --git a/core/libs/prx/libSceNpTrophy2/src/TrophyInfo.cpp b/core/libs/prx/libSceNpTrophy2/src/TrophyInfo.cpp index 1cabae19e7b6..81a2b5cc3a39 100644 --- a/core/libs/prx/libSceNpTrophy2/src/TrophyInfo.cpp +++ b/core/libs/prx/libSceNpTrophy2/src/TrophyInfo.cpp @@ -121,7 +121,7 @@ int APS5_VABI sceNpTrophy2GetTrophyIcon(int context, int handle, int trophy_id, if (size != nullptr) { *size = NP_TROPHY2_ICON_SIZE_NONE; } - throw std::runtime_error(std::string(__func__) + ": icon file not found"); + return SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND; } } diff --git a/core/libs/tests/GuestNpTrophy2.cpp b/core/libs/tests/GuestNpTrophy2.cpp index 923c21abd201..835504b1741a 100644 --- a/core/libs/tests/GuestNpTrophy2.cpp +++ b/core/libs/tests/GuestNpTrophy2.cpp @@ -58,6 +58,16 @@ int main() { Require(sceNpTrophy2GetRewardIcon(1, 1, 1, nullptr, &iconSize) == SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND); Require(iconSize == 0); Require(sceNpTrophy2GetRewardIcon(1, 1, 1, nullptr, nullptr) == SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND); + std::size_t gameIconSize = 1234; + Require(sceNpTrophy2GetGameIcon(1, 1, nullptr, &gameIconSize) == SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND); + Require(gameIconSize == 0); + std::size_t groupIconSize = 1234; + Require(sceNpTrophy2GetGroupIcon(1, 1, 2, nullptr, &groupIconSize) == SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND); + Require(groupIconSize == 0); + std::size_t trophyIconSize = 1234; + Require(sceNpTrophy2GetTrophyIcon(1, 1, 3, nullptr, &trophyIconSize) == SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND); + Require(trophyIconSize == 0); + Require(sceNpTrophy2GetTrophyIcon(1, 1, 3, nullptr, nullptr) == SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND); int handle = -1; Require(sceNpTrophy2CreateHandle(&handle) == SCE_NP_TROPHY2_OK); diff --git a/docs/dev/debt/libSceNpTrophy2.md b/docs/dev/debt/libSceNpTrophy2.md index 18b4250235a8..b2cc150cb3ed 100644 --- a/docs/dev/debt/libSceNpTrophy2.md +++ b/docs/dev/debt/libSceNpTrophy2.md @@ -2,6 +2,7 @@ ### Silent stubs +- [sceNpTrophy2GetGameIcon](../../../core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp), [sceNpTrophy2GetGroupIcon](../../../core/libs/prx/libSceNpTrophy2/src/GroupInfo.cpp) and [sceNpTrophy2GetTrophyIcon](../../../core/libs/prx/libSceNpTrophy2/src/TrophyInfo.cpp) (libSceNpTrophy2) - zero the size and return `SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND` (-2141898479, 0x80553911) whether or not an icon exists: no file is read, and the context, handle, id and buffer are ignored. The error value is inferred from the sibling calls in KytyPS5 (libTrophy.cpp:464/483/502), as for the entry below; the console's answer is not measured. - [sceNpTrophy2GetRewardIcon](../../../core/libs/prx/libSceNpTrophy2/src/Context.cpp) (libSceNpTrophy2) - zeroes size and returns `SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND` (-2141898479): the `(int context, int handle, int reward_id, void* buffer, size_t* size)` signature and two-stage query pattern follow the bundled `Media/Plugins/PSNCore.prx` of PPSA06888 and SharpProspero; returning -2141898479 (0x80553911) when icons are unavailable is inferred from sibling calls (sceNpTrophy2GetGameIcon, sceNpTrophy2GetGroupIcon, sceNpTrophy2GetTrophyIcon) in KytyPS5 (libTrophy.cpp:464/483/502) - [libSceNpTrophy2](../../../core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp): `sceNpTrophy2RegisterUnlockCallback` accepts a callback that is never called, as the callback's signature and when the console calls it are not known, `sceNpTrophy2UnregisterUnlockCallback` only returns success, and `sceNpTrophy2ShowTrophyList` returns success without showing a list (there is no system trophy UI; seen on PPSA15552). - [sceNpTrophy2RegisterContext](../../../core/libs/prx/libSceNpTrophy2/src/Context.cpp) (libSceNpTrophy2) - returns `SCE_NP_TROPHY2_OK` and ignores its arguments: it checks neither the context nor the handle and records nothing. Eight titles in my set call it.