Added initial support for the Wii Motion Plus extension

This adds a gyro sensor to the Wii controller, and is enabled in standalone and nunchuk mode
This commit is contained in:
Sam Lantinga 2022-09-06 23:33:55 -07:00
parent 29f4a5ba0e
commit 30f55a5d59
3 changed files with 504 additions and 218 deletions

View file

@ -574,8 +574,7 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI
} else if (vendor == USB_VENDOR_NINTENDO &&
guid.data[15] != k_eSwitchDeviceInfoControllerType_Unknown &&
guid.data[15] != k_eSwitchDeviceInfoControllerType_ProController &&
guid.data[15] != k_eWiiExtensionControllerType_ClassicController &&
guid.data[15] != k_eWiiExtensionControllerType_ClassicControllerPro &&
guid.data[15] != k_eWiiExtensionControllerType_Gamepad &&
guid.data[15] != k_eWiiExtensionControllerType_WiiUPro) {
switch (guid.data[15]) {
case k_eSwitchDeviceInfoControllerType_NESLeft:
@ -594,7 +593,7 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI
case k_eWiiExtensionControllerType_None:
SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,start:b6,x:b2,y:b3,", sizeof(mapping_string));
break;
case k_eWiiExtensionControllerType_Nunchuck:
case k_eWiiExtensionControllerType_Nunchuk:
{
/* FIXME: Should we map this to the left or right side? */
const SDL_bool map_nunchuck_left_side = SDL_TRUE;