summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2023-09-16 08:17:30 +0200
committergerman77 <juangerman-13@hotmail.com>2023-09-16 08:31:09 +0200
commitc8b9467f502a37abf2198df556b03510f104732a (patch)
tree868f4bcc77b7aa12c80d3f6b343cae162594580a
parentMerge pull request #11385 from liamwhite/acceptcancel (diff)
downloadyuzu-c8b9467f502a37abf2198df556b03510f104732a.tar
yuzu-c8b9467f502a37abf2198df556b03510f104732a.tar.gz
yuzu-c8b9467f502a37abf2198df556b03510f104732a.tar.bz2
yuzu-c8b9467f502a37abf2198df556b03510f104732a.tar.lz
yuzu-c8b9467f502a37abf2198df556b03510f104732a.tar.xz
yuzu-c8b9467f502a37abf2198df556b03510f104732a.tar.zst
yuzu-c8b9467f502a37abf2198df556b03510f104732a.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 3b349b4c4..a894af8ea 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -419,9 +419,17 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) {
std::scoped_lock lock{mutex};
auto& controller = GetControllerFromNpadIdType(npad_id);
const auto controller_type = controller.device->GetNpadStyleIndex();
+
+ if (!controller.device->IsConnected() && controller.is_connected) {
+ DisconnectNpad(npad_id);
+ return;
+ }
if (!controller.device->IsConnected()) {
return;
}
+ if (controller.device->IsConnected() && !controller.is_connected) {
+ InitNewlyAddedController(npad_id);
+ }
// This function is unique to yuzu for the turbo buttons and motion to work properly
controller.device->StatusUpdate();
@@ -736,14 +744,6 @@ void Controller_NPad::SetSupportedStyleSet(Core::HID::NpadStyleTag style_set) {
// Once SetSupportedStyleSet is called controllers are fully initialized
is_controller_initialized = true;
-
- // Connect all active controllers
- for (auto& controller : controller_data) {
- const auto& device = controller.device;
- if (device->IsConnected()) {
- AddNewControllerAt(device->GetNpadStyleIndex(), device->GetNpadIdType());
- }
- }
}
Core::HID::NpadStyleTag Controller_NPad::GetSupportedStyleSet() const {