feat(libScePad): set the light bar from scePadSetLightBarForTracker #8260

Merged
YossiYad merged 3 commits from upstream-pr/8260 into main 2026-11-13 09:34:57 +00:00
YossiYad commented 2026-10-20 07:23:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-20T07:23:31Z.


What

scePadSetLightBarForTracker threw. It now takes (handle, const PadLightBarParam*) and does what scePadSetLightBar does: INVALID_HANDLE for a handle that is not the open pad, INVALID_ARG for a null colour, and otherwise it sets the light bar colour the controller output carries.

The signature and the behaviour follow shadPS4 (PS4), which sets the light bar the same way (it does not check for a null colour). How the console combines this colour with the one the VR tracker picks is not measured; the debt entry says so in place of "unknown signature".

Tested

Current validation (2026-10-25): rebased onto main 16ff208dc3; rebuilt and passed guest_pad on Bazzite 44. Conventions pass against upstream/main. The signature remains unverified against a PS5 system module.

Linux (Fedora 44, GCC, Ninja, -DBUILD_TESTING=ON), based on main 3fd1cc393b:

  • guest_pad passes with a new CheckTrackerLightBar: a wrong handle and a null colour are refused without a new output, and a valid call publishes the colour through PadFetchOutput_nid_postfix. It passed 10 of 10 runs, and fails when the call returns success without setting the colour.
  • Full ctest: 1670 of 1675 pass. The 5 failures (application_heap_scripting, application_heap_lazy, agc_driver_bda_device, agc_driver_guest_memory_lifetime, agc_driver_tessellation) fail the same way on main on this machine.
  • tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py lists #5038, #6044 and #7881, which conflict with main and share libScePad files; none of their diffs touches this function.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4932425156 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8260). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-20T07:23:31Z. --- ### What `scePadSetLightBarForTracker` threw. It now takes `(handle, const PadLightBarParam*)` and does what `scePadSetLightBar` does: `INVALID_HANDLE` for a handle that is not the open pad, `INVALID_ARG` for a null colour, and otherwise it sets the light bar colour the controller output carries. The signature and the behaviour follow [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/a808e76/src/core/libraries/pad/pad.cpp) (PS4), which sets the light bar the same way (it does not check for a null colour). How the console combines this colour with the one the VR tracker picks is not measured; the debt entry says so in place of "unknown signature". ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Current validation (2026-10-25): rebased onto main `16ff208dc3`; rebuilt and passed `guest_pad` on Bazzite 44. Conventions pass against upstream/main. The signature remains unverified against a PS5 system module. Linux (Fedora 44, GCC, Ninja, `-DBUILD_TESTING=ON`), based on `main` `3fd1cc393b`: - `guest_pad` passes with a new `CheckTrackerLightBar`: a wrong handle and a null colour are refused without a new output, and a valid call publishes the colour through `PadFetchOutput_nid_postfix`. It passed 10 of 10 runs, and fails when the call returns success without setting the colour. - Full `ctest`: 1670 of 1675 pass. The 5 failures (`application_heap_scripting`, `application_heap_lazy`, `agc_driver_bda_device`, `agc_driver_guest_memory_lifetime`, `agc_driver_tessellation`) fail the same way on `main` on this machine. - `tools/check_conventions.py --base upstream/main` passes. `tools/pr_overlap.py` lists #5038, #6044 and #7881, which conflict with `main` and share libScePad files; none of their diffs touches this function. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
YossiYad commented 2026-10-21 06:50:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-21T06:50:59Z.


Rebased onto current main (head ffe29512a, main 7ce3b1df3). The only conflict was the declarations at the top of GuestPad.cpp, where main added scePadGetControllerInformation and scePadGetExtControllerInformation at the same spot; I kept both. main still has scePadSetLightBarForTracker as a stub, and the added and removed lines match the previous head.

guest_pad passes 3 of 3 here, and check_conventions has no findings.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309947665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8260#issuecomment-6309947665). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-21T06:50:59Z. --- Rebased onto current `main` (head `ffe29512a`, `main` `7ce3b1df3`). The only conflict was the declarations at the top of `GuestPad.cpp`, where `main` added `scePadGetControllerInformation` and `scePadGetExtControllerInformation` at the same spot; I kept both. `main` still has `scePadSetLightBarForTracker` as a stub, and the added and removed lines match the previous head. `guest_pad` passes 3 of 3 here, and `check_conventions` has no findings.
YossiYad commented 2026-10-22 05:33:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T05:33:57Z.


Rebased onto main da54c652e after #9137 (head 8ef0f0f0e). It now uses main's (std::int32_t handle, const PadLightBarParam* color) declaration, and the debt entry moved under the new "Unknown function info" layout. guest_pad passes 3 of 3.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333560765 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8260#issuecomment-6333560765). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-22T05:33:57Z. --- Rebased onto `main` `da54c652e` after #9137 (head `8ef0f0f0e`). It now uses `main`'s `(std::int32_t handle, const PadLightBarParam* color)` declaration, and the debt entry moved under the new "Unknown function info" layout. `guest_pad` passes 3 of 3.
harisibrar1 commented 2026-10-24 15:38:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:38:04Z.

Review: COMMENTED


Checked against main b607bfdc8b and shadPS4 a808e76 (src/core/libraries/pad/pad.cpp):

  • This no longer merges cleanly: #8350 (scePadGetControllerType) added its declaration, CheckControllerType(handle); and its libScePad.md entry at the same spots as this PR. All three are "keep both" conflicts, so a quick rebase should do it.
  • The NID iHuOWdvQVpg and the (handle, const PadLightBarParam*) signature match the cited shadPS4 code, and forwarding to scePadSetLightBar keeps main's handle → null → special-handle order.
  • Small wording point for the debt entry: shadPS4 does more than skip the null check; it reads pParam->r/g/b in its LOG_INFO (pad.cpp:599) before the handle check, so a null colour would crash there. Maybe "shadPS4 dereferences the colour before any check".
  • The only evidence is shadPS4's PS4 HLE, and no PS5 title is known to call this yet. Do you have a PS5 system-module read of this NID, like the scePadGetAccessibilityControllerState entry has, to confirm the argument types and error order? If not, keeping the entry under "Unknown function info", as you did, seems right.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638811676 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8260#pullrequestreview-5638811676). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T15:38:04Z. **Review:** COMMENTED --- Checked against main b607bfdc8b and shadPS4 a808e76 (src/core/libraries/pad/pad.cpp): - This no longer merges cleanly: #8350 (scePadGetControllerType) added its declaration, `CheckControllerType(handle);` and its libScePad.md entry at the same spots as this PR. All three are "keep both" conflicts, so a quick rebase should do it. - The NID `iHuOWdvQVpg` and the `(handle, const PadLightBarParam*)` signature match the cited shadPS4 code, and forwarding to `scePadSetLightBar` keeps main's handle → null → special-handle order. - Small wording point for the debt entry: shadPS4 does more than skip the null check; it reads `pParam->r/g/b` in its LOG_INFO (pad.cpp:599) before the handle check, so a null colour would crash there. Maybe "shadPS4 dereferences the colour before any check". - The only evidence is shadPS4's PS4 HLE, and no PS5 title is known to call this yet. Do you have a PS5 system-module read of this NID, like the scePadGetAccessibilityControllerState entry has, to confirm the argument types and error order? If not, keeping the entry under "Unknown function info", as you did, seems right. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
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!8260
No description provided.