Fix gamepad reading

This commit is contained in:
Maschell 2021-12-26 20:52:06 +01:00
parent 13055af2ca
commit 10b0825be0

View File

@ -76,7 +76,10 @@ int main(int argc, char **argv) {
VPADStatus vpad_data;
VPADRead(VPAD_CHAN_0, &vpad_data, 1, &err);
uint32_t btn = vpad_data.hold | vpad_data.trigger;
uint32_t btn = 0;
if(err == VPAD_READ_SUCCESS) {
btn = vpad_data.hold | vpad_data.trigger;
}
std::string environment_path = "fs:/vol/external01/wiiu/environments/default";
if ((btn & VPAD_BUTTON_X) == VPAD_BUTTON_X) {