fix(libSceAgc): match sceAgcInit pointer ABI #5889

Closed
NumberGuan wants to merge 1 commit from upstream-pr/5889 into main
NumberGuan commented 2026-10-14 14:47:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NumberGuan on 2026-10-14T14:47:48Z.


What

PPSA99011 and PPSA99995 call sceAgcInit with a pointer and a 32-bit second argument. AnyPS5 currently reads the pointer value as the register-default version, which makes both titles throw during initialization. This change matches the two-argument ABI and retains the current default-table handling for values 0–13.

A firmware 13.60 probe recorded in #4808 shows sceAgcInit(&state, 8) returning 0 without modifying the buffer. The meaning and accepted range of the second argument beyond that observed call remain unverified; the technical-debt entry records this limit.

Fixes #4808.

Tested

  • Windows 11 / MinGW GCC 15.2: full build and libs target passed.
  • CTest: 1,184 cases, 0 failures, 44 skipped. agc_initialization and agc_commands passed.
  • tools/check_test_registration.py build, tools/check_conventions.py --base origin/main, and git diff --check passed.
  • tools/check_skips.py build/ctest.xml --job windows exits 1 in this environment: the display has no 120 Hz mode, and Windows long paths are disabled. No PS5 or game runtime test was performed for this change.

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 or are listed in technical debt
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA99011 and PPSA99995 #4808
  • GPUs tested: n/a (no GPU runtime test for this library change)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4859709468 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5889). Originally posted by [NumberGuan](https://github.com/NumberGuan) on 2026-10-14T14:47:48Z. --- ### What PPSA99011 and PPSA99995 call `sceAgcInit` with a pointer and a 32-bit second argument. AnyPS5 currently reads the pointer value as the register-default version, which makes both titles throw during initialization. This change matches the two-argument ABI and retains the current default-table handling for values 0–13. A firmware 13.60 probe recorded in [#4808](https://github.com/boykopovar/AnyPS5/issues/4808) shows `sceAgcInit(&state, 8)` returning 0 without modifying the buffer. The meaning and accepted range of the second argument beyond that observed call remain unverified; the technical-debt entry records this limit. Fixes #4808. ### Tested - Windows 11 / MinGW GCC 15.2: full build and `libs` target passed. - CTest: 1,184 cases, 0 failures, 44 skipped. `agc_initialization` and `agc_commands` passed. - `tools/check_test_registration.py build`, `tools/check_conventions.py --base origin/main`, and `git diff --check` passed. - `tools/check_skips.py build/ctest.xml --job windows` exits 1 in this environment: the display has no 120 Hz mode, and Windows long paths are disabled. No PS5 or game runtime test was performed for this change. ### 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 - [x] Unimplemented paths throw or are listed in technical debt - [x] No notes, investigation files or images added to the repository - [x] No new third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA99011 and PPSA99995 #4808 - [x] GPUs tested: n/a (no GPU runtime test for this library change) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 12:11:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:11:13Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1060 core/libs/prx/libSceAgc/tests/Commands.cpp
docs/dev/debt/libSceAgc.md
PR 5877 docs/dev/debt/libSceAgc.md
PR 6270 core/libs/prx/libSceAgc/tests/Commands.cpp
docs/dev/debt/libSceAgc.md
PR 6447 core/libs/prx/libSceAgc/tests/Commands.cpp
docs/dev/debt/libSceAgc.md
PR 6653 docs/dev/debt/libSceAgc.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191732247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5889#issuecomment-6191732247). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:11:13Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1060](https://www.github.com/boykopovar/AnyPS5/pull/1060) | `core/libs/prx/libSceAgc/tests/Commands.cpp`<br>`docs/dev/debt/libSceAgc.md` | | [PR 5877](https://www.github.com/boykopovar/AnyPS5/pull/5877) | `docs/dev/debt/libSceAgc.md` | | [PR 6270](https://www.github.com/boykopovar/AnyPS5/pull/6270) | `core/libs/prx/libSceAgc/tests/Commands.cpp`<br>`docs/dev/debt/libSceAgc.md` | | [PR 6447](https://www.github.com/boykopovar/AnyPS5/pull/6447) | `core/libs/prx/libSceAgc/tests/Commands.cpp`<br>`docs/dev/debt/libSceAgc.md` | | [PR 6653](https://www.github.com/boykopovar/AnyPS5/pull/6653) | `docs/dev/debt/libSceAgc.md` |
adriadam10 commented 2026-10-16 11:13:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T11:13:18Z.


Closing as superseded. #5163 already fixed #4808 on main: sceAgcInit now returns 0 for a pointer-shaped argument, matching the console probe in that issue, and sceAgcInit_0090(state, version) already models the two-argument form with pointer validation.

This PR would bring back SCE_AGC_ERROR_INVALID_ARGUMENT for values >= 14, which is what #5163 removed. It also conflicts with main in Init.cpp, tests/Commands.cpp and docs/dev/debt/libSceAgc.md.

If PPSA99011 or PPSA99995 still stops at this call on current main, please reopen #4808 or open a new PR rebased on main with the failing log.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214261143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5889#issuecomment-6214261143). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T11:13:18Z. --- Closing as superseded. #5163 already fixed #4808 on main: `sceAgcInit` now returns 0 for a pointer-shaped argument, matching the console probe in that issue, and `sceAgcInit_0090(state, version)` already models the two-argument form with pointer validation. This PR would bring back `SCE_AGC_ERROR_INVALID_ARGUMENT` for values >= 14, which is what #5163 removed. It also conflicts with `main` in `Init.cpp`, `tests/Commands.cpp` and `docs/dev/debt/libSceAgc.md`. If PPSA99011 or PPSA99995 still stops at this call on current `main`, please reopen #4808 or open a new PR rebased on `main` with the failing log.

Pull request closed

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!5889
No description provided.