Changes

Jump to navigation Jump to search
3,191 bytes added ,  07:23, 20 January 2017
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 80: Line 80:  
| 11
 
| 11
 
| Y
 
| Y
 +
|-
 +
| 12
 +
| Inverted value of [[GPIO_Services|GPIO]] bit0.
 +
|-
 +
| 13
 +
| Inverted value of [[GPIO_Services|GPIO]] bit14.
 
|-
 
|-
 
| 28
 
| 28
| Circle pad left (X <= -41)
+
| Circle pad right (X >= 41)
 
|-
 
|-
 
| 29
 
| 29
| Circle pad right (X >= 41)
+
| Circle pad left (X <= -41)
 
|-
 
|-
 
| 30
 
| 30
Line 94: Line 100:  
|}
 
|}
   −
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 175: Line 181:     
=Offset 0x108=
 
=Offset 0x108=
The size of this region is 0x50-bytes. This contains the accelerometer state.
+
{| class="wikitable" border="1"
 +
|-
 +
!  Relative offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x8
 +
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.
 +
|-
 +
| 0x8
 +
| 0x8
 +
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.
 +
|-
 +
| 0x10
 +
| 0x4
 +
| Index in the following array which was last updated by HID module.
 +
|-
 +
| 0x18
 +
| 0x6
 +
| Current accelerometer state entry, contains the raw accelerometer output data.
 +
|-
 +
| 0x20
 +
| 0x30
 +
| Array containing 8 accelerometer entries. Each entry when updated contains accelerometer data converted from the above entry.
 +
|}
 +
 
 +
The size of this region is 0x50-bytes. This contains the accelerometer state. The data stored under these entries is loaded from [[MCU|MCUHID]] service commands.
 +
 
 +
HID module first updates index0, then index1, and so on. When updating the array when the index is already 7, the index is reset to 0.
 +
 
 +
==Entry format==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Relative offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x2
 +
| s16. X?
 +
|-
 +
| 0x2
 +
| 0x2
 +
| s16. Y?
 +
|-
 +
|-
 +
| 0x4
 +
| 0x2
 +
| s16. Z?
 +
|}
    
=Offset 0x158=
 
=Offset 0x158=
Line 205: Line 261:  
|}
 
|}
   −
The size of this region is 0xE0-bytes. Initially this contains 0xFF/0x00 bytes. This contains the gyroscope state.
+
The size of this region is 0xE0-bytes. Initially this contains 0xFF/0x00 bytes. This contains the gyroscope state. The [[I2C]] gyroscope device is used for this.
    
HID module first updates index0, then index1, and so on. When updating the array when the index is already 31, the index is reset to 0.
 
HID module first updates index0, then index1, and so on. When updating the array when the index is already 31, the index is reset to 0.
Line 218: Line 274:  
| 0x0
 
| 0x0
 
| 0x2
 
| 0x2
| Unknown s16.
+
| s16 X/roll(This the raw byte-swapped data from I2C, for the entry at +0x18 and the array entries).
 
|-
 
|-
 
| 0x2
 
| 0x2
 
| 0x2
 
| 0x2
| Unknown s16.
+
| Entry at +0x18: s16 Y/pitch. Array entries: s16 Z/yaw.
 
|-
 
|-
 
|-
 
|-
 +
| 0x4
 
| 0x2
 
| 0x2
| 0x2
+
| Entry at +0x18: s16 Z/yaw. Array entries: s16 Y/pitch, from the raw byte-swapped I2C data.
| Unknown s16.
   
|}
 
|}
    
=Offset 0x238=
 
=Offset 0x238=
The size of this region is 0x78-bytes. Initially this contains 0xFF/0x00 bytes.
+
{| class="wikitable" border="1"
 +
|-
 +
!  Relative offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x8
 +
| [[SVC|svcGetSystemTick]] tick-count output, for when HID module updates entry index0 in the below array.
 +
|-
 +
| 0x8
 +
| 0x8
 +
| Before the above tick-count field is updated, that value is copied into this field. Therefore, this contains the tick-count for the previous time that entry index0 in the below array was updated by HID module.
 +
|-
 +
| 0x10
 +
| 0x4
 +
| Index in the following array which was last updated by HID module.
 +
|-
 +
| 0x18
 +
| 0x60
 +
| Array containing 8 entries, see below.
 +
|}
 +
 
 +
The size of this region is 0x78-bytes. Initially this contains 0xFF/0x00 bytes. The data stored under these entries is for the DebugPad. [[I2C]] deviceid 12 is used for this.
 +
 
 +
This doesn't have any HID service commands for enabling/disabling this. HID module only updates this state when reading the DebugPad state from hardware via the service command was successful. Since the DebugPad hardware is not available on retail units, this sharedmem section is not updated by HID module on retail units.
 +
 
 +
HID module first updates index0, then index1, and so on. When updating the array when the index is already 7, the index is reset to 0.
 +
 
 +
==Entry format==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Relative offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x2
 +
| ?
 +
|-
 +
| 0x2
 +
| 0x2
 +
| ?
 +
|-
 +
| 0x4
 +
| 0x2
 +
| ?
 +
|-
 +
| 0x6
 +
| 0x1
 +
| ?
 +
|-
 +
| 0x7
 +
| 0x1
 +
| ?
 +
|-
 +
| 0x8
 +
| 0x1
 +
| ?
 +
|-
 +
| 0x9
 +
| 0x1
 +
| ?
 +
|-
 +
| 0xA
 +
| 0x2
 +
| Padding, not written by HID module.
 +
|}

Navigation menu