Repository navigation
fix(libSceNpTrophy2): return INVALID_TROPHY_ID for a trophy that is not in the title's data - #9115
Merged
oneandonlydean merged 1 commit intoOct 22, 2026
Conversation
This was referenced Oct 21, 2026
Contributor
|
Independent Windows run of this PR (data only). Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against PR head tested: Results (3 runs each):
GPU: the run output has no Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code). |
…ot in the title's data sceNpTrophy2GetTrophyInfo threw std::invalid_argument for a trophy id that is not in the title's trophyNN.ucp, so a title that asks for one stopped (PPSA14363 asks for trophy 19 of ids 0 to 18). KytyPS5 returns NP_TROPHY2_ERROR_INVALID_TROPHY_ID (0x8055390A) there without writing either output; return the same. A group that is not in the data still throws. Co-Authored-By: Claude <noreply@anthropic.com>
thuanquang
force-pushed
the
fix/trophy2-unknown-id-error
branch
from
October 21, 2026 18:46
6eb4376 to
a42182e
Compare
This was referenced Oct 21, 2026
This was referenced Oct 22, 2026
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
METAL GEAR SOLID Master Collection Vol. 1 (PPSA14363) stops a few seconds after start-up on
main3e91c8e (64 commits before this branch's base 2f161d4; no libSceNpTrophy2 file has changed since, andTrophyInfo.cpp:86still throws on currentmaineaff876):The title's trophy data has ids 0 to 18, and the title asks for trophy 19. #7262 made
sceNpTrophy2GetTrophyInforead the title'strophyNN.ucpand throw for an id that is not in it, and chose not to adopt KytyPS5's error codes because no other public source confirmed them. KytyPS5 is still the only source for this code. REVERSE_ENGINEERING.md lists other implementations, KytyPS5 by name, as the third kind of source, after a console measurement and the library's own code; neither of those two is used here, and either would settle the value.mainalready returns error codes on KytyPS5's word alone:sceAudioOut2MasteringGetStatereturns0x80268204for a states id it does not know and0x80268201for a null state (libSceAudioOut debt).KytyPS5 returns
NP_TROPHY2_ERROR_INVALID_TROPHY_IDfor such an id, before it writes either output. It defines the value as0x8055390a(L123). This is the KytyPS5 commit the libSceNpTrophy2 debt file links for the structure layouts (itsprogress_percentageand platinum entries also follow KytyPS5, without naming a commit), andmainalready defines itsNP_TROPHY2_ERROR_ICON_FILE_NOT_FOUNDvalue (0x80553911, L25; added in 0c2cfe0), though the icon queries throw instead of returning it. The code also has the low byte of the PS4 library'sINVALID_TROPHY_ID,0x8055160A(shadPS4), as KytyPS5'sINVALID_ARGUMENTandINVALID_CONTEXTdo (0x04and0x09, L121-L122, against the PS4 library's0x80551604and0x80551609, shadPS4); that is a pattern, not a source. The only other project found to carry0x8055390a, Orbistoun, takes its codes from "the reference emulators" and says they are "Assumed, not measured". With this change,sceNpTrophy2GetTrophyInforeturnsSCE_NP_TROPHY2_ERROR_INVALID_TROPHY_ID(0x8055390A) and writes neither output. Whether the console returns the same code is not confirmed; the debt entry says so.Unchanged: a group id that is not in the data still throws in
sceNpTrophy2GetGroupInfo(KytyPS5 returns0x8055390Bthere, L366 and L124, but no title is known to need it), and both outputs null still throws.The "Trophy queries" debt entry is rewritten gap first (959 -> 992 characters). It keeps the other facts, and replaces "A trophy or group that is not in the file throws" with the new return of
sceNpTrophy2GetTrophyInfo(named, sincesceNpTrophy2GetTrophyIconin the same file still throws for every id) and "A group that is not in the data throws".Tested
Windows 11 26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON. This branch is one commit (a42182e) onmain2f161d4. It differs from 6eb4376, on which the results below were measured, only in the wording of the debt entry. Red, the first green run and the title run used the same change onmain3e91c8e; no file this change touches differs between the two, and green was repeated on 6eb4376.guest_np_trophy_data: trophy ids 8 (one past the synthetic package's last id, the title's pattern), 99 and -1 return0x8055390A, and both outputs keep their0x5afill. The known-trophy checks around them (ids 0, 1, 5 and 6 report their data) and the unknown-group check (still throws) are the controls.main's library with only this test:guest_np_trophy_datafails withterminate called after throwing an instance of 'std::invalid_argument'/what(): sceNpTrophy2GetTrophyInfo: trophy 8 is not in /app0/sce_sys/trophy2/trophy00.ucp, the message the title stops on (8 where the title has 19).guest_np_trophy_data,guest_nptrophy2,guest_np_trophy_unlocks,guest_np_trophy_stats,np_trophy2_store,np_trophy2_packageandnp_uds_eventspass 3 of 3, on 3e91c8e and again on 6eb4376.main3e91c8e the title no longer aborts: it creates its save data after the trophy query and runs until the 300 s limit of the test run, with no throw or abort in the log. Unmodifiedmainaborts about 7 s after start-up with the message above.python tools/check_conventions.py --base origin/mainwith this title and body passes.python tools/pr_overlap.py --branch fix/trophy2-unknown-id-error: only feat(libSceNpTrophy2): implement sceNpTrophy2GetRewardIcon #8218 shares a file,docs/dev/debt/libSceNpTrophy2.md(not compared, because feat(libSceNpTrophy2): implement sceNpTrophy2GetRewardIcon #8218 conflicts withmain); feat(libSceNpTrophy2): implement sceNpTrophy2GetRewardIcon #8218 changes other entries of that file, not "Trophy queries".6eb4376d7b):guest_np_trophy_datapasses 3 of 3, and fails 3 of 3 (0xc0000409) with this PR's two library files taken from2f161d4f33.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code