Skip to content
Closed
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
6 changes: 3 additions & 3 deletions core/libs/prx/libSceNpManager/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ int APS5_VABI sceNpUnregisterPremiumEventCallback(void) {
return 0;
}

int APS5_VABI sceNpGetUserIdByAccountId() {
NotImplemented_nid_no_patch(__func__);
return 0;
int APS5_VABI sceNpGetUserIdByAccountId(uint64_t accountId, int* userId) {
if (accountId == 0 || !userId) return SCE_NP_ERROR_INVALID_ARGUMENT;
return SCE_NP_ERROR_SIGNED_OUT;
}

}
6 changes: 6 additions & 0 deletions core/libs/tests/GuestNpManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <cstring>

extern "C" {
int APS5_VABI sceNpGetUserIdByAccountId(uint64_t accountId, int* userId);
int APS5_VABI sceNpGetNpId(int user_id, NpId* np_id);
}

Expand All @@ -24,6 +25,11 @@ void Require(bool condition, const char* message) {
}

int main() {
int userId = 0x7a7a;
Require(sceNpGetUserIdByAccountId(0x1234, &userId) == SignedOut, "sceNpGetUserIdByAccountId must report the account as signed out");
Require(userId == 0x7a7a, "sceNpGetUserIdByAccountId must leave the user id untouched");
Require(sceNpGetUserIdByAccountId(0, &userId) == InvalidArgument, "sceNpGetUserIdByAccountId must reject account id 0");
Require(sceNpGetUserIdByAccountId(0x1234, nullptr) == InvalidArgument, "sceNpGetUserIdByAccountId must reject a null user id");
NpId npId{};
std::memset(&npId, 0x5a, sizeof(npId));
NpId untouched{};
Expand Down
1 change: 1 addition & 0 deletions docs/dev/TechnicalDebt.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Throughout the project, every function at every stage either **does exactly what
- [sceCoredumpWriteUserString](../../core/libs/prx/libkernel/System/src/Coredump.cpp) and [sceSaveDataConvert, sceSaveDataGetConvertProgress](../../core/libs/prx/libSceSaveData.native/Export.cpp) - imported by PPSA16064, not called during its start-up and added without an implementation; unknown signatures
- [sce::Json::Parser::parse](../../core/libs/prx/libSceJson2/Export.cpp) (libSceJson2) - a number that overflows a double (e.g. `1e309`) throws: whether the console rejects the document or stores an infinite real is unknown
- [sceUserServiceGetNpAccountId](../../core/libs/prx/libSceUserService/Export.cpp) (libSceUserService) - the account id for a user with no linked PSN account is assumed to be 0 with success; libSceNpManager's `sceNpGetAccountIdA` answers the same question with `SCE_NP_ERROR_SIGNED_OUT`
- [sceNpGetUserIdByAccountId](../../core/libs/prx/libSceNpManager/Export.cpp) (libSceNpManager) - the signature `(accountId, userId*)` and the errors for a zero account id or a null pointer are taken from [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/945dbc3cc3eee80ac3e053b438502ed936fa6bb2/src/core/libraries/np/np_manager.cpp); not confirmed on a PS5 title (PPSA14632 imports it). No account is ever signed in here, so every valid lookup returns `SCE_NP_ERROR_SIGNED_OUT`
- [sceUserServiceGetUserColor](../../core/libs/prx/libSceUserService/Export.cpp) (libSceUserService) - the default profile colour is assumed to be blue (0)
- [kP2L8t3j-aM](../../core/libs/prx/libSceVideoOut/src/Output.cpp) (libSceVideoOut) - unknown name, signature
- [LibwuIonIBw](../../core/libs/prx/libSceVideoOut/src/Output.cpp) (libSceVideoOut) - unknown name, signature
Expand Down