gb-tarot/CopyRange.inc

46 lines
560 B
PHP

CopyRange:
; hl is source
; de is destination
; bc is length to copy
ld a, b
or a, c
ret z
.loop
ld a, [hl+]
ld [de], a
inc de
dec bc
ld a, b
or a, c ; check if bc is zero
jr nz, .loop
ret
CopyRangeBy8s:
; hl is source
; de is destination
; bc is length to copy
ld a, b
or a, c
ret z
.loop
rept 8
ld a, [hl+]
ld [de], a
inc de
dec bc
endr
ld a, b
or a, c ; check if bc is zero
jr nz, .loop
ret
CopyOneTileData:
di
rept 16
ld a, [hl+]
ld [de], a
inc de
endr
reti