mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-22 04:39:17 +01:00
Fix opening the config menu with the classic controller
This commit is contained in:
parent
5da5c0e117
commit
c89db187b6
@ -86,16 +86,22 @@ DECL_FUNCTION(void, WPADRead, WPADChan chan, WPADStatusProController *data) {
|
||||
real_WPADRead(chan, data);
|
||||
|
||||
if (!configMenuOpened && data[0].err == 0) {
|
||||
if (data[0].extensionType != 0xFF) {
|
||||
if (data[0].extensionType == WPAD_EXT_CORE || data[0].extensionType == WPAD_EXT_NUNCHUK) {
|
||||
// button data is in the first 2 bytes for wiimotes
|
||||
if (((uint16_t *) data)[0] == (WPAD_BUTTON_B | WPAD_BUTTON_DOWN | WPAD_BUTTON_MINUS)) {
|
||||
wantsToOpenConfigMenu = true;
|
||||
}
|
||||
} else {
|
||||
// TODO does this work for classic controllers?
|
||||
if (data[0].buttons == (WPAD_CLASSIC_BUTTON_L | WPAD_CLASSIC_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_MINUS)) {
|
||||
} else if (data[0].extensionType == WPAD_EXT_CLASSIC) {
|
||||
// TODO: figure out the real struct..
|
||||
if ((((uint32_t *) data)[10] & 0xFFFF) == (WPAD_CLASSIC_BUTTON_L | WPAD_CLASSIC_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_MINUS)) {
|
||||
wantsToOpenConfigMenu = true;
|
||||
}
|
||||
} else if (data[0].extensionType == WPAD_EXT_PRO_CONTROLLER) {
|
||||
if (data[0].buttons == (WPAD_PRO_TRIGGER_L | WPAD_PRO_BUTTON_DOWN | WPAD_PRO_BUTTON_MINUS)) {
|
||||
wantsToOpenConfigMenu = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user