Support mountable-content DLC (addcont with real content) #1581

Manually merged
github merged 1 commit from gh-pr/1581/head into gh-pr/1581/base 2026-11-26 10:00:38 +00:00
Owner

@⁠Pipe530 on GitHub · 2026-10-17 02:23 UTC · original
Pipe530:pipe530-dlc-mounting-support → main · +64 −12 · 5 files · 1 commits · merged 2026-10-17 02:44 UTC

Basic DLC (entitlement/key-unlock only) already worked. This PR adds support for the other type of DLC: add-on content that contains real files and must be mounted by the game via sceAppContentAddcontMount.

Tested with Street Fighter 6 (PPSA02633): both DLC paks (re_dlc_000.pak, 7 GB and 32 GB) mount, resolve and are read by the game; the DLC-unlocked Fighting Ground mode becomes selectable.

Changes:

  • fileSystem.cpp: collapse duplicate slashes in mount-point path resolution.
  • libAppContent.cpp: returns mount points without a trailing slash and succeeds with the same mount point for already-mounted content, matching shadPS4-style behavior; creates /download0/pdlc; invalidates cached APR failed resolves on mount/unmount.
  • libAmpr.cpp: InvalidateFailedResolves() plus diagnostic logging for /addcont* resolves and pak reads.
  • libPlayGo.cpp: PlayGoGetChunkId returns the total chunk count when the output list is null and rejects a non-null list with zero capacity.

verified manually via runtime logs. SF6 later crashes in the Vulkan descriptor heap, which is unrelated to this change since main cant render that game well.

**@⁠Pipe530** on GitHub · 2026-10-17 02:23 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1581) `Pipe530:pipe530-dlc-mounting-support` → `main` · +64 −12 · 5 files · 1 commits · merged 2026-10-17 02:44 UTC Basic DLC (entitlement/key-unlock only) already worked. This PR adds support for the **other type of DLC**: add-on content that contains real files and must be mounted by the game via `sceAppContentAddcontMount`. Tested with Street Fighter 6 (PPSA02633): both DLC paks (`re_dlc_000.pak`, 7 GB and 32 GB) mount, resolve and are read by the game; the DLC-unlocked Fighting Ground mode becomes selectable. Changes: - `fileSystem.cpp`: collapse duplicate slashes in mount-point path resolution. - `libAppContent.cpp`: returns mount points without a trailing slash and succeeds with the same mount point for already-mounted content, matching shadPS4-style behavior; creates `/download0/pdlc`; invalidates cached APR failed resolves on mount/unmount. - `libAmpr.cpp`: `InvalidateFailedResolves()` plus diagnostic logging for `/addcont*` resolves and pak reads. - `libPlayGo.cpp`: `PlayGoGetChunkId` returns the total chunk count when the output list is null and rejects a non-null list with zero capacity. verified manually via runtime logs. SF6 later crashes in the Vulkan descriptor heap, which is unrelated to this change since main cant render that game well.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:00:37 +00:00
github manually merged commit 58cb92ec5a into gh-pr/1581/base 2026-11-26 10:00:38 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 02:26 UTC · original · edited 2026-10-17 02:43 UTC

Review in Change Stack →

📝 Walkthrough

MountPoints::ResolvePath now normalizes repeated slashes before mount matching and relative-path extraction. Addcont mount operations handle repeated mounts, normalize unmount paths, invalidate failed path resolutions, and create a resolved pdlc directory when its path is nonempty. The changes also add logging for selected addcont resolutions and package reads. PlayGoGetChunkId now supports zero-entry queries by returning the loaded chunk count.

Suggested reviewers: nmzik, frangametv

Priority: ➖ Normal

Change: Feature

Merge Risk: 🟡 Moderate · up to 106eb

DLC content now mounts and loads. However, unmounting or remounting add-on content can leave the game reading files from the previous mount, because cached successful lookups are not cleared. This should be addressed or explicitly accepted before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the primary change: support for mountable add-on content DLC with real files.
Description check Passed The description directly explains the DLC mounting changes, affected components, test case, and known unrelated crash.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 02:26 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1581#issuecomment-6228491651) · edited 2026-10-17 02:43 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1581?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> `MountPoints::ResolvePath` now normalizes repeated slashes before mount matching and relative-path extraction. Addcont mount operations handle repeated mounts, normalize unmount paths, invalidate failed path resolutions, and create a resolved pdlc directory when its path is nonempty. The changes also add logging for selected addcont resolutions and package reads. `PlayGoGetChunkId` now supports zero-entry queries by returning the loaded chunk count. **Suggested reviewers:** `nmzik`, `frangametv` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"106ebd0b4eeefea562696a5e498893f1ab5826a1" --> **Change:** Feature <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>🟡 Moderate</strong> · up to <code>106eb</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `106eb` --> <!-- final_review_risk_coverage:{"sourceCommitId":"106ebd0b4eeefea562696a5e498893f1ab5826a1","coveredCommitId":"106ebd0b4eeefea562696a5e498893f1ab5826a1","kind":"reviewed"} --> DLC content now mounts and loads. However, unmounting or remounting add-on content can leave the game reading files from the previous mount, because cached successful lookups are not cleared. This should be addressed or explicitly accepted before merge. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------- | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly identifies the primary change: support for mountable add-on content DLC with real files. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the DLC mounting changes, affected components, test case, and known unrelated crash. | </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1581)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 02:27 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 982b02ec-c958-461f-9f0e-f7d29960ffc7
📥 Commits

Reviewing files that changed from the base of the PR and between 9202bddad2 and 106ebd0b4eeefea562696a5e498893f1ab5826a1.

📒 Files selected for processing: 4
  • src/kernel/fileSystem.cpp
  • src/libs/libAmpr.cpp
  • src/libs/libAppContent.cpp
  • src/libs/libPlayGo.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 02:27 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1581#pullrequestreview-5555562068) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `982b02ec-c958-461f-9f0e-f7d29960ffc7` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 9202bddad2c6fa66e7f0e864228aa63110c2e991 and 106ebd0b4eeefea562696a5e498893f1ab5826a1. </details> <details> <summary>📒 Files selected for processing: 4</summary> * `src/kernel/fileSystem.cpp` * `src/libs/libAmpr.cpp` * `src/libs/libAppContent.cpp` * `src/libs/libPlayGo.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=bcdd6640-510f-4228-802a-319e1df328b4 attempt=0122b815-bfd7-4845-a430-d0469ad5331a batch=1/1 -->
@ -179,0 +183,4 @@
void InvalidateFailedResolves() {
std::scoped_lock lock(g_mutex);
for (auto it = g_resolved_paths.begin(); it != g_resolved_paths.end();) {
it = it->second.result != OK ? g_resolved_paths.erase(it) : std::next(it);
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 02:27 UTC · original

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Invalidate successful resolutions when an addcont mount changes.

If APR resolves /addcont0/file before unmount, this function retains its successful cache entry. A later resolve returns the old file ID and host path, even after /addcont0 is unmounted or assigned to another entitlement. Remove affected path-cache entries on mount changes. Keep existing file IDs valid separately if submitted reads still need them.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 02:27 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1581#discussion_r4300909607) **🗄️ Data Integrity & Integration** | **🟠 Major** | **🏗️ Heavy lift** **Invalidate successful resolutions when an addcont mount changes.** If APR resolves `/addcont0/file` before unmount, this function retains its successful cache entry. A later resolve returns the old file ID and host path, even after `/addcont0` is unmounted or assigned to another entitlement. Remove affected path-cache entries on mount changes. Keep existing file IDs valid separately if submitted reads still need them. <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:9ec69f508f03d2935ae616c6 --> <!-- This is an auto-generated comment by CodeRabbit -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.