HID Shared Memory: Difference between revisions

Luigi2us (talk | contribs)
PAD State: my bad
Peachy (talk | contribs)
m Add HID 3D slider field
 
(5 intermediate revisions by 3 users not shown)
Line 3: Line 3:
The data for each of the below entries(PAD state, circle-pad, touch-screen, etc) is originally written by the HID module at different times per frame.
The data for each of the below entries(PAD state, circle-pad, touch-screen, etc) is originally written by the HID module at different times per frame.


size: 0x2b0 (FIRM 4.4)
size: 0x2b0 (System-version v4.4 - [[9.0.0-20]])


=Offset 0x0=
=Offset 0x0=
Line 23: Line 23:
| 0x4
| 0x4
| Index in the following array which was last updated by HID module.
| Index in the following array which was last updated by HID module.
|-
| 0x18
| 0x4
| 3D slider state as f32 (0.0f = completely off, 1.0f = max)
|-
|-
| 0x1C
| 0x1C
Line 80: Line 84:
| 11
| 11
| Y
| Y
|-
| 12
| Inverted value of [[GPIO_Services|GPIO]] bit0.
|-
| 13
| Inverted value of [[GPIO_Services|GPIO]] bit14.
|-
|-
| 28
| 28
Line 94: Line 104:
|}
|}


Bit set = button pressed, bit clear = button not pressed. Bit28-31 only apply to the PAD fields in the array entries. Bit28-31 are set by HID module depending on data from a GPIO command, these are not included with the [[PAD]] register itself.
Bit set = button pressed, bit clear = button not pressed. Bit28-31 only apply to the PAD fields in the array entries. Bit28-31 are set by HID module depending on data from a codec command, these are not included with the [[PAD]] register itself. Likewise for Bit12-13, except these are set depending on data from a GPIO command, and are likely used with the sharedmem PAD-state field too(this was originally implemented in an old HID module version / initial module version).


==Entry format==
==Entry format==
Line 319: Line 329:
| 0x0
| 0x0
| 0x2
| 0x2
| ?
| Keys held
|-
|-
| 0x2
| 0x2
| 0x2
| 0x2
| ?
| Keys just pressed
|-
|-
| 0x4
| 0x4
| 0x2
| 0x2
| ?
| Keys just released
|-
|-
| 0x6
| 0x6
| 0x1
| 0x1
| ?
| Left Stick X (range roughly -32 to +31)
|-
|-
| 0x7
| 0x7
| 0x1
| 0x1
| ?
| Left Stick Y (range roughly -32 to +31)
|-
|-
| 0x8
| 0x8
| 0x1
| 0x1
| ?
| Right Stick X (range roughly -16 to +15)
|-
|-
| 0x9
| 0x9
| 0x1
| 0x1
| ?
| Right Stick Y (range roughly -16 to +15)
|-
|-
| 0xA
| 0xA
Line 349: Line 359:
| Padding, not written by HID module.
| Padding, not written by HID module.
|}
|}
Note: there is code in hid sysmodule where holding +, -, DPAD Left, and A will recallibrate the sticks to zero.