summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-12-13 21:33:54 -0600
committerGitHub <noreply@github.com>2018-12-13 21:33:54 -0600
commit2c6849bee81f2c05cbf0df1f88c6d5460e7b1e2d (patch)
treebbea5b11d19d277815e51c237b4a7d3dfe8f3a74 /include/global.h
parent170b6ef44992f4b7decb31451a3756b6bd4e2d46 (diff)
Decompile battle_anim_8170478.c (#445)
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h
index 33a31bf4d..58b338f9e 100644
--- a/include/global.h
+++ b/include/global.h
@@ -61,6 +61,12 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
+// Extracts the upper 16 bits of a 32-bit number
+#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
+
+// Extracts the lower 16 bits of a 32-bit number
+#define LOHALF(n) ((n) & 0xFFFF)
+
// There are many quirks in the source code which have overarching behavioral differences from
// a number of other files. For example, diploma.c seems to declare rodata before each use while
// other files declare out of order and must be at the beginning. There are also a number of