Commit Graph
25 Commits
Author SHA1 Message Date
xdCloudy 1dd35ad32e feat(prx): add missing libSceNpTrophy2 exports 2026-10-21 02:37:18 +01:00
Yunus Shaikh a8dd45faa3 fix(libSceNpTrophy2): refuse a posted unlock of an unknown, platinum or progressive trophy
With the title's trophy data loaded, an _UnlockTrophy posted through UDS
no longer records an id the data does not have, the platinum, or a
progressive trophy. Each refusal logs the trophy and the reason, returns
false and calls no listener.

The statistics path and the platinum award now use an internal record
that keeps part 1's behaviour, so a progressive trophy still unlocks
through its statistic and the platinum with the last trophy that names
it. Without trophy data every id of 0 or more is recorded as before.
2026-10-17 23:29:17 +00:00
Yunus Shaikh 4362803457 feat(libSceNpUniversalDataSystem): unlock trophies through the title's statistics
Events other than the trophy events go through the title's
sce_sys/uds/udsNN.ucp: stats_definition.json gives the statistics that
keep their latest uint32 or uint64 value, and stats_extraction.json the
event property ($.name, dotted for nested objects) that sets each one.
Statistics are kept per user and service label in
_trophy/<user id>_<service label>.stats.txt next to the unlocks.

After each event that sets a statistic, every trophy's unlockCondition
(ge, gt, le or lt against its targetValue) is checked on the values that
event set and the stored values of the other statistics, so a later
event setting the same statistic cannot hide what this one reached.
Reached trophies unlock through the same path as _UnlockTrophy.
Progressive trophies report their statistic as progress, and
APS5_TRACE_UDS prints each statistic an event sets. A missing udsNN.ucp
is ignored and a malformed one is logged once.
2026-10-17 23:28:56 +00:00
Yunus Shaikh 95179c1d61 feat(libSceNpTrophy2): record trophy unlocks per title and user
Unlocks are kept in _trophy/<user id>_<service label>.txt in the title's
run directory, one "<trophy id> <RTC tick>" line per trophy, and each new
unlock logs "[trophy] <title id> unlocked trophy <id> for user <id>".
GetTrophyInfo, GetTrophyInfoArray, GetGroupInfo, GetGroupInfoArray and
GetGameInfo report the recorded unlocks, their times, the unlocked
counts by grade and the progress percentage. An unlock also unlocks the
platinum the trophy names once every trophy naming that platinum is
unlocked. Unlock listeners let a later notification subscribe. Removing a
listener waits for its running callback, and a listener removed during a
dispatch is not called by it.
2026-10-17 23:27:39 +00:00
Yunus Shaikh d374de5e38 feat(libSceNpTrophy2): report the title's trophy data from trophyNN.ucp
The title's sce_sys/trophy2/trophyNN.ucp is read on first use with a
bounds-checked .ucp reader and a small JSON reader. tropconf.json gives
each trophy's grade, group, hidden and reward flags, platinum and
unlock condition, and tropmeta_<tag>.json its texts in the console
language, then en-US, then the file's default language. Contexts
remember their user and service label, so the queries find the file.

