Razer Hydra (and Sixense STEM) controller support.

Adds support for the Razer Hydra controller to the Windows version of Dolphin (other versions should be unaffected).

The Hydra, from Razer and Sixense, is the two-handed motion tracking controller for the PC. Making it perfect for use in Dolphin to emulate a Wiimote and Nunchuk. This patch allows the Razer Hydra to be used as an emulated Wiimote, Wiimote + Nunchuk, Classic Controller, Gamecube controller or sideways Wiimote.

![](http://assets.razerzone.com/eeimages/products/64/razer-hydra-bundle.png)

This probably also supports the new Sixense STEM controller that Sixense is bringing out soon (to ride on the coattails of the Oculus Rift), which is likely to be backwards compatible.

This patch has no effect (dolphin behaves the same as before except for a log message) unless the user has sixense_x64.dll (part of the Sixense driver) installed (or sixense.dll for 32 bit). Users can get it from http://sixense.com/windowssdkdownload and put it in their Dolphin exe folder.

When the dll is present, and a Hydra is connected, and not sitting in the dock, and Wiimote 1 is set to Emulated Wiimote, the Hydra will automatically control Wiimote 1 and its Nuchuk or Classic Controller extensions. It will also control Gamecube controller 1 if it is enabled. While holding the hydra, the actual tilt will override any other emulated tilt, and the actual pointing will override any other emulated IR, and the actual joysticks will override other emulated joysticks, but emulated buttons, swings and shakes from other inputs will still work additively.

It currently uses a fixed control scheme to make it plug-and-play:
Wiimote:
A: right start button (middle)
B: right bumper or trigger (underneath)
Minus: right 3 button (top left)
Plus: right 4 button (top right)
Home/Recenter IR: push right stick in (top middle)
Dpad: right analog stick (top middle)
1: right 1 button (bottom left)
2: right 2 button (bottom right)
IR pointer: right controller's position in space relative to where you pressed Home
Orientation/Motion sensing: right controller's orientation/motion
Swap extension: push left stick in

Nunchuk:
C: left bumper (top) or left 1 button (bottom left)
Z: left trigger (bottom) or left 2 button (bottom right)
Stick: left stick
Orientation/Motion sensing: left controller's orientation/motion

Classic:
L: left analog trigger (bottom left unlike Classic Controller Pro)
ZL: left bumper (top left)
R: right analog trigger
ZR: right bumper
left stick: left stick
right stick: right stick
dpad: left buttons like if tilted inwards, 3=up, 2=down, 1=left, 4=right 
a, b, x, y: right buttons like if tilted inwards: 2=a, 1=b, 4=x, 3=y
minus: left start
plus: right start
home/recenter IR: push right stick in

Sideways Wiimote (if left controller is docked):
turn right hydra sideways yourself, same as above wiimote controls

Sideways Wiimote (if holding both controllers):
steering/tilt left-right: angle between controllers (like holding imaginary wheel or sideways wiimote with both hands)
tilt forwards-backwards: tilt controllers (only measures right one) forwards or backwards
motion sensing: shake or swing controllers (only measures right one)
1: right 1 button (bottom left)
2: right 2 button (bottom right)
A: left or right start button
B: left or right bumpers or triggers
minus: right 3 button (top left)
plus: right 4 button (top right)
home/recenter IR: push right stick in

GameCube:
L: left analog trigger (bottom left like GameCube controller)
Z: left or right bumper (top left or top right)
R: right analog trigger (bottom right)
analog stick: left stick
C-substick: right stick
dpad: left buttons like if tilted inwards, 3=up, 2=down, 1=left, 4=right 
a, b, x, y: right buttons like GameCube layout: 2=a, 1=b, 4=x, 3=y
start: right start

General:
Cycle between Wiimote/sideways Wiimote/Wiimote+Nunchuk/Classic: push left stick in
(note that doesn't affect the gamecube controller)
Recenter IR pointer: push right stick in (press again to get out of home screen)
Recenter hydra joysticks: dock then undock that controller
(if that doesn't help, disconnect and reconnect nunchuk/classic extension)

Troubleshooting:
Hydra isn't recognised: make sure sixense_x64.dll is in Dolphin's exe folder (see above).
Wii cursor isn't showing: push the right analog stick in, then exit the home screen.
IR Pointer doesn't aim smoothly: it uses position rather than angle, so move rather than aiming.
Orientation/motion sensing is messed up: make sure base is straight with cables at back, then dock both controllers and pick them up again. If that doesn't work, make sure you have the Sideways Wiimote setting set correctly in Wiimote settings.
Hands are swapped: The nunchuk should be the controller that says LT (or q7) on the triggers, so hold that one in your left hand.
Joystick is messed up: dock then undock both controllers, then disconnect and reconnect the extension in Wiimote settings.