From 544ec49785bfcfc55a1ff3fa6faf1fab81e1681c Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 11 Dec 2020 15:54:50 +0100 Subject: [PATCH] Only use the VPAD values if the reading was successful --- source/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/main.cpp b/source/main.cpp index 5ac2035..20a21c7 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -59,7 +59,11 @@ 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; + } + bool loadWithoutHacks = false; bool kernelDone = false; bool skipKernel = false;