Use more assertions to ensure correct code and data
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user