Fix PS3 trigger and face-button analog axes - #265
Open
Revise0592 wants to merge 1 commit into
Open
Conversation
PS3Device::process() set the L2/R2 digital button bits from gp_in.trigger_l/trigger_r but never wrote report_in_.l2_axis/r2_axis, so the analog pressure value for both triggers was always 0. Games that read trigger pressure instead of (or in addition to) the digital bit never saw a real throttle/brake input. Separately, the digital-only face-button fallback in PS3.cpp (used whenever the host controller doesn't report analog buttons, e.g. a standard XInput pad) and the analog-enabled path in DInput.cpp both had circle/cross/square axes rotated onto the wrong physical buttons, while the digital bits and PS3's own analog-enabled path were correct. Practically: pressing B (Xbox) correctly set the Circle digital bit, but wrote its pressure value into cross_axis instead of circle_axis. Tested on hardware (Pi Pico, PS3 output mode): MotorStorm and Driver: San Francisco, both previously broken (no throttle/brake, wrong face-button actions), now behave correctly. Minecraft: PS3 Edition, which already worked before this fix, is unaffected. Fixes wiredopposite#164, Fixes wiredopposite#142 Relates to wiredopposite#68, wiredopposite#127
Open
|
Maybe @MegaCadeDev can use this in his fork? |
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's broken
Both bugs only show up on PS3 output mode, and specifically hit games that read the analog pressure value for a button/trigger rather than just its digital bit which is why some games worked fine and others didn't.
I noticed the XMB seemed to work OK but going into a game, buttons went skewif and triggers didn't work.
1. Triggers (L2/R2) had no analog pressure
PS3Device::process()set the L2/R2 digital button bits fromgp_in.trigger_l/trigger_r, but never wrotereport_in_.l2_axis/r2_axis. Those bytes stayed at 0 every frame, so any game reading trigger pressure (throttle/brake, aim, etc.) saw no input at all, even though the digital button bit was set correctly.2. Face-button (Circle/Cross/Square) were wired to the wrong buttons
In
PS3.cpp's digital-only fallback (used whenever the host controller doesn't report analog buttons, e.g. a standard XInput pad) and inDInput.cpp's analog-enabled path, the circle/cross/square axis assignments were rotated one position off relative to the correct mapping (confirmed against the digital button bits and PS3's own analog-enabled branch, both of which are correct). In practice: pressing Xbox B correctly set the PS3 Circle digital bit, but wrote its pressure value intocross_axisinstead ofcircle_axisso any game reading pressure would see Cross being pressed instead of Circle.Testing
Built and flashed to real hardware (Pi Pico, PS3 output mode):
Related issues
This looks like it explains several existing open reports:
I will also disclose that I did use AI to help me figure this out, but I did learn something out of this - if I have inadvertently broken something else, let me know. I have mainly been testing on PS3. I can also test on XBOX 360.