diff options
author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2018-08-25 22:23:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 22:23:45 -0400 |
commit | 3eacab563d0e1ab5557c2443556a7a5e58d14cad (patch) | |
tree | 3d747166409fdc94f0fd1aa760693a7ee5bd2156 /home/copy2.asm | |
parent | 89681d231611938a791f4256e602c88c2f9aa3e1 (diff) | |
parent | b2adcd6d6ff91efc764a6ecc65147be7b9cda9e8 (diff) |
Merge pull request #555 from Rangi42/ldh
Use real labels for HRAM instead of constants, and the ldh instruction
Diffstat (limited to 'home/copy2.asm')
-rw-r--r-- | home/copy2.asm | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/home/copy2.asm b/home/copy2.asm index fdf55b2e3..018986cf2 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -54,31 +54,31 @@ ByteFill:: GetFarByte:: ; retrieve a single byte from a:hl, and return it in a. ; bankswitch to new bank - ld [hBuffer], a - ld a, [hROMBank] + ldh [hBuffer], a + ldh a, [hROMBank] push af - ld a, [hBuffer] + ldh a, [hBuffer] rst Bankswitch ; get byte from new bank ld a, [hl] - ld [hBuffer], a + ldh [hBuffer], a ; bankswitch to previous bank pop af rst Bankswitch ; return retrieved value in a - ld a, [hBuffer] + ldh a, [hBuffer] ret GetFarHalfword:: ; retrieve a halfword from a:hl, and return it in hl. ; bankswitch to new bank - ld [hBuffer], a - ld a, [hROMBank] + ldh [hBuffer], a + ldh a, [hROMBank] push af - ld a, [hBuffer] + ldh a, [hBuffer] rst Bankswitch ; get halfword from new bank, put it in hl @@ -92,40 +92,40 @@ GetFarHalfword:: ret FarCopyWRAM:: - ld [hBuffer], a - ld a, [rSVBK] + ldh [hBuffer], a + ldh a, [rSVBK] push af - ld a, [hBuffer] - ld [rSVBK], a + ldh a, [hBuffer] + ldh [rSVBK], a call CopyBytes pop af - ld [rSVBK], a + ldh [rSVBK], a ret GetFarWRAMByte:: - ld [hBuffer], a - ld a, [rSVBK] + ldh [hBuffer], a + ldh a, [rSVBK] push af - ld a, [hBuffer] - ld [rSVBK], a + ldh a, [hBuffer] + ldh [rSVBK], a ld a, [hl] - ld [hBuffer], a + ldh [hBuffer], a pop af - ld [rSVBK], a - ld a, [hBuffer] + ldh [rSVBK], a + ldh a, [hBuffer] ret GetFarWRAMWord:: - ld [hBuffer], a - ld a, [rSVBK] + ldh [hBuffer], a + ldh a, [rSVBK] push af - ld a, [hBuffer] - ld [rSVBK], a + ldh a, [hBuffer] + ldh [rSVBK], a ld a, [hli] ld h, [hl] ld l, a pop af - ld [rSVBK], a + ldh [rSVBK], a ret |