The trophy, group and game queries report these names, grades, groups
and counts, list every trophy and group, and give progressive trophies
their target. Unlocks are not recorded yet, so every trophy reports as
locked and nothing is written to the host. A missing file is ignored
and a malformed one is logged once; either way the queries keep their
placeholders. A JSON document that nests deeper than 64 levels or holds
more than 1048576 values counts as malformed, which keeps the parsed
values to about 140 MiB.
2026-10-17 23:25:07 +00:00
Yunus Shaikh e40191d7c9 fix(libSceNpTrophy2): give progress values a type and a 64-bit value
A progress value is {int32 type, 4 reserved bytes, uint64 value}, as
KytyPS5 lays it out, which makes the trophy details 1312 bytes and the
trophy data 32 bytes. Size checks for every query structure keep the
layout fixed, and the technical debt names its single public source.
2026-10-17 23:21:04 +00:00
Aryan SharmaandClaude Haiku 5.5 6a8062b487 feat(libSceNpTrophy2): declare sceNpTrophy2GetRewardIcon's arguments
The bundled PSNCore.prx of PPSA06888 calls sceNpTrophy2GetRewardIcon
with (context, handle, reward_id, buffer, size): once with a null buffer
to read the size, then with a buffer of that size. The function still
throws because the reward icon data is unknown.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-17 16:45:41 +05:30
Simon 69e3c1d115 fix(libSceNpTrophy2): accept a null details or data in GetTrophyInfo and GetGroupInfo
sceNpTrophy2GetTrophyInfo and sceNpTrophy2GetGroupInfo rejected a call
unless both outputs were given, although both already fill each output
only when it is not null. PPSA18391 (Clickteam Fusion) queries trophies
with a null details. Only a call with neither output is rejected now, as
in sceNpTrophy2GetGameInfo.
2026-10-11 15:35:56 +02:00
Adrià Franch ddf6b8c984 test(libSceNpTrophy2): cover sceNpTrophy2ShowTrophyList, take the context argument 2026-10-11 13:08:03 +02:00
SueryandClaude Opus 5.5 6c96c2ee1e fix(libSceNpTrophy2): return success from sceNpTrophy2ShowTrophyList
There is no system trophy UI, so the call returns success without showing a
list, like the other silent NpTrophy2 entry points; recorded in
docs/dev/TechnicalDebt.md. PPSA15552 (Dead Cells) calls it and
aborted on the NotImplemented exception.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017Dqgm9nUKygsXzr6poJsHJ
2026-10-11 07:02:34 -04:00
Claude 121d9332b5 build(libs): strip the MinGW static runtime flags once for all libraries
Every library CMakeLists.txt ended with the same block removing -static,
-static-libgcc and -static-libstdc++ from CMAKE_EXE_LINKER_FLAGS on MinGW,
because core/libs/CMakeLists.txt only removed them after adding the library
directories. Remove them before the libc and library directories are added
so each directory inherits the stripped flags, and drop the 52 copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017pTZqAyVSZy2FZmaqakPHZ
2026-10-07 10:10:38 +00:00
Dean 3e79925c4b Merge pull request #912 from Pacuka/fix/trophy2-gameinfo-null-data
fix(trophy2): accept a null data or details in sceNpTrophy2GetGameInfo
2026-10-07 10:17:49 +13:00
PacukaandClaude Opus 5.5 30a6e03636 fix(trophy2): accept a null data or details in sceNpTrophy2GetGameInfo
The Smurfs Dreams (Unreal Engine) asks only for the game details and
passes a null data pointer; on success it reads the trophy count from the
details, on a negative result it takes its error path. The function
already fills each output only when it is given, but rejected the call
unless both were. Only a call without either output is rejected now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 17:58:35 +02:00
MerijnandClaude Opus 5.5 d82bae0934 feat(libs): add exports imported by PPSA12544's Unity plugins
PPSA12544's Media/Plugins modules (CommonDialog, PSN, Share) import
libSceVrSetupDialog, which no library provided, and Share, NpTrophy2,
WebBrowserDialog and NpEntitlementAccess functions that were not
exported. Add libSceVrSetupDialog and the missing functions as
unimplemented exports, except
sceNpEntitlementAccessRequestConsumeServiceEntitlement, which reports
SCE_NP_ERROR_SIGNED_OUT like
sceNpEntitlementAccessRequestConsumeUnifiedEntitlement. Their other
imports are covered by #734 and #369, and two by #407.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 23:18:46 +02:00
Adrià FranchandClaude f3e783b6cb feat(libs): implement sceNpTrophy2UnregisterUnlockCallback
Co-Authored-By: Claude <[email protected]>
2026-10-05 19:14:49 +02:00
Pouare514 ac7bc704c3 fix(prx): export tripwire NIDs under recomputed real names, restore main's hunks 2026-10-05 02:13:22 +02:00
Pouare514 66a95ada20 feat(prx): unknown loader tripwires for TLOU 2026-10-05 02:12:32 +02:00
boykopovar bd0969c3a4 fix(libs): ex from libc prx: unwind for catch fix (mingw) 2026-09-13 19:21:31 +03:00
boykopovar 4781694512 feat(libs): NpTrophy2 impl + fopen not found logic update 2026-09-13 11:01:59 +03:00
boykopovar 0c2cfe0564 feat(NpTrophy2): add user data constants 2026-09-13 10:35:37 +03:00
boykopovar 42e1bad3d2 refactor(libs): move NpTrophy2 types from global SceTypes to libSceNpTrophy2 2026-09-13 10:30:13 +03:00
boykopovar 7d40561780 refactor(libs): organize NpTrophy2 with cmakelists 2026-09-13 10:19:56 +03:00
boykopovar abc72da741 feat(libs): define vabi macros + add to declarations 2026-09-10 08:07:03 +03:00
boykopovar 6123893998 feat(libs): throw not impl ex in every stub 2026-09-06 15:05:04 +03:00
boykopovar 59bee8d187 feat(libs): add libs function signatures 2026-08-20 23:18:16 +03:00