HID services: Difference between revisions
No edit summary |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 384: | Line 384: | ||
== ActivateConsoleSixAxisSensor == | == ActivateConsoleSixAxisSensor == | ||
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output. | Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output. | ||
As of [10.0.0+] sdknso no longer uses this. | |||
== ActivateSevenSixAxisSensor == | == ActivateSevenSixAxisSensor == | ||
Line 399: | Line 401: | ||
Takes a PID, an u64 [[AM_services|AppletResourceUserId]], two u64s for the size of each TransferMemory, and two TransferMemory handles. No output. | Takes a PID, an u64 [[AM_services|AppletResourceUserId]], two u64s for the size of each TransferMemory, and two TransferMemory handles. No output. | ||
The size of the first TransferMemory is 0x1000 with MemoryPermission=read-only, while the second one has size 0x7F000 with MemoryPermission=none. | The size of the first TransferMemory is 0x1000 with MemoryPermission=read-only, while the second one has size 0x7F000 with MemoryPermission=none. sdknso uses an user-specified buffer for this, with the second tmem immediately following the first one. sdknso later uses data at buf+0 for loading SevenSixAxisSensor state. | ||
The data at tmem+0 has the following structure: | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x10 || Unused by sdknso. | |||
|- | |||
| 0x10 || 0x8 || Latest entry. | |||
|- | |||
| 0x18 || 0x8 || Total entries. | |||
|- | |||
| 0x20 || 0xA50(0x21*0x50) || Array of the below entries. | |||
|} | |||
Entry: | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || Timestamp | |||
|- | |||
| 0x8 || 0x10 || Unused by sdknso. | |||
|- | |||
| 0x10 || 0x40 || SevenSixAxisSensorState | |||
|} | |||
SevenSixAxisSensorState: | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || First timestamp. | |||
|- | |||
| 0x8 || 0x8 || Second timestamp (in samples). | |||
|- | |||
| 0x10 || 0x8 || ? | |||
|- | |||
| 0x18 || 0x28 || float data | |||
|} | |||
== FinalizeSevenSixAxisSensor == | == FinalizeSevenSixAxisSensor == | ||
Line 1,382: | Line 1,427: | ||
Uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. Then an error is thrown if [[Settings_services#ButtonConfigSettings|IsFull]] bit0 is clear. Then the data at +0x1C8 size 0x3E0 is cleared, IsFull bit0 is cleared, [[Settings_services#SetButtonConfigSettingsEmbedded|SetButtonConfigSettingsEmbedded]] is used with the updated array, and then returns 0. | Uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. Then an error is thrown if [[Settings_services#ButtonConfigSettings|IsFull]] bit0 is clear. Then the data at +0x1C8 size 0x3E0 is cleared, IsFull bit0 is cleared, [[Settings_services#SetButtonConfigSettingsEmbedded|SetButtonConfigSettingsEmbedded]] is used with the updated array, and then returns 0. | ||
== | == DeleteButtonConfigStorageFull == | ||
Takes an input s32 entry-index, no output. | Takes an input s32 entry-index, no output. | ||
Line 3,039: | Line 3,084: | ||
This is "nn::hidconfig::ButtonConfigEmbedded". This is a 0x54-byte struct. | This is "nn::hidconfig::ButtonConfigEmbedded". This is a 0x54-byte struct. | ||
= ButtonConfigFull = | {| class="wikitable" border="1" | ||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x44 (4*17) || [[#ButtonConfig]], for the following buttons: DLeft, DUp, DRight, DDown, A, B, X, Y, L-Stick, R-Stick, L, R, ZL, ZR, -, +, Capture. | |||
|- | |||
| 0x44 || 0x8 || [[#JoystickConfig]], for the left-stick. | |||
|- | |||
| 0x4C || 0x8 || [[#JoystickConfig]], for the right-stick. | |||
|} | |||
== ButtonConfig == | |||
u32 button mapping config. Must be value 0 - 22, which selects what button to map to. | |||
{| class="wikitable" border="1" | |||
! Value | |||
! Description | |||
|- | |||
| 0 || A | |||
|- | |||
| 1 || B | |||
|- | |||
| 2 || X | |||
|- | |||
| 3 || Y | |||
|- | |||
| 4 || L-Stick | |||
|- | |||
| 5 || R-Stick | |||
|- | |||
| 6 || L | |||
|- | |||
| 7 || R | |||
|- | |||
| 8 || ZL | |||
|- | |||
| 9 || ZR | |||
|- | |||
| 10 || - | |||
|- | |||
| 11 || + | |||
|- | |||
| 12 || DLeft | |||
|- | |||
| 13 || DUp | |||
|- | |||
| 14 || DRight | |||
|- | |||
| 15 || DDown | |||
|- | |||
| 16 || SL_Left | |||
|- | |||
| 17 || SR_Left | |||
|- | |||
| 18 || SL_Right | |||
|- | |||
| 19 || SR_Right | |||
|- | |||
| 20 || HOME | |||
|- | |||
| 21 || Capture | |||
|- | |||
| 22 || Disabled | |||
|} | |||
== JoystickConfig == | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x4 || Orientation. 0 = default, 1 = enabled for Left, 2 = enabled for Right. | |||
|- | |||
| 0x4 || 0x1 || StickChange | |||
|- | |||
| 0x5 || 0x3 || Padding | |||
|} | |||
= ButtonConfigFull = | |||
This is "nn::hidconfig::ButtonConfigFull". This is a 0x54-byte struct. | This is "nn::hidconfig::ButtonConfigFull". This is a 0x54-byte struct. | ||
This is identical to [[#ButtonConfigEmbedded]]. | |||
= ButtonConfigLeft = | = ButtonConfigLeft = | ||
This is "nn::hidconfig::ButtonConfigLeft". This is a 0x34-byte struct. | This is "nn::hidconfig::ButtonConfigLeft". This is a 0x34-byte struct. | ||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x2C (4*11) || [[#ButtonConfig]], for the following buttons: DLeft, DUp, DRight, DDown, L-Stick, L, ZL, -, SL_Left, SR_Left, Capture. | |||
|- | |||
| 0x2C || 0x8 || [[#JoystickConfig]] | |||
|} | |||
= ButtonConfigRight = | = ButtonConfigRight = | ||
This is "nn::hidconfig::ButtonConfigRight". This is a 0x30-byte struct. | This is "nn::hidconfig::ButtonConfigRight". This is a 0x30-byte struct. | ||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x28 (4*10) || [[#ButtonConfig]], for the following buttons: A, B, X, Y, R-Stick, R, ZR, +, SL_Right, SR_Right. | |||
|- | |||
| 0x28 || 0x8 || [[#JoystickConfig]] | |||
|} | |||
= IrCameraHandle = | = IrCameraHandle = |