|
@ -8,18 +8,18 @@ wait_for_vblank:: |
|
|
jr nz, wait_for_vblank |
|
|
jr nz, wait_for_vblank |
|
|
ret |
|
|
ret |
|
|
|
|
|
|
|
|
; Copy data between two regions |
|
|
|
|
|
|
|
|
; Copy data between two regions (takes 40*N+12 cycles) |
|
|
; @param bc Pointer to the destination region |
|
|
; @param bc Pointer to the destination region |
|
|
; @param hl Pointer to the source region |
|
|
; @param hl Pointer to the source region |
|
|
; @param d Size (in bytes) to copy. Must be >0 |
|
|
; @param d Size (in bytes) to copy. Must be >0 |
|
|
; @destroy a, b, c, d, h, l |
|
|
; @destroy a, b, c, d, h, l |
|
|
memcpy:: |
|
|
memcpy:: |
|
|
ld a, [hli] |
|
|
|
|
|
ld [bc], a |
|
|
|
|
|
inc bc |
|
|
|
|
|
dec d |
|
|
|
|
|
jr nz, memcpy |
|
|
|
|
|
ret |
|
|
|
|
|
|
|
|
ld a, [hli] ; 8 |
|
|
|
|
|
ld [bc], a ; 8 |
|
|
|
|
|
inc bc ; 8 |
|
|
|
|
|
dec d ; 4 |
|
|
|
|
|
jr nz, memcpy ; 12/8 |
|
|
|
|
|
ret ; 16 |
|
|
|
|
|
|
|
|
; Fill a memory region with a value |
|
|
; Fill a memory region with a value |
|
|
; @param hl Pointer to the destination region |
|
|
; @param hl Pointer to the destination region |
|
|