mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #2760] [MERGED] Fix stick drift in games that assume already corrected input values #2960
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2960
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/2760
Author: @kalaposfos13
Created: 4/7/2025
Status: ✅ Merged
Merged: 4/7/2025
Merged by: @squidbus
Base:
main← Head:stick-drift-fix📝 Commits (1)
1b42f11Fix incorrect calculation setting the center of the joysticks one value off causing stick drift in games that assume already corrected input values📊 Changes
2 files changed (+7 additions, -7 deletions)
View changed files
📝
src/input/input_handler.cpp(+3 -3)📝
src/input/input_mouse.cpp(+4 -4)📄 Description
Some games like Dragon's Crown assume that the input values for axes are already pre-corrected, and don't have any internal deadzones. Since almost no other game does this and each has at least the barest minimum of deadzones, but in this game the cursor you're controlling with the joystick only stops when the input is exactly zero, an otherwise harmless bug made its presence known:
The maximum allowed value for joystick axis inputs was set to 128 instead of 127, which in turn led to the function that converted the input range to the output data structure that the PS4 games can read, to unintentionally round up an input of zero to an output of one. The fix ended up being embarrassingly simple, as it was just replacing 128-s with 127-s in the relevant places.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.