diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-03-24 22:56:16 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-03-24 22:56:16 -0400 |
commit | d4cca4ffa2fe1fbeacc3eeb961112a7c71d37f47 (patch) | |
tree | 4839a56089892c09bd311c62078851990fd92bfb /include/global.h | |
parent | d49d3b6858b13665840b14dd7d963b72b7e74fb4 (diff) |
through sub_8024F38
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h index d738deb3c..778019812 100644 --- a/include/global.h +++ b/include/global.h @@ -86,6 +86,11 @@ #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) +// Macros for checking the joypad +#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 S16TOPOSFLOAT(val) \ ({ \ s16 v = (val); \ |