Line 7:
Line 7:
The 32 bytes from 0x(4)a60020 are, as usual, calibration information, described as follows.
The 32 bytes from 0x(4)a60020 are, as usual, calibration information, described as follows.
+
+
{| class="wikitable" style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
+
|- style="text-align: center;"
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''Address'''
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''0x00'''
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''0x01'''
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''0x02'''
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''0x03'''
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''0x04'''
+
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddf;" | '''0x05'''
+
|-
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | '''0x(4)a60020'''
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Fast mode'' yaw zero value
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Fast mode'' roll zero value
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Fast mode'' pitch zero value
+
|-
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | '''0x(4)a60026'''
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Fast mode'' yaw scale value
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Fast mode'' roll scale value
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Fast mode'' pitch scale value
+
|-
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | '''0x(4)a60032'''
+
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="1" | ''Fast mode''vu8 degrees_div_6 (what the hell is this?)
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="1" | UID 1 (seems to just be a unique id)
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | CRC32 Hash of all calibration data's MSB
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Slow mode'' yaw zero value
+
|-
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | '''0x(4)a60038'''
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Slow mode'' roll zero value
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | ''Slow mode'' pitch zero value
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="1" | ''Slow mode''vu8 degrees_div_6 (what the hell is this?)
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="1" | UID 2 (seems to just be a unique id)
+
|-
+
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="2" | CRC32 Hash of all calibration data's LSB
+
|}
+
+
{{Collapse|title=source code struct example|text=
<source lang="cpp">// All values are big-endian.
<source lang="cpp">// All values are big-endian.
// Assume data is tightly packed.
// Assume data is tightly packed.
Line 37:
Line 75:
u16 crc32_lsb;
u16 crc32_lsb;
};
};
−
</source>
+
</source>}}
Writing 0x04 to 0x(4)A600FE activates the MotionPlus as the "active" extension. This does 3 things (with no additional initialization):
Writing 0x04 to 0x(4)A600FE activates the MotionPlus as the "active" extension. This does 3 things (with no additional initialization):
Line 51:
Line 89:
* Extension reports no longer contain MotionPlus data
* Extension reports no longer contain MotionPlus data
−
It is possible to read from both Motion Plus and an extension controller at the same time by activating the MotionPlus in one of the pass-through modes suggested by DogP. When activated, this interleaves extension controller data with MotionPlus data on every other read. Data passing through are modified to make room for 3 bookkeeping bits. Two pass-through modes are currently known, one with modifications adapted to the NunChuck, and one with modifications adapted to the Classic Controller (but suitable for Guitar, Drums, or Turntable).
+
It is possible to read from both MotionPlus and an extension controller at the same time by activating the MotionPlus in one of the pass-through modes suggested by DogP. When activated, this interleaves extension controller data with MotionPlus data on every other read. Data passing through are modified to make room for 3 bookkeeping bits. Two pass-through modes are currently known, one with modifications adapted to the [[Nunchuck]], and one with modifications adapted to the [[Classic Controller]] (but suitable for [[Guitar]], [[Drums]], or [[Turntable]]).
−
Nunchuck pass-through mode :
+
[[Nunchuck]] pass-through mode :
* Activated by writing 0x05 instead of 0x04 to 0x(4)A600FE
* Activated by writing 0x05 instead of 0x04 to 0x(4)A600FE
* Data passing through drops the least significant bit of the three accelerometer values
* Data passing through drops the least significant bit of the three accelerometer values
Line 62:
Line 100:
* Bit 0 of byte 5 is moved to bit 2 of byte 5, overwriting it
* Bit 0 of byte 5 is moved to bit 2 of byte 5, overwriting it
−
Classic Controller or Musical Instrument pass-through mode:
+
[[Classic Controller]] or [[Musical Instrument]] pass-through mode:
* Activated by writing 0x07 instead of 0x04 to 0x(4)A600FE
* Activated by writing 0x07 instead of 0x04 to 0x(4)A600FE
* Data passing through drops the least significant bit of the axes of the left (or only) joystick
* Data passing through drops the least significant bit of the axes of the left (or only) joystick
Line 68:
Line 106:
* Bits 0 and 1 of Byte 5 are moved to bit 0 of Bytes 0 and 1, overwriting what was there before
* Bits 0 and 1 of Byte 5 are moved to bit 0 of Bytes 0 and 1, overwriting what was there before
−
There is no requirement to use the correct mode for the extension, but otherwise the bitshift/move wouldn't make sense. Using the Nunchuk in classic controller mode would clobber a significant bit in the middle of the Z acceleration. Using the Classic controller in Nunchuk mode would clobber some of the buttons.
+
+
{{note|There is no requirement to use the correct mode for the extension, but otherwise the bitshift/move wouldn't make sense. Using the Nunchuk in classic controller mode would clobber a significant bit in the middle of the Z acceleration. Using the Classic controller in Nunchuk mode would clobber some of the buttons.}}
== Data Format ==
== Data Format ==