From d137a1a0c11737e1cbe9ca9fbeba74913ad63eab Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 Dec 2019 19:12:09 -0500 Subject: Use constants in compare macro --- asm/macros/event.inc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 8b43d0821..951e295a6 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 -- cgit v1.2.3 From 9e08cfe55f632fd749ce64c0e54eb93bd10926dc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 Dec 2019 19:22:39 -0500 Subject: Remove uses of compare_var_to --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 951e295a6..764dcf054 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -235,7 +235,7 @@ @ Generic compare macro which attempts to deduce argument types based on their values @ 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) + .if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END)) compare_var_to_var \var, \arg .else compare_var_to_value \var, \arg -- cgit v1.2.3