shithub: pokered

ref: b2369b0961add3a7b7475870df4e46566903dd8b
dir: /macros/code.asm/

View raw version
; Syntactic sugar macros

lb: MACRO ; r, hi, lo
	ld \1, ((\2) & $ff) << 8 + ((\3) & $ff)
ENDM

ldPal: MACRO
	ld \1, \2 << 6 | \3 << 4 | \4 << 2 | \5
ENDM

; Design patterns

dict: MACRO
if \1 == 0
	and a
else
	cp \1
endc
	jp z, \2
ENDM