ref: 2955e28a42e5bc90363f9466a4ba9d2c2ad33454
parent: b6793b65df8472aed4cd58cf05e86c399dd0c3ea
author: yenatch <[email protected]>
date: Fri Jul 18 01:33:27 EDT 2014
Add address labels used by Decompress.
--- a/home/decompress.asm
+++ b/home/decompress.asm
@@ -1,10 +1,10 @@
FarDecompress:: ; b40
; Decompress graphics data from a:hl to de.
- ld [$c2c4], a
+ ld [wLZBank], a
ld a, [hROMBank]
push af
- ld a, [$c2c4]
+ ld a, [wLZBank]
rst Bankswitch
call Decompress
@@ -75,9 +75,9 @@
; Save the output address
; for rewrite commands.
ld a, e
- ld [$c2c2], a
+ ld [wLZAddress], a
ld a, d
- ld [$c2c2 + 1], a
+ ld [wLZAddress + 1], a
.Main
ld a, [hl]
@@ -164,16 +164,16 @@
; Write the same byte for bc bytes.
ld a, [hli]
-.iterloop
+.iloop
dec c
- jr nz, .iternext
+ jr nz, .inext
dec b
jp z, .Main
-.iternext
+.inext
ld [de], a
inc de
- jr .iterloop
+ jr .iloop
.Alt
@@ -249,10 +249,10 @@
ld l, [hl]
ld h, a
; add to starting output address
- ld a, [$c2c2]
+ ld a, [wLZAddress]
add l
ld l, a
- ld a, [$c2c3]
+ ld a, [wLZAddress + 1]
adc h
ld h, a
@@ -272,6 +272,7 @@
; However, lengths longer than 768
; would be interpreted as LZ_END.
+; More practically, LZ_LONG is not recursive.
; For now, it defaults to LZ_REPEAT.
@@ -306,8 +307,10 @@
rl b
dec c
jr nz, .floop
+
ld a, b
pop bc
+
ld [de], a
inc de
jr .Flip
--- a/wram.asm
+++ b/wram.asm
@@ -250,7 +250,13 @@
wMapMusic:: ; c2c0
ds 1
-SECTION "auto",WRAM0[$c2c7]
+ ds 1
+
+wLZAddress:: dw ; c2c2
+wLZBank:: db ; c2c4
+
+ ds 2
+
InputType:: ; c2c7
ds 1
AutoInputAddress:: ; c2c8
@@ -260,7 +266,8 @@
AutoInputLength:: ; c2cb
ds 1
-SECTION "linkbattle",WRAM0[$c2dc]
+ ds 16
+
InLinkBattle:: ; c2dc
; 0 not in link battle
; 1 link battle
@@ -267,7 +274,6 @@
; 4 mobile battle
ds 1
-SECTION "scriptengine",WRAM0[$c2dd]
ScriptVar:: ; c2dd
ds 1