diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-11-26 16:47:19 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-11-26 16:47:19 -0500 |
commit | 9750849c69899b0faaa156f397ff63dd086ab40c (patch) | |
tree | 09bf54b9dadd85e869b672a51976d2f6e90f610e | |
parent | a2b7b3ebf2f5460c4f5ab076e5dcb06935f61d25 (diff) |
Genericize PRESSED macro
-rw-r--r-- | include/global.h | 4 |
1 files changed, 3 insertions, 1 deletions
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[]; |