summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorDiegoisawesome <diego@domoreaweso.me>2018-12-25 15:03:13 -0600
committerDiegoisawesome <diego@domoreaweso.me>2018-12-25 15:03:13 -0600
commitd8948a5cda2e385c1d4b5c6190c4fe0fb53359fb (patch)
treefa882b0733f88cc17dcbaef8c25c30c7198bdca1 /asm/macros
parentdea41e1a7e6e73789431153d6c28dac3a3a73ac6 (diff)
parenta54aa03d20dacc88879404b87a5f6a7eb7babc54 (diff)
Merge remote-tracking branch 'pret/master' into trade
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/event.inc68
-rw-r--r--asm/macros/map.inc2
2 files changed, 67 insertions, 3 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 9a028b2e5..94caeb697 100644
--- a/asm/macros/map.inc
+++ b/asm/macros/map.inc
@@ -14,7 +14,7 @@
.4byte \address
.endm
- .macro object_event index, gfx, replacement, x, y, elevation, movement_type, x_radius, y_radius, trainer_type, sight_radius_tree_etc, script, event_flag
+ .macro object_event index:req, gfx:req, replacement:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
.byte \index, \gfx, \replacement, 0
.2byte \x
.2byte \y