diff options
| author | 2018-01-15 01:49:32 -0700 | |
|---|---|---|
| committer | 2018-01-15 02:30:58 -0700 | |
| commit | bb1fcfac3377ca207b3cfc0c50ecae2b31462cd5 (patch) | |
| tree | d2a2e5cc181d281aa522d1026e1099caa7529684 | |
| parent | configure_input: update w/ Switch buttons (diff) | |
| download | yuzu-bb1fcfac3377ca207b3cfc0c50ecae2b31462cd5.tar.gz yuzu-bb1fcfac3377ca207b3cfc0c50ecae2b31462cd5.tar.xz yuzu-bb1fcfac3377ca207b3cfc0c50ecae2b31462cd5.zip | |
hid: Remove redundant HID prefix on structs/enums
| -rw-r--r-- | src/core/hle/service/hid/hid.h | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 7803778d4..7fd45d56f 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -11,7 +11,7 @@ namespace HID { | |||
| 11 | 11 | ||
| 12 | // Begin enums and output structs | 12 | // Begin enums and output structs |
| 13 | 13 | ||
| 14 | enum HIDControllerType : u32 { | 14 | enum ControllerType : u32 { |
| 15 | ControllerType_ProController = 1 << 0, | 15 | ControllerType_ProController = 1 << 0, |
| 16 | ControllerType_Handheld = 1 << 1, | 16 | ControllerType_Handheld = 1 << 1, |
| 17 | ControllerType_JoyconPair = 1 << 2, | 17 | ControllerType_JoyconPair = 1 << 2, |
| @@ -19,7 +19,7 @@ enum HIDControllerType : u32 { | |||
| 19 | ControllerType_JoyconRight = 1 << 4, | 19 | ControllerType_JoyconRight = 1 << 4, |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | enum HIDControllerLayoutType : u32 { | 22 | enum ControllerLayoutType : u32 { |
| 23 | Layout_ProController = 0, // Pro Controller or HID gamepad | 23 | Layout_ProController = 0, // Pro Controller or HID gamepad |
| 24 | Layout_Handheld = 1, // Two Joy-Con docked to rails | 24 | Layout_Handheld = 1, // Two Joy-Con docked to rails |
| 25 | Layout_Single = 2, // Horizontal single Joy-Con or pair of Joy-Con, adjusted for orientation | 25 | Layout_Single = 2, // Horizontal single Joy-Con or pair of Joy-Con, adjusted for orientation |
| @@ -29,16 +29,16 @@ enum HIDControllerLayoutType : u32 { | |||
| 29 | Layout_Default = 6, // Safe default, single Joy-Con have buttons/sticks rotated for orientation | 29 | Layout_Default = 6, // Safe default, single Joy-Con have buttons/sticks rotated for orientation |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | enum HIDControllerColorDescription { | 32 | enum ControllerColorDescription { |
| 33 | ColorDesc_ColorsNonexistent = 1 << 1, | 33 | ColorDesc_ColorsNonexistent = 1 << 1, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | enum HIDControllerConnectionState { | 36 | enum ControllerConnectionState { |
| 37 | ConnectionState_Connected = 1 << 0, | 37 | ConnectionState_Connected = 1 << 0, |
| 38 | ConnectionState_Wired = 1 << 1, | 38 | ConnectionState_Wired = 1 << 1, |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | enum HIDControllerID { | 41 | enum ControllerID { |
| 42 | Controller_Player1 = 0, | 42 | Controller_Player1 = 0, |
| 43 | Controller_Player2 = 1, | 43 | Controller_Player2 = 1, |
| 44 | Controller_Player3 = 2, | 44 | Controller_Player3 = 2, |
| @@ -53,26 +53,26 @@ enum HIDControllerID { | |||
| 53 | 53 | ||
| 54 | // End enums and output structs | 54 | // End enums and output structs |
| 55 | 55 | ||
| 56 | // Begin HIDTouchScreen | 56 | // Begin TouchScreen |
| 57 | 57 | ||
| 58 | struct HIDTouchScreenHeader { | 58 | struct TouchScreenHeader { |
| 59 | u64 timestampTicks; | 59 | u64 timestampTicks; |
| 60 | u64 numEntries; | 60 | u64 numEntries; |
| 61 | u64 latestEntry; | 61 | u64 latestEntry; |
| 62 | u64 maxEntryIndex; | 62 | u64 maxEntryIndex; |
| 63 | u64 timestamp; | 63 | u64 timestamp; |
| 64 | }; | 64 | }; |
| 65 | static_assert(sizeof(HIDTouchScreenHeader) == 0x28, | 65 | static_assert(sizeof(TouchScreenHeader) == 0x28, |
| 66 | "HID touch screen header structure has incorrect size"); | 66 | "HID touch screen header structure has incorrect size"); |
| 67 | 67 | ||
| 68 | struct HIDTouchScreenEntryHeader { | 68 | struct TouchScreenEntryHeader { |
| 69 | u64 timestamp; | 69 | u64 timestamp; |
| 70 | u64 numTouches; | 70 | u64 numTouches; |
| 71 | }; | 71 | }; |
| 72 | static_assert(sizeof(HIDTouchScreenEntryHeader) == 0x10, | 72 | static_assert(sizeof(TouchScreenEntryHeader) == 0x10, |
| 73 | "HID touch screen entry header structure has incorrect size"); | 73 | "HID touch screen entry header structure has incorrect size"); |
| 74 | 74 | ||
| 75 | struct HIDTouchScreenEntryTouch { | 75 | struct TouchScreenEntryTouch { |
| 76 | u64 timestamp; | 76 | u64 timestamp; |
| 77 | u32 padding; | 77 | u32 padding; |
| 78 | u32 touchIndex; | 78 | u32 touchIndex; |
| @@ -83,37 +83,37 @@ struct HIDTouchScreenEntryTouch { | |||
| 83 | u32 angle; | 83 | u32 angle; |
| 84 | u32 padding_2; | 84 | u32 padding_2; |
| 85 | }; | 85 | }; |
| 86 | static_assert(sizeof(HIDTouchScreenEntryTouch) == 0x28, | 86 | static_assert(sizeof(TouchScreenEntryTouch) == 0x28, |
| 87 | "HID touch screen touch structure has incorrect size"); | 87 | "HID touch screen touch structure has incorrect size"); |
| 88 | 88 | ||
| 89 | struct HIDTouchScreenEntry { | 89 | struct TouchScreenEntry { |
| 90 | HIDTouchScreenEntryHeader header; | 90 | TouchScreenEntryHeader header; |
| 91 | std::array<HIDTouchScreenEntryTouch, 16> touches; | 91 | std::array<TouchScreenEntryTouch, 16> touches; |
| 92 | u64 unk; | 92 | u64 unk; |
| 93 | }; | 93 | }; |
| 94 | static_assert(sizeof(HIDTouchScreenEntry) == 0x298, | 94 | static_assert(sizeof(TouchScreenEntry) == 0x298, |
| 95 | "HID touch screen entry structure has incorrect size"); | 95 | "HID touch screen entry structure has incorrect size"); |
| 96 | 96 | ||
| 97 | struct HIDTouchScreen { | 97 | struct TouchScreen { |
| 98 | HIDTouchScreenHeader header; | 98 | TouchScreenHeader header; |
| 99 | std::array<HIDTouchScreenEntry, 17> entries; | 99 | std::array<TouchScreenEntry, 17> entries; |
| 100 | std::array<u8, 0x3c0> padding; | 100 | std::array<u8, 0x3c0> padding; |
| 101 | }; | 101 | }; |
| 102 | static_assert(sizeof(HIDTouchScreen) == 0x3000, "HID touch screen structure has incorrect size"); | 102 | static_assert(sizeof(TouchScreen) == 0x3000, "HID touch screen structure has incorrect size"); |
| 103 | 103 | ||
| 104 | // End HIDTouchScreen | 104 | // End TouchScreen |
| 105 | 105 | ||
| 106 | // Begin HIDMouse | 106 | // Begin Mouse |
| 107 | 107 | ||
| 108 | struct HIDMouseHeader { | 108 | struct MouseHeader { |
| 109 | u64 timestampTicks; | 109 | u64 timestampTicks; |
| 110 | u64 numEntries; | 110 | u64 numEntries; |
| 111 | u64 latestEntry; | 111 | u64 latestEntry; |
| 112 | u64 maxEntryIndex; | 112 | u64 maxEntryIndex; |
| 113 | }; | 113 | }; |
| 114 | static_assert(sizeof(HIDMouseHeader) == 0x20, "HID mouse header structure has incorrect size"); | 114 | static_assert(sizeof(MouseHeader) == 0x20, "HID mouse header structure has incorrect size"); |
| 115 | 115 | ||
| 116 | struct HIDMouseButtonState { | 116 | struct MouseButtonState { |
| 117 | union { | 117 | union { |
| 118 | u64 hex{}; | 118 | u64 hex{}; |
| 119 | 119 | ||
| @@ -126,7 +126,7 @@ struct HIDMouseButtonState { | |||
| 126 | }; | 126 | }; |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | struct HIDMouseEntry { | 129 | struct MouseEntry { |
| 130 | u64 timestamp; | 130 | u64 timestamp; |
| 131 | u64 timestamp_2; | 131 | u64 timestamp_2; |
| 132 | u32 x; | 132 | u32 x; |
| @@ -135,31 +135,31 @@ struct HIDMouseEntry { | |||
| 135 | u32 velocityY; | 135 | u32 velocityY; |
| 136 | u32 scrollVelocityX; | 136 | u32 scrollVelocityX; |
| 137 | u32 scrollVelocityY; | 137 | u32 scrollVelocityY; |
| 138 | HIDMouseButtonState buttons; | 138 | MouseButtonState buttons; |
| 139 | }; | 139 | }; |
| 140 | static_assert(sizeof(HIDMouseEntry) == 0x30, "HID mouse entry structure has incorrect size"); | 140 | static_assert(sizeof(MouseEntry) == 0x30, "HID mouse entry structure has incorrect size"); |
| 141 | 141 | ||
| 142 | struct HIDMouse { | 142 | struct Mouse { |
| 143 | HIDMouseHeader header; | 143 | MouseHeader header; |
| 144 | std::array<HIDMouseEntry, 17> entries; | 144 | std::array<MouseEntry, 17> entries; |
| 145 | std::array<u8, 0xB0> padding; | 145 | std::array<u8, 0xB0> padding; |
| 146 | }; | 146 | }; |
| 147 | static_assert(sizeof(HIDMouse) == 0x400, "HID mouse structure has incorrect size"); | 147 | static_assert(sizeof(Mouse) == 0x400, "HID mouse structure has incorrect size"); |
| 148 | 148 | ||
| 149 | // End HIDMouse | 149 | // End Mouse |
| 150 | 150 | ||
| 151 | // Begin HIDKeyboard | 151 | // Begin Keyboard |
| 152 | 152 | ||
| 153 | struct HIDKeyboardHeader { | 153 | struct KeyboardHeader { |
| 154 | u64 timestampTicks; | 154 | u64 timestampTicks; |
| 155 | u64 numEntries; | 155 | u64 numEntries; |
| 156 | u64 latestEntry; | 156 | u64 latestEntry; |
| 157 | u64 maxEntryIndex; | 157 | u64 maxEntryIndex; |
| 158 | }; | 158 | }; |
| 159 | static_assert(sizeof(HIDKeyboardHeader) == 0x20, | 159 | static_assert(sizeof(KeyboardHeader) == 0x20, |
| 160 | "HID keyboard header structure has incorrect size"); | 160 | "HID keyboard header structure has incorrect size"); |
| 161 | 161 | ||
| 162 | struct HIDKeyboardModifierKeyState { | 162 | struct KeyboardModifierKeyState { |
| 163 | union { | 163 | union { |
| 164 | u64 hex{}; | 164 | u64 hex{}; |
| 165 | 165 | ||
| @@ -178,34 +178,34 @@ struct HIDKeyboardModifierKeyState { | |||
| 178 | }; | 178 | }; |
| 179 | }; | 179 | }; |
| 180 | 180 | ||
| 181 | struct HIDKeyboardEntry { | 181 | struct KeyboardEntry { |
| 182 | u64 timestamp; | 182 | u64 timestamp; |
| 183 | u64 timestamp_2; | 183 | u64 timestamp_2; |
| 184 | HIDKeyboardModifierKeyState modifier; | 184 | KeyboardModifierKeyState modifier; |
| 185 | u32 keys[8]; | 185 | u32 keys[8]; |
| 186 | }; | 186 | }; |
| 187 | static_assert(sizeof(HIDKeyboardEntry) == 0x38, "HID keyboard entry structure has incorrect size"); | 187 | static_assert(sizeof(KeyboardEntry) == 0x38, "HID keyboard entry structure has incorrect size"); |
| 188 | 188 | ||
| 189 | struct HIDKeyboard { | 189 | struct Keyboard { |
| 190 | HIDKeyboardHeader header; | 190 | KeyboardHeader header; |
| 191 | std::array<HIDKeyboardEntry, 17> entries; | 191 | std::array<KeyboardEntry, 17> entries; |
| 192 | std::array<u8, 0x28> padding; | 192 | std::array<u8, 0x28> padding; |
| 193 | }; | 193 | }; |
| 194 | static_assert(sizeof(HIDKeyboard) == 0x400, "HID keyboard structure has incorrect size"); | 194 | static_assert(sizeof(Keyboard) == 0x400, "HID keyboard structure has incorrect size"); |
| 195 | 195 | ||
| 196 | // End HIDKeyboard | 196 | // End Keyboard |
| 197 | 197 | ||
| 198 | // Begin HIDController | 198 | // Begin Controller |
| 199 | 199 | ||
| 200 | struct HIDControllerMAC { | 200 | struct ControllerMAC { |
| 201 | u64 timestamp; | 201 | u64 timestamp; |
| 202 | std::array<u8, 0x8> mac; | 202 | std::array<u8, 0x8> mac; |
| 203 | u64 unk; | 203 | u64 unk; |
| 204 | u64 timestamp_2; | 204 | u64 timestamp_2; |
| 205 | }; | 205 | }; |
| 206 | static_assert(sizeof(HIDControllerMAC) == 0x20, "HID controller MAC structure has incorrect size"); | 206 | static_assert(sizeof(ControllerMAC) == 0x20, "HID controller MAC structure has incorrect size"); |
| 207 | 207 | ||
| 208 | struct HIDControllerHeader { | 208 | struct ControllerHeader { |
| 209 | u32 type; | 209 | u32 type; |
| 210 | u32 isHalf; | 210 | u32 isHalf; |
| 211 | u32 singleColorsDescriptor; | 211 | u32 singleColorsDescriptor; |
| @@ -217,19 +217,19 @@ struct HIDControllerHeader { | |||
| 217 | u32 rightColorBody; | 217 | u32 rightColorBody; |
| 218 | u32 rightColorbuttons; | 218 | u32 rightColorbuttons; |
| 219 | }; | 219 | }; |
| 220 | static_assert(sizeof(HIDControllerHeader) == 0x28, | 220 | static_assert(sizeof(ControllerHeader) == 0x28, |
| 221 | "HID controller header structure has incorrect size"); | 221 | "HID controller header structure has incorrect size"); |
| 222 | 222 | ||
| 223 | struct HIDControllerLayoutHeader { | 223 | struct ControllerLayoutHeader { |
| 224 | u64 timestampTicks; | 224 | u64 timestampTicks; |
| 225 | u64 numEntries; | 225 | u64 numEntries; |
| 226 | u64 latestEntry; | 226 | u64 latestEntry; |
| 227 | u64 maxEntryIndex; | 227 | u64 maxEntryIndex; |
| 228 | }; | 228 | }; |
| 229 | static_assert(sizeof(HIDControllerLayoutHeader) == 0x20, | 229 | static_assert(sizeof(ControllerLayoutHeader) == 0x20, |
| 230 | "HID controller layout header structure has incorrect size"); | 230 | "HID controller layout header structure has incorrect size"); |
| 231 | 231 | ||
| 232 | struct HIDControllerPadState { | 232 | struct ControllerPadState { |
| 233 | union { | 233 | union { |
| 234 | u64 hex{}; | 234 | u64 hex{}; |
| 235 | 235 | ||
| @@ -270,43 +270,43 @@ struct HIDControllerPadState { | |||
| 270 | }; | 270 | }; |
| 271 | }; | 271 | }; |
| 272 | 272 | ||
| 273 | struct HIDControllerInputEntry { | 273 | struct ControllerInputEntry { |
| 274 | u64 timestamp; | 274 | u64 timestamp; |
| 275 | u64 timestamp_2; | 275 | u64 timestamp_2; |
| 276 | HIDControllerPadState buttons; | 276 | ControllerPadState buttons; |
| 277 | u32 joystickLeftX; | 277 | u32 joystickLeftX; |
| 278 | u32 joystickLeftY; | 278 | u32 joystickLeftY; |
| 279 | u32 joystickRightX; | 279 | u32 joystickRightX; |
| 280 | u32 joystickRightY; | 280 | u32 joystickRightY; |
| 281 | u64 connectionState; | 281 | u64 connectionState; |
| 282 | }; | 282 | }; |
| 283 | static_assert(sizeof(HIDControllerInputEntry) == 0x30, | 283 | static_assert(sizeof(ControllerInputEntry) == 0x30, |
| 284 | "HID controller input entry structure has incorrect size"); | 284 | "HID controller input entry structure has incorrect size"); |
| 285 | 285 | ||
| 286 | struct HIDControllerLayout { | 286 | struct ControllerLayout { |
| 287 | HIDControllerLayoutHeader header; | 287 | ControllerLayoutHeader header; |
| 288 | std::array<HIDControllerInputEntry, 17> entries; | 288 | std::array<ControllerInputEntry, 17> entries; |
| 289 | }; | 289 | }; |
| 290 | static_assert(sizeof(HIDControllerLayout) == 0x350, | 290 | static_assert(sizeof(ControllerLayout) == 0x350, |
| 291 | "HID controller layout structure has incorrect size"); | 291 | "HID controller layout structure has incorrect size"); |
| 292 | 292 | ||
| 293 | struct HIDController { | 293 | struct Controller { |
| 294 | HIDControllerHeader header; | 294 | ControllerHeader header; |
| 295 | std::array<HIDControllerLayout, 7> layouts; | 295 | std::array<ControllerLayout, 7> layouts; |
| 296 | std::array<u8, 0x2a70> unk_1; | 296 | std::array<u8, 0x2a70> unk_1; |
| 297 | HIDControllerMAC macLeft; | 297 | ControllerMAC macLeft; |
| 298 | HIDControllerMAC macRight; | 298 | ControllerMAC macRight; |
| 299 | std::array<u8, 0xdf8> unk_2; | 299 | std::array<u8, 0xdf8> unk_2; |
| 300 | }; | 300 | }; |
| 301 | static_assert(sizeof(HIDController) == 0x5000, "HID controller structure has incorrect size"); | 301 | static_assert(sizeof(Controller) == 0x5000, "HID controller structure has incorrect size"); |
| 302 | 302 | ||
| 303 | // End HIDController | 303 | // End Controller |
| 304 | 304 | ||
| 305 | struct HIDSharedMemory { | 305 | struct SharedMemory { |
| 306 | std::array<u8, 0x400> header; | 306 | std::array<u8, 0x400> header; |
| 307 | HIDTouchScreen touchscreen; | 307 | TouchScreen touchscreen; |
| 308 | HIDMouse mouse; | 308 | Mouse mouse; |
| 309 | HIDKeyboard keyboard; | 309 | Keyboard keyboard; |
| 310 | std::array<u8, 0x400> unkSection1; | 310 | std::array<u8, 0x400> unkSection1; |
| 311 | std::array<u8, 0x400> unkSection2; | 311 | std::array<u8, 0x400> unkSection2; |
| 312 | std::array<u8, 0x400> unkSection3; | 312 | std::array<u8, 0x400> unkSection3; |
| @@ -316,10 +316,10 @@ struct HIDSharedMemory { | |||
| 316 | std::array<u8, 0x200> unkSection7; | 316 | std::array<u8, 0x200> unkSection7; |
| 317 | std::array<u8, 0x800> unkSection8; | 317 | std::array<u8, 0x800> unkSection8; |
| 318 | std::array<u8, 0x4000> controllerSerials; | 318 | std::array<u8, 0x4000> controllerSerials; |
| 319 | std::array<HIDController, 10> controllers; | 319 | std::array<Controller, 10> controllers; |
| 320 | std::array<u8, 0x4600> unkSection9; | 320 | std::array<u8, 0x4600> unkSection9; |
| 321 | }; | 321 | }; |
| 322 | static_assert(sizeof(HIDSharedMemory) == 0x40000, "HID Shared Memory structure has incorrect size"); | 322 | static_assert(sizeof(SharedMemory) == 0x40000, "HID Shared Memory structure has incorrect size"); |
| 323 | 323 | ||
| 324 | /// Reload input devices. Used when input configuration changed | 324 | /// Reload input devices. Used when input configuration changed |
| 325 | void ReloadInputDevices(); | 325 | void ReloadInputDevices(); |