summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/hid.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/hid/hid.h')
-rw-r--r--src/core/hle/service/hid/hid.h46
1 files changed, 34 insertions, 12 deletions
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h
index 9c6e86f77..6318d1d53 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -65,7 +65,7 @@ struct PadState {
};
/**
- * Structure of a single entry in the PadData's Pad state history array.
+ * Structure of a single entry of Pad state history within HID shared memory
*/
struct PadDataEntry {
PadState current_state;
@@ -77,22 +77,44 @@ struct PadDataEntry {
};
/**
- * Structure of all data related to the 3DS Pad.
+ * Structure of a single entry of touch state history within HID shared memory
*/
-struct PadData {
- s64 index_reset_ticks;
- s64 index_reset_ticks_previous;
- u32 index; // the index of the last updated Pad state history element
+struct TouchDataEntry {
+ u16 x;
+ u16 y;
+ u32 data_valid;
+};
+
+/**
+ * Structure of data stored in HID shared memory
+ */
+struct SharedMem {
+ // Offset 0x0 : "PAD" data, this is used for buttons and the circle pad
+ struct {
+ s64 index_reset_ticks;
+ s64 index_reset_ticks_previous;
+ u32 index; // Index of the last updated pad state history element
+
+ INSERT_PADDING_BYTES(0x8);
+
+ PadState current_state; // Same as entries[index].current_state
+ u32 raw_circle_pad_data;
+
+ INSERT_PADDING_BYTES(0x4);
- u32 pad1;
- u32 pad2;
+ std::array<PadDataEntry, 8> entries; // Pad state history
+ } pad;
- PadState current_state; // same as entries[index].current_state
- u32 raw_circle_pad_data;
+ // Offset 0xA8 : Touchpad data, this is used for touchpad input
+ struct {
+ s64 index_reset_ticks;
+ s64 index_reset_ticks_previous;
+ u32 index; // Index of the last updated touch state history element
- u32 pad3;
+ INSERT_PADDING_BYTES(0xC);
- std::array<PadDataEntry, 8> entries; // Pad state history
+ std::array<TouchDataEntry, 8> entries;
+ } touch;
};
// Pre-defined PadStates for single button presses