Difference between revisions of "Wiimote/Extension Controllers"

From WiiBrew
Jump to navigation Jump to search
(guitar hero world tour)
Line 214: Line 214:
 
|}
 
|}
 
SX,SY are the Analog Stick X and Y positions.  BG,BR,BY,BB,BO are the fret buttons by color (Green, Red, Yellow, Blue, Orange).  B-,B+ are the + and - buttons at the base of the controller.  BU and BD are up and down on the strum bar, respectively.  WB is the analog whammy bar.
 
SX,SY are the Analog Stick X and Y positions.  BG,BR,BY,BB,BO are the fret buttons by color (Green, Red, Yellow, Blue, Orange).  B-,B+ are the + and - buttons at the base of the controller.  BU and BD are up and down on the strum bar, respectively.  WB is the analog whammy bar.
 +
 +
= Guitar Hero Guitar World Tour =
 +
The Guitar is identified by the 16-bit constant 0xFFFF (0xFFFF encrypted) at register address 0xa400fe. It a two-axis analog thumbstick, a one-axis analog "whammy bar" and 15 buttons.
  
 
= Balance Board =
 
= Balance Board =

Revision as of 20:02, 1 December 2008

The Wiimote includes a 6-pin expansion port that allows external peripherals to be connected to it. Communications are bidirectional synchronous serial (the protocol is unknown), and the devices provide a virtual register block of length 0x100 that is mapped at 0xa40000 in the Wiimote's address space. Communications are encrypted, as detailed in Wiimote#Extension Controllers. Nintendo has currently released two extensions, the Nunchuk and the Classic Controller. In addition, Guitar Hero guitars also act as extension controllers. The Balance board acts like a dummy Wiimote with its own type of extension controller.

Peripheral Protocol is 400kHz "fast" I2C, with slave address 0x52. It should be possible to make homebrew peripherals; see the Tenkey project (japanese) or the Twiidler project

Nunchuk

The Nunchuk is identified by the 16-bit constant 0x0000 (0xFEFE encrypted) at register address 0xa400fe. It provides three-axis acceleration data, two digital buttons, and an X-Y analog stick.

Data Format

The Nunchuk reports its information as 6 bytes of data, readable at 0xa40008 and streamable using Data Reporting Modes that include Extension bytes (unused bytes are filled with 0x00). The data is packed into the six bytes as follows (after decryption):

  Bit
Byte 7 6 5 4 3 2 1 0
0 SX<7:0>
1 SY<7:0>
2 AX<7:0>
3 AY<7:0>
4 AZ<7:0>
5 Unknown BC BZ

