mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-22 04:39:17 +01:00
Explicit support for Motion Plus controllers
This commit is contained in:
parent
87ad32516f
commit
87bb3c521f
@ -111,12 +111,13 @@ DECL_FUNCTION(void, WPADRead, WPADChan chan, WPADStatusProController *data) {
|
|||||||
|
|
||||||
if (!sConfigMenuOpened && data && data[0].err == 0) {
|
if (!sConfigMenuOpened && data && data[0].err == 0) {
|
||||||
if (data[0].extensionType != 0xFF) {
|
if (data[0].extensionType != 0xFF) {
|
||||||
if (data[0].extensionType == WPAD_EXT_CORE || data[0].extensionType == WPAD_EXT_NUNCHUK) {
|
if (data[0].extensionType == WPAD_EXT_CORE || data[0].extensionType == WPAD_EXT_NUNCHUK ||
|
||||||
|
data[0].extensionType == WPAD_EXT_MPLUS || data[0].extensionType == WPAD_EXT_MPLUS_NUNCHUK) {
|
||||||
// button data is in the first 2 bytes for wiimotes
|
// button data is in the first 2 bytes for wiimotes
|
||||||
if (((uint16_t *) data)[0] == (WPAD_BUTTON_B | WPAD_BUTTON_DOWN | WPAD_BUTTON_MINUS)) {
|
if (((uint16_t *) data)[0] == (WPAD_BUTTON_B | WPAD_BUTTON_DOWN | WPAD_BUTTON_MINUS)) {
|
||||||
sWantsToOpenConfigMenu = true;
|
sWantsToOpenConfigMenu = true;
|
||||||
}
|
}
|
||||||
} else if (data[0].extensionType == WPAD_EXT_CLASSIC) {
|
} else if (data[0].extensionType == WPAD_EXT_CLASSIC || data[0].extensionType == WPAD_EXT_MPLUS_CLASSIC) {
|
||||||
// TODO: figure out the real struct..
|
// TODO: figure out the real struct..
|
||||||
if ((((uint32_t *) data)[10] & 0xFFFF) == (WPAD_CLASSIC_BUTTON_L | WPAD_CLASSIC_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_MINUS)) {
|
if ((((uint32_t *) data)[10] & 0xFFFF) == (WPAD_CLASSIC_BUTTON_L | WPAD_CLASSIC_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_MINUS)) {
|
||||||
sWantsToOpenConfigMenu = true;
|
sWantsToOpenConfigMenu = true;
|
||||||
|
@ -144,7 +144,8 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kpad.extensionType == WPAD_EXT_CORE || kpad.extensionType == WPAD_EXT_NUNCHUK) {
|
if (kpad.extensionType == WPAD_EXT_CORE || kpad.extensionType == WPAD_EXT_NUNCHUK ||
|
||||||
|
kpad.extensionType == WPAD_EXT_MPLUS || kpad.extensionType == WPAD_EXT_MPLUS_NUNCHUK) {
|
||||||
data.buttons_r = remapWiiMoteButtons(kpad.release);
|
data.buttons_r = remapWiiMoteButtons(kpad.release);
|
||||||
data.buttons_h = remapWiiMoteButtons(kpad.hold);
|
data.buttons_h = remapWiiMoteButtons(kpad.hold);
|
||||||
data.buttons_d = remapWiiMoteButtons(kpad.trigger);
|
data.buttons_d = remapWiiMoteButtons(kpad.trigger);
|
||||||
|
Loading…
Reference in New Issue
Block a user