5.8 KiB
libSceNpTrophy2 technical debt
Silent stubs
- libSceNpTrophy2:
sceNpTrophy2RegisterUnlockCallbackaccepts a callback that is never called, as the callback's signature and when the console calls it are not known,sceNpTrophy2UnregisterUnlockCallbackonly returns success, andsceNpTrophy2ShowTrophyListreturns success without showing a list (there is no system trophy UI; seen on PPSA15552).
Unknown function info
-
Query structures: a progress value is a 16-byte
{int32 type, 4 reserved bytes, uint64 value}and the game, group and trophy structures are 152, 24, 152, 32, 1312 and 32 bytes, as KytyPS5 asserts; no other public source confirms the layout. Progress type 1 marks a progressive trophy's target and progress, as in KytyPS5. Trophies without agroupIdbelong to group -1, KytyPS5's base game group. -
sceNpTrophy2GetRewardIcon (libSceNpTrophy2) takes
(int context, int handle, int reward_id, void* buffer, size_t* size), from the call sites in the bundledMedia/Plugins/PSNCore.prxof PPSA06888, the same shape assceNpTrophy2GetTrophyIcon. The title calls it twice: first with a null buffer to read the size, then with a buffer of that size allocated withmalloc. The meaning of the third argument is unverified, and the reward icon data is unknown, so every call throws -
libSceNpTrophy2 pending exports - 23 named callable exports were identified in the PS5 3.20 export table and cross-checked against firmware 13.60. Signatures and behavior remain unverified; declarations use the unknown-signature convention and throw through
NotImplemented_nid_no_patch. Evidence: 3.20 export list.
Functional
- Trophy queries report the title's trophy data (
sce_sys/trophy2/trophyNN.ucp) and the unlocks in the trophy store. Without the file, or when it is malformed, they report the old placeholders andsceNpTrophy2GetTrophyInfoArraylists only trophy 0. Icons are not read. Hidden trophies report their names and descriptions; whether the console blanks them before the unlock is not known.progress_percentageweighs gold 6, silver 2 and bronze 1 and leaves the platinum out, as KytyPS5 does (the ratio of the published PSN trophy points); the console's formula is not known. A trophy or group that is not in the file throws. A context that was not created or was destroyed reports placeholders and no unlocks and returns success; the console's errors for it are unknown. - Trophy data limits: a
trophyNN.ucporudsNN.ucplarger than 256 MiB or listing more than 4096 files, and a JSON file in it that nests deeper than 64 levels or holds more than 1048576 values, are not used, and the title runs as without that file. The limits keep the memory the reader takes to the file and about 140 MiB of parsed JSON; the console's limits are not known. - Text language: texts come from
tropmeta_<tag>.jsonfor the console language, thenen-US, then the file'sdefaultLanguage. The tags for languages 0 to 29 are KytyPS5's;uk-UAfor 30 (Ukrainian) is an assumption. - Platinum: an unlock through any path unlocks the platinum that the trophy names in
platinumTrophyIdonce every trophy naming that platinum is unlocked, as KytyPS5 does; trophies withoutplatinumTrophyIdare not required. With the title's trophy data loaded, a posted_UnlockTrophyof a trophy that is not in the data, of a platinum or of a progressive trophy is not stored and prints a[trophy] ignoredline, as KytyPS5 refuses them, so a progressive trophy unlocks only through its statistic; without trophy data any id of 0 or more is stored, including ids the data would make the platinum, a progressive trophy or no trophy, and the platinum is not unlocked when the trophies it needs are. The console's behaviour is not known. - Damaged records: a line in
_trophy/<user id>_<service label>.txtor.stats.txtthat is not a new<id> <value>pair (a blank line, a carriage return, a repeated or negative id, a value that is not a number) makesreadRecordthrow astd::runtime_errorthat names the file and the line. Every call that reads that record then throws it instead of returning, which stops the title as any throwing export does, so the title gets no return value; main returned 0 from these calls. The failed read is not kept, so each later call reads the file again and throws again until the file is fixed or deleted. The unlock record is read bysceNpTrophy2GetTrophyInfo,sceNpTrophy2GetTrophyInfoArrayandsceNpTrophy2GetGameInfofor a created context, bysceNpTrophy2GetGroupInfoandsceNpTrophy2GetGroupInfoArraywhen the title's trophy data is loaded, by asceNpUniversalDataSystemPostEventof an_UnlockTrophythat the trophy data does not refuse, and by a statistic change when the trophy data is loaded; the stat record by asceNpUniversalDataSystemPostEventof an event that a statistics rule copies and by the trophy queries of a progressive trophy with a statistic. What the console does with a damaged record is not known.