pokecrystal/macros/coords.asm

52 lines
833 B
NASM
Raw Normal View History

bccoord EQUS "coord bc,"
decoord EQUS "coord de,"
hlcoord EQUS "coord hl,"
2017-12-14 05:36:24 +00:00
coord: MACRO
; register, x, y[, origin]
if _NARG < 4
ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2)
else
ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
endc
2017-12-28 21:31:16 +00:00
ENDM
2017-12-14 05:36:24 +00:00
dwcoord: MACRO
rept _NARG / 2
dw TileMap + SCREEN_WIDTH * (\2) + (\1)
shift
shift
endr
2017-12-28 21:31:16 +00:00
ENDM
2017-12-14 05:36:24 +00:00
ldcoord_a: MACRO
if _NARG < 3
ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a
else
ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
endc
2017-12-28 21:31:16 +00:00
ENDM
2017-12-14 05:36:24 +00:00
lda_coord: MACRO
if _NARG < 3
ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)]
else
ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
endc
2017-12-28 21:31:16 +00:00
ENDM
2017-12-14 05:36:24 +00:00
bgrows EQUS "* $20" ; SCREEN_WIDTH
hlbgcoord EQUS "bgcoord hl,"
debgcoord EQUS "bgcoord de,"
bcbgcoord EQUS "bgcoord bc,"
bgcoord: MACRO
IF _NARG >= 4
ld \1, \3 bgrows + \2 + \4
ELSE
2017-12-28 12:32:33 +00:00
ld \1, \3 bgrows + \2 + vBGMap0
2017-12-14 05:36:24 +00:00
ENDC
ENDM