[PR #4016] [MERGED] pad: refactoring #3871

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/4016
Author: @roamic
Created: 2/10/2026
Status: Merged
Merged: 2/11/2026
Merged by: @georgemoralis

Base: mainHead: fix-pad-ringbuffer


📝 Commits (2)

📊 Changes

6 files changed (+116 additions, -265 deletions)

View changed files

📝 src/core/libraries/pad/pad.cpp (+32 -122)
📝 src/input/controller.cpp (+29 -115)
📝 src/input/controller.h (+43 -16)
📝 src/input/input_handler.cpp (+6 -6)
📝 src/input/input_mouse.cpp (+3 -3)
📝 src/sdl_window.cpp (+3 -3)

📄 Description

I was trying to fix controller issues in Ys VIII and ended up refactoring a chunk of pad code while trying to find a root cause.

The main fix is setting m_connected_count to 1, everything else is just a bonus.

  • Moved ring buffer queue to a separate entity for clarity. Queue is now 64 items.
  • Core controller state is now persistent instead of popping the queue every time.
  • Removed a lot of dead code.
  • Removed a lot of unneeded sync.
  • Merged a lot of duplicated code. Note: acceleration was multiplied by 0.098 in one method but not in the other, let me know if it's correct to keep multiplication for both.

🔄 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/4016 **Author:** [@roamic](https://github.com/roamic) **Created:** 2/10/2026 **Status:** ✅ Merged **Merged:** 2/11/2026 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `fix-pad-ringbuffer` --- ### 📝 Commits (2) - [`dc593a5`](https://github.com/shadps4-emu/shadPS4/commit/dc593a5093d2fda56bbcea9c8c766c0811127399) pad: refactoring - [`0a1801d`](https://github.com/shadps4-emu/shadPS4/commit/0a1801da4cefb2a0332cf210625bfbf117159f5c) clang is not my friend ### 📊 Changes **6 files changed** (+116 additions, -265 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/pad/pad.cpp` (+32 -122) 📝 `src/input/controller.cpp` (+29 -115) 📝 `src/input/controller.h` (+43 -16) 📝 `src/input/input_handler.cpp` (+6 -6) 📝 `src/input/input_mouse.cpp` (+3 -3) 📝 `src/sdl_window.cpp` (+3 -3) </details> ### 📄 Description I was trying to fix controller issues in Ys VIII and ended up refactoring a chunk of pad code while trying to find a root cause. The main fix is setting `m_connected_count` to `1`, everything else is just a bonus. * Moved ring buffer queue to a separate entity for clarity. Queue is now 64 items. * Core controller state is now persistent instead of popping the queue every time. * Removed a lot of dead code. * Removed a lot of unneeded sync. * Merged a lot of duplicated code. Note: `acceleration` was multiplied by `0.098` in one method but not in the other, let me know if it's correct to keep multiplication for both. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:05:17 +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#3871
No description provided.