fix(libScePad): report the DualSense touchpad resolution #8138

Merged
bl4nkTHEBUNKER merged 1 commit from upstream-pr/8138 into main 2026-10-20 17:25:53 +00:00
bl4nkTHEBUNKER commented 2026-10-19 23:53:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by bl4nkTHEBUNKER on 2026-10-19T23:53:22Z.


What

scePadGetControllerInformation and scePadGetExtControllerInformation reported the touchpad as 1920 by 943: the DualShock 4 height with the DualSense pixel density. The library reports a DualSense to every title (scePadGetInfo answers SCE_PAD_DEVICE_TYPE_DUAL_SENSE), so the touchpad is 1920 by 1080.

Three places disagreed with each other:

before after
controller information 1920 by 943 1920 by 1080
host controller fingers in PadInput scaled by 1919 and 942 scaled by 1919 and 1079
keyboard and View button touch contacts y 471 y 540, the centre line

A title that maps touch coordinates through the reported resolution lost the lower part of the touchpad and read every y compressed. The width and height now live beside the pad state as kTouchPadWidth and kTouchPadHeight, and the controller information, the finger scaling and the virtual contacts all read them, so the three cannot drift apart again.

Sources, both naming the same pair:

  • duaLib, which reimplements the PC libScePad.dll and is already a source in the pad debt, reports 1920 by 1080 at 44.86 pixels per cm for a DualSense, against 1920 by 943 at 44 for a DualShock 4.
  • The Linux kernel's hid-playstation holds DS_TOUCHPAD_WIDTH 1920 and DS_TOUCHPAD_HEIGHT 1080 for the DualSense, against DS4_TOUCHPAD_HEIGHT 942 in the same file.

The pixel density 44.86 already matched duaLib's DualSense value and is unchanged. A DualShock 4 on the host now reports through the DualSense range as well, since the title is told it holds a DualSense; that and the unmeasured console values are in the technical debt.

Tested

Windows 11, GCC 16.2 (MSYS2 UCRT64), core/libs/tests/GuestPad.cpp extended and run against libScePad's sources with -Wall -Wextra (clean, test passes). New assertions: both controller information exports report 1920 by 1080 and 44.86, the invalid handle still returns INVALID_HANDLE, and the keyboard touch contacts land on the quarter points and the centre line. The existing injected-touch assertions that held the 942 centre line now read the same constants. No title tested: no touch-driven title was run.

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:4928964837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8138). Originally posted by [bl4nkTHEBUNKER](https://github.com/bl4nkTHEBUNKER) on 2026-10-19T23:53:22Z. --- ### What `scePadGetControllerInformation` and `scePadGetExtControllerInformation` reported the touchpad as 1920 by 943: the DualShock 4 height with the DualSense pixel density. The library reports a DualSense to every title (`scePadGetInfo` answers `SCE_PAD_DEVICE_TYPE_DUAL_SENSE`), so the touchpad is 1920 by 1080. Three places disagreed with each other: | | before | after | |---|---|---| | controller information | 1920 by 943 | 1920 by 1080 | | host controller fingers in `PadInput` | scaled by 1919 and 942 | scaled by 1919 and 1079 | | keyboard and View button touch contacts | y 471 | y 540, the centre line | A title that maps touch coordinates through the reported resolution lost the lower part of the touchpad and read every y compressed. The width and height now live beside the pad state as `kTouchPadWidth` and `kTouchPadHeight`, and the controller information, the finger scaling and the virtual contacts all read them, so the three cannot drift apart again. Sources, both naming the same pair: - [duaLib](https://github.com/WujekFoliarz/duaLib/blob/0b39f92261e2ff0e77eb0dac00943be6970e0dbf/src/source/duaLib.cpp#L847-L849), which reimplements the PC `libScePad.dll` and is already a source in [the pad debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/debt/libScePad.md), reports 1920 by 1080 at 44.86 pixels per cm for a DualSense, against 1920 by 943 at 44 for a DualShock 4. - The Linux kernel's [hid-playstation](https://github.com/torvalds/linux/blob/cd4f494ba535e848e2d299707d363de84e61a518/drivers/hid/hid-playstation.c#L177-L178) holds `DS_TOUCHPAD_WIDTH 1920` and `DS_TOUCHPAD_HEIGHT 1080` for the DualSense, against `DS4_TOUCHPAD_HEIGHT 942` in the same file. The pixel density 44.86 already matched duaLib's DualSense value and is unchanged. A DualShock 4 on the host now reports through the DualSense range as well, since the title is told it holds a DualSense; that and the unmeasured console values are in the [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/debt/libScePad.md). ### Tested Windows 11, GCC 16.2 (MSYS2 UCRT64), `core/libs/tests/GuestPad.cpp` extended and run against `libScePad`'s sources with `-Wall -Wextra` (clean, test passes). New assertions: both controller information exports report 1920 by 1080 and 44.86, the invalid handle still returns `INVALID_HANDLE`, and the keyboard touch contacts land on the quarter points and the centre line. The existing injected-touch assertions that held the 942 centre line now read the same constants. No title tested: no touch-driven title was run. ### 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 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
github-actions[bot] commented 2026-10-20 00:15:56 +00:00 (Migrated from github.com)

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


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
PR 6337 core/libs/tests/GuestPad.cpp L7
docs/dev/debt/libScePad.md L162
PR 7064 docs/dev/debt/libScePad.md L162
PR 7965 core/libs/prx/libScePad/Export.cpp L81-84, L125-128
core/libs/prx/libScePad/src/PadState.cpp L205-206
core/libs/prx/libSceVideoOut/src/PadInput.cpp L195-196, L200
core/libs/tests/GuestPad.cpp L29-30, L319
PR 8260 core/libs/tests/GuestPad.cpp L30
PR 8350 core/libs/tests/GuestPad.cpp L30

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 674 core/libs/prx/libSceVideoOut/src/PadInput.cpp
PR 5038 core/libs/prx/libScePad/Export.cpp
docs/dev/debt/libScePad.md
PR 6044 core/libs/tests/GuestPad.cpp
PR 7499 core/libs/prx/libSceVideoOut/src/PadInput.cpp
PR 7881 core/libs/prx/libScePad/Export.cpp
core/libs/prx/libScePad/include/PadState.hpp
core/libs/prx/libScePad/src/PadState.cpp
core/libs/prx/libSceVideoOut/src/PadInput.cpp
core/libs/tests/GuestPad.cpp
docs/dev/debt/libScePad.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280246825 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8138#issuecomment-6280246825). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T00:15:56Z. --- <!-- 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 | |---|---|---|---| | [PR 6337](https://www.github.com/boykopovar/AnyPS5/pull/6337) | `core/libs/tests/GuestPad.cpp` [L7](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/tests/GuestPad.cpp#L7)<br>`docs/dev/debt/libScePad.md` [L162](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/docs/dev/debt/libScePad.md#L162) | | | | [PR 7064](https://www.github.com/boykopovar/AnyPS5/pull/7064) | `docs/dev/debt/libScePad.md` [L162](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/docs/dev/debt/libScePad.md#L162) | | | | [PR 7965](https://www.github.com/boykopovar/AnyPS5/pull/7965) | `core/libs/prx/libScePad/Export.cpp` [L81-84](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/prx/libScePad/Export.cpp#L81-L84), [L125-128](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/prx/libScePad/Export.cpp#L125-L128)<br>`core/libs/prx/libScePad/src/PadState.cpp` [L205-206](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/prx/libScePad/src/PadState.cpp#L205-L206)<br>`core/libs/prx/libSceVideoOut/src/PadInput.cpp` [L195-196](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/prx/libSceVideoOut/src/PadInput.cpp#L195-L196), [L200](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/prx/libSceVideoOut/src/PadInput.cpp#L200)<br>`core/libs/tests/GuestPad.cpp` [L29-30](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/tests/GuestPad.cpp#L29-L30), [L319](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/tests/GuestPad.cpp#L319) | | | | [PR 8260](https://www.github.com/boykopovar/AnyPS5/pull/8260) | `core/libs/tests/GuestPad.cpp` [L30](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/tests/GuestPad.cpp#L30) | | | | [PR 8350](https://www.github.com/boykopovar/AnyPS5/pull/8350) | `core/libs/tests/GuestPad.cpp` [L30](https://github.com/boykopovar/AnyPS5/blob/7526640c3c1c5ea236c33b43b854681e8d169745/core/libs/tests/GuestPad.cpp#L30) | | | 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 674](https://www.github.com/boykopovar/AnyPS5/pull/674) | `core/libs/prx/libSceVideoOut/src/PadInput.cpp` | | [PR 5038](https://www.github.com/boykopovar/AnyPS5/pull/5038) | `core/libs/prx/libScePad/Export.cpp`<br>`docs/dev/debt/libScePad.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestPad.cpp` | | [PR 7499](https://www.github.com/boykopovar/AnyPS5/pull/7499) | `core/libs/prx/libSceVideoOut/src/PadInput.cpp` | | [PR 7881](https://www.github.com/boykopovar/AnyPS5/pull/7881) | `core/libs/prx/libScePad/Export.cpp`<br>`core/libs/prx/libScePad/include/PadState.hpp`<br>`core/libs/prx/libScePad/src/PadState.cpp`<br>`core/libs/prx/libSceVideoOut/src/PadInput.cpp`<br>`core/libs/tests/GuestPad.cpp`<br>`docs/dev/debt/libScePad.md` |
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!8138
No description provided.