improve call_if macros

This commit is contained in:
Melody
2018-12-21 21:32:45 -05:00
parent ac2e4adf2d
commit 55005f1588
175 changed files with 1245 additions and 1400 deletions
+42 -8
View File
@@ -1557,40 +1557,74 @@
@ Supplementary
.macro goto_if_unset flag, dest
.macro goto_if_unset flag:req, dest:req
checkflag \flag
goto_if 0, \dest
.endm
.macro goto_if_set flag, dest
.macro goto_if_set flag:req, dest:req
checkflag \flag
goto_if 1, \dest
.endm
.macro goto_if_lt dest @ LESS THAN
.macro goto_if_lt dest:req @ LESS THAN
goto_if 0, \dest
.endm
.macro goto_if_eq dest @ EQUAL
.macro goto_if_eq dest:req @ EQUAL
goto_if 1, \dest
.endm
.macro goto_if_gt dest @ GREATER THAN
.macro goto_if_gt dest:req @ GREATER THAN
goto_if 2, \dest
.endm
.macro goto_if_le dest @ LESS THAN OR EQUAL
.macro goto_if_le dest:req @ LESS THAN OR EQUAL
goto_if 3, \dest
.endm
.macro goto_if_ge dest @ GREATER THAN OR EQUAL
.macro goto_if_ge dest:req @ GREATER THAN OR EQUAL
goto_if 4, \dest
.endm
.macro goto_if_ne dest @ NOT EQUAL
.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