feat(libSceAgc): implement DCB and ACB marker span functions #1055

Closed
Kikoarl wants to merge 1 commit from upstream-pr/1055 into main
Kikoarl commented 2026-10-07 06:00:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-07T06:00:18Z.


What

Implements sceAgcDcbPushMarkerSpan, sceAgcDcbSetMarkerSpan, sceAgcAcbPushMarkerSpan, and sceAgcAcbSetMarkerSpan in libSceAgc.

  • Provenance: Signatures (cb, marker, length, color) follow OpenAGC (include/agcdriver.h and src/cb_builders.c), which document the explicit-length marker variants for DCB and ACB.
  • Sits symmetrically alongside existing sceAgcDcbPushMarker, sceAgcDcbSetMarker, sceAgcAcbPushMarker, and sceAgcAcbSetMarker.
  • Emits the standard custom NOP marker packet (0x10, sub-opcode 0x0b for push, 0x0c for pop) with explicit length bounds, ensuring payload zero-padding and null-termination.
  • Validates command buffer pointers and rejects null text when length is non-zero with an exact-or-throw policy.
  • Documented in TechnicalDebt.md in the same commit.

Tested

  • Built cleanly on Linux with GCC in /tmp/anyps5_build.
  • Unit tests added to core/libs/prx/libSceAgc/tests/Commands.cpp (testMarkers in agc_commands):
    • Verified packet header, sub-opcode, text payload, and cursor advance for DCB and ACB PushMarkerSpan.
    • Verified SetMarkerSpan emits matching push and pop packets for DCB and ACB.
    • Verified empty marker with length 0 and null pointer.
    • Negative tests verify rejection of null command buffers and null text with non-zero length.
    • Passed ctest -R agc_commands.
  • Progress: python3 tools/progress.py confirms libSceAgc progress improved from 199 to 202 implemented functions (4 stubs resolved).

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4768625420 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1055). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-07T06:00:18Z. --- ### What Implements `sceAgcDcbPushMarkerSpan`, `sceAgcDcbSetMarkerSpan`, `sceAgcAcbPushMarkerSpan`, and `sceAgcAcbSetMarkerSpan` in `libSceAgc`. - Provenance: Signatures `(cb, marker, length, color)` follow [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/main/include/agcdriver.h) (`include/agcdriver.h` and `src/cb_builders.c`), which document the explicit-length marker variants for DCB and ACB. - Sits symmetrically alongside existing `sceAgcDcbPushMarker`, `sceAgcDcbSetMarker`, `sceAgcAcbPushMarker`, and `sceAgcAcbSetMarker`. - Emits the standard custom NOP marker packet (`0x10`, sub-opcode `0x0b` for push, `0x0c` for pop) with explicit length bounds, ensuring payload zero-padding and null-termination. - Validates command buffer pointers and rejects null text when length is non-zero with an exact-or-throw policy. - Documented in `TechnicalDebt.md` in the same commit. ### Tested - Built cleanly on Linux with GCC in `/tmp/anyps5_build`. - Unit tests added to `core/libs/prx/libSceAgc/tests/Commands.cpp` (`testMarkers` in `agc_commands`): - Verified packet header, sub-opcode, text payload, and cursor advance for DCB and ACB `PushMarkerSpan`. - Verified `SetMarkerSpan` emits matching push and pop packets for DCB and ACB. - Verified empty marker with length 0 and null pointer. - Negative tests verify rejection of null command buffers and null text with non-zero length. - Passed `ctest -R agc_commands`. - Progress: `python3 tools/progress.py` confirms `libSceAgc` progress improved from 199 to 202 implemented functions (4 stubs resolved). ### 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
github-actions[bot] commented 2026-10-07 06:00:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T06:00:41Z.


Progress report (a9ec7be → de52e0e)

📈 System libraries: 87.44% (+0.14%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceAgc sceAgcAcbPushMarkerSpan
libSceAgc sceAgcAcbSetMarkerSpan
libSceAgc sceAgcDcbPushMarkerSpan
libSceAgc sceAgcDcbSetMarkerSpan
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6031993116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1055#issuecomment-6031993116). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T06:00:41Z. --- <!-- progress-report --> ### Progress report (a9ec7be → de52e0e) 📈 **System libraries**: 87.44% (+0.14%, +4 implemented functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcAcbPushMarkerSpan` | | libSceAgc | `sceAgcAcbSetMarkerSpan` | | libSceAgc | `sceAgcDcbPushMarkerSpan` | | libSceAgc | `sceAgcDcbSetMarkerSpan` | </details>
github-actions[bot] commented 2026-10-07 06:50:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T06:50:54Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#971 core/libs/prx/libSceAgc/DcbState/src/Marker.cpp L22, L24-25, L31, L34, L62 sceAgcAcbPushMarkerSpan
sceAgcAcbSetMarkerSpan
sceAgcDcbPushMarkerSpan
sceAgcDcbSetMarkerSpan
#1061 docs/dev/TechnicalDebt.md L33
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6032622464 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1055#issuecomment-6032622464). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T06:50:54Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #971 | `core/libs/prx/libSceAgc/DcbState/src/Marker.cpp` [L22](https://github.com/boykopovar/AnyPS5/blob/c644f46b225378d1d5e850c41ec59dd4f318b3d8/core/libs/prx/libSceAgc/DcbState/src/Marker.cpp#L22), [L24-25](https://github.com/boykopovar/AnyPS5/blob/c644f46b225378d1d5e850c41ec59dd4f318b3d8/core/libs/prx/libSceAgc/DcbState/src/Marker.cpp#L24-L25), [L31](https://github.com/boykopovar/AnyPS5/blob/c644f46b225378d1d5e850c41ec59dd4f318b3d8/core/libs/prx/libSceAgc/DcbState/src/Marker.cpp#L31), [L34](https://github.com/boykopovar/AnyPS5/blob/c644f46b225378d1d5e850c41ec59dd4f318b3d8/core/libs/prx/libSceAgc/DcbState/src/Marker.cpp#L34), [L62](https://github.com/boykopovar/AnyPS5/blob/c644f46b225378d1d5e850c41ec59dd4f318b3d8/core/libs/prx/libSceAgc/DcbState/src/Marker.cpp#L62) | `sceAgcAcbPushMarkerSpan`<br>`sceAgcAcbSetMarkerSpan`<br>`sceAgcDcbPushMarkerSpan`<br>`sceAgcDcbSetMarkerSpan` | | | #1061 | `docs/dev/TechnicalDebt.md` [L33](https://github.com/boykopovar/AnyPS5/blob/c644f46b225378d1d5e850c41ec59dd4f318b3d8/docs/dev/TechnicalDebt.md#L33) | | |
oneandonlydean commented 2026-10-07 09:00:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T09:00:28Z.


Thanks for the PR. I'm closing this one, for two reasons:

  • #971 already implements the same four functions (sceAgc{Dcb,Acb}{Push,Set}MarkerSpan) in the same files and was opened first, so these two would conflict and only one can go in. If you see a problem with #971's version, a review comment there is the best place for it.
  • As with #970 and #999, no title is shown to reach these on main. The owner merges library functions only when a title needs them, shown by the title ID and the log line where it stops on main.

If a title stops at one of the marker span functions on main, please add the title ID and that log line on #971.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6034588352 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1055#issuecomment-6034588352). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-07T09:00:28Z. --- Thanks for the PR. I'm closing this one, for two reasons: - #971 already implements the same four functions (`sceAgc{Dcb,Acb}{Push,Set}MarkerSpan`) in the same files and was opened first, so these two would conflict and only one can go in. If you see a problem with #971's version, a review comment there is the best place for it. - As with #970 and #999, no title is shown to reach these on main. The owner merges library functions only when a title needs them, shown by the title ID and the log line where it stops on main. If a title stops at one of the marker span functions on main, please add the title ID and that log line on #971.

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