aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/hid/hid.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-03-09 23:03:24 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-03-10 23:58:13 -0400
commit85cbccb1d3110c934ccf0edddf86a03fa692f27b (patch)
treea504346ed7fad36c0a08e3aadb3391588a4f7339 /src/core/hle/service/hid/hid.cpp
parentd61b26b79f889603a084e148626bba3c267cf75f (diff)
HID: Added additional variable comments and some code cleanups.
Diffstat (limited to 'src/core/hle/service/hid/hid.cpp')
-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 baff9271..6aa8bfd1 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) {