summaryrefslogtreecommitdiff
path: root/macros/gfx.asm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/gfx.asm')
-rw-r--r--macros/gfx.asm8
1 files changed, 8 insertions, 0 deletions
diff --git a/macros/gfx.asm b/macros/gfx.asm
index 2c67cfc8..b42b1440 100644
--- a/macros/gfx.asm
+++ b/macros/gfx.asm
@@ -1,5 +1,13 @@
+assert_valid_rgb: MACRO
+rept _NARG
+ assert 0 <= (\1) && (\1) <= 31, "RGB channel must be 0-31"
+ shift
+endr
+ENDM
+
RGB: MACRO
rept _NARG / 3
+ assert_valid_rgb \1, \2, \3
dw palred (\1) + palgreen (\2) + palblue (\3)
shift 3
endr