Files
AnyPS5/docs/dev/debt/libSceNpTus.md
T
Dean b14af0b8c3 Merge pull request #10693 from MarcZX10/marc/sweep-np-tss
feat(libSceNpTus): implement sceNpTssGetData and sceNpTssGetDataAsync
2026-11-01 14:58:29 +13:00

16 KiB

libSceNpTus technical debt

Unknown function info

  • TUS variable outputs (libSceNpTus) - the layouts of the variable arrays of the sceNpTusGetMultiSlotVariable* calls and of outVariable in sceNpTusAddAndGetVariableAAsync are not verified, so the output is never written and variableArraySize / outVariableSize are not checked; shadPS4, and RPCS3 in its PS3 sceNpTusGetMultiSlotVariable* and sceNpTusAddAndGetVariable* calls, return INVALID_ALIGNMENT unless the size is arrayLen variables of the call's type, or one variable for outVariable. The signatures and the community error codes follow shadPS4, which fpPS4 agrees with for the context and request calls; no console measurement.
  • Multi-slot variable calls (libSceNpTus) - the argument checks of the multi-slot get, set and delete calls are not measured on a console; they follow shadPS4, where they differ between functions: arrayLen < 1 is INSUFFICIENT_ARGUMENT in the NpId and virtual-user delete calls and in sceNpTusGetMultiSlotVariableVUserAsync, and INVALID_ARGUMENT in the others; a null NpId is accepted except in delete; an empty virtual user ID is INVALID_ARGUMENT. RPCS3's PS3 module has only the NpId and virtual-user calls; it returns INVALID_ARGUMENT for an empty array in all of them, rejects a null target in get and set and does not check for an empty virtual user ID.
  • Variable, data, data status and TSS requests (libSceNpTus) - the argument checks of the 82 add-and-get, try-and-set, data, data status, multi-user, friends and sceNpTssGetSmallStorage calls are not measured on a console; their signatures, checks and order follow shadPS4, including its differences between forms: the NpId try-and-set calls return INVALID_ARGUMENT for an operation type outside 1-6 where the others return INVALID_TYPE, and the NpId and virtual-user multi-slot data status calls return TOO_MANY_NPID for more than 64 slots. As for the calls above, the output and structure sizes are not checked, and every request finishes with SCE_NP_ERROR_SIGNED_OUT
  • sceNpTusSetThreadParam (libSceNpTus) - unknown signature
  • sceNpTusCreateTitleCtx (libSceNpTus) - unknown signature
  • sceNpTusSetTimeout (libSceNpTus) - unknown signature
  • sceNpTusChangeModeForOtherSaveDataOwners (libSceNpTus) - unknown signature
  • sceNpTusDeleteMultiSlotDataVUser (libSceNpTus) - waits on the request that sceNpTusDeleteMultiSlotDataVUserAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT. The checks of sceNpTusDeleteMultiSlotDataVUserAsync apply.
  • sceNpTusDeleteMultiSlotDataVUserAsync (libSceNpTus) - the argument checks and their order follow shadPS4 and are not measured on a console: a null virtual user, null slot ids or no slot are INSUFFICIENT_ARGUMENT, a non-null option, a negative slot id or an empty virtual user are INVALID_ARGUMENT and more than 64 slots are TOO_MANY_SLOTID. The request finishes with SCE_NP_ERROR_SIGNED_OUT and no slot data exists to delete.
  • sceNpTssGetStorage (libSceNpTus) - unknown signature
  • sceNpTssGetStorageAsync (libSceNpTus) - unknown signature
  • sceNpTssGetDataAsync (libSceNpTus) - the implemented argument checks and their order are not measured on a console: a non-null option must have size 0x20 or returns INVALID_ALIGNMENT; a non-null dataStatus must have dataStatusSize 0x18 or also returns INVALID_ALIGNMENT; a null dataStatus is accepted and its size is ignored; and a slot id outside 0 to 15 returns INVALID_ARGUMENT. The option-size check precedes the data-status-size check, which precedes the slot and request checks. The data-status layout is unverified, and nothing is written to the data status or the data. The option's offsets and condition are not read, and the transfer offset that shadPS4 keeps per request is not kept. The request finishes with SCE_NP_ERROR_SIGNED_OUT.
  • sceNpTssGetData (libSceNpTus) - waits on the request that sceNpTssGetDataAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT. The checks of sceNpTssGetDataAsync apply.
  • sceNpTusGetDataForCrossSaveVUser (libSceNpTus) - waits on the request that sceNpTusGetDataForCrossSaveVUserAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT. The checks of sceNpTusGetDataForCrossSaveVUserAsync apply.
  • sceNpTusGetDataForCrossSaveVUserAsync (libSceNpTus) - the argument checks and their order follow shadPS4 and are not measured on a console. dataStatusSize and the layout of dataStatus are not checked, and dataStatus and data are never written, so no transfer offset is kept between calls. The request finishes with SCE_NP_ERROR_SIGNED_OUT.
  • sceNpTusGetFriendsVariableA (libSceNpTus) - waits on the request that sceNpTusGetFriendsVariableAAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT; the number of entries read that the console returns on success is never produced. The checks of sceNpTusGetFriendsVariableAAsync apply.
  • sceNpTusGetFriendsVariableAAsync (libSceNpTus) - the argument checks and their order follow shadPS4 and are not measured on a console. variableArraySize and the size of its entries are not checked and the array is never written. A non-null option is read as size, startSerialRank and hits (0x18 bytes): another size is INVALID_ALIGNMENT and a startSerialRank of 0 is INVALID_ARGUMENT; hits is never written, and the option is accepted where sceNpTusGetFriendsVariableAsync refuses every option. The request finishes with SCE_NP_ERROR_SIGNED_OUT.
  • sceNpTusGetFriendsVariableForCrossSave (libSceNpTus) - waits on the request that sceNpTusGetFriendsVariableForCrossSaveAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT; the number of entries read that the console returns on success is never produced. The checks of sceNpTusGetFriendsVariableForCrossSaveAsync apply.
  • sceNpTusGetFriendsVariableForCrossSaveAsync (libSceNpTus) - the argument checks and their order follow shadPS4 and are not measured on a console. variableArraySize and the size of its entries are not checked and the array is never written. A non-null option is read as size, startSerialRank and hits (0x18 bytes): another size is INVALID_ALIGNMENT and a startSerialRank of 0 is INVALID_ARGUMENT; hits is never written, and the option is accepted where sceNpTusGetFriendsVariableAsync refuses every option. The request finishes with SCE_NP_ERROR_SIGNED_OUT.
  • sceNpTusGetFriendsDataStatusA (libSceNpTus) - waits on the request that sceNpTusGetFriendsDataStatusAAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT; the number of entries read that the console returns on success is never produced. The checks of sceNpTusGetFriendsDataStatusAAsync apply.
  • sceNpTusGetFriendsDataStatusAAsync (libSceNpTus) - the argument checks and their order follow shadPS4 and are not measured on a console. statusArraySize and the size of its entries are not checked and the array is never written. A non-null option is read as size, startSerialRank and hits (0x18 bytes): another size is INVALID_ALIGNMENT and a startSerialRank of 0 is INVALID_ARGUMENT; hits is never written, and the option is accepted where sceNpTusGetFriendsDataStatusAsync refuses every option. The request finishes with SCE_NP_ERROR_SIGNED_OUT.
  • sceNpTusGetFriendsDataStatusForCrossSave (libSceNpTus) - waits on the request that sceNpTusGetFriendsDataStatusForCrossSaveAsync starts, as shadPS4 does, and returns its argument error or SCE_NP_ERROR_SIGNED_OUT; the number of entries read that the console returns on success is never produced. The checks of sceNpTusGetFriendsDataStatusForCrossSaveAsync apply.
  • sceNpTusGetFriendsDataStatusForCrossSaveAsync (libSceNpTus) - the argument checks and their order follow shadPS4 and are not measured on a console. statusArraySize and the size of its entries are not checked and the array is never written. A non-null option is read as size, startSerialRank and hits (0x18 bytes): another size is INVALID_ALIGNMENT and a startSerialRank of 0 is INVALID_ARGUMENT; hits is never written, and the option is accepted where sceNpTusGetFriendsDataStatusAsync refuses every option. The request finishes with SCE_NP_ERROR_SIGNED_OUT.
  • Friends, cross-save and virtual-user argument checks (libSceNpTus) - unverified: the checks of the A and ForCrossSave friends calls, sceNpTusGetDataForCrossSaveVUser and sceNpTusDeleteMultiSlotDataVUser, and their *Async forms, follow shadPS4 and their tests assert those results; no console measured them. An emulator run of the firmware 13.42 module (report) differs: the friends calls refuse an array size other than arrayLen times the entry size with 0x80550714, answer an option size mismatch with 0x80550704, accept start rank 0 and zero the array for SDK 5.50 and later; the data status call takes only a dataStatusSize of 0x1F0 or 0x210 and accepts a null status or empty name; the delete call accepts a null or empty virtual user and arrayLen -1, and refuses 0 with 0x80550704.
  • sceNpTusDeleteNpTitleCtx (libSceNpTus) - the PS5 signature, error codes and child-request lifetime have not been measured on a console. Deletion invalidates the context and all its requests, following shadPS4.

Functional

  • sceNpTusCreateNpTitleCtxA (libSceNpTus) - creates a title context without checking sign-in, up to 32 contexts (TOO_MANY_OBJECTS beyond); shadPS4 returns the sceNpGetNpId error instead. Requests are limited to 256, and the limits are not measured on a console.
  • sceNpTssCreateNpTitleCtx and sceNpTssCreateNpTitleCtxA (libSceNpTus) - that TSS title contexts share the TUS context table and its 32-context limit is inferred from shadPS4, which redirects both to the TUS creators, and from TSS requests coming from sceNpTusCreateRequest; nothing is measured on a console. The A form is sceNpTusCreateNpTitleCtxA. The NpId form returns INSUFFICIENT_ARGUMENT for a null npId and INVALID_ARGUMENT for service label 0xFFFFFFFF before the limit, as shadPS4's sceNpTusCreateNpTitleCtx does; the signatures are shadPS4's and fpPS4's, and Orbital's for the A form.
  • sceNpTusCreateNpTitleCtx (libSceNpTus) - not measured on a console, and the npId contents are neither read nor kept with the context, where shadPS4 keeps them for its requests. It is sceNpTssCreateNpTitleCtx: INSUFFICIENT_ARGUMENT for a null npId, then INVALID_ARGUMENT for service label 0xFFFFFFFF, then a context in the shared 32-context table, as in shadPS4; the signature is shadPS4's and fpPS4's.
  • sceNpTusPollAsync, sceNpTusWaitAsync (libSceNpTus) - there is no PSN, so every implemented *Async call whose arguments pass the checks starts a request that finishes at once with SCE_NP_ERROR_SIGNED_OUT, which poll and wait report and the blocking calls return; shadPS4 returns SIGNED_OUT from the *Async call itself when no shadNet client is signed in, and RPCS3 returns INVALID_ONLINE_ID while offline, marked there as probable behaviour. An abort stays set, so every later operation on the request, blocking ones included, finishes with ABORTED; in shadPS4 an abort only ends the operation in progress. Until an operation has started, poll returns 1 and wait returns INVALID_ARGUMENT as in shadPS4; RPCS3 blocks until a result is set.
  • sceNpTusGetData, sceNpTusGetDataVUser, sceNpTusGetMultiSlotVariable, sceNpTusGetMultiSlotVariableVUser, sceNpTusGetMultiUserVariableForCrossSave, sceNpTusSetData, sceNpTusSetDataVUser, sceNpTusSetMultiSlotVariable and sceNpTusSetMultiSlotVariableVUser (libSceNpTus) - block on their *Async forms with the same parameters, as shadPS4 does, so they inherit those forms' unmeasured checks and the offline SIGNED_OUT result