fix(libSceAgcDriver): return 0 from sceAgcDriverRegisterDefaultOwner #5834

Merged
xXPBSXx merged 1 commit from upstream-pr/5834 into main 2026-10-15 18:34:26 +00:00
xXPBSXx commented 2026-10-14 12:56:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T12:56:05Z.


What

Broken Sword - Shadow of the Templars: Reforged (PPSA21480) stops at start-up on the code that sceAgcDriverRegisterDefaultOwner returned:

[ERRORDIALOG] open: error_code=0x8A6C9018 user_id=268435456
ERROR: G:\Revolution\BS1\Source\src\system\ps5\agc_graphics.cpp:266 Sony call failed with code 8a6c9018
what():  sceCoredumpWriteUserString not implemented

(PPSA21480_rH/run_090451.err lines 2, 3 and 6; the last AGC call in the call trace of PPSA21480_rT3/run_120116.err is sceAgcDriverRegisterDefaultOwner, from app.exe+0x8f424, and the title's own report names that code.) The function now takes the uint32_t owner by value, as OpenAGC and SharpEmu declare it, and returns 0.

With this change the title goes past that call and ends later, on AJM: decoding codec 23 is not implemented (PPSA21480_rT5/run_131226.err line 8), a different gap that this pull request does not touch.

  • Sources: https://github.com/OpenAGC/OpenAGC/blob/HEAD/include/agcdriver.h (line 188, int32_t sceAgcDriverRegisterDefaultOwner(uint32_t owner)); https://github.com/sharpemu/sharpemu/blob/HEAD/src/SharpEmu.Libs/Agc/AgcExports.DriverResources.cs (lines 165-180: owner read from RDI as uint32, stored, returns OK).
  • Not known: what the console returns. OpenAGC's src/game_compat.c (lines 343-349) says that on firmware 5.50 this export is a six-byte stub that returns 0x8A6C9018; SharpEmu returns 0. The two do not agree, and neither is a console measurement. This pull request follows what the title needs (0), recorded in docs/dev/debt/libSceAgcDriver.md.
  • Other titles tolerate 0x8A6C9018 from the neighbouring registration calls (sceAgcDriverRegisterOwner, RegisterResource, ...); those still return it. Tolerating is not needing: whether a title that called this function and ignored the code behaves differently with 0 (for example by entering an owner or validation path) is not known; I have no run of such a title.

Tested

Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release. Branch fix/agc-register-default-owner-v2, commit 5a7f183a3 on main 344afad05 (one commit; git merge-tree against main 1b55ee4ab is clean):

  • guest_agc_driver_resources (changed: sceAgcDriverRegisterDefaultOwner(0) and (owner) return 0), measured on main 344afad05 + this commit: passes with the change; with Unimplemented.cpp taken from main (test kept) it aborts, exit code 0xc0000409.
  • python tools/check_conventions.py --base upstream/main with this title and body passes.
  • Title run, PPSA21480, on main 067f4f614 + this commit (applied as cherry-pick, HEAD 9c448d571): ninja -C build -j4 relinker plus all 126 core/libs/libs/*.prx, finished 14:32:29 local time (libSceAgcDriver.prx 14:31:18); relink relink_title_trace.ps1 = relinker.exe --windows --registry --trace-imports, app.exe 14:32:31; run_title.ps1 -Seconds 120. Result (PPSA21480_rT6/run_143233.err, 342 lines): no 8a6c9018 and no sceCoredumpWriteUserString line; the run ends at line 8 with AJM: decoding codec 23 is not implemented. Without the change (PPSA21480_rH/run_090451.err, libraries of main e46c69505): the stop described above.
  • Not tested: Linux (one source for both hosts, only Windows was built), a console, other titles.

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 (docs/dev/debt/libSceAgcDriver.md)
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA21480 (Broken Sword - Shadow of the Templars: Reforged) at sceAgcDriverRegisterDefaultOwner; no bring-up discussion known to me
  • GPUs tested: n/a (no GPU code changed; the title run used an NVIDIA GeForce RTX 4080 SUPER, Windows 10)
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4858209160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5834). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T12:56:05Z. --- ### What Broken Sword - Shadow of the Templars: Reforged (PPSA21480) stops at start-up on the code that `sceAgcDriverRegisterDefaultOwner` returned: [ERRORDIALOG] open: error_code=0x8A6C9018 user_id=268435456 ERROR: G:\Revolution\BS1\Source\src\system\ps5\agc_graphics.cpp:266 Sony call failed with code 8a6c9018 what(): sceCoredumpWriteUserString not implemented (`PPSA21480_rH/run_090451.err` lines 2, 3 and 6; the last AGC call in the call trace of `PPSA21480_rT3/run_120116.err` is `sceAgcDriverRegisterDefaultOwner`, from `app.exe+0x8f424`, and the title's own report names that code.) The function now takes the `uint32_t owner` by value, as OpenAGC and SharpEmu declare it, and returns 0. With this change the title goes past that call and ends later, on `AJM: decoding codec 23 is not implemented` (`PPSA21480_rT5/run_131226.err` line 8), a different gap that this pull request does not touch. - Sources: https://github.com/OpenAGC/OpenAGC/blob/HEAD/include/agcdriver.h (line 188, `int32_t sceAgcDriverRegisterDefaultOwner(uint32_t owner)`); https://github.com/sharpemu/sharpemu/blob/HEAD/src/SharpEmu.Libs/Agc/AgcExports.DriverResources.cs (lines 165-180: owner read from RDI as `uint32`, stored, returns OK). - Not known: what the console returns. OpenAGC's `src/game_compat.c` (lines 343-349) says that on firmware 5.50 this export is a six-byte stub that returns `0x8A6C9018`; SharpEmu returns 0. The two do not agree, and neither is a console measurement. This pull request follows what the title needs (0), recorded in `docs/dev/debt/libSceAgcDriver.md`. - Other titles tolerate `0x8A6C9018` from the neighbouring registration calls (`sceAgcDriverRegisterOwner`, `RegisterResource`, ...); those still return it. Tolerating is not needing: whether a title that called this function and ignored the code behaves differently with 0 (for example by entering an owner or validation path) is not known; I have no run of such a title. ### Tested Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release. Branch `fix/agc-register-default-owner-v2`, commit `5a7f183a3` on `main` `344afad05` (one commit; `git merge-tree` against `main` `1b55ee4ab` is clean): - `guest_agc_driver_resources` (changed: `sceAgcDriverRegisterDefaultOwner(0)` and `(owner)` return 0), measured on `main` `344afad05` + this commit: passes with the change; with `Unimplemented.cpp` taken from `main` (test kept) it aborts, exit code `0xc0000409`. - `python tools/check_conventions.py --base upstream/main` with this title and body passes. - Title run, PPSA21480, on `main` `067f4f614` + this commit (applied as cherry-pick, `HEAD` `9c448d571`): `ninja -C build -j4 relinker` plus all 126 `core/libs/libs/*.prx`, finished 14:32:29 local time (`libSceAgcDriver.prx` 14:31:18); relink `relink_title_trace.ps1` = `relinker.exe --windows --registry --trace-imports`, `app.exe` 14:32:31; `run_title.ps1 -Seconds 120`. Result (`PPSA21480_rT6/run_143233.err`, 342 lines): no `8a6c9018` and no `sceCoredumpWriteUserString` line; the run ends at line 8 with `AJM: decoding codec 23 is not implemented`. Without the change (`PPSA21480_rH/run_090451.err`, libraries of `main` `e46c69505`): the stop described above. - Not tested: Linux (one source for both hosts, only Windows was built), a console, other titles. ### 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 (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt (`docs/dev/debt/libSceAgcDriver.md`) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA21480 (Broken Sword - Shadow of the Templars: Reforged) at `sceAgcDriverRegisterDefaultOwner`; no bring-up discussion known to me - [x] GPUs tested: n/a (no GPU code changed; the title run used an NVIDIA GeForce RTX 4080 SUPER, Windows 10) - [x] AI-assisted: yes AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-15 12:10:09 +00:00 (Migrated from github.com)

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


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 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5499 docs/dev/debt/libSceAgcDriver.md
PR 5761 docs/dev/debt/libSceAgcDriver.md
PR 5884 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6044 core/libs/tests/GuestAgcDriverResources.cpp
PR 6222 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191713541 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5834#issuecomment-6191713541). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:10:09Z. --- <!-- 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 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5761](https://www.github.com/boykopovar/AnyPS5/pull/5761) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5884](https://www.github.com/boykopovar/AnyPS5/pull/5884) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestAgcDriverResources.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `docs/dev/debt/libSceAgcDriver.md` |
adriadam10 commented 2026-10-15 13:26:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T13:26:08Z.


Checked the signature change against the cited sources, guest_agc_driver_resources (passes with the change, fails without it) and the build/ctest of the touched libraries on Linux; the technical-debt line records that the console value is unverified. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193178770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5834#issuecomment-6193178770). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T13:26:08Z. --- Checked the signature change against the cited sources, `guest_agc_driver_resources` (passes with the change, fails without it) and the build/ctest of the touched libraries on Linux; the technical-debt line records that the console value is unverified. Merging once the full Build is green.
xXPBSXx commented 2026-10-15 17:14:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-15T17:14:14Z.


@adriadam10 a short request on this PR: your Linux review above ends with "Merging once the full Build is green". The full Build only runs when a collaborator starts it for a pull request from a fork, so I cannot trigger it from my side. Head 5a7f183a3 is MERGEABLE, the Conventions, Eligibility and Intake checks are green, and the description names the title (Broken Sword - Shadow of the Templars: Reforged, PPSA21480), the log line and the test that fails without the change. If there is anything else you need from me to run it, tell me and I will do it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197916981 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5834#issuecomment-6197916981). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-15T17:14:14Z. --- @adriadam10 a short request on this PR: your Linux review above ends with "Merging once the full Build is green". The full Build only runs when a collaborator starts it for a pull request from a fork, so I cannot trigger it from my side. Head `5a7f183a3` is `MERGEABLE`, the Conventions, Eligibility and Intake checks are green, and the description names the title (Broken Sword - Shadow of the Templars: Reforged, PPSA21480), the log line and the test that fails without the change. If there is anything else you need from me to run it, tell me and I will do it. AI-assisted (Claude Code).
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!5834
No description provided.