summaryrefslogtreecommitdiff
path: root/macros.asm
diff options
context:
space:
mode:
Diffstat (limited to 'macros.asm')
-rw-r--r--macros.asm53
1 files changed, 49 insertions, 4 deletions
diff --git a/macros.asm b/macros.asm
index fcf3eb15f..2677de671 100644
--- a/macros.asm
+++ b/macros.asm
@@ -16,7 +16,6 @@ INCLUDE "macros/mobile.asm"
INCLUDE "macros/trainer.asm"
INCLUDE "macros/trade_anim.asm"
-
RGB: MACRO
dw ((\3) << 10) + ((\2) << 5) + (\1)
ENDM
@@ -213,17 +212,26 @@ ENDM
palettes EQUS "* 8"
ldpixel: MACRO
-if _NARG == 5
+if _NARG >= 5
lb \1, \2 * 8 + \4, \3 * 8 + \5
else
lb \1, \2 * 8, \3 * 8
endc
- endm
+endm
depixel EQUS "ldpixel de,"
+bcpixel EQUS "ldpixel bc,"
+
+dbpixel: MACRO
+if _NARG >= 4
+ db \1 * 8 + \3, \2 * 8 + \4
+else
+ db \1 * 8, \2 * 8
+endc
+endm
bgcoord: MACRO
-IF _NARG == 4
+IF _NARG >= 4
ld \1, \3 * $20 + \2 + \4
ELSE
ld \1, \3 * $20 + \2 + VBGMap0
@@ -234,3 +242,40 @@ hlbgcoord EQUS "bgcoord hl,"
debgcoord EQUS "bgcoord de,"
bcbgcoord EQUS "bgcoord bc,"
bgrows EQUS "* $20"
+
+palred EQUS "$0400 *"
+palgreen EQUS "$0020 *"
+palblue EQUS "$0001 *"
+
+dsprite: MACRO
+; conditional segment is there because not every instance of
+; this macro is directly OAM
+if _NARG >= 7 ; y tile, y pxl, x tile, x pxl, vtile offset, flags, palette
+ db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & 7)
+else
+ db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
+endc
+endm
+
+jumptable_start: MACRO
+; Use the declare opname you want to use,
+; either "dw", "dba", or "dab".
+if def(__far)
+ purge __far
+endc
+if _NARG == 0
+__far EQUS "dw"
+else
+__far EQUS "\1"
+endc
+ enum_start
+endm
+
+jumptable: MACRO
+if DEF(\1TableIndex)
+__enum__ = __enum__ + 1
+else
+ enum \1TableIndex
+endc
+ __far \1
+endm