fix(libSceAppContent): read user defined app params from param.json #995

Merged
CnRJay merged 2 commits from upstream-pr/995 into main 2026-10-08 06:07:22 +00:00
CnRJay commented 2026-10-06 22:15:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-06T22:15:06Z.


What

sceAppContentAppParamGetInt numbered the SKU flag 1 and returned zero for 2..5. The SDK numbering, as in fpPS4 (src/ps4_libsceappcontent.pas), is SKU_FLAG = 0 and USER_DEFINED_PARAM_1..4 = 1..4. The user defined params now come from userDefinedParam1..userDefinedParam4 in sce_sys/param.json (absent reads as 0); other ids keep returning SCE_APP_CONTENT_ERROR_PARAMETER.

The param.json parser reads them as int32 and throws for non-integers or out-of-range values. AppMetadata exposes them through GetAppUserDefinedParam.

UFC 6 (PPSA23566) reads param 1 at startup and crashes on purpose unless it is its title number (23566, its userDefinedParam1) or 29746.

Tested

  • Windows 11, bundled MinGW 15.2, Release, on edf90b16: 365/365 CTest. param_json_parser covers present, absent, negative and INT32_MAX params, and rejects 2147483648, 1.5, 1e3, strings and booleans.
  • PPSA23566: the title-number check passes and startup continues to content mounting.

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:4765246054 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/995). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-06T22:15:06Z. --- ### What `sceAppContentAppParamGetInt` numbered the SKU flag 1 and returned zero for 2..5. The SDK numbering, as in fpPS4 (`src/ps4_libsceappcontent.pas`), is `SKU_FLAG` = 0 and `USER_DEFINED_PARAM_1..4` = 1..4. The user defined params now come from `userDefinedParam1`..`userDefinedParam4` in `sce_sys/param.json` (absent reads as 0); other ids keep returning `SCE_APP_CONTENT_ERROR_PARAMETER`. The param.json parser reads them as int32 and throws for non-integers or out-of-range values. `AppMetadata` exposes them through `GetAppUserDefinedParam`. UFC 6 (PPSA23566) reads param 1 at startup and crashes on purpose unless it is its title number (23566, its `userDefinedParam1`) or 29746. ### Tested - Windows 11, bundled MinGW 15.2, Release, on `edf90b16`: 365/365 CTest. `param_json_parser` covers present, absent, negative and `INT32_MAX` params, and rejects `2147483648`, `1.5`, `1e3`, strings and booleans. - PPSA23566: the title-number check passes and startup continues to content mounting. ### 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)
adriadam10 commented 2026-10-08 05:53:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T05:53:25Z.


Rebased on current main (trivial conflict in Export.cpp) and added one commit of ours: GuestAppContent.cpp now pins sceAppContentAppParamGetInt ids 0..5 (0 = SKU flag 3, 1..4 = userDefinedParam1..4 with distinct values incl. negative and INT32_MAX, 5 = SCE_APP_CONTENT_ERROR_PARAMETER leaving value untouched, null value = error). The test fails if the id mapping is shifted. Full ctest green (415/415); merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6053347327 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/995#issuecomment-6053347327). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T05:53:25Z. --- Rebased on current `main` (trivial conflict in `Export.cpp`) and added one commit of ours: `GuestAppContent.cpp` now pins `sceAppContentAppParamGetInt` ids 0..5 (0 = SKU flag 3, 1..4 = `userDefinedParam1..4` with distinct values incl. negative and `INT32_MAX`, 5 = `SCE_APP_CONTENT_ERROR_PARAMETER` leaving `value` untouched, null `value` = error). The test fails if the id mapping is shifted. Full ctest green (415/415); merging once CI is green.
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!995
No description provided.