diff options
-rw-r--r-- | home/decompress.asm | 23 | ||||
-rw-r--r-- | wram.asm | 12 |
2 files changed, 22 insertions, 13 deletions
diff --git a/home/decompress.asm b/home/decompress.asm index 15dab48f8..b98be0fe8 100644 --- 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 @@ LZ_LONG_HI EQU %00000011 ; 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 @@ LZ_LONG_HI EQU %00000011 ; 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 @@ LZ_LONG_HI EQU %00000011 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 @@ LZ_LONG_HI EQU %00000011 ; 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 @@ LZ_LONG_HI EQU %00000011 rl b dec c jr nz, .floop + ld a, b pop bc + ld [de], a inc de jr .Flip @@ -250,7 +250,13 @@ CurSFX:: ; c2bf 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,14 +266,14 @@ AutoInputBank:: ; c2ca AutoInputLength:: ; c2cb ds 1 -SECTION "linkbattle",WRAM0[$c2dc] + ds 16 + InLinkBattle:: ; c2dc ; 0 not in link battle ; 1 link battle ; 4 mobile battle ds 1 -SECTION "scriptengine",WRAM0[$c2dd] ScriptVar:: ; c2dd ds 1 |