feat(libSceNpManager): implement sceNpGetNpId #924

Merged
Adin-bima merged 1 commit from upstream-pr/924 into main 2026-10-07 20:48:20 +00:00
Adin-bima commented 2026-10-06 17:18:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Adin-bima on 2026-10-06T17:18:48Z.


What

Implements sceNpGetNpId in libSceNpManager. PSN is not emulated, so like sceNpGetOnlineId and sceNpGetAccountIdA it returns SCE_NP_ERROR_SIGNED_OUT and leaves the NpId untouched; a null NpId returns SCE_NP_ERROR_INVALID_ARGUMENT. This matches shadPS4 when the user is not signed in and prosper. The invalid-user-id branch shadPS4 selects by firmware version is not modelled, as the other identity getters here do not check the user id either.

libSceNpManager gets its own CMakeLists.txt (same shape as libSceNpSessionSignaling) to register the new guest_np_manager test.

Tested

Linux (GCC), new guest_np_manager test: signed-out result with the NpId unchanged, invalid argument for a null NpId. Full ctest: 358/360 passed; agc_driver_lds_atomics64 and agc_driver_scalar_sop1 fail the same way on unmodified main on this machine (RTX 5070 Ti). Not tested with a title.

Checklist

  • Based on current main; no other open PR implements the same functions — #346 (opened earlier) implements the same functions; this is offered as a replacement if #346 is not continued
  • 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4762249916 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/924). Originally posted by [Adin-bima](https://github.com/Adin-bima) on 2026-10-06T17:18:48Z. --- ### What Implements `sceNpGetNpId` in libSceNpManager. PSN is not emulated, so like `sceNpGetOnlineId` and `sceNpGetAccountIdA` it returns `SCE_NP_ERROR_SIGNED_OUT` and leaves the `NpId` untouched; a null `NpId` returns `SCE_NP_ERROR_INVALID_ARGUMENT`. This matches [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_manager.cpp) when the user is not signed in and [prosper](https://github.com/mattias800/prosper/blob/main/prosper/src/hle/np/np.cpp). The invalid-user-id branch shadPS4 selects by firmware version is not modelled, as the other identity getters here do not check the user id either. libSceNpManager gets its own `CMakeLists.txt` (same shape as libSceNpSessionSignaling) to register the new `guest_np_manager` test. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. --> Linux (GCC), new `guest_np_manager` test: signed-out result with the `NpId` unchanged, invalid argument for a null `NpId`. Full `ctest`: 358/360 passed; `agc_driver_lds_atomics64` and `agc_driver_scalar_sop1` fail the same way on unmodified `main` on this machine (RTX 5070 Ti). Not tested with a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [ ] Based on current `main`; no other open PR implements the same functions — #346 (opened earlier) implements the same functions; this is offered as a replacement if #346 is not continued - [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
github-actions[bot] commented 2026-10-07 20:28:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T20:28:41Z.


Progress report (5895ea7 → 953e6ce)

📈 System libraries: 87.03% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNpManager sceNpGetNpId
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6046242232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/924#issuecomment-6046242232). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T20:28:41Z. --- <!-- progress-report --> ### Progress report (5895ea7 → 953e6ce) 📈 **System libraries**: 87.03% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNpManager | `sceNpGetNpId` | </details>
adriadam10 commented 2026-10-07 20:48:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T20:48:17Z.


Checked the build and ctest (402/402, guest_np_manager fails without the Export.cpp change), and the result codes and untouched NpId against shadPS4 and prosper; consistent with sceNpGetOnlineId/sceNpGetAccountIdA. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6046565312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/924#issuecomment-6046565312). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T20:48:17Z. --- Checked the build and ctest (402/402, `guest_np_manager` fails without the Export.cpp change), and the result codes and untouched `NpId` against shadPS4 and prosper; consistent with `sceNpGetOnlineId`/`sceNpGetAccountIdA`. Merging.
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!924
No description provided.