summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorDiegoisawesome <Diegoisawesome@users.noreply.github.com>2019-12-20 23:40:12 -0800
committerGitHub <noreply@github.com>2019-12-20 23:40:12 -0800
commitd42ea06dc5ade2209fb84ffedafd33de3fbc9cd1 (patch)
treed4109c9287dfad47e1548c90c9c63f6510cfaa23 /asm/macros
parente4e3d439dcb7dedf0fd3da17d82120303ca10f5b (diff)
parent9e08cfe55f632fd749ce64c0e54eb93bd10926dc (diff)
Merge pull request #939 from GriffinRichards/fix-compare
Use constants in compare macro
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/event.inc12
1 files changed, 5 insertions, 7 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 14a1447ee..df063b613 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -233,14 +233,12 @@
.endm
@ Generic compare macro which attempts to deduce argument types based on their values
- @ Any values between 0x4000 to 0x4FFF and 0x8000 to 0x8FFF are considered event variable identifiers
- .macro compare arg1:req, arg2:req
- .if ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && ((\arg2 >> 12) == 4 || (\arg2 >> 12) == 8)
- compare_var_to_var \arg1, \arg2
- .elseif ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && (\arg2 >= 0 && \arg2 <= 0xFFFF)
- compare_var_to_value \arg1, \arg2
+ @ Any values between 0x4000 to 0x40FF and 0x8000 to 0x8015 are considered event variable identifiers
+ .macro compare var:req, arg:req
+ .if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END))
+ compare_var_to_var \var, \arg
.else
- .error "Invalid arguments for 'compare'"
+ compare_var_to_value \var, \arg
.endif
.endm