summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-06-13 19:01:05 +0200
committerZach Hilman <zachhilman@gmail.com>2018-06-13 19:01:05 +0200
commit50153a1cb2edbb9ae3aef79a464779099c1e2827 (patch)
tree4eef099ef0cba7a97260539a505030c11d50af7e /src
parentMerge pull request #560 from Subv/crash_widget (diff)
downloadyuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.tar
yuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.tar.gz
yuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.tar.bz2
yuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.tar.lz
yuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.tar.xz
yuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.tar.zst
yuzu-50153a1cb2edbb9ae3aef79a464779099c1e2827.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/hid/hid.cpp5
-rw-r--r--src/core/hle/service/hid/hid.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 85ca4bf06..d84c0a0b2 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -83,7 +83,10 @@ private:
controller_header.left_color_buttons = JOYCON_BUTTONS_NEON_BLUE;
for (size_t controller = 0; controller < mem.controllers.size(); controller++) {
- for (int index = 0; index < HID_NUM_LAYOUTS; index++) {
+ for (int index = 0;
+ index <
+ (controller != Controller_Handheld ? HID_NUM_LAYOUTS : HID_NUM_LAYOUTS_HANDHELD);
+ index++) {
ControllerLayout& layout = mem.controllers[controller].layouts[index];
layout.header.num_entries = HID_NUM_ENTRIES;
layout.header.max_entry_index = HID_NUM_ENTRIES - 1;
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h
index b499308d6..a032f59dc 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -13,6 +13,7 @@ namespace Service::HID {
constexpr u32 HID_NUM_ENTRIES = 17;
constexpr u32 HID_NUM_LAYOUTS = 7;
+constexpr u32 HID_NUM_LAYOUTS_HANDHELD = 2;
constexpr s32 HID_JOYSTICK_MAX = 0x8000;
constexpr s32 HID_JOYSTICK_MIN = -0x8000;