feat(libSceNpEntitlementAccess): implement sceNpEntitlementAccessGetPftFlag #4860

Merged
jagrat04 merged 2 commits from upstream-pr/4860 into main 2026-10-13 08:13:42 +00:00
jagrat04 commented 2026-10-13 00:28:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-13T00:28:42Z.


What

Implement sceNpEntitlementAccessGetPftFlag in libSceNpEntitlementAccess (Play First Trial flag).

  • Reports a full game, not a Play First Trial: writes 0 to the uint32_t* flag output and returns 0.
  • Validates parameter: returns 0x817D0002 when flag is null.
  • Signature, value, one-word write and error match sceNpEntitlementAccessGetGameTrialsFlag and sharpemu src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs:98-116.
  • Updates technical debt documentation in docs/dev/debt/libSceAudioOut.md and docs/dev/debt/libSceNpEntitlementAccess.md.
  • Adds unit test coverage in core/libs/tests/GuestOfflineImports.cpp.

Tested

  • Windows: guest_offline_imports ctest passed (100% tests passed).
  • Conventions check passed (python tools/check_conventions.py --base origin/main).

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4836623464 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4860). Originally posted by [jagrat04](https://github.com/jagrat04) on 2026-10-13T00:28:42Z. --- ### What Implement `sceNpEntitlementAccessGetPftFlag` in `libSceNpEntitlementAccess` (Play First Trial flag). - Reports a full game, not a Play First Trial: writes 0 to the `uint32_t* flag` output and returns 0. - Validates parameter: returns `0x817D0002` when `flag` is null. - Signature, value, one-word write and error match `sceNpEntitlementAccessGetGameTrialsFlag` and sharpemu `src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs:98-116`. - Updates technical debt documentation in `docs/dev/debt/libSceAudioOut.md` and `docs/dev/debt/libSceNpEntitlementAccess.md`. - Adds unit test coverage in `core/libs/tests/GuestOfflineImports.cpp`. ### Tested - Windows: `guest_offline_imports` ctest passed (100% tests passed). - Conventions check passed (`python tools/check_conventions.py --base origin/main`). ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-13 00:29:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T00:29:03Z.


Progress report (bd826d5 → dd5853d)

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

✅ 1 implemented
Library Name
libSceNpEntitlementAccess sceNpEntitlementAccessGetPftFlag
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135276646 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4860#issuecomment-6135276646). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T00:29:03Z. --- <!-- progress-report --> ### Progress report (bd826d5 → dd5853d) 📈 **System libraries**: 88.24% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNpEntitlementAccess | `sceNpEntitlementAccessGetPftFlag` | </details>
adriadam10 commented 2026-10-13 08:11:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T08:11:53Z.


Checked the build, guest_offline_imports (it fails without the change and passes with it) and the other core/libs tests; merging.

Added one commit: the debt line cited sharpemu NpEntitlementAccessExports.cs#L98-L116 for sceNpEntitlementAccessGetPftFlag, but that range only has GetGameTrialsFlag (sharpemu has no Pft export). The line now cites dlc_emu, whose dlcEmu_sceNpEntitlementAccessGetPftFlag has the same signature, writes OFF (0) and returns the parameter error for null. Please cite sources that actually cover the function next time.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141245472 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4860#issuecomment-6141245472). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T08:11:53Z. --- Checked the build, `guest_offline_imports` (it fails without the change and passes with it) and the other core/libs tests; merging. Added one commit: the debt line cited sharpemu `NpEntitlementAccessExports.cs#L98-L116` for `sceNpEntitlementAccessGetPftFlag`, but that range only has `GetGameTrialsFlag` (sharpemu has no Pft export). The line now cites [dlc_emu](https://github.com/drakmor/dlc_emu/blob/main/src/dlc_modules/dlc_content.cpp), whose `dlcEmu_sceNpEntitlementAccessGetPftFlag` has the same signature, writes OFF (0) and returns the parameter error for null. Please cite sources that actually cover the function next time.
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!4860
No description provided.