feat(libSceNpCommon): implement nine state helpers #12823
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12823"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-29T11:27:07Z.
What
Implement nine
libSceNpCommonstate helpers reconstructed from PS5 firmware 13.60.Seven functions query object state. Two implement clear/no-op behaviour.
EventFlag::IsInitst-oQvV7HVI+0x10is nonzeroRingBuf::IsFullbvJ207-8qBQ+0x20and+0x28are equalEventQueue::IsInitVI8AHrfLdqY+0x98is nonzeroMutex::IsInitYc+qj4TIEY0+0x10is nonzeroRingBufMemory::IsInitzdRXyt-65kA+0x8is non-nullIpmiClient::IsConnectedprj9aMR74bA+0x18equals zeroCallout::IsTimedoutxxOTJpEyoj4+0x10is positive or-2NpTitleSecret::ClearX0vEo7cZamA+0x8JsonNull::Clear88GKkivBFhIAll nine retain their existing NIDs.
Firmware evidence
libSceNpCommon.sprxAB696280CAF5CF465C62E00D1785FB4348B59A7E376D7C6802453419E5765CD0These are firmware-derived reconstructions. They have not been independently validated through console execution. No proprietary firmware artifacts are committed.
Implementation
falseresults for null or unreadable predicate operands.The defensive invalid-memory behaviour is an emulator compatibility choice, not a claim about native firmware faults.
GuestCopyOut_nid_no_patchmay perform a partial write on an inaccessible destination, particularly through Linuxprocess_vm_writev. Failed clears do not guarantee atomic rollback.Upstream reconciliation
Merged current upstream main
5bae1a4bc2into this branch. The net PR diff remains the same five intended files, preserving all nine exports and NIDs, the focused test and existing upstream implementations. Related #12852 deliberately leaves RingBuf::IsFull and RingBufMemory::IsInit to this PR; its adjacent shared-file edits may still need merge-order reconciliation.Tested
Windows x86_64, WinLibs GCC, CMake/Ninja Release, head
d4aee6eb2c:guest_np_common_state_predicate_testsandguest_np_common_rtc_tests.Linux partial-write behavior and console runtime remain unverified; the documented defensive-memory and partial-write limits remain. New-head hosted checks are pending.
Checklist
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:54:05Z.
Review: COMMENTED
Nine NpCommon state helpers in one PR (+269/-46). Please say what else the diff carries.