diff options
Diffstat (limited to 'home/copy.asm')
-rw-r--r-- | home/copy.asm | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/home/copy.asm b/home/copy.asm index d2228405..b239d951 100644 --- a/home/copy.asm +++ b/home/copy.asm @@ -1,7 +1,7 @@ FarCopyData:: ; Copy bc bytes from a:hl to de. ld [wFarCopyDataSavedROMBank], a - ld a, [H_LOADEDROMBANK] + ldh a, [hLoadedROMBank] push af ld a, [wFarCopyDataSavedROMBank] call BankswitchCommon @@ -12,17 +12,17 @@ FarCopyData:: CopyData:: ; Copy bc bytes from hl to de. - ld a,b + ld a, b and a jr z, .copybytes - ld a,c + ld a, c and a ; is lower byte 0 jr z, .loop inc b ; if not, increment b as there are <$100 bytes to copy .loop call .copybytes dec b - jr nz,.loop + jr nz, .loop ret .copybytes @@ -34,41 +34,41 @@ CopyData:: ret CopyVideoDataAlternate:: - ld a, [rLCDC] - bit 7,a ; LCD enabled? + ldh a, [rLCDC] + bit 7, a ; LCD enabled? jp nz, CopyVideoData ; if yes, then copy video data push hl - ld h,d - ld l,e + ld h, d + ld l, e pop de - ld a,b ; save bank + ld a, b ; save bank push af swap c - ld a,$f + ld a, $f and c - ld b,a - ld a,$f0 + ld b, a + ld a, $f0 and c - ld c,a + ld c, a pop af jp FarCopyData CopyVideoDataDoubleAlternate:: - ld a, [rLCDC] - bit 7,a ; LCD enabled? + ldh a, [rLCDC] + bit 7, a ; LCD enabled? jp nz, CopyVideoDataDouble ; if yes, then copy video data push de - ld d,h - ld e,l - ld a,b + ld d, h + ld e, l + ld a, b push af ; save bank to switch to - ld h,$0 - ld l,c - add hl,hl ; get raw length of bytes to copy - add hl,hl - add hl,hl - ld b,h - ld c,l + ld h, $0 + ld l, c + add hl, hl ; get raw length of bytes to copy + add hl, hl + add hl, hl + ld b, h + ld c, l pop af pop hl jp FarCopyDataDouble |