diff options
author | yenatch <yenatch@gmail.com> | 2014-05-26 14:04:56 -0700 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2014-05-26 22:04:39 -0700 |
commit | 40c17c906b2b3f65b3b04b1933b90238a7ac5566 (patch) | |
tree | 6de26c959808d5a792b692f2300c33557c1dbfab /engine/predefs.asm | |
parent | 52ba96f5f4ec53450a0ff6257ea1040d09b7e537 (diff) |
Remove most static wram addresses. Use labels instead.
For unknown addresses, use "w<address>".
Label overleads are still an issue.
Diffstat (limited to 'engine/predefs.asm')
-rwxr-xr-x | engine/predefs.asm | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/engine/predefs.asm b/engine/predefs.asm index a3591421..2f4e68df 100755 --- a/engine/predefs.asm +++ b/engine/predefs.asm @@ -1,25 +1,20 @@ -GetPredefPointer: ; 4fe49 (13:7e49) -; stores hl in $CC4F,$CC50 -; stores de in $CC51,$CC52 -; stores bc in $CC53,$CC54 -; grabs a byte "n" from $CC4E, -; and gets the nth (3-byte) pointer in PredefPointers -; stores the bank of said pointer in [$D0B7] -; stores the pointer in hl and returns - ; ld $CC4F,hl +GetPredefPointer: +; Store the contents of the register +; pairs (hl, de, bc) at wPredefRegisters. +; Then put the bank and address of predef +; wPredefID in [wPredefBank] and hl. + ld a,h - ld [$CC4F],a + ld [wPredefRegisters],a ld a,l - ld [$CC50],a + ld [wPredefRegisters + 1],a - ; ld $CC51,de - ld hl,$CC51 + ld hl,wPredefRegisters + 2 ld a,d ld [hli],a ld a,e ld [hli],a - ; ld $CC53,bc ld a,b ld [hli],a ld [hl],c @@ -27,11 +22,10 @@ GetPredefPointer: ; 4fe49 (13:7e49) ld hl,PredefPointers ld de,0 - ; de = 3 * [$CC4E] - ld a,[$CC4E] + ld a,[wPredefID] ld e,a - add a,a - add a,e + add a + add e ld e,a jr nc,.next inc d @@ -43,7 +37,7 @@ GetPredefPointer: ; 4fe49 (13:7e49) ; get bank of predef routine ld a,[de] - ld [$D0B7],a + ld [wPredefBank],a ; get pointer inc de |