summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/hid.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-03-10 04:03:24 +0100
committerbunnei <bunneidev@gmail.com>2015-03-11 04:58:13 +0100
commit85cbccb1d3110c934ccf0edddf86a03fa692f27b (patch)
treea504346ed7fad36c0a08e3aadb3391588a4f7339 /src/core/hle/service/hid/hid.cpp
parentHID: Complete refactor of pad/touch input to fix threading issues. (diff)
downloadyuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.tar
yuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.tar.gz
yuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.tar.bz2
yuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.tar.lz
yuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.tar.xz
yuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.tar.zst
yuzu-85cbccb1d3110c934ccf0edddf86a03fa692f27b.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/hid.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index baff92716..6aa8bfd1f 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -17,6 +17,8 @@
namespace Service {
namespace HID {
+static const int MAX_CIRCLEPAD_POS = 0x9C; ///< Max value for a circle pad position
+
Kernel::SharedPtr<Kernel::SharedMemory> g_shared_mem = nullptr;
Kernel::SharedPtr<Kernel::Event> g_event_pad_or_touch_1;
@@ -78,8 +80,10 @@ void HIDUpdate() {
pad_entry->delta_removals.hex = changed.hex & old_state.hex;;
// Set circle Pad
- pad_entry->circle_pad_x = state.circle_left ? -0x9C : state.circle_right ? 0x9C : 0x0;
- pad_entry->circle_pad_y = state.circle_down ? -0x9C : state.circle_up ? 0x9C : 0x0;
+ pad_entry->circle_pad_x = state.circle_left ? -MAX_CIRCLEPAD_POS :
+ state.circle_right ? MAX_CIRCLEPAD_POS : 0x0;
+ pad_entry->circle_pad_y = state.circle_down ? -MAX_CIRCLEPAD_POS :
+ state.circle_up ? MAX_CIRCLEPAD_POS : 0x0;
// If we just updated index 0, provide a new timestamp
if (shared_mem->pad.index == 0) {