From 2b455c2dd0e3d5dfbabd123baf2cd00811951450 Mon Sep 17 00:00:00 2001 From: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com> Date: Tue, 23 Mar 2021 13:54:01 +0100 Subject: [PATCH] Improve prompts A LOT. --- source/gui/msg.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/source/gui/msg.cpp b/source/gui/msg.cpp index b1f124f..3bc95e0 100644 --- a/source/gui/msg.cpp +++ b/source/gui/msg.cpp @@ -89,11 +89,17 @@ bool Msg::promptMsg(const std::string &promptMsg) { for (int i = 0; i < 3; i++) gspWaitForVBlank(); hidScanInput(); + uint32_t Down = 0; while(1) { - hidScanInput(); - if (hidKeysDown() & KEY_A) return true; - else if (hidKeysDown() & KEY_B) return false; - } + do { + gspWaitForVBlank(); + hidScanInput(); + Down = hidKeysDown(); + } while (!Down); + + if (Down & KEY_A) return true; + else if (Down & KEY_B) return false; + }; } /* @@ -120,8 +126,14 @@ void Msg::waitMsg(const std::string &msg) { for (int i = 0; i < 3; i++) gspWaitForVBlank(); hidScanInput(); + uint32_t Down = 0; while(!doOut) { - hidScanInput(); - if (hidKeysDown()) doOut = !doOut; + do { + gspWaitForVBlank(); + hidScanInput(); + Down = hidKeysDown(); + } while (!Down); + + doOut = true; } } \ No newline at end of file