summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-06-14 02:03:12 +0200
committerZach Hilman <zachhilman@gmail.com>2018-06-14 02:03:12 +0200
commitac88d3e89f68cf9eac11014225c2847e96f8a620 (patch)
tree0385b272123d104023a174aa3056839c0631d98d
parentMove loop condition to free function (diff)
downloadyuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.tar
yuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.tar.gz
yuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.tar.bz2
yuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.tar.lz
yuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.tar.xz
yuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.tar.zst
yuzu-ac88d3e89f68cf9eac11014225c2847e96f8a620.zip
-rw-r--r--src/core/hle/service/hid/hid.cpp14
-rw-r--r--src/core/hle/service/hid/hid.h1
2 files changed, 5 insertions, 10 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index d4f741505..2696a8bf0 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -16,14 +16,6 @@
namespace Service::HID {
-int GetNumberLayoutsForController(size_t controller_id) {
- if (controller_id == Controller_Handheld) {
- return HID_NUM_LAYOUTS_HANDHELD;
- } else {
- return HID_NUM_LAYOUTS;
- }
-}
-
// Updating period for each HID device.
// TODO(shinyquagsire23): These need better values.
constexpr u64 pad_update_ticks = CoreTiming::BASE_CLOCK_RATE / 10000;
@@ -91,7 +83,11 @@ 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 < GetNumberLayoutsForController(controller); index++) {
+ for (int index = 0; index < HID_NUM_LAYOUTS; index++) {
+ // TODO(DarkLordZach): Is this layout/controller config actually invalid?
+ if (controller == Controller_Handheld && index == Layout_Single)
+ continue;
+
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 a032f59dc..b499308d6 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -13,7 +13,6 @@ 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;