feat(libkernel): accept the audio coprocessor memory protection bits #900

Merged
alfalfa-star merged 1 commit from upstream-pr/900 into main 2026-10-07 16:26:06 +00:00
alfalfa-star commented 2026-10-06 14:20:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-06T14:20:34Z.


What

Accept memory protection bits 0x100 and 0x200 when mapping direct memory.

PPSA14632 (LEGO Horizon Adventures, Unreal Engine) maps direct memory with protection 0x3f2: the CPU, GPU and AMPR bits plus 0x100 and 0x200. On main the mapping throws Unsupported memory protection bits: 1010. The KytyPS5 and etaHEN headers name these bits audio coprocessor (ACP) read and write. That work runs on the host CPU, so they map to host read and read/write access, like the GPU bits. The assumption is recorded in TechnicalDebt.

Tested

  • Arch Linux, GCC 16.2, Release. New guest_memory case CheckAudioCoprocessorProtection: mappings with the ACP bits get the expected host access, and bits outside 0x3f7 still throw. Full ctest: 359/359.
  • PPSA14632: the 0x3f2 mapping succeeds, and the title runs on to texture uploads and save data.
  • Windows not built or tested (the conversion is shared with Windows).

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:4760091171 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/900). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-06T14:20:34Z. --- ### What Accept memory protection bits 0x100 and 0x200 when mapping direct memory. PPSA14632 (LEGO Horizon Adventures, Unreal Engine) maps direct memory with protection 0x3f2: the CPU, GPU and AMPR bits plus 0x100 and 0x200. On `main` the mapping throws `Unsupported memory protection bits: 1010`. The KytyPS5 and etaHEN headers name these bits audio coprocessor (ACP) read and write. That work runs on the host CPU, so they map to host read and read/write access, like the GPU bits. The assumption is recorded in TechnicalDebt. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. --> - Arch Linux, GCC 16.2, Release. New `guest_memory` case `CheckAudioCoprocessorProtection`: mappings with the ACP bits get the expected host access, and bits outside 0x3f7 still throw. Full ctest: 359/359. - PPSA14632: the 0x3f2 mapping succeeds, and the title runs on to texture uploads and save data. - Windows not built or tested (the conversion is shared with Windows). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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-06 22:02:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:02:50Z.


Thanks, this looks right: the ACP bits are sourced from KytyPS5 and etaHEN, the assumption is in TechnicalDebt, and bits outside 0x3f7 still throw.

After the last batch it conflicts with main in docs/dev/TechnicalDebt.md. Could you rebase onto main?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026271487 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/900#issuecomment-6026271487). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T22:02:50Z. --- Thanks, this looks right: the ACP bits are sourced from KytyPS5 and etaHEN, the assumption is in TechnicalDebt, and bits outside 0x3f7 still throw. After the last batch it conflicts with main in `docs/dev/TechnicalDebt.md`. Could you rebase onto main?
alfalfa-star commented 2026-10-07 05:14:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-07T05:14:20Z.


Rebased onto main (9ab937b2). The only conflict was in docs/dev/TechnicalDebt.md; I kept main's sceKernelReleaseFlexibleMemory line and added the ACP line after it. Local build and full ctest: 383/383.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6031432866 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/900#issuecomment-6031432866). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-07T05:14:20Z. --- Rebased onto main (`9ab937b2`). The only conflict was in `docs/dev/TechnicalDebt.md`; I kept main's `sceKernelReleaseFlexibleMemory` line and added the ACP line after it. Local build and full ctest: 383/383.
adriadam10 commented 2026-10-07 16:26:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T16:26:03Z.


Checked the ACP bits against KytyPS5 (libAmpr.cpp) and etaHEN (global.h: ACP_READ 0x100, ACP_WRITE 0x200); build + full ctest green on Linux merged onto main, and guest_memory fails without the change. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6042156816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/900#issuecomment-6042156816). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T16:26:03Z. --- Checked the ACP bits against KytyPS5 (`libAmpr.cpp`) and etaHEN (`global.h`: `ACP_READ 0x100`, `ACP_WRITE 0x200`); build + full ctest green on Linux merged onto main, and `guest_memory` fails without the change. 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!900
No description provided.