From 9c06176db55b3c95a2d526f62de83f0893439d3a Mon Sep 17 00:00:00 2001 From: luckytyphlosion Date: Mon, 11 May 2015 16:22:44 -0400 Subject: Update copy2.asm --- home/copy2.asm | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/home/copy2.asm b/home/copy2.asm index 5f66fec8..ad863788 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -37,26 +37,38 @@ FarCopyData3:: FarCopyDataDouble:: ; Expand bc bytes of 1bpp image data -; from a:hl to 2bpp data at de. - ld [$ff8b],a +; from a:de to 2bpp data at hl. + ld [wd122+1],a ld a,[H_LOADEDROMBANK] push af - ld a,[$ff8b] - ld [H_LOADEDROMBANK],a - ld [MBC1RomBank],a -.loop - ld a,[hli] - ld [de],a + ld a,[wd122+1] + call BankswitchCommon + ld a,h ; swap hl and de + ld h,d + ld d,a + ld a,l + ld l,e + ld e,a + ld a,b + and a + jr z,.lessthan$100bytes + ld a,c + and a ; multiple of $100 + jr z, .expandloop ; if so, do not increment b because the first instance of dec c results in underflow +.lessthan$100bytes + inc b +.expandloop + ld a,[de] inc de - ld [de],a + ld [hli],a + ld [hli],a inc de - dec bc - ld a,c - or b - jr nz,.loop + dec c + jr nz, .expandloop + dec b + jr nz, .expandloop pop af - ld [H_LOADEDROMBANK],a - ld [MBC1RomBank],a + call BankswitchCommon ret CopyVideoDataLCDEnabled:: -- cgit v1.2.3