aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-03-08 00:13:49 -0500
committerGravatar bunnei <bunneidev@gmail.com>2015-03-10 18:05:17 -0400
commit3229b048d9b4f16433fb1c5d623e6b79bc1a2d93 (patch)
tree20b3976db72b7191a899692433e6b34e491c827c /src/core/hle/service
parent83a66dd701789761c118c7e105327a1b6166ed13 (diff)
HID: Moved some docstrings to the header.
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/hid/hid.cpp25
-rw-r--r--src/core/hle/service/hid/hid.h15
2 files changed, 16 insertions, 24 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index c21799db..5812724d 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -32,7 +32,7 @@ static s16 next_pad_circle_y = 0;
/**
* Gets a pointer to the PadData structure inside HID shared memory
*/
-static inline SharedMem* GetPadData() {
+static inline SharedMem* GetSharedMem() {
if (g_shared_mem == nullptr)
return nullptr;
return reinterpret_cast<SharedMem*>(g_shared_mem->GetPointer().ValueOr(nullptr));
@@ -66,28 +66,18 @@ static void UpdateNextCirclePadState() {
next_pad_circle_y += next_state.circle_up ? max_value : 0x0;
}
-/**
- * Sets a Pad state (button or button combo) as pressed
- */
void PadButtonPress(const PadState& pad_state) {
next_state.hex |= pad_state.hex;
UpdateNextCirclePadState();
}
-/**
- * Sets a Pad state (button or button combo) as released
- */
void PadButtonRelease(const PadState& pad_state) {
next_state.hex &= ~pad_state.hex;
UpdateNextCirclePadState();
}
-/**
- * Called after all Pad changes to be included in this update have been made,
- * including both Pad key changes and analog circle Pad changes.
- */
void PadUpdateComplete() {
- SharedMem* shared_mem = GetPadData();
+ SharedMem* shared_mem = GetSharedMem();
if (shared_mem == nullptr)
return;
@@ -135,17 +125,6 @@ void PadUpdateComplete() {
g_event_pad_or_touch_2->Signal();
}
- // If we just updated index 0, provide a new timestamp
- if (pad_data->index == 0) {
- pad_data->index_reset_ticks_previous = pad_data->index_reset_ticks;
- pad_data->index_reset_ticks = (s64)Core::g_app_core->GetTicks();
- }
-
- // Signal both handles when there's an update to Pad or touch
- g_event_pad_or_touch_1->Signal();
- g_event_pad_or_touch_2->Signal();
-}
-
void GetIPCHandles(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h
index 6318d1d5..cd626324 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -162,9 +162,22 @@ const PadState PAD_CIRCLE_DOWN = {{1u << 31}};
*/
void GetIPCHandles(Interface* self);
-// Methods for updating the HID module's state
+/**
+ * Sets a Pad state (button or button combo) as pressed
+ * @param pad_state PadState data indicating which buttons have been pressed
+ */
void PadButtonPress(const PadState& pad_state);
+
+/**
+ * Sets a Pad state (button or button combo) as released
+ * @param pad_state PadState data indicating which buttons have been released
+ */
void PadButtonRelease(const PadState& pad_state);
+
+/**
+ * Called after all Pad changes to be included in this update have been made, including both Pad
+ * key changes and analog circle Pad changes.
+ */
void PadUpdateComplete();
void HIDInit();