diff options
Diffstat (limited to 'asm/macros')
-rw-r--r-- | asm/macros/event.inc | 68 | ||||
-rw-r--r-- | asm/macros/map.inc | 4 |
2 files changed, 70 insertions, 2 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc index c815f3753..ba851d70a 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1557,17 +1557,81 @@ @ Supplementary - .macro goto_eq dest:req + .macro goto_if_unset flag:req, dest:req + checkflag \flag + goto_if 0, \dest + .endm + + .macro goto_if_set flag:req, dest:req + checkflag \flag + goto_if 1, \dest + .endm + + .macro goto_if_lt dest:req @ LESS THAN + goto_if 0, \dest + .endm + + .macro goto_if_eq dest:req @ EQUAL goto_if 1, \dest .endm + .macro goto_if_gt dest:req @ GREATER THAN + goto_if 2, \dest + .endm + + .macro goto_if_le dest:req @ LESS THAN OR EQUAL + goto_if 3, \dest + .endm + + .macro goto_if_ge dest:req @ GREATER THAN OR EQUAL + goto_if 4, \dest + .endm + + .macro goto_if_ne dest:req @ NOT EQUAL + goto_if 5, \dest + .endm + + .macro call_if_unset flag:req, dest:req + checkflag \flag + call_if 0, \dest + .endm + + .macro call_if_set flag:req, dest:req + checkflag \flag + call_if 1, \dest + .endm + + .macro call_if_lt dest:req @ LESS THAN + call_if 0, \dest + .endm + + .macro call_if_eq dest:req @ EQUAL + call_if 1, \dest + .endm + + .macro call_if_gt dest:req @ GREATER THAN + call_if 2, \dest + .endm + + .macro call_if_le dest:req @ LESS THAN OR EQUAL + call_if 3, \dest + .endm + + .macro call_if_ge dest:req @ GREATER THAN OR EQUAL + call_if 4, \dest + .endm + + .macro call_if_ne dest:req @ NOT EQUAL + call_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 diff --git a/asm/macros/map.inc b/asm/macros/map.inc index 94caeb697..c98364ccc 100644 --- a/asm/macros/map.inc +++ b/asm/macros/map.inc @@ -101,3 +101,7 @@ map \map .space 2 .endm + + .macro map_header_flags allow_bike:req, allow_escape_rope:req, allow_run:req, show_map_name:req + .byte ((\show_map_name & 1) << 3) | ((\allow_run & 1) << 2) | ((\allow_escape_rope & 1) << 1) | \allow_bike + .endm |