Fix DualShock 2 pressure byte order for R1 and L2 - #265
Open
drakolordx7 wants to merge 1 commit into
Open
drakolordx7 wants to merge 1 commit into
drakolordx7 wants to merge 1 commit into
Conversation
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
force-pushed
the
fix/pad-pressure-order
branch
from
September 30, 2026 23:15
93099d7 to
33612fe
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
scePadReadfilled the shoulder pressure bytes 16..19 as L1, L2, R1, R2. A DualShock 2 reports them as 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).Pad.cpp), the pad test fails onR1 pressure is byte 17.Made by drakolord and assisted with Claude Code.