diff options
author | Melody <melody@pallet.town> | 2018-12-21 20:28:24 -0500 |
---|---|---|
committer | Melody <melody@pallet.town> | 2018-12-21 20:28:24 -0500 |
commit | ac2e4adf2da2f30a741556e20e5bc9a494997581 (patch) | |
tree | 1a05a202cfece044d546094581d8463a9b6e452c /asm/macros | |
parent | 87fd6b8dc21b37b656f16e3f11832c6951328750 (diff) |
improve goto_if macros
Diffstat (limited to 'asm/macros')
-rw-r--r-- | asm/macros/event.inc | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc index c815f3753..074a22443 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1557,17 +1557,47 @@ @ Supplementary - .macro goto_eq dest:req + .macro goto_if_unset flag, dest + checkflag \flag + goto_if 0, \dest + .endm + + .macro goto_if_set flag, dest + checkflag \flag goto_if 1, \dest .endm + .macro goto_if_lt dest @ LESS THAN + goto_if 0, \dest + .endm + + .macro goto_if_eq dest @ EQUAL + goto_if 1, \dest + .endm + + .macro goto_if_gt dest @ GREATER THAN + goto_if 2, \dest + .endm + + .macro goto_if_le dest @ LESS THAN OR EQUAL + goto_if 3, \dest + .endm + + .macro goto_if_ge dest @ GREATER THAN OR EQUAL + goto_if 4, \dest + .endm + + .macro goto_if_ne dest @ NOT EQUAL + goto_if 5, \dest + .endm + .macro switch var:req copyvar 0x8000, \var .endm .macro case condition:req, dest:req compare 0x8000, \condition - goto_eq \dest + goto_if_eq \dest .endm @ Message box types |