diff options
Diffstat (limited to 'src/core/hle/service/hid/hid.h')
-rw-r--r-- | src/core/hle/service/hid/hid.h | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 669b1f723..f54ffd8be 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -9,10 +9,10 @@ #ifndef _MSC_VER #include <cstddef> #endif -#include "core/settings.h" #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" +#include "core/settings.h" namespace Service { @@ -103,7 +103,7 @@ struct SharedMem { struct { 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 + u32 index; ///< Index of the last updated pad state entry INSERT_PADDING_WORDS(0x2); @@ -121,7 +121,7 @@ struct SharedMem { struct { 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 + u32 index; ///< Index of the last updated touch entry INSERT_PADDING_WORDS(0x1); @@ -135,7 +135,7 @@ struct SharedMem { struct { 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 accelerometer entry + u32 index; ///< Index of the last updated accelerometer entry INSERT_PADDING_WORDS(0x1); @@ -149,7 +149,7 @@ struct SharedMem { struct { 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 accelerometer entry + u32 index; ///< Index of the last updated accelerometer entry INSERT_PADDING_WORDS(0x1); @@ -176,9 +176,9 @@ struct GyroscopeCalibrateParam { // is technically allowed since C++11. This macro should be enabled once MSVC adds // support for that. #ifndef _MSC_VER -#define ASSERT_REG_POSITION(field_name, position) \ - static_assert(offsetof(SharedMem, field_name) == position * 4, \ - "Field "#field_name" has invalid position") +#define ASSERT_REG_POSITION(field_name, position) \ + static_assert(offsetof(SharedMem, field_name) == position * 4, \ + "Field " #field_name " has invalid position") ASSERT_REG_POSITION(pad.index_reset_ticks, 0x0); ASSERT_REG_POSITION(touch.index_reset_ticks, 0x2A); @@ -187,33 +187,33 @@ ASSERT_REG_POSITION(touch.index_reset_ticks, 0x2A); #endif // !defined(_MSC_VER) // Pre-defined PadStates for single button presses -const PadState PAD_NONE = {{0}}; -const PadState PAD_A = {{1u << 0}}; -const PadState PAD_B = {{1u << 1}}; -const PadState PAD_SELECT = {{1u << 2}}; -const PadState PAD_START = {{1u << 3}}; -const PadState PAD_RIGHT = {{1u << 4}}; -const PadState PAD_LEFT = {{1u << 5}}; -const PadState PAD_UP = {{1u << 6}}; -const PadState PAD_DOWN = {{1u << 7}}; -const PadState PAD_R = {{1u << 8}}; -const PadState PAD_L = {{1u << 9}}; -const PadState PAD_X = {{1u << 10}}; -const PadState PAD_Y = {{1u << 11}}; - -const PadState PAD_ZL = {{1u << 14}}; -const PadState PAD_ZR = {{1u << 15}}; - -const PadState PAD_TOUCH = {{1u << 20}}; - -const PadState PAD_C_RIGHT = {{1u << 24}}; -const PadState PAD_C_LEFT = {{1u << 25}}; -const PadState PAD_C_UP = {{1u << 26}}; -const PadState PAD_C_DOWN = {{1u << 27}}; +const PadState PAD_NONE = {{0}}; +const PadState PAD_A = {{1u << 0}}; +const PadState PAD_B = {{1u << 1}}; +const PadState PAD_SELECT = {{1u << 2}}; +const PadState PAD_START = {{1u << 3}}; +const PadState PAD_RIGHT = {{1u << 4}}; +const PadState PAD_LEFT = {{1u << 5}}; +const PadState PAD_UP = {{1u << 6}}; +const PadState PAD_DOWN = {{1u << 7}}; +const PadState PAD_R = {{1u << 8}}; +const PadState PAD_L = {{1u << 9}}; +const PadState PAD_X = {{1u << 10}}; +const PadState PAD_Y = {{1u << 11}}; + +const PadState PAD_ZL = {{1u << 14}}; +const PadState PAD_ZR = {{1u << 15}}; + +const PadState PAD_TOUCH = {{1u << 20}}; + +const PadState PAD_C_RIGHT = {{1u << 24}}; +const PadState PAD_C_LEFT = {{1u << 25}}; +const PadState PAD_C_UP = {{1u << 26}}; +const PadState PAD_C_DOWN = {{1u << 27}}; const PadState PAD_CIRCLE_RIGHT = {{1u << 28}}; -const PadState PAD_CIRCLE_LEFT = {{1u << 29}}; -const PadState PAD_CIRCLE_UP = {{1u << 30}}; -const PadState PAD_CIRCLE_DOWN = {{1u << 31}}; +const PadState PAD_CIRCLE_LEFT = {{1u << 29}}; +const PadState PAD_CIRCLE_UP = {{1u << 30}}; +const PadState PAD_CIRCLE_DOWN = {{1u << 31}}; /** * HID::GetIPCHandles service function @@ -305,6 +305,5 @@ void Init(); /// Shutdown HID service void Shutdown(); - } } |