Changes

Jump to navigation Jump to search
26 bytes added ,  04:06, 27 November 2019
Line 45: Line 45:     
== ControllerSupportArg ==
 
== ControllerSupportArg ==
This is "nn::hid::ControllerSupportArg". This is a 0x21C-byte (0x430-byte with version 0x7) struct pushed for input storage.
+
This is "nn::hid::ControllerSupportArg". This is a 0x21C-byte (0x9C-byte with version <=0x2, 0x430-byte with version 0x7) struct pushed for input storage.
    
Layout with the original version:
 
Layout with the original version:
Line 59: Line 59:  
| 0x1 || 0x1 || s8 playerCountMax, must be >=1 and <=4.
 
| 0x1 || 0x1 || s8 playerCountMax, must be >=1 and <=4.
 
|-
 
|-
| 0x2 || 0x4 || Unknown, copied into state as individual bytes.
+
| 0x2 || 0x4 || Unknown u8 flags, non-zero for enabled.
 
|-
 
|-
| 0x6 || 0x1 || Enables using the 0x10-bytes at offset 0x7 when non-zero.
+
| 0x6 || 0x1 || Enables using the array at offset 0x7 when non-zero.
 
|-
 
|-
| 0x7 || 0x10 || Unknown, copied into state as individual bytes.
+
| 0x7 || 4*max_controllers || Array of 4-byte entries for each controller, see below for total entries (max controllers). This entry contains individual u8s.
 
|-
 
|-
| 0x17 || 0x1 || Enables using the ExplainText data when non-zero.
+
| 0x7 + 4*max_controllers || 0x1 || Enables using the ExplainText data when non-zero.
 
|}
 
|}
   −
Layout starting with version 0x7:
+
With both versions, the rest of the struct is an array containing 0x81-byte (0x21-byte with version <=0x2) entries. With version pre-0x7 there's 4 entries allocated, starting with version 0x7 there's 8 entries allocated. This contains the ExplainText string which includes the NUL-terminator. Each entry corresponds to a controller NpadId, starting with NpadId/controller 0.
 
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Offset
  −
!  Size
  −
!  Description
  −
|-
  −
| 0x0 || 0x28 || ?
  −
|}
  −
 
  −
With both versions, the rest of the struct is an array containing 0x81-byte entries. With the original version there's 4 entries allocated, starting with version 0x7 there's 8 entries allocated. This contains the ExplainText string which includes the NUL-terminator. Each entry corresponds to a controller NpadId, starting with NpadId/controller 0.
      
Regardless of version, the default data for this struct is setup by setting u32 +0 to 0x01010400, u8 +4 to 0x1, with the rest being cleared as needed. sdknso itself only calls the func for this from ShowControllerStrapGuide, since that's the only time sdknso itself writes to ControllerSupportArg besides ExplainText (and is also the only case where the ControllerSupportArg is not user-specified).
 
Regardless of version, the default data for this struct is setup by setting u32 +0 to 0x01010400, u8 +4 to 0x1, with the rest being cleared as needed. sdknso itself only calls the func for this from ShowControllerStrapGuide, since that's the only time sdknso itself writes to ControllerSupportArg besides ExplainText (and is also the only case where the ControllerSupportArg is not user-specified).

Navigation menu