From da582d5258703eb52d8cadb4cbaef4ee7031b833 Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Fri, 4 Sep 2020 20:41:29 -0400 Subject: [PATCH] Make JOY Macros match --- include/global.h | 2 +- src/main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/global.h b/include/global.h index 08988eac7..8c5167041 100644 --- a/include/global.h +++ b/include/global.h @@ -99,7 +99,7 @@ #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) // Macros for checking the joypad -#define TEST_BUTTON(field, button) ({(field) & (button);}) +#define TEST_BUTTON(field, button) ((field) & (button)) #define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button) #define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button) #define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button) diff --git a/src/main.c b/src/main.c index 4e52216a4..238bd8243 100644 --- a/src/main.c +++ b/src/main.c @@ -135,10 +135,10 @@ void AgbMain() ReadKeys(); if (!gSoftResetDisabled - && (gMain.heldKeysRaw & A_BUTTON) - && (gMain.heldKeysRaw & B_BUTTON) - && (gMain.heldKeysRaw & START_BUTTON) - && (gMain.heldKeysRaw & SELECT_BUTTON)) //The reset key combo A + B + START + SELECT + && JOY_HELD_RAW(A_BUTTON) + && JOY_HELD_RAW(B_BUTTON) + && JOY_HELD_RAW(START_BUTTON) + && JOY_HELD_RAW(SELECT_BUTTON)) //The reset key combo A + B + START + SELECT { rfu_REQ_stopMode(); rfu_waitREQComplete();