Skip update warning with any controller

This commit is contained in:
Andrew Hawes 2023-06-06 09:29:53 +01:00
parent 10161be0a2
commit d7577b15e9
2 changed files with 17 additions and 2 deletions

View File

@ -14,6 +14,7 @@
#include <malloc.h>
#include <memory>
#include <nn/act/client_cpp.h>
#include <padscore/kpad.h>
#include <string>
#include <sysapp/title.h>
#include <vector>
@ -395,9 +396,19 @@ void handleUpdateWarningScreen() {
VPADStatus vpad{};
VPADRead(VPAD_CHAN_0, &vpad, 1, nullptr);
if (vpad.trigger & VPAD_BUTTON_A) {
KPADStatus kpad;
uint32_t wiimoteButtonsTriggered = 0;
uint32_t classicButtonsTriggered = 0;
for (int32_t i = 0; i < 4; i++) {
if (KPADRead((KPADChan) i, &kpad, 1) > 0) {
wiimoteButtonsTriggered |= kpad.trigger;
classicButtonsTriggered |= kpad.classic.trigger;
}
}
if (vpad.trigger & VPAD_BUTTON_A || wiimoteButtonsTriggered & WPAD_BUTTON_A || classicButtonsTriggered & WPAD_CLASSIC_BUTTON_A) {
break;
} else if (vpad.trigger & VPAD_BUTTON_B) {
} else if (vpad.trigger & VPAD_BUTTON_B || wiimoteButtonsTriggered & WPAD_BUTTON_B || classicButtonsTriggered & WPAD_CLASSIC_BUTTON_B) {
f = fopen(UPDATE_SKIP_PATH, "w");
if (f) {
// It's **really** important to have this text on the stack.

View File

@ -9,6 +9,7 @@
#include <gx2/state.h>
#include <malloc.h>
#include <mocha/mocha.h>
#include <padscore/kpad.h>
#include <sndcore2/core.h>
#include <string>
#include <sys/stat.h>
@ -48,6 +49,9 @@ int32_t main(int32_t argc, char **argv) {
OSFatal("AutobootModule: Mocha_InitLibrary failed");
}
KPADInit();
WPADEnableURCC(1);
VPADStatus vpad{};
// Buffer vpad read.
VPADRead(VPAD_CHAN_0, &vpad, 1, nullptr);