SX,SY are the Analog Stick X and Y positions, while AX, AY, and AZ are the accelerometer data (in the same format as described in Wiimote#Accelerometer). BC and BZ are the state of the C and Z buttons (0=pressed).

Nintendo games calibrate the center position of the Analog Stick upon power-up or insertion of the Nunchuk.

Wireless Nunchuk

It looks like Wireless Nunchuks operate differently than the original Nunchuk-Extension. Anyone have a clue?

Nyko Kama

The Nyko Kama is just a simple wireless Nunchuk, with a Sync and Power button. It uses two AAA batteries.

The Nyko Kama does not work with current homebrew or PC Wiimote software. It is unknown how to make it work.

Snakebyte Wireless Motion XS

Snakebyte is a German company that makes 3rd party Wii Remotes, Nunchuks, Classic Controllers, and Sensor Bars.

On the Discussion page, the user "Grid" supplied the following information: (Abridged. Spelling and grammar have been corrected.)

"I am using a wireless Nunchuk controller by some third party company (Snakebyte), and I was trying many, many times to get the wireless Nunchuk running on any lib out there. But anytime I plug it into my WiiMote my application slows down and I don't get any response from the Nunchuk. I've got no idea, my Wii accepts the wireless Nunchuk without any problem.
I don't see any problem with any Wii game. Some WiiMote libs, which support the original Nunchuk perfectly, toggle between "nothing inserted" and "partially inserted" when the wireless Nunchuk is plugged in. Also no Data is streamed from the Nunchuk. It's extremely strange!!!! I've got no clue!
I'm still trying to run a Wireless Nunchuk. One problem is that the address areas where the calibration data is normally stored is write-only on the wireless Nunchuks. But the weird thing about this wireless Nunchuk from Snakebyte [1] is that I got no response at all until I played Metroid Prime 3 or Zelda with it. I am not kidding!!! After playing one of these games, I get all the data, only without the calibration, so I can't really use the data because I don't know how to calibrate the accelerometers and the joystick."

That appears to be similar behaviour to what I observed with the Datel Blade-FX as documented below. It returns 0xFF 0xFF as the extension type, but then when you try to read the calibration data it disconnects and then reconnects later, thus producing the observed "toggle between "nothing inserted" and "partially inserted" when the wireless Nunchuk is plugged in". CarlKenner 04:20, 28 November 2008 (UTC)

Datel Blade-FX

This wireless Nunchuk can emulate either a Nunchuk or a Classic Controller. At startup it behaves like a Nunchuk, but pressing the "Classic" button puts it into Classic Controller mode. While in Classic Controller mode, the FUNCTION LED will be solidly lit (red). Classic controller emulation allows it to be used in the Wii system menu, with the joystick controlling the cursor, and the Z button selecting, and the C button having no visible effect. It also allows it to work (according to the instructions) with some Virtual Console games.

This wireless Nunchuk also has a cheat feature that remembers a motion that you do and repeats it continuously without you having to keep doing the motion. That is done with the "FX" button.

There is also a "SYNC" button where the cord would be. Pressing it once connects the wireless nunchuk. While connected, the STATUS LED will slowly flash.

When the wireless adapter is plugged in, but the wireless nunchuk has not been synced or turned on, then it behaves as though nothing was plugged in. No status report is generated when the wireless adapter is plugged in or unplugged, unless the nunchuk is synced. Querying the status report returns 0 for the extension flag (instead of 2).

But when the wireless nunchuk is synced, then it sends a status report indicating that an extension is connected. Trying to read the 16 bytes from 0xF0 of the expansion (to identify the expansion) successfully returns "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF", which isn't particularly helpful. Trying to read any 16 byte block has the same effect, it returns success, but it is all FFs.

BUT... trying to read the calibration data from 0x20 or 0x30 (although it still returns success as above) causes the Nunchuk to disconnect, sending a status report to indicate no extension is plugged in. It will automatically reconnect 0.5 seconds later. While disconnected, attempting to read from the Nunchuk returns error 7.

Expansion data (in the input reports that include expansion data) is all 0xFF, just like trying to read the Nunchuk memory.

As soon as the "Classic" button is pressed, a status message is sent saying that the extension has been unplugged. It will stay "unplugged" until the status button is released again, however long they hold down the button for. Once the "Classic" button has been released, it will wait about half a second and then send a status message saying the extension has been plugged in again. If the Classic button is pressed twice before it sent the released message, then it may send another disconnect and connect message after the connect message. It is not currently possible to tell whether it is in Classic Controller or Nunchuk mode. But we can use this method to read when the "Classic" button is held down (although it will always look like it was held down longer than it really was).

Actually unplugging the adapter will give the same disconnect message, so after a few seconds one should assume that they did a real disconnect instead of holding down the "Classic" button. In one case, after unplugging and replugging the adapter, the BladeFX started returning all 00 instead of FF when reading the expansion type from 0xF0. The data returned from report 0x34 also had 00 00 00 as the last 3 extension bytes, even though the first 16 (starting from 0x08 in extension memory) were all FF. Trying to read the calibration from 0x20 still returned all 0xFF and then disconnected as usual. Pressing buttons on the BladeFX had no effect on the data returned in report 0x34. I have not done any additional experiments with this state yet.

Clearly the current method of turning on an expansion doesn't work for the Datel Blade-FX, and we need some way to turn it on. Perhaps then the calibration can be read without an error, and we can get real data.

It is not yet known how to make the Datel Blade-FX work, although it can be detected when it is synced, due to its strange behaviour, and the "Classic" button can be read. Nothing else is readable yet.

CarlKenner 03:50, 28 November 2008 (UTC)

Classic Controller

The Classic Controller is identified by the 16-bit constant 0x0101 (0xFDFD encrypted) at register address 0xa400fe. It provides 15 buttons, two of which are analog triggers and provide both "clicked" status and a distance pressed measurement, and two X-Y analog sticks.

Data Format

The Classic Controller reports its information as 6 bytes of data, readable at 0xa40008 and streamable using Data Reporting Modes that include Extension bytes (unused bytes are filled with 0x00). The data is packed into the six bytes as follows (after decryption):

  Bit
Byte 7 6 5 4 3 2 1 0
0 RX<4:3> LX<5:0>
1 RX<2:1> LY<5:0>
2 RX<0> LT<4:3> RY<4:0>
3 LT<2:0> RT<4:0>
4 BDR BDD BLT B- BH B+ BRT 1
5 BZL BB BY BA BX BZR BDL BDU

LX,LY are the left Analog Stick X and Y (0-61), RX and RY are the right Analog Stick X and Y (0-31), and LT and RT are the Left and Right Triggers (0-31). The left Analog Stick has twice the precision of the other analog values.

BD{L,R,U,D} are the D-Pad direction buttons. B{ZR,ZL,A,B,X,Y,+,H,-} are the discrete buttons. B{LT,RT} are the digital button click of LT and RT. All buttons are 0 when pressed.

Nintendo games calibrate the center position of the Analog Sticks upon power-up or insertion of the Classic Controller.

Guitar Hero Guitar

The Guitar is identified by the 16-bit constant 0x0103 (0xFDFB encrypted) at register address 0xa400fe. It a two-axis analog thumbstick, a one-axis analog "whammy bar" and 9 buttons.

Data Format

The Guitar reports its information as 6 bytes of data, readable at 0xa40008 and streamable using Data Reporting Modes that include Extension bytes (unused bytes are filled with 0x00). The data is packed into the six bytes as follows (after decryption):

  Bit
Byte 7 6 5 4 3 2 1 0
0 SX<7:0>
1 SY<7:0>
2 Unknown
3 WB<7:0>
4 ? BD ? B- ? B+ ? ?
5 BO BR BB BG BY ? ? BU

SX,SY are the Analog Stick X and Y positions. BG,BR,BY,BB,BO are the fret buttons by color (Green, Red, Yellow, Blue, Orange). B-,B+ are the + and - buttons at the base of the controller. BU and BD are up and down on the strum bar, respectively. WB is the analog whammy bar.

Guitar Hero Guitar World Tour

The Guitar is identified by the 16-bit constant 0xFFFF (0xFFFF encrypted) at register address 0xa400fe. It a two-axis analog thumbstick, a one-axis analog "whammy bar" and 15 buttons.

Balance Board

The Balance Board extension is identified by the 16-bit constant 0x2A2C (0x0402 encrypted) at register address 0xa400fe. This extension is only found connected to the Wii Balance Board device, and is documented on that page.

Wii Motion Plus

The Wii Motion Plus extension is unusual in that it has its own extension port on the back allowing a Nunchuk for example to be plugged in along with the Wii Motion Plus. That might radically change the way it is detected and used compared to other extensions.

The Wii Motion Plus consists of two rate-gyros. These gyros measure rotation SPEED, but can't actually measure absolute orientation, which causes drift if not corrected by some other data source. Speed is one step better than the acceleration reported by the accelerometers. One of the two gyros will obviously have to measure yaw, since that can't be measured by accelerometers. The other axis is unknown, but I would guess pitch. Unlike the rotation measured by accelerometers, whose axes are defined by gravity, the gyro axes are relative to the angle of the Wiimote. So even if it can measure yaw when the Wiimote is in the normal orientation, it won't be able to detect yaw when the Wiimote is vertical.

In addition to providing yaw, the gyros also allow the software to tell the difference between orientation and acceleration, which are difficult to tell apart from the accelerometers which measure a mixture of both.

Wii Motion Plus will be available in early 2009 packaged along with Wii Sports Resort.

Wii Motion Plus Documentation at AiLive