Repository navigation
feat(libSceNpTrophy): return 0x80551692 from the system debug calls as firmware 13.42 does - #12957
Conversation
…s firmware 13.42 does Firmware 13.42's sceNpTrophySystemDbgCtl, GetDbgParam, GetDbgParamInt, SetDbgParam and SetDbgParamInt each return 0x80551692 and do nothing else.
Progress report (bb04a4f → 161792d)📈 System libraries: 46.53% (+0.04%, +5 implemented functions) ✅ 5 implemented
Changed libraries (implemented exports)
|
|
@BunnyFl Your 13.42 run of the five debug calls is what this PR implements, thanks. libSceNpTrophy still throws on 78 more exports, almost all
The rest go to the service, so I'd leave them throwing. The 78 exports
|
rooklz
left a comment
There was a problem hiding this comment.
Reviewed at 161792d (merged into main bb04a4f for the checks below).
Evidence. The cited source is BunnyFl's comment on #9874: firmware 13.42 libSceNpTrophy.sprx, five exports run in an emulator. That is source 2 in docs/dev/REVERSE_ENGINEERING.md (the library's own code). The behaviour is a constant return with no calls and no writes, and the debt line keeps the parameter lists listed as unknown. Because the bodies read no arguments, the parameterless SysV declarations are ABI-safe for any caller. The debt entry follows the #9173 libSceComposite precedent of firmware-measured constant returns under Silent stubs, and it states the provenance (an emulator run, not a console).
Checks (macOS arm64 host, Apple clang, -arch x86_64)
git merge-treeagainst bb04a4f is clean,git diff --checkis clean, andtools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.py: 0 of 1467 open PRs share files or exports.-fsyntax-onlyreports 0 errors for bothExport.cppandGuestNpTrophySystemDebug.cpp.- I built
Export.cppstandalone with ASan+UBSan and ran the new test against it:NpTrophy system debug tests passed. - Negative control: the same test linked against
main'sExport.cppaborts at the first call. (My shim has no NotImplemented definition, so here it shows as a SEGV. The author's real-build baseline reports the abort.) - Mutant: making
sceNpTrophySystemSetDbgParamIntreturn 0is killed (sceNpTrophySystemSetDbgParamInt did not return 0x80551692). - CI: windows, conventions and intake pass. The relinker and linux lanes are skipped by path filter.
Optional
Export.cpp:21-35already names every other NpTrophy code as a constant. This one has no public name, so the literal is fine. If a later PR learns the name, it can be lifted into that table.
Approving.
AI-assisted: yes
|
@zaryabzip I sorted the 78 in firmware 13.42's 1. Fixed returns, and checks followed by a fixed result: none. No export among the 78 is a bare constant return like the debug calls, and none only checks its arguments and then returns a fixed code or value. 2. Argument-only helpers: no service, no library state, no imports. Measured.
None of the four checks for NULL, so a NULL argument faults. 3. Trophy-config accessors: argument checks, then they read the config object. That object is the one
4. No direct call to the trophy service, but they depend on library state or other modules; I did not sort these further:
Several of them make indirect calls through objects, which could reach the service. For example, 5. Requests to the trophy service (
So the four helpers in section 2 can be implemented exactly now. The section 3 checks could front a throw for the config read, if that's useful. AI-assisted: yes (Claude Code) |
|
Checked the return value and the "no calls, no writes" claim against @BunnyFl's 13.42 run on #9874, the parameterless declarations (the bodies read no arguments), the Silent stubs entry and the moved names in the debt file, and that the new test checks all five exports twice and aborts on |
What
sceNpTrophySystemDbgCtl,sceNpTrophySystemGetDbgParam,sceNpTrophySystemGetDbgParamInt,sceNpTrophySystemSetDbgParamandsceNpTrophySystemSetDbgParamIntnow return0x80551692. That is all firmware 13.42's module does: @BunnyFl ran them in an emulator twice, with null, small and all-ones arguments. They made no calls and wrote no memory.The declarations stay parameterless, because the bodies read no arguments. The five names leave the "unknown function info" list and get a Silent stubs entry citing the measurement. The convention checker requires a constant return to be listed there, as #9173's firmware-measured libSceComposite returns are. libSceNpTrophy goes from 12 to 17 of 97.
GuestNpTrophySystemDebug.cppcalls each one twice and checks the code. They're declared onmain, so the test builds there and aborts at the first call. It's a new test file because open PRs #12218 and #11104 edit the existing NpTrophy tests.Tested
Windows 11 Home 10.0.26200 (WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2) at 161792d, and Ubuntu 24.04.5 on WSL2 (GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1) with it merged into
mainbb04a4f:Export.cppshows only the two-Wformat-truncationlinesmainalready prints on Linux.ctest -R "^guest_np_trophy": every NpTrophy test passes on both hosts (6 on Windows, 5 on Linux, whereguest_np_trophy_host_writeisn't built). The new test printsNpTrophy system debug tests passedand passes 3 of 3 on--repeat until-fail:3.mainwith only the new test file and itsCMakeLists.txtblock, the test builds and then aborts withsceNpTrophySystemDbgCtl not implementedon both hosts (Windows exit 0xc0000409, Linux SIGABRT).tools/check_conventions.pypasses. No open PR toucheslibSceNpTrophy/or its debt file.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)