aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/hid/hid.h
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.h
parentd61b26b79f889603a084e148626bba3c267cf75f (diff)
HID: Added additional variable comments and some code cleanups.
Diffstat (limited to 'src/core/hle/service/hid/hid.h')
-rw-r--r--src/core/hle/service/hid/hid.h41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h
index 063f0685..03971d3c 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -80,40 +80,45 @@ struct PadDataEntry {
* Structure of a single entry of touch state history within HID shared memory
*/
struct TouchDataEntry {
- u16 x; ///< Y-coordinate of a touchpad press on the lower screen
- u16 y; ///< X-coordinate of a touchpad press on the lower screen
- BitField<0,7,u32> valid; ///< Set to 1 when this entry contains actual X/Y data, otherwise 0
+ u16 x; ///< Y-coordinate of a touchpad press on the lower screen
+ u16 y; ///< X-coordinate of a touchpad press on the lower screen
+ BitField<0, 7, u32> valid; ///< Set to 1 when this entry contains actual X/Y data, otherwise 0
};
/**
* Structure of data stored in HID shared memory
*/
struct SharedMem {
- // "Pad data, this is used for buttons and the circle pad
+ /// 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
+ s64 index_reset_ticks; ///< CPU tick count for when HID module updated entry index 0
+ s64 index_reset_ticks_previous; ///< Previous `index_reset_ticks`
+ u32 index; ///< Index of the last updated pad state entry
- INSERT_PADDING_BYTES(0x8);
+ INSERT_PADDING_WORDS(0x2);
- PadState current_state; // Same as entries[index].current_state
- u32 raw_circle_pad_data;
+ PadState current_state; ///< Current state of the pad buttons
- INSERT_PADDING_BYTES(0x4);
+ // TODO(bunnei): Implement `raw_circle_pad_data` field
+ u32 raw_circle_pad_data; ///< Raw (analog) circle pad data, before being converted
- std::array<PadDataEntry, 8> entries; // Pad state history
+ INSERT_PADDING_WORDS(0x1);
+
+ std::array<PadDataEntry, 8> entries; ///< Last 8 pad entries
} pad;
- // Touchpad data, this is used for touchpad input
+ /// 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
+ s64 index_reset_ticks; ///< CPU tick count for when HID module updated entry index 0
+ s64 index_reset_ticks_previous; ///< Previous `index_reset_ticks`
+ u32 index; ///< Index of the last updated touch entry
+
+ INSERT_PADDING_WORDS(0x1);
- INSERT_PADDING_BYTES(0xC);
+ // TODO(bunnei): Implement `raw_entry` field
+ TouchDataEntry raw_entry; ///< Raw (analog) touch data, before being converted
- std::array<TouchDataEntry, 8> entries;
+ std::array<TouchDataEntry, 8> entries; ///< Last 8 touch entries, in pixel coordinates
} touch;
};