[PR #2760] [MERGED] Fix stick drift in games that assume already corrected input values #2960

Closed
opened 2026-02-27 22:01:55 +03:00 by kerem · 0 comments
Owner

📋 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: mainHead: stick-drift-fix


📝 Commits (1)

  • 1b42f11 Fix 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.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2760 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 4/7/2025 **Status:** ✅ Merged **Merged:** 4/7/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `stick-drift-fix` --- ### 📝 Commits (1) - [`1b42f11`](https://github.com/shadps4-emu/shadPS4/commit/1b42f115d8b4c19ca746a879efbdb15c8b679437) Fix 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) <details> <summary>View changed files</summary> 📝 `src/input/input_handler.cpp` (+3 -3) 📝 `src/input/input_mouse.cpp` (+4 -4) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:55 +03:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2960
No description provided.