From 9750849c69899b0faaa156f397ff63dd086ab40c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 26 Nov 2018 16:47:19 -0500 Subject: Genericize PRESSED macro --- include/global.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/global.h b/include/global.h index 9fb7703cd..2b9b00d5c 100644 --- a/include/global.h +++ b/include/global.h @@ -67,7 +67,9 @@ // We suspect it was used globally. // GameFreak never ceases to amaze. // TODO: Propagate use of this macro -#define PRESSED(button) ({gMain.newKeys & (button);}) +#define TEST_BUTTON(field, button) ({(field) & (button);}) +#define PRESSED(button) TEST_BUTTON(gMain.newKeys, button) +#define PUSHED(button) TEST_BUTTON(gMain.heldKeys, button) extern u8 gStringVar1[]; extern u8 gStringVar2[]; -- cgit v1.2.3