sub_812CAD8

New macro `PRESSED(x)` tests `gMain.newKeys & (x)`.  The macro itself
is inoptimal.  However, its use is required to match this function.
We suspect this macro may have been implemented globally, hence we
put it in `global.h`.  Propagating its use through the remainder of
this project, as well as [Ruby](/pret/pokeruby) and [Emerald](/pret/pokeemerald),
has been left as a to-do item.
This commit is contained in:
PikalaxALT
2018-11-24 20:04:50 -05:00
parent 8ef1594d20
commit 93f67f9557
3 changed files with 84 additions and 198 deletions
+7
View File
@@ -62,6 +62,13 @@
#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)
// This macro is required to prevent the compiler from optimizing
// a dpad up/down check in sub_812CAD8 (fame_checker.c).
// We suspect it was used globally.
// GameFreak never ceases to amaze.
// TODO: Propagate use of this macro
#define PRESSED(button) ({gMain.newKeys & (button);})
extern u8 gStringVar1[];
extern u8 gStringVar2[];
extern u8 gStringVar3[];