diff options
author | bunnei <bunneidev@gmail.com> | 2015-03-08 06:12:47 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-03-10 23:05:16 +0100 |
commit | 83a66dd701789761c118c7e105327a1b6166ed13 (patch) | |
tree | 48c3feab4d36116b25990c4dc18429cfb674fd29 /src/core/hle/service/hid/hid.h | |
parent | Merge pull request #649 from lioncash/clean (diff) | |
download | yuzu-83a66dd701789761c118c7e105327a1b6166ed13.tar yuzu-83a66dd701789761c118c7e105327a1b6166ed13.tar.gz yuzu-83a66dd701789761c118c7e105327a1b6166ed13.tar.bz2 yuzu-83a66dd701789761c118c7e105327a1b6166ed13.tar.lz yuzu-83a66dd701789761c118c7e105327a1b6166ed13.tar.xz yuzu-83a66dd701789761c118c7e105327a1b6166ed13.tar.zst yuzu-83a66dd701789761c118c7e105327a1b6166ed13.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/hid.h | 46 |
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 |