Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/libs/prx/libSceNpTrophy2/src/GameInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion core/libs/prx/libSceNpTrophy2/src/GroupInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
2 changes: 1 addition & 1 deletion core/libs/prx/libSceNpTrophy2/src/TrophyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
10 changes: 10 additions & 0 deletions core/libs/tests/GuestNpTrophy2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions docs/dev/debt/libSceNpTrophy2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading