Ring-Con: Difference between revisions
Line 155: | Line 155: | ||
Then, if any of the 16bit output fields in output_struct are set to 0xCAFE, a flag is set to 0x2 (same field used for invalid-CRC, which uses value 0x1 for that). Then this returns 0. | Then, if any of the 16bit output fields in output_struct are set to 0xCAFE, a flag is set to 0x2 (same field used for invalid-CRC, which uses value 0x1 for that). Then this returns 0. | ||
This reads the user calibration. | |||
Reply: | Reply: | ||
Line 162: | Line 164: | ||
! Offset || Size || Description | ! Offset || Size || Description | ||
|- | |- | ||
| 0x4 || 0x2 || | | 0x4 || 0x2 || "os_max". s16 value copied to output_struct+0x0. | ||
|- | |- | ||
| 0x6 || 0x1 || [[#CRC]] over the previous 0x2-bytes. | | 0x6 || 0x1 || [[#CRC]] over the previous 0x2-bytes. | ||
Line 168: | Line 170: | ||
| 0x7 || 0x1 || Padding. | | 0x7 || 0x1 || Padding. | ||
|- | |- | ||
| 0x8 || 0x2 || | | 0x8 || 0x2 || "hk_max". s16 value copied to output_struct+0x2. | ||
|- | |- | ||
| 0xA || 0x1 || [[#CRC]] over the previous 0x2-bytes. | | 0xA || 0x1 || [[#CRC]] over the previous 0x2-bytes. | ||
Line 174: | Line 176: | ||
| 0xB || 0x1 || Padding. | | 0xB || 0x1 || Padding. | ||
|- | |- | ||
| 0xC || 0x2 || | | 0xC || 0x2 || "zero". s16 value copied to output_struct+0x4. | ||
|- | |- | ||
| 0xE || 0x1 || [[#CRC]] over the previous 0x2-bytes. | | 0xE || 0x1 || [[#CRC]] over the previous 0x2-bytes. | ||
Line 224: | Line 226: | ||
The app doesn't use reply data here besides the status, and the output_size is not checked. | The app doesn't use reply data here besides the status, and the output_size is not checked. | ||
The code calling this func saves PlayReports with EventId "write_user_cal". This is the Write version of [[#0x00021A04]], the s16s here are the same as [[#0x00021A04]]. | |||
The code calling this func will first call this func, then on success a PlayReport is saved. Then [[#0x00021A04]] is used, on success if the output matches the data used for 0x10011A04 and the is_valid flag is 0, this returns 0. Otherwise: the func for 0x10011A04 is used again, handling error on failure. Then a PlayReport is saved again. [[#0x00021A04]] is used, with error handling on failure. Then the same validation checks run again. If it didn't return at this point, error handling runs. | |||
Cmd: | Cmd: |