feat(libSceNpManager): implement sceNpCheckNpAvailability #1241

Closed
izzangalaxybyte wants to merge 3 commits from upstream-pr/1241 into main
izzangalaxybyte commented 2026-10-07 19:08:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by izzangalaxybyte on 2026-10-07T19:08:19Z.


What

Implements sceNpCheckNpAvailability, which threw NotImplemented. PSN is not emulated and every user is signed out, so it now matches sceNpCheckNpReachability:

  • null user → SCE_NP_ERROR_INVALID_ARGUMENT
  • otherwise → SCE_NP_ERROR_SIGNED_OUT

Source: shadPS4 src/core/libraries/np/np_manager.cpp (PS4) returns INVALID_ARGUMENT for a null online ID and completes the request with SIGNED_OUT when the user is not signed in to PSN.

libSceNpManager gets its own CMakeLists.txt (same shape as libSceErrorDialog) so it can register the new guest_np_manager CTest.

The third parameter (result) is kept as declared and unused; shadPS4 declares the function with two parameters.

Overlap: #924 is merged and this branch merges main; GuestNpManager.cpp keeps its sceNpGetNpId cases and adds the sceNpCheckNpAvailability ones. #926 adds the same test file (its CMakeLists.txt is identical) with no shared exports; whichever merges second appends its cases to the other's test.

Tested

Linux x86-64 (Ubuntu 24.04, GCC 13.3, Docker linux/amd64 emulated on an Apple Silicon Mac), configured as in build.yml without ccache: build and libs target succeed, guest_np_manager passes, 395/400 tests pass.

The 5 failures are from the emulated container, not this change: guest_access and guest_memory (userfaultfd not permitted, no free range above the mapping hint), guest_dynamic_loader (permission denied copying into the bind-mounted build directory), amd64_only_converter (SHA-1 stub changed a register or RFLAGS under emulation), linux_entry_argv (exit -5). No title tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4777225862 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1241). Originally posted by [izzangalaxybyte](https://github.com/izzangalaxybyte) on 2026-10-07T19:08:19Z. --- ### What Implements `sceNpCheckNpAvailability`, which threw `NotImplemented`. PSN is not emulated and every user is signed out, so it now matches `sceNpCheckNpReachability`: - null user → `SCE_NP_ERROR_INVALID_ARGUMENT` - otherwise → `SCE_NP_ERROR_SIGNED_OUT` Source: shadPS4 `src/core/libraries/np/np_manager.cpp` (PS4) returns `INVALID_ARGUMENT` for a null online ID and completes the request with `SIGNED_OUT` when the user is not signed in to PSN. libSceNpManager gets its own `CMakeLists.txt` (same shape as libSceErrorDialog) so it can register the new `guest_np_manager` CTest. The third parameter (`result`) is kept as declared and unused; shadPS4 declares the function with two parameters. Overlap: #924 is merged and this branch merges `main`; `GuestNpManager.cpp` keeps its `sceNpGetNpId` cases and adds the `sceNpCheckNpAvailability` ones. #926 adds the same test file (its `CMakeLists.txt` is identical) with no shared exports; whichever merges second appends its cases to the other's test. ### Tested Linux x86-64 (Ubuntu 24.04, GCC 13.3, Docker `linux/amd64` emulated on an Apple Silicon Mac), configured as in `build.yml` without ccache: build and `libs` target succeed, `guest_np_manager` passes, 395/400 tests pass. The 5 failures are from the emulated container, not this change: `guest_access` and `guest_memory` (`userfaultfd` not permitted, no free range above the mapping hint), `guest_dynamic_loader` (permission denied copying into the bind-mounted build directory), `amd64_only_converter` (SHA-1 stub changed a register or RFLAGS under emulation), `linux_entry_argv` (exit -5). No title tested. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-08 02:44:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:44:41Z.


Closing: no title is shown to reach sceNpCheckNpAvailability on main. If one does, comment here with the title ID and the log line where it stops, and it can be reopened (rebased without the merge commit).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051106868 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1241#issuecomment-6051106868). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T02:44:41Z. --- Closing: no title is shown to reach `sceNpCheckNpAvailability` on main. If one does, comment here with the title ID and the log line where it stops, and it can be reopened (rebased without the merge commit).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1241
No description provided.