summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2023-09-16 08:21:47 +0200
committergerman77 <juangerman-13@hotmail.com>2023-09-16 08:31:19 +0200
commit8950fe79ad0f1a10880556856eca9f987cdfd886 (patch)
tree8fed94e0fdad0043aa70af8ba4ba01793b658d12 /src/core/hle
parentservice: hid: Ensure state is correct (diff)
downloadyuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.tar
yuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.tar.gz
yuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.tar.bz2
yuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.tar.lz
yuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.tar.xz
yuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.tar.zst
yuzu-8950fe79ad0f1a10880556856eca9f987cdfd886.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp4
-rw-r--r--src/core/hle/service/hid/hid.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index a894af8ea..da3220ddc 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -476,6 +476,10 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) {
pad_entry.npad_buttons.l.Assign(button_state.zl);
pad_entry.npad_buttons.r.Assign(button_state.zr);
}
+
+ if (pad_entry.npad_buttons.raw != Core::HID::NpadButton::None) {
+ hid_core.SetLastActiveController(npad_id);
+ }
}
void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index fd466db7b..3657e61d3 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -2768,7 +2768,7 @@ private:
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
- rb.PushEnum(Core::HID::NpadIdType::Handheld);
+ rb.PushEnum(system.HIDCore().GetLastActiveController());
}
void GetUniquePadsFromNpad(HLERequestContext& ctx) {