Skip to content

Fix DualShock 2 pressure byte order for R1 and L2 - #265

Open
drakolordx7 wants to merge 1 commit into
ran-j:mainfrom
drakolordx7:fix/pad-pressure-order
Open

drakolordx7 wants to merge 1 commit into
ran-j:mainfrom
drakolordx7:fix/pad-pressure-order

Conversation

@drakolordx7

@drakolordx7 drakolordx7 commented Sep 30, 2026 •

Copy link
Copy Markdown

What

scePadRead filled the shoulder pressure bytes 16..19 as L1, L2, R1, R2. A DualShock 2 reports them as L1, R1, L2, R2:

byte 8 9 10 11 12 13 14 15 16 17 18 19
button right left up down triangle circle cross square L1 R1 L2 R2

Games that read buttons through the pressure bytes saw R1 and L2 swapped.

How it was found

Porting Killzone (SCUS-97402), which reads every button as an analog value from the pressure bytes (byte pad + 0x34 + id, ids in DS2 pressure order). With the old order, R1 (fire in its default controller map) triggered crouch and L2 fired. Logging which ids read as pressed while holding R1 / L2 / R2 / L1 / triangle gave ids 10 / 9 / 11 / 8 / 4 before this change and 9 / 10 / 11 / 8 / 4 after.

Test

The existing scePadRead fills pressure bytes... test pressed only L1 and R2, which are at the same index in both orders, so it could not catch this. It now also presses R1 alone and L2 alone and checks bytes 16..19.

  • ps2x_tests: 436 / 436 pass (run from the repository root).
  • With only the test change (old Pad.cpp), the pad test fails on R1 pressure is byte 17.

Made by drakolord and assisted with Claude Code.

scePadRead filled the shoulder pressure bytes 16..19 as L1, L2, R1, R2.
A DualShock 2 reports them as L1, R1, L2, R2 (bytes 8..19: right, left,
up, down, triangle, circle, cross, square, L1, R1, L2, R2).

Games that read buttons through the pressure bytes therefore saw R1 and
L2 swapped. Found in Killzone (SCUS-97402), which reads every button as
an analog value from the pressure bytes: with the old order, R1 (fire in
its default controller map) triggered crouch and L2 fired.

The existing pad test only pressed L1 and R2, which sit at the same
index in both orders; it now also presses R1 alone and L2 alone.

Made by drakolord and assisted with Claude Code.
@drakolordx7
drakolordx7 force-pushed the fix/pad-pressure-order branch from 93099d7 to 33612fe Compare September 30, 2026 23:15
Scotho added a commit to Scotho/socom-unzipped that referenced this pull request Oct 3, 2026
…n R1 (upstream PS2Recomp #265)

scePadRead filled the shoulder pressure bytes 16..19 as L1, L2, R1, R2; a DualShock 2 reports L1, R1, L2, R2.
Ported from upstream PS2Recomp PR #265 by drako (drakolordx7), the fix and its test as written there.

Upstream: ran-j/PS2Recomp#265 (open, not merged on 2026-10-03; no merge commit;
ported from its head commit 33612fead3b98fa1ab416110a01a03701fe1cd85). Same licence (GPL-3.0).
SOCOM II reads its pad through libpad2 (scePad2Read, the socom2_pad2_hle path), not scePadRead,
so this path is not on the game's input path. LATER row 83; research/85 section 4.

Co-authored-by: drako <98249188+drakolordx7@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant