ref: 849595e53717eaf4cda658b02d8f7d4ed6f7d293
parent: 8e033210694533bc1233a851d6914e1f0cb90232
author: yenatch <yenatch@gmail.com>
date: Tue Feb 10 09:16:31 EST 2015
Blindly use wram labels for everything except mobile, part 2.
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -82,20 +82,20 @@
push de
push bc
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
pop bc
pop de
ld a, c
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, b
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, e
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, d
- ld [$cdaf], a
- ld hl, $cda9
+ ld [wcda9 + 6], a
+ ld hl, wcda9
call Function9809
ld hl, BlkPacket_9a86
call Function9809
@@ -112,8 +112,8 @@
; 8ade
Function8ade: ; 8ade
- ld hl, $cd9b
- ld a, [$cda9]
+ ld hl, wcd9b
+ ld a, [wcda9]
ld e, a
ld d, $0
add hl, de
@@ -130,9 +130,9 @@
.asm_8af7
push de
- ld hl, $cdb3
+ ld hl, wcda9 + 10
ld bc, $0006
- ld a, [$cda9]
+ ld a, [wcda9]
call AddNTimes
pop de
ld [hl], e
@@ -143,7 +143,7 @@
call CheckCGB
ret z
ld hl, Palette8b2f
- ld de, $d000
+ ld de, Unkn1Pals
ld bc, $0008
ld a, $5
call FarCopyWRAM
@@ -225,20 +225,20 @@
ld a, c
push af
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
pop af
call Function9775
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
- ld hl, $cda9
+ ld [wcda9 + 6], a
+ ld hl, wcda9
jp Function9809
.asm_8bb2
@@ -311,7 +311,7 @@
ld b, $0
add hl, bc
ld bc, $0604
- ld a, [$c705]
+ ld a, [EnemySafeguardCount]
and $3
call Function9663
call Function323d
@@ -342,7 +342,7 @@
; 8c43
Function8c43: ; 8c43
- ld a, [$d10a]
+ ld a, [wd10a]
and a
jr z, .asm_8c52
cp $1
@@ -352,11 +352,11 @@
ret
.asm_8c52
- ld de, $d092
+ ld de, BGPals + $10 + 2
jr .asm_8c5a
.asm_8c57
- ld de, $d09a
+ ld de, BGPals + $18 + 2
.asm_8c5a
ld l, c
@@ -375,7 +375,7 @@
.asm_8c70
ld e, c
inc e
- ld hl, $cdf8
+ hlcoord 11, 1, AttrMap
ld bc, $0028
ld a, [CurPartyMon]
.asm_8c7b
@@ -406,10 +406,10 @@
ld [rSVBK], a
ld a, [hli]
ld [Unkn1Pals], a
- ld [$d010], a
+ ld [wd010], a
ld a, [hl]
- ld [$d001], a
- ld [$d011], a
+ ld [wd001], a
+ ld [wd011], a
pop af
ld [rSVBK], a
call Function96a4
@@ -429,7 +429,7 @@
jr nz, .asm_8cf0
push hl
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
pop hl
@@ -436,14 +436,14 @@
inc hl
inc hl
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hli]
- ld [$cdaf], a
- ld hl, $cda9
+ ld [wcda9 + 6], a
+ ld hl, wcda9
call Function9809
ld hl, BlkPacket_9a86
call Function9809
@@ -450,7 +450,7 @@
ret
.asm_8cf0
- ld de, $d000
+ ld de, Unkn1Pals
ld bc, $0008
ld a, $5
call FarCopyWRAM
@@ -536,7 +536,7 @@
Function9610: ; 9610
- ld de, $d000
+ ld de, Unkn1Pals
ld c, $4
Function9615: ; 9615
@@ -635,7 +635,7 @@
push af
ld a, $5
ld [rSVBK], a
- ld hl, $d000
+ ld hl, Unkn1Pals
ld c, $8
.asm_9683
ld a, $ff
@@ -669,8 +669,8 @@
; 96a4
Function96a4: ; 96a4
- ld hl, $d000
- ld de, $d080
+ ld hl, Unkn1Pals
+ ld de, BGPals
ld bc, $0080
ld a, $5
call FarCopyWRAM
@@ -722,8 +722,8 @@
; 96f3
Function96f3: ; 96f3
- ld hl, $cd9b
- ld a, [$cda9]
+ ld hl, wcd9b
+ ld a, [wcda9]
ld e, a
ld d, $0
add hl, de
@@ -732,9 +732,9 @@
ld a, [de]
inc a
ld e, a
- ld hl, $ce0c
+ hlcoord 11, 2, AttrMap
ld bc, $0028
- ld a, [$cda9]
+ ld a, [wcda9]
.asm_970b
and a
jr z, .asm_9712
@@ -784,7 +784,7 @@
Function974b: ; 974b
and a
jp nz, Function97f9
- ld a, [$d45b]
+ ld a, [wd45b]
bit 2, a
jr nz, .asm_9760
ld a, [PlayerGender]
@@ -835,7 +835,7 @@
dec c
jr nz, .asm_9787
ld hl, Palettes_979c
- ld de, $d050
+ ld de, wd050
ld bc, $0010
ld a, $5
call FarCopyWRAM
@@ -920,13 +920,13 @@
; 9809
Function9809: ; 9809
- ld a, [$cfbe]
+ ld a, [wcfbe]
push af
set 7, a
- ld [$cfbe], a
+ ld [wcfbe], a
call Function981a
pop af
- ld [$cfbe], a
+ ld [wcfbe], a
ret
; 981a
@@ -976,10 +976,10 @@
call CheckCGB
ret nz
di
- ld a, [$cfbe]
+ ld a, [wcfbe]
push af
set 7, a
- ld [$cfbe], a
+ ld [wcfbe], a
xor a
ld [rJOYP], a
ld [hSGB], a
@@ -999,7 +999,7 @@
.asm_988a
pop af
- ld [$cfbe], a
+ ld [wcfbe], a
ei
ret
; 9890
@@ -1040,9 +1040,9 @@
push af
ld a, $5
ld [rSVBK], a
- ld hl, $d000
+ ld hl, Unkn1Pals
call Function98df
- ld hl, $d080
+ ld hl, BGPals
call Function98df
pop af
ld [rSVBK], a
@@ -1942,7 +1942,7 @@
Functionb1de: ; b1de
callba Function494ac
jr c, .asm_b230
- ld a, [$d19a]
+ ld a, [wd19a]
and 7
ld e, a
ld d, 0
@@ -2006,7 +2006,7 @@
ld bc, $0040
ld a, $5
call FarCopyWRAM
- ld a, [$d19a]
+ ld a, [wd19a]
cp 1
jr z, .asm_b253
cp 2
@@ -2031,7 +2031,7 @@
inc hl
.asm_b26d
- ld de, $d032
+ ld de, wd032
ld bc, $0004
ld a, $5
call FarCopyWRAM
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -124,7 +124,7 @@
jr z, .asm_10984f
ld a, $40
.asm_10984f
- ld [$cf63], a
+ ld [wcf63], a
ld a, [rSVBK]
push af
@@ -135,7 +135,7 @@
call ClearTileMap
call ClearSprites
- ld hl, $ca00
+ ld hl, wca00
ld c, $80
ld de, $ff00
@@ -163,9 +163,9 @@
call Request2bpp
ld a, $ff
- ld [$cf64], a
+ ld [wcf64], a
xor a
- ld [$cf65], a
+ ld [wcf65], a
call Function109bca
ld e, l
@@ -176,7 +176,7 @@
call Function109a95
xor a
- ld [$cf66], a
+ ld [wcf66], a
ld hl, LYOverrides
ld bc, $100
@@ -197,7 +197,7 @@
xor a
ld [hBGMapMode], a
ld [CreditsPos], a
- ld [$cd21], a
+ ld [wcd21], a
ld [CreditsTimer], a
.asm_1098de
@@ -225,7 +225,7 @@
ld a, [hJoypadDown]
and $1
ret z
- ld a, [$cf63]
+ ld a, [wcf63]
bit 7, a
ret
; 109908
@@ -234,7 +234,7 @@
ld a, [hJoypadDown]
and $2
ret z
- ld a, [$cf63]
+ ld a, [wcf63]
bit 6, a
ret z
ld hl, CreditsPos
@@ -255,7 +255,7 @@
; 109926
Function109926: ; 109926
- ld a, [$cf63]
+ ld a, [wcf63]
and $f
ld e, a
ld d, 0
@@ -286,12 +286,12 @@
Function109951: ; 109951 (42:5951)
- ld hl, $cf63
+ ld hl, wcf63
inc [hl]
ret
Function109956: ; 109956 (42:5956)
- ld hl, $cf63
+ ld hl, wcf63
ld a, [hl]
and $f0
ld [hl], a
@@ -305,13 +305,13 @@
Function109964: ; 109964 (42:5964)
call Function109bca
ld a, l
- ld [$cf68], a
+ ld [Requested2bppSource], a
ld a, h
- ld [$cf69], a
+ ld [Requested2bppSource + 1], a
ld a, $0
- ld [$cf6a], a
+ ld [Requested2bppDest], a
ld a, $90
- ld [$cf6b], a
+ ld [Requested2bppDest + 1], a
jr Function10997b
Function10997b: ; 10997b (42:597b)
@@ -318,7 +318,7 @@
xor a
ld [hBGMapMode], a ; $ff00+$d4
ld a, $8
- ld [$cf67], a
+ ld [Requested2bpp], a
jp Function109951
Function109986: ; 109986 (42:5986)
@@ -325,13 +325,13 @@
ld a, [rLY] ; $ff00+$44
cp $30
jr c, Function109986
- ld a, [$cf66]
+ ld a, [wcf66]
dec a
dec a
- ld [$cf66], a
- ld hl, $d11f
+ ld [wcf66], a
+ ld hl, LYOverrides + $1f
call Function1099a3
- ld hl, $d187
+ ld hl, LYOverrides + $87
call Function1099a3
jp Function109951
@@ -346,7 +346,7 @@
ParseCredits: ; 1099aa
- ld hl, $cf63
+ ld hl, wcf63
bit 7, [hl]
jp nz, .done
@@ -440,9 +440,9 @@
.scene
; Update the scene number and corresponding palette.
call .get
- ld [$cf65], a ; scene
+ ld [wcf65], a ; scene
xor a
- ld [$cf64], a ; frame
+ ld [wcf64], a ; frame
call GetCreditsPalette
call Function32f9 ; update hw pal registers
jr .loop
@@ -450,7 +450,7 @@
.clear
; Clear the banner.
ld a, $ff
- ld [$cf64], a ; frame
+ ld [wcf64], a ; frame
jr .loop
.music
@@ -485,14 +485,14 @@
.end
; Stop execution.
- ld hl, $cf63
+ ld hl, wcf63
set 7, [hl]
ld a, $20
- ld [$c2a7], a
- ld a, $5c
- ld [$c2a9], a
- ld a, $00
- ld [$c2aa], a
+ ld [MusicFade], a
+ ld a, MUSIC_POST_CREDITS % $100
+ ld [MusicFadeID], a
+ ld a, MUSIC_POST_CREDITS / $100
+ ld [MusicFadeIDHi], a
ret
.get
@@ -524,7 +524,7 @@
ld a, $c
ld [hBGMapAddress], a ; $ff00+$d6
ld a, $28
- ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
+ ld hl, TileMap
ld bc, $168
call ByteFill
ld a, $7f
@@ -537,19 +537,19 @@
hlcoord 0, 17
ld a, $20
call Function109b1d
- ld hl, AttrMap ; $cdd9
+ ld hl, AttrMap
ld bc, $50
xor a
call ByteFill
- ld hl, $ce29
+ hlcoord 0, 4, AttrMap
ld bc, $14
ld a, $1
call ByteFill
- ld hl, $ce3d
+ hlcoord 0, 5, AttrMap
ld bc, $f0
ld a, $2
call ByteFill
- ld hl, $cf2d
+ hlcoord 0, 17, AttrMap
ld bc, $14
ld a, $1
call ByteFill
@@ -557,7 +557,7 @@
xor a
ld [hBGMapMode], a ; $ff00+$d4
ld [hBGMapAddress], a ; $ff00+$d6
- ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
+ ld hl, TileMap
call Function109aff
call Function3200
ret
@@ -617,7 +617,7 @@
.GetPalAddress
; Each set of palette data is 24 bytes long.
- ld a, [$cf65] ; scene
+ ld a, [wcf65] ; scene
and 3
add a
add a ; * 8
@@ -635,10 +635,10 @@
push af
push hl
- add $d000 % $100
+ add Unkn1Pals % $100
ld e, a
ld a, 0
- adc $d000 / $100
+ adc Unkn1Pals / $100
ld d, a
ld bc, 24
call CopyBytes
@@ -645,10 +645,10 @@
pop hl
pop af
- add $d080 % $100
+ add BGPals % $100
ld e, a
ld a, 0
- adc $d080 / $100
+ adc BGPals / $100
ld d, a
ld bc, 24
call CopyBytes
@@ -723,7 +723,7 @@
; 109bca
Function109bca: ; 109bca (42:5bca)
- ld hl, $cf64
+ ld hl, wcf64
ld a, [hl]
cp $ff
jr z, .asm_109bed
@@ -733,7 +733,7 @@
inc a
and 3
ld [hl], a
- ld a, [$cf65]
+ ld a, [wcf65]
and 3
add a
add a
@@ -749,7 +749,7 @@
ret
.asm_109bed
- ld hl, $ca00
+ ld hl, wca00
ret
; 109bf1 (42:5bf1)
--- a/engine/engine_flags.asm
+++ b/engine/engine_flags.asm
@@ -3,43 +3,43 @@
; location, bit
; pokegear
- dwb $d957, %00000010 ; radio card ; $0
- dwb $d957, %00000001 ; map card
- dwb $d957, %00000100 ; phone card
- dwb $d957, %00001000 ; expn card
- dwb $d957, %10000000 ; on/off
-
+ dwb wd957, %00000010 ; radio card ; $0
+ dwb wd957, %00000001 ; map card
+ dwb wd957, %00000100 ; phone card
+ dwb wd957, %00001000 ; expn card
+ dwb wd957, %10000000 ; on/off
+
; wDaycareMan, %10000000 ; daycare 1 on
dwb wDaycareMan, %01000000 ; monster 1 and 2 are compatible
; wDaycareMan, %00100000 ; egg is ready
dwb wDaycareMan, %00000001 ; monster 1 in daycare
-
+
; wDaycareLady, %10000000 = daycare 2 on
dwb wDaycareLady, %00000001 ; monster 2 in daycare
-
- dwb $d854, %00000001 ; mom saving money ; $8
- dwb $d854, %10000000 ; dst
-
- dwb $dc39, %00000001
-
- dwb $d84c, %00000001 ; pokedex
- dwb $d84c, %00000010 ; unown dex
- dwb $d84c, %00001000 ; pokerus
- dwb $d84c, %00010000 ; rocket signal on ch20
- dwb $d84c, %01000000 ; credits skip
- dwb $d84c, %10000000 ; bug contest on ; $10
- dwb $d84d, %00000100 ; bug contest timer
- dwb $d84d, %00000010 ; rockets in radio tower
- dwb $d84d, %00000001 ; bike shop call enabled (1024 bike steps reqd)
- dwb $d84d, %00010000
- dwb $d84d, %00100000 ; give pokerus; berry -> berry juice when trading?
- dwb $d84d, %01000000
- dwb $d84d, %10000000 ; rockets in mahogany
-
- dwb $dbf5, %00000001 ; strength active ; $18
- dwb $dbf5, %00000010 ; always on bike (cant surf)
- dwb $dbf5, %00000100 ; downhill (cycling road)
-
+
+ dwb wMomSavingMoney, %00000001 ; mom saving money ; $8
+ dwb wMomSavingMoney, %10000000 ; dst
+
+ dwb wdc39, %00000001
+
+ dwb StatusFlags, %00000001 ; pokedex
+ dwb StatusFlags, %00000010 ; unown dex
+ dwb StatusFlags, %00001000 ; pokerus
+ dwb StatusFlags, %00010000 ; rocket signal on ch20
+ dwb StatusFlags, %01000000 ; credits skip
+ dwb StatusFlags, %10000000 ; bug contest on ; $10
+ dwb StatusFlags2, %00000100 ; bug contest timer
+ dwb StatusFlags2, %00000010 ; rockets in radio tower
+ dwb StatusFlags2, %00000001 ; bike shop call enabled (1024 bike steps reqd)
+ dwb StatusFlags2, %00010000
+ dwb StatusFlags2, %00100000 ; give pokerus; berry -> berry juice when trading?
+ dwb StatusFlags2, %01000000
+ dwb StatusFlags2, %10000000 ; rockets in mahogany
+
+ dwb BikeFlags, %00000001 ; strength active ; $18
+ dwb BikeFlags, %00000010 ; always on bike (cant surf)
+ dwb BikeFlags, %00000100 ; downhill (cycling road)
+
dwb JohtoBadges, %00000001 ; zephyrbadge
dwb JohtoBadges, %00000010 ; hivebadge
dwb JohtoBadges, %00000100 ; plainbadge
@@ -48,7 +48,7 @@
dwb JohtoBadges, %00100000 ; stormbadge ; $20
dwb JohtoBadges, %01000000 ; glacierbadge
dwb JohtoBadges, %10000000 ; risingbadge
-
+
dwb KantoBadges, %00000001 ; boulderbadge
dwb KantoBadges, %00000010 ; cascadebadge
dwb KantoBadges, %00000100 ; thunderbadge
@@ -57,7 +57,7 @@
dwb KantoBadges, %00100000 ; marshbadge ; $28
dwb KantoBadges, %01000000 ; volcanobadge
dwb KantoBadges, %10000000 ; earthbadge
-
+
; unown sets
dwb UnlockedUnowns, %00000001 ; 1
dwb UnlockedUnowns, %00000010 ; 2
@@ -67,7 +67,7 @@
dwb UnlockedUnowns, %00100000 ; 6 ; $30
dwb UnlockedUnowns, %01000000 ; 7
dwb UnlockedUnowns, %10000000 ; 8
-
+
; fly
dwb VisitedSpawns, %00000001 ; your house
dwb VisitedSpawns, %00000010 ; viridian pokecenter
@@ -96,103 +96,103 @@
dwb VisitedSpawns + 3, %00000010 ; blackthorn
dwb VisitedSpawns + 3, %00000100 ; silver cave
dwb VisitedSpawns + 3, %00010000 ; unused
-
- dwb $dc9d, %00000001 ; lucky number show
- dwb $d84d, %00001000
-
- dwb $dc1e, %00000001 ; kurt making balls ; $50
- dwb $dc1e, %00000010
- dwb $dc1e, %00000100 ; special wilddata?
- dwb $dc1e, %00001000 ; time capsule (24h wait)
- dwb $dc1e, %00010000 ; all fruit trees
- dwb $dc1e, %00100000 ; shuckle given
- dwb $dc1e, %01000000 ; goldenrod underground merchant closed
- dwb $dc1e, %10000000 ; fought in trainer hall today
-
- dwb $dc1f, %00000001 ; mt moon square clefairy ; $58
- dwb $dc1f, %00000010 ; union cave lapras
- dwb $dc1f, %00000100 ; goldenrod underground haircut used
- dwb $dc1f, %00001000 ; goldenrod mall happiness event floor05 person07
- dwb $dc1f, %00010000 ; tea in blues house
- dwb $dc1f, %00100000 ; indigo plateau rival fight
- dwb $dc1f, %01000000
- dwb $dc1f, %10000000
-
- dwb $dc20, %00000001 ; $60
- dwb $dc20, %00000010 ; goldenrod dept store sale is on
-
- dwb $cfbc, %10000000 ; $62
-
+
+ dwb wdc9d, %00000001 ; lucky number show
+ dwb StatusFlags2, %00001000
+
+ dwb wdc1e, %00000001 ; kurt making balls ; $50
+ dwb wdc1e, %00000010
+ dwb wdc1e, %00000100 ; special wilddata?
+ dwb wdc1e, %00001000 ; time capsule (24h wait)
+ dwb wdc1e, %00010000 ; all fruit trees
+ dwb wdc1e, %00100000 ; shuckle given
+ dwb wdc1e, %01000000 ; goldenrod underground merchant closed
+ dwb wdc1e, %10000000 ; fought in trainer hall today
+
+ dwb wdc1f, %00000001 ; mt moon square clefairy ; $58
+ dwb wdc1f, %00000010 ; union cave lapras
+ dwb wdc1f, %00000100 ; goldenrod underground haircut used
+ dwb wdc1f, %00001000 ; goldenrod mall happiness event floor05 person07
+ dwb wdc1f, %00010000 ; tea in blues house
+ dwb wdc1f, %00100000 ; indigo plateau rival fight
+ dwb wdc1f, %01000000
+ dwb wdc1f, %10000000
+
+ dwb wdc20, %00000001 ; $60
+ dwb wdc20, %00000010 ; goldenrod dept store sale is on
+
+ dwb GameTimerPause, %10000000 ; $62
+
dwb PlayerGender, %00000001 ; player is female
-
- dwb $dbf3, %00000100 ; have gs ball after kurt examined it
-
+
+ dwb wdbf3, %00000100 ; have gs ball after kurt examined it
+
; rematches
- dwb $dc4c, %00000001 ; jack
- dwb $dc4c, %00000010 ; huey
- dwb $dc4c, %00000100 ; gaven
- dwb $dc4c, %00001000 ; beth ; $68
- dwb $dc4c, %00010000 ; jose
- dwb $dc4c, %00100000 ; reena
- dwb $dc4c, %01000000 ; joey
- dwb $dc4c, %10000000 ; wade
- dwb $dc4d, %00000001 ; ralph
- dwb $dc4d, %00000010 ; liz
- dwb $dc4d, %00000100 ; anthony
- dwb $dc4d, %00001000 ; todd ; $70
- dwb $dc4d, %00010000 ; gina
- dwb $dc4d, %00100000 ; arnie
- dwb $dc4d, %01000000 ; alan
- dwb $dc4d, %10000000 ; dana
- dwb $dc4e, %00000001 ; chad
- dwb $dc4e, %00000010 ; tully
- dwb $dc4e, %00000100 ; brent
- dwb $dc4e, %00001000 ; tiffany ; $78
- dwb $dc4e, %00010000 ; vance
- dwb $dc4e, %00100000 ; wilton
- dwb $dc4e, %01000000 ; parry
- dwb $dc4e, %10000000 ; erin
-
- dwb $dc50, %00000001 ; beverly has nugget
- dwb $dc50, %00000010 ; jose has star piece
- dwb $dc50, %00000100 ; wade has item (see bittable1 $032b-e)
- dwb $dc50, %00001000 ; gina has leaf stone ; $80
- dwb $dc50, %00010000 ; alan has fire stone
- dwb $dc50, %00100000 ; liz has thunderstone
- dwb $dc50, %01000000 ; derek has nugget
- dwb $dc50, %10000000 ; tully has water stone
-
- dwb $dc51, %00000001 ; tiffany has pink bow
- dwb $dc51, %00000010 ; wilton has item (see bittable1 $032f-31)
-
- dwb $dc54, %00000001
- dwb $dc54, %00000010 ; $88
- dwb $dc54, %00000100
- dwb $dc54, %00001000
- dwb $dc54, %00010000
- dwb $dc54, %00100000
- dwb $dc54, %01000000
- dwb $dc54, %10000000
-
- dwb $dc55, %00000001
- dwb $dc55, %00000010 ; $90
- dwb $dc55, %00000100
- dwb $dc55, %00001000
- dwb $dc55, %00010000
- dwb $dc55, %00100000
- dwb $dc55, %01000000
- dwb $dc55, %10000000
-
- dwb $dc56, %00000001
- dwb $dc56, %00000010 ; $98
- dwb $dc56, %00000100
- dwb $dc56, %00001000
- dwb $dc56, %00010000
- dwb $dc56, %00100000
- dwb $dc56, %01000000
- dwb $dc56, %10000000
-
- dwb $d45b, %00000100 ; female player has been transformed into male
-
- dwb $dc20, %00000100 ; dunsparce swarm ; $a0
- dwb $dc20, %00001000 ; yanma swarm
+ dwb wdc4c, %00000001 ; jack
+ dwb wdc4c, %00000010 ; huey
+ dwb wdc4c, %00000100 ; gaven
+ dwb wdc4c, %00001000 ; beth ; $68
+ dwb wdc4c, %00010000 ; jose
+ dwb wdc4c, %00100000 ; reena
+ dwb wdc4c, %01000000 ; joey
+ dwb wdc4c, %10000000 ; wade
+ dwb wdc4c + 1, %00000001 ; ralph
+ dwb wdc4c + 1, %00000010 ; liz
+ dwb wdc4c + 1, %00000100 ; anthony
+ dwb wdc4c + 1, %00001000 ; todd ; $70
+ dwb wdc4c + 1, %00010000 ; gina
+ dwb wdc4c + 1, %00100000 ; arnie
+ dwb wdc4c + 1, %01000000 ; alan
+ dwb wdc4c + 1, %10000000 ; dana
+ dwb wdc4c + 2, %00000001 ; chad
+ dwb wdc4c + 2, %00000010 ; tully
+ dwb wdc4c + 2, %00000100 ; brent
+ dwb wdc4c + 2, %00001000 ; tiffany ; $78
+ dwb wdc4c + 2, %00010000 ; vance
+ dwb wdc4c + 2, %00100000 ; wilton
+ dwb wdc4c + 2, %01000000 ; parry
+ dwb wdc4c + 2, %10000000 ; erin
+
+ dwb wdc50, %00000001 ; beverly has nugget
+ dwb wdc50, %00000010 ; jose has star piece
+ dwb wdc50, %00000100 ; wade has item (see bittable1 $032b-e)
+ dwb wdc50, %00001000 ; gina has leaf stone ; $80
+ dwb wdc50, %00010000 ; alan has fire stone
+ dwb wdc50, %00100000 ; liz has thunderstone
+ dwb wdc50, %01000000 ; derek has nugget
+ dwb wdc50, %10000000 ; tully has water stone
+
+ dwb wdc50 + 1, %00000001 ; tiffany has pink bow
+ dwb wdc50 + 1, %00000010 ; wilton has item (see bittable1 $032f-31)
+
+ dwb wdc54, %00000001
+ dwb wdc54, %00000010 ; $88
+ dwb wdc54, %00000100
+ dwb wdc54, %00001000
+ dwb wdc54, %00010000
+ dwb wdc54, %00100000
+ dwb wdc54, %01000000
+ dwb wdc54, %10000000
+
+ dwb wdc54 + 1, %00000001
+ dwb wdc54 + 1, %00000010 ; $90
+ dwb wdc54 + 1, %00000100
+ dwb wdc54 + 1, %00001000
+ dwb wdc54 + 1, %00010000
+ dwb wdc54 + 1, %00100000
+ dwb wdc54 + 1, %01000000
+ dwb wdc54 + 1, %10000000
+
+ dwb wdc54 + 2, %00000001
+ dwb wdc54 + 2, %00000010 ; $98
+ dwb wdc54 + 2, %00000100
+ dwb wdc54 + 2, %00001000
+ dwb wdc54 + 2, %00010000
+ dwb wdc54 + 2, %00100000
+ dwb wdc54 + 2, %01000000
+ dwb wdc54 + 2, %10000000
+
+ dwb wd45b, %00000100 ; female player has been transformed into male
+
+ dwb wdc20, %00000100 ; dunsparce swarm ; $a0
+ dwb wdc20, %00001000 ; yanma swarm
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -131,8 +131,8 @@
EnterMap: ; 9673e
xor a
- ld [$d453], a
- ld [$d454], a
+ ld [wd453], a
+ ld [wd454], a
call Function968d1
callba RunMapSetupScript
call Function966cb
@@ -252,7 +252,7 @@
; 967f4
Function967f4: ; 967f4
- ld a, [$d150]
+ ld a, [wd150]
bit 5, a
jr z, .asm_96806
bit 6, a
@@ -273,7 +273,7 @@
; 96812
Function96812: ; 96812
- ld hl, $d150
+ ld hl, wd150
bit 6, [hl]
ret z
@@ -328,7 +328,7 @@
jr z, .asm_96865
xor a
- ld [$c2da], a
+ ld [wc2da], a
.asm_96865
scf
@@ -420,7 +420,7 @@
Function968c7:: ; 968c7
- ld hl, $d452
+ ld hl, wd452
ld a, [hl]
and a
ret z
@@ -432,7 +432,7 @@
Function968d1: ; 968d1
ld a, 5
- ld [$d452], a
+ ld [wd452], a
ret
; 968d7
@@ -441,11 +441,11 @@
; 968d8
Function968d8: ; 968d8
- ld a, [$d452]
+ ld a, [wd452]
cp 2
ret nc
ld a, 2
- ld [$d452], a
+ ld [wd452], a
ret
; 968e4
@@ -457,7 +457,7 @@
; 968ec
Function968ec: ; 968ec
- ld a, [$dc07]
+ ld a, [wdc07]
and a
jr z, .asm_96938
@@ -468,7 +468,7 @@
ld e, a
ld d, 0
- ld hl, $dc08
+ ld hl, wdc07 + 1
ld a, [hli]
ld h, [hl]
ld l, a
@@ -492,11 +492,11 @@
bit 3, [hl]
jr z, .asm_96938
- ld hl, $d44f
+ ld hl, ScriptDelay + 2
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [$d44e]
+ ld a, [ScriptDelay + 1]
call CallScript
scf
ret
@@ -750,7 +750,7 @@
.read
call PlayTalkObject
- ld hl, $d041
+ ld hl, wd041
ld a, [hli]
ld h, [hl]
ld l, a
@@ -811,7 +811,7 @@
CheckSignFlag: ; 96ad8
- ld hl, $d041
+ ld hl, wd041
ld a, [hli]
ld h, [hl]
ld l, a
@@ -947,11 +947,11 @@
; 96b72
.Script ; 96b72
- ptjump $d0e8
+ ptjump wd0e8
; 96b75
.Asm ; 96b75
- ptcallasm $d0e8
+ ptcallasm wd0e8
end
; 96b79
@@ -1021,11 +1021,11 @@
; 96bd7
Function96bd7: ; 96bd7
- ld a, [$dca1]
+ ld a, [wdca1]
and a
ret z
dec a
- ld [$dca1], a
+ ld [wdca1], a
ret nz
ld a, BANK(UnknownScript_0x13619)
ld hl, UnknownScript_0x13619
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -9,19 +9,19 @@
; 97c30
Function97c30:: ; 97c30
- ld a, [$d45c]
+ ld a, [wd45c]
and a
ret z
- ld hl, $d45e
+ ld hl, wd45c + 2
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [$d45d]
+ ld a, [wd45c + 1]
call CallScript
scf
push af
xor a
- ld hl, $d45c
+ ld hl, wd45c
ld bc, 8
call ByteFill
pop af
@@ -29,7 +29,7 @@
; 97c4f
Function97c4f:: ; 97c4f
- ld hl, $d45c
+ ld hl, wd45c
ld a, [hl]
and a
ret nz
@@ -146,7 +146,7 @@
ld hl, StatusFlags
bit 5, [hl]
jr nz, .asm_97d21
- ld a, [$d19a]
+ ld a, [wd19a]
cp $4
jr z, .asm_97d17
cp $7
@@ -196,7 +196,7 @@
; Species
ld a, [hli]
- ld [$d22e], a
+ ld [wd22e], a
; Min level
ld a, [hli]
@@ -278,7 +278,7 @@
call Function2d05
and a
jr nz, .asm_97df7
- ld hl, $dca2
+ ld hl, wdca1 + 1
ld a, [hli]
ld d, a
ld e, [hl]
@@ -298,13 +298,13 @@
ld a, d
cp $4
jr c, .asm_97df7
- ld a, [$dc31]
+ ld a, [wdc31]
and a
jr nz, .asm_97df7
ld a, $6
- ld [$dc31], a
+ ld [wdc31], a
xor a
- ld [$dc32], a
+ ld [wdc31 + 1], a
ld hl, StatusFlags2
res 4, [hl]
scf
@@ -316,7 +316,7 @@
; 97df9
Function97df9:: ; 97df9
- ld hl, $d6de
+ ld hl, wd6de
ld de, $0006
ld c, $4
xor a
@@ -329,7 +329,7 @@
; 97e08
Function97e08:: ; 97e08
- ld hl, $d6de
+ ld hl, wd6de
xor a
.asm_97e0c
ld [hConnectionStripLength], a
@@ -353,7 +353,7 @@
; 97e25
Function97e25: ; 97e25
- ld hl, $d6de
+ ld hl, wd6de
ld bc, 6
call AddNTimes
ld b, h
@@ -379,7 +379,7 @@
; 97e45
Function97e45: ; 97e45
- ld hl, $d6de
+ ld hl, wd6de
ld de, $0006
ld c, $4
.asm_97e4d
@@ -400,7 +400,7 @@
; 97e5c
Function97e5c:: ; 97e5c
- ld hl, $d6de
+ ld hl, wd6de
ld de, $0006
ld c, $4
.asm_97e64
@@ -560,7 +560,7 @@
ld hl, $0002
add hl, bc
ld a, [hl]
- ld [$d173], a
+ ld [wd173], a
ret
; 97f1b
@@ -572,13 +572,13 @@
ld hl, $0003
add hl, bc
ld a, [hl]
- ld [$d173], a
+ ld [wd173], a
ret
; 97f2c
Function97f2c: ; 97f2c
ld a, $7f
- ld [$d173], a
+ ld [wd173], a
ld hl, $0005
add hl, bc
ld [hl], 0
@@ -587,7 +587,7 @@
Function97f38: ; 97f38
push bc
- ld bc, $d4d6
+ ld bc, PlayerStruct
call GetSpriteDirection
and a
pop bc
@@ -595,7 +595,7 @@
; 97f42
Function97f42: ; 97f42
- ld de, $d4d6
+ ld de, PlayerStruct
ld a, $d
.asm_97f47
push af
--- a/engine/fruit_trees.asm
+++ b/engine/fruit_trees.asm
@@ -43,7 +43,7 @@
; 4404c
TryResetFruitTrees: ; 4404c
- ld hl, $dc1e
+ ld hl, wdc1e
bit 4, [hl]
ret nz
jp ResetFruitTrees
@@ -70,7 +70,7 @@
ld [hli], a
ld [hli], a
ld [hl], a
- ld hl, $dc1e
+ ld hl, wdc1e
set 4, [hl]
ret
; 44078
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -242,7 +242,7 @@
Movement_remove_person: ; 51fd
call Function4357
- ld hl, $d4cd
+ ld hl, wd4cd
ld a, [hConnectionStripLength]
cp [hl]
jr nz, .asm_520a
@@ -737,7 +737,7 @@
call Function5556
.asm_5430
- ld hl, $d4cf
+ ld hl, wd4cf
ld a, [hConnectionStripLength]
cp [hl]
jr z, .asm_543f
@@ -760,7 +760,7 @@
ld hl, $000b
add hl, bc
ld [hl], $4
- ld hl, $d4cf
+ ld hl, wd4cf
ld a, [hConnectionStripLength]
cp [hl]
jr z, .asm_5461
@@ -783,7 +783,7 @@
ld hl, $000b
add hl, bc
ld [hl], $1
- ld hl, $d4cf
+ ld hl, wd4cf
ld a, [hConnectionStripLength]
cp [hl]
jr z, .asm_5483
@@ -812,7 +812,7 @@
add hl, bc
ld [hl], $2
call Function5529
- ld hl, $d4cf
+ ld hl, wd4cf
ld a, [hConnectionStripLength]
cp [hl]
jr z, .asm_54b1
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -9,7 +9,7 @@
ld [hBGMapMode], a
; Reset timing variables
- ld hl, $cf63
+ ld hl, wcf63
ld [hli], a ; cf63 ; Scene?
ld [hli], a ; cf64
ld [hli], a ; cf65 ; Timer lo
@@ -144,12 +144,12 @@
; Update palette colors
ld hl, TitleScreenPalettes
- ld de, $d000
+ ld de, Unkn1Pals
ld bc, $0080
call CopyBytes
ld hl, TitleScreenPalettes
- ld de, $d080
+ ld de, BGPals
ld bc, $0080
call CopyBytes
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -69,21 +69,21 @@
Function8db8: ; 8db8
ld hl, PalPacket_9c66 + 1
- ld de, $d000
+ ld de, Unkn1Pals
ld c, $4
call Function9615
ld hl, PalPacket_9c66 + 1
- ld de, $d020
+ ld de, Unkn1Pals + $20
ld c, $4
call Function9615
ld hl, PalPacket_9c66 + 1
- ld de, MartPointer
+ ld de, Unkn2Pals
ld c, $2
call Function9615
jr Function8e23
Function8ddb: ; 8ddb
- ld de, $d000
+ ld de, Unkn1Pals
call Function9729
push hl
call Function9643
@@ -108,7 +108,7 @@
call Function9643
ld hl, Palettes_a8ca
call Function9643
- ld de, MartPointer
+ ld de, Unkn2Pals
pop hl
call Function9643
pop hl
@@ -123,11 +123,11 @@
ld bc, $0168
ld a, $2
call ByteFill
- ld hl, $ce29
+ hlcoord 0, 4, AttrMap
ld bc, $080a
ld a, $0
call Function9663
- ld hl, $cde3
+ hlcoord 10, 0, AttrMap
ld bc, $070a
ld a, $1
call Function9663
@@ -135,20 +135,20 @@
ld bc, $040a
ld a, $2
call Function9663
- ld hl, $ce6f
+ hlcoord 10, 7, AttrMap
ld bc, $050a
ld a, $3
call Function9663
- ld hl, $cebf
+ hlcoord 10, 11, AttrMap
ld bc, $0109
ld a, $4
call Function9663
- ld hl, $cec9
+ hlcoord 0, 12, AttrMap
ld bc, $0078
ld a, $7
call ByteFill
ld hl, Palettes_979c
- ld de, $d050
+ ld de, Unkn2Pals + $10
ld bc, $0030
ld a, $5
call FarCopyWRAM
@@ -166,7 +166,7 @@
ld hl, Palette_b309
.asm_8e93
- ld de, $d038
+ ld de, wd038
ld bc, $0008
ld a, $5
call FarCopyWRAM
@@ -180,7 +180,7 @@
ld hl, Palette_b309
.asm_8ead
- ld de, $d000
+ ld de, Unkn1Pals
ld bc, $0008
ld a, $5
call FarCopyWRAM
@@ -198,7 +198,7 @@
ld hl, Palettes_b729
.asm_8ec8
- ld de, $d000
+ ld de, Unkn1Pals
ld bc, $0030
ld a, $5
call FarCopyWRAM
@@ -209,8 +209,8 @@
; 8edb
Function8edb: ; 8edb
- ld de, $d000
- ld a, [$cda1]
+ ld de, Unkn1Pals
+ ld a, [wcda1]
ld l, a
ld h, $0
add hl, hl
@@ -225,7 +225,7 @@
ld hl, Palettes_a8ca
call Function9643
ld hl, Palette8f52
- ld de, $d018
+ ld de, wd018
ld bc, $0018
ld a, $5
call FarCopyWRAM
@@ -234,19 +234,19 @@
ld bc, $0814
ld a, $1
call Function9663
- ld hl, $cf23
+ hlcoord 10, 16, AttrMap
ld bc, $000a
ld a, $2
call ByteFill
- ld hl, $ce4a
+ hlcoord 13, 5, AttrMap
ld bc, $0202
ld a, $3
call Function9663
- ld hl, $ce4c
+ hlcoord 15, 5, AttrMap
ld bc, $0202
ld a, $4
call Function9663
- ld hl, $ce4e
+ hlcoord 17, 5, AttrMap
ld bc, $0202
ld a, $5
call Function9663
@@ -300,13 +300,13 @@
.asm_8f90
call Function9699
- ld hl, $cdee
+ hlcoord 1, 1, AttrMap
ld bc, $0707
ld a, $1
call Function9663
call Function971a
ld hl, Palette8fc2
- ld de, $d078
+ ld de, Unkn2Pals + $38
ld bc, $0008
ld a, $5
call FarCopyWRAM
@@ -349,7 +349,7 @@
.asm_8fed
call Function9699
- ld hl, $ce2a
+ hlcoord 1, 4, AttrMap
ld bc, $0707
ld a, $1
call Function9663
@@ -372,7 +372,7 @@
.asm_901a
call Function9699
- ld hl, $cdee
+ hlcoord 1, 1, AttrMap
ld bc, $0707
ld a, $1
call Function9663
@@ -400,7 +400,7 @@
call Function9775
call Function9643
call Function9699
- ld hl, $ce44
+ hlcoord 7, 5, AttrMap
ld bc, $0707
ld a, $1
call Function9663
@@ -419,43 +419,43 @@
ld a, $5
call FarCopyWRAM
call Function9699
- ld hl, $ce01
+ hlcoord 0, 2, AttrMap
ld bc, $0a03
ld a, $2
call Function9663
- ld hl, $ce12
+ hlcoord 17, 2, AttrMap
ld bc, $0a03
ld a, $2
call Function9663
- ld hl, $ce29
+ hlcoord 0, 4, AttrMap
ld bc, $0603
ld a, $3
call Function9663
- ld hl, $ce3a
+ hlcoord 17, 4, AttrMap
ld bc, $0603
ld a, $3
call Function9663
- ld hl, $ce51
+ hlcoord 0, 6, AttrMap
ld bc, $0203
ld a, $4
call Function9663
- ld hl, $ce62
+ hlcoord 17, 6, AttrMap
ld bc, $0203
ld a, $4
call Function9663
- ld hl, $ce05
+ hlcoord 4, 2, AttrMap
ld bc, $020c
ld a, $1
call Function9663
- ld hl, $ce04
+ hlcoord 3, 2, AttrMap
ld bc, $0a01
ld a, $1
call Function9663
- ld hl, $ce11
+ hlcoord 16, 2, AttrMap
ld bc, $0a01
ld a, $1
call Function9663
- ld hl, $cec9
+ hlcoord 0, 12, AttrMap
ld bc, $0078
ld a, $7
call ByteFill
@@ -474,7 +474,7 @@
ld a, $3c
call Function9625
call Function9630
- ld hl, $ce51
+ hlcoord 0, 6, AttrMap
ld bc, $0c14
ld a, $1
call Function9663
@@ -620,7 +620,7 @@
call Function974b
call Function9643
ld hl, Palettes_979c
- ld de, $d050
+ ld de, Unkn2Pals + $10
ld bc, $0030
ld a, $5
call FarCopyWRAM
@@ -723,7 +723,7 @@
.asm_92e3
call ByteFill
- ld hl, $cdfb
+ hlcoord 14, 1, AttrMap
ld bc, $0705
ld a, [PlayerGender]
and a
@@ -733,33 +733,33 @@
.asm_92f6
call Function9663
- ld hl, $cdff
+ hlcoord 18, 1, AttrMap
ld [hl], $1
- ld hl, $ceb7
+ hlcoord 2, 11, AttrMap
ld bc, $0204
ld a, $1
call Function9663
- ld hl, $cebb
+ hlcoord 6, 11, AttrMap
ld bc, $0204
ld a, $2
call Function9663
- ld hl, $cebf
+ hlcoord 10, 11, AttrMap
ld bc, $0204
ld a, $3
call Function9663
- ld hl, $cec3
+ hlcoord 14, 11, AttrMap
ld bc, $0204
ld a, $4
call Function9663
- ld hl, $cef3
+ hlcoord 2, 14, AttrMap
ld bc, $0204
ld a, $5
call Function9663
- ld hl, $cef7
+ hlcoord 6, 14, AttrMap
ld bc, $0204
ld a, $6
call Function9663
- ld hl, $cefb
+ hlcoord 10, 14, AttrMap
ld bc, $0204
ld a, $7
call Function9663
@@ -767,7 +767,7 @@
and a
push af
jr z, .asm_935d
- ld hl, $ceff
+ hlcoord 14, 14, AttrMap
ld bc, $0204
ld a, $1
call Function9663
@@ -780,7 +780,7 @@
.asm_9363
ld a, c
- ld hl, $cdff
+ hlcoord 18, 1, AttrMap
ld [hl], a
call Function96b3
call Function96a4
@@ -803,7 +803,7 @@
add hl, bc
call Function9643
call Function9699
- ld hl, $cdf8
+ hlcoord 11, 1, AttrMap
ld bc, $0209
ld a, $1
call Function9663
@@ -863,19 +863,19 @@
ld bc, $010a
ld a, $1
call Function9663
- ld hl, $cde3
+ hlcoord 10, 0, AttrMap
ld bc, $010a
ld a, $2
call Function9663
- ld hl, $ce08
+ hlcoord 7, 2, AttrMap
ld bc, $0901
ld a, $3
call Function9663
- ld hl, $ce65
+ hlcoord 0, 7, AttrMap
ld bc, $0305
ld a, $4
call Function9663
- ld hl, $ce15
+ hlcoord 0, 3, AttrMap
ld bc, $0305
ld a, $5
call Function9663
@@ -944,7 +944,7 @@
call Function91c8
ld de, $0014
ld hl, AttrMap
- ld a, [$cf82]
+ ld a, [wcf82]
.asm_94a5
and a
jr z, .asm_94ac
@@ -953,19 +953,19 @@
jr .asm_94a5
.asm_94ac
- ld a, [$cf83]
+ ld a, [wcf83]
ld e, a
ld d, $0
add hl, de
- ld a, [$cf82]
+ ld a, [wcf82]
ld b, a
- ld a, [$cf84]
+ ld a, [wcf84]
inc a
sub b
ld b, a
- ld a, [$cf83]
+ ld a, [wcf83]
ld c, a
- ld a, [$cf85]
+ ld a, [wcf85]
sub c
inc a
ld c, a
@@ -979,11 +979,11 @@
ld hl, PalPacket_9ba6 + 1
call Function9610
call Function9699
- ld hl, $ce29
+ hlcoord 0, 4, AttrMap
ld bc, $0a14
ld a, $2
call Function9663
- ld hl, $ce51
+ hlcoord 0, 6, AttrMap
ld bc, $0614
ld a, $1
call Function9663
@@ -1003,7 +1003,7 @@
ld de, Unkn2Pals
call Function9630
ld hl, Palette_9521
- ld de, $d048
+ ld de, Unkn2Pals + 8
call Function9630
call Function9699
call Function96b3
@@ -1048,7 +1048,7 @@
ld bc, $0008
ld a, $5
call FarCopyWRAM
- ld de, $d078
+ ld de, Unkn2Pals + $38
ld a, $1c
call Function9625
call Function9630
@@ -1076,15 +1076,15 @@
call FarCopyWRAM
call Function96a4
call Function9699
- ld hl, $ce68
+ hlcoord 3, 7, AttrMap
ld bc, $080e
ld a, $1
call Function9663
- ld hl, $ce3e
+ hlcoord 1, 5, AttrMap
ld bc, $0112
ld a, $1
call Function9663
- ld hl, $cf1a
+ hlcoord 1, 16, AttrMap
ld bc, $0112
ld a, $1
call Function9663
@@ -1092,7 +1092,7 @@
ld bc, $1102
ld a, $1
call Function9663
- ld hl, $ce4f
+ hlcoord 18, 5, AttrMap
ld bc, $0c01
ld a, $1
call Function9663
--- a/predef/sgb.asm
+++ b/predef/sgb.asm
@@ -68,7 +68,7 @@
ld hl, BlkPacket_9aa6
call Function9809
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
ld a, [PlayerHPPal]
@@ -79,13 +79,13 @@
ld de, Palettes_a8be
add hl, de
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
+ ld [wcda9 + 6], a
ld a, [EnemyHPPal]
ld l, a
ld h, $0
@@ -94,37 +94,37 @@
ld de, Palettes_a8be
add hl, de
ld a, [hli]
- ld [$cdb2], a
+ ld [wcda9 + 9], a
ld a, [hli]
- ld [$cdb3], a
+ ld [wcda9 + 10], a
ld a, [hli]
- ld [$cdb4], a
+ ld [wcda9 + 11], a
ld a, [hl]
- ld [$cdb5], a
+ ld [wcda9 + 12], a
ld hl, PalPacket_9cf6
- ld de, $cdb9
+ ld de, wcda9 + $10
ld bc, $0010
call CopyBytes
call Function9729
ld a, [hli]
- ld [$cdbc], a
+ ld [wcda9 + $13], a
ld a, [hli]
- ld [$cdbd], a
+ ld [wcda9 + $14], a
ld a, [hli]
- ld [$cdbe], a
+ ld [wcda9 + $15], a
ld a, [hl]
- ld [$cdbf], a
+ ld [wcda9 + $16], a
call Function973a
ld a, [hli]
- ld [$cdc2], a
+ ld [wcda9 + $19], a
ld a, [hli]
- ld [$cdc3], a
+ ld [wcda9 + $1a], a
ld a, [hli]
- ld [$cdc4], a
+ ld [wcda9 + $1b], a
ld a, [hl]
- ld [$cdc5], a
- ld hl, $cda9
- ld de, $cdb9
+ ld [wcda9 + $1c], a
+ ld hl, wcda9
+ ld de, wcda9 + $10
ld a, $1
ld [SGBPredef], a
ret
@@ -132,10 +132,10 @@
Function873c: ; 873c
ld hl, PalPacket_9bd6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
- ld hl, $cdaa
+ ld hl, wcda9 + 1
ld [hl], $10
inc hl
inc hl
@@ -142,7 +142,7 @@
ld a, [PlayerHPPal]
add $2f
ld [hl], a
- ld hl, $cda9
+ ld hl, wcda9
ld de, BlkPacket_9ad6
ret
; 875c
@@ -155,10 +155,10 @@
Function8763: ; 8763
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
- ld a, [$cda1]
+ ld a, [wcda1]
ld l, a
ld h, $0
add hl, hl
@@ -166,25 +166,25 @@
ld de, Palettes_a8be
add hl, de
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
+ ld [wcda9 + 6], a
ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld bc, wd10e + 21
call Function974b
ld a, [hli]
- ld [$cdb2], a
+ ld [wcda9 + 9], a
ld a, [hli]
- ld [$cdb3], a
+ ld [wcda9 + 10], a
ld a, [hli]
- ld [$cdb4], a
+ ld [wcda9 + 11], a
ld a, [hl]
- ld [$cdb5], a
- ld hl, $cda9
+ ld [wcda9 + 12], a
+ ld hl, wcda9
ld de, BlkPacket_9ac6
ret
; 87ab
@@ -191,16 +191,16 @@
Function87ab: ; 87ab
ld hl, PalPacket_9c56
- ld de, $cdaa
+ ld de, wcda9 + 1
ret
; 87b2
Function87b2: ; 87b2
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
- ld hl, $cdac
+ ld hl, wcda9 + 3
ld [hl], $9f
inc hl
ld [hl], $2a
@@ -211,14 +211,14 @@
ld a, [CurPartySpecies]
call Function9775
ld a, [hli]
- ld [$cdb2], a
+ ld [wcda9 + 9], a
ld a, [hli]
- ld [$cdb3], a
+ ld [wcda9 + 10], a
ld a, [hli]
- ld [$cdb4], a
+ ld [wcda9 + 11], a
ld a, [hl]
- ld [$cdb5], a
- ld hl, $cda9
+ ld [wcda9 + 12], a
+ ld hl, wcda9
ld de, BlkPacket_9ae6
ret
; 87e9
@@ -225,10 +225,10 @@
Function87e9: ; 87e9
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
- ld hl, $cdac
+ ld hl, wcda9 + 3
ld [hl], $9f
inc hl
ld [hl], $2a
@@ -237,17 +237,17 @@
inc hl
ld [hl], $19
ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld bc, wd10e + 21
call Function974b
ld a, [hli]
- ld [$cdb2], a
+ ld [wcda9 + 9], a
ld a, [hli]
- ld [$cdb3], a
+ ld [wcda9 + 10], a
ld a, [hli]
- ld [$cdb4], a
+ ld [wcda9 + 11], a
ld a, [hl]
- ld [$cdb5], a
- ld hl, $cda9
+ ld [wcda9 + 12], a
+ ld hl, wcda9
ld de, BlkPacket_9ae6
ret
; 8823
@@ -260,10 +260,10 @@
Function882a: ; 882a
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
- ld hl, $cdac
+ ld hl, wcda9 + 3
ld [hl], $9f
inc hl
ld [hl], $2a
@@ -271,7 +271,7 @@
ld [hl], $5a
inc hl
ld [hl], $19
- ld hl, $cda9
+ ld hl, wcda9
ld de, BlkPacket_9a86
ret
; 884b
@@ -355,11 +355,11 @@
Function88b1: ; 88b1
ld hl, PalPacket_9bd6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
call Function8a0c
- ld hl, $cdaa
+ ld hl, wcda9 + 1
ld [hld], a
ld de, BlkPacket_9a86
ld a, $9
@@ -370,7 +370,7 @@
Function88cd: ; 88cd
push bc
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
pop bc
@@ -377,7 +377,7 @@
ld a, c
and a
jr z, .asm_88ef
- ld hl, $cdac
+ ld hl, wcda9 + 3
ld [hl], $e7
inc hl
ld [hl], $1c
@@ -397,16 +397,16 @@
ld a, [PlayerHPPal]
call Function974b
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
+ ld [wcda9 + 6], a
.asm_8913
- ld hl, $cda9
+ ld hl, wcda9
ld de, BlkPacket_9a86
ret
; 891a
@@ -425,37 +425,37 @@
Function8928: ; 8928
ld hl, PalPacket_9bd6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
ld hl, BlkPacket_9a86
- ld de, $cdb9
+ ld de, wcda9 + $10
ld bc, $0010
call CopyBytes
call Function8a0c
- ld hl, $cdaa
+ ld hl, wcda9 + 1
ld [hl], a
- ld hl, $cdac
+ ld hl, wcda9 + 3
ld [hl], $2e
- ld hl, $cdbc
+ ld hl, wcda9 + $13
ld a, $5
ld [hli], a
- ld a, [$cf83]
+ ld a, [wcf83]
ld [hli], a
- ld a, [$cf82]
+ ld a, [wcf82]
ld [hli], a
- ld a, [$cf85]
+ ld a, [wcf85]
ld [hli], a
- ld a, [$cf84]
+ ld a, [wcf84]
ld [hl], a
- ld hl, $cda9
- ld de, $cdb9
+ ld hl, wcda9
+ ld de, wcda9 + $10
ret
; 8969
Function8969: ; 8969
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
ld a, [CurPartySpecies]
@@ -466,7 +466,7 @@
add hl, hl
ld de, PokemonPalettes
add hl, de
- ld a, [$cf65]
+ ld a, [wcf65]
and 3
sla a
sla a
@@ -474,14 +474,14 @@
ld b, 0
add hl, bc
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
- ld hl, $cda9
+ ld [wcda9 + 6], a
+ ld hl, wcda9
ld de, BlkPacket_9a86
ret
; 89a6
@@ -494,21 +494,21 @@
Function89ad: ; 89ad
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld bc, wd10e + 21
call Function974b
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
- ld hl, $cda9
+ ld [wcda9 + 6], a
+ ld hl, wcda9
ld de, BlkPacket_9a86
ret
; 89d9
@@ -521,21 +521,21 @@
Function89e0: ; 89e0
ld hl, PalPacket_9ce6
- ld de, $cda9
+ ld de, wcda9
ld bc, $0010
call CopyBytes
ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld bc, wd10e + 21
call Function9764
ld a, [hli]
- ld [$cdac], a
+ ld [wcda9 + 3], a
ld a, [hli]
- ld [$cdad], a
+ ld [wcda9 + 4], a
ld a, [hli]
- ld [$cdae], a
+ ld [wcda9 + 5], a
ld a, [hl]
- ld [$cdaf], a
- ld hl, $cda9
+ ld [wcda9 + 6], a
+ ld hl, wcda9
ld de, BlkPacket_9a86
ret
; 8a0c
@@ -548,7 +548,7 @@
ret
.asm_8a16
- ld a, [$d19a]
+ ld a, [wd19a]
cp $2
jr z, .asm_8a39
cp $4
--- a/tilesets/animations.asm
+++ b/tilesets/animations.asm
@@ -104,7 +104,7 @@
TilesetAnimfc0d7: ; 0xfc0d7
; param, function
dw $9030, WriteTileToBuffer
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw $9030, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -119,7 +119,7 @@
TilesetAnimfc103: ; 0xfc103
; param, function
dw $9140, WriteTileToBuffer
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw $9140, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -162,15 +162,15 @@
TilesetAnimfc17f: ; 0xfc17f
; param, function
dw $9530, WriteTileToBuffer
- dw $cf41, ScrollTileDown
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw $9530, WriteTileFromBuffer
dw $9030, WriteTileToBuffer
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw $9030, WriteTileFromBuffer
dw $9530, WriteTileToBuffer
- dw $cf41, ScrollTileDown
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw $9530, WriteTileFromBuffer
dw NULL, DoneTileAnimation
; 0xfc1af
@@ -178,17 +178,17 @@
TilesetAnimfc1af: ; 0xfc1af
; param, function
dw $9540, WriteTileToBuffer
- dw $cf41, ScrollTileDown
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw $9540, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw $9030, WriteTileToBuffer
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw $9030, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw $9540, WriteTileToBuffer
- dw $cf41, ScrollTileDown
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw $9540, WriteTileFromBuffer
dw NULL, DoneTileAnimation
; 0xfc1e7
@@ -198,7 +198,7 @@
; param, function
dw $9140, WriteTileToBuffer
dw NULL, Functionfc71e
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw NULL, Functionfc71e
dw $9140, WriteTileFromBuffer
dw NULL, Functionfc71e
@@ -206,11 +206,11 @@
dw NULL, Functionfc71e
dw $9400, WriteTileToBuffer
dw NULL, Functionfc71e
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw NULL, Functionfc71e
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw NULL, Functionfc71e
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw NULL, Functionfc71e
dw $9400, WriteTileFromBuffer
dw NULL, Functionfc71e
@@ -221,7 +221,7 @@
; param, function
dw $9350, WriteTileToBuffer
dw NULL, Functionfc71e
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw NULL, Functionfc71e
dw $9350, WriteTileFromBuffer
dw NULL, Functionfc71e
@@ -229,11 +229,11 @@
dw NULL, Functionfc71e
dw $9310, WriteTileToBuffer
dw NULL, Functionfc71e
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw NULL, Functionfc71e
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw NULL, Functionfc71e
- dw $cf41, ScrollTileDown
+ dw wcf41, ScrollTileDown
dw NULL, Functionfc71e
dw $9310, WriteTileFromBuffer
dw NULL, Functionfc71e
@@ -262,7 +262,7 @@
TilesetAnimfc2bf: ; 0xfc2bf
dw $94f0, WriteTileToBuffer
- dw $cf41, ScrollTileRightLeft
+ dw wcf41, ScrollTileRightLeft
dw $94f0, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -873,14 +873,14 @@
WriteTileFromBuffer: ; fc696
-; Write tiledata at $cf41 to de.
-; $cf41 is loaded to sp for WriteTile.
+; Write tiledata at wcf41 to de.
+; wcf41 is loaded to sp for WriteTile.
ld hl, [sp+0]
ld b, h
ld c, l
- ld hl, $cf41
+ ld hl, wcf41
ld sp, hl
ld h, d
@@ -890,7 +890,7 @@
WriteTileToBuffer: ; fc6a2
-; Write tiledata de to $cf41.
+; Write tiledata de to wcf41.
; de is loaded to sp for WriteTile.
ld hl, [sp+0]
@@ -901,7 +901,7 @@
ld l, e
ld sp, hl
- ld hl, $cf41
+ ld hl, wcf41
; fallthrough
@@ -971,7 +971,7 @@
jr z, .color2
.color1
- ld hl, $d01a ; pal 3 color 1
+ ld hl, Unkn1Pals + $1a ; pal 3 color 1
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -979,7 +979,7 @@
jr .end
.color0
- ld hl, $d018 ; pal 3 color 0
+ ld hl, Unkn1Pals + $18 ; pal 3 color 0
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -987,7 +987,7 @@
jr .end
.color2
- ld hl, $d01c ; pal 3 color 2
+ ld hl, Unkn1Pals + $1c ; pal 3 color 2
ld a, [hli]
ld [rBGPD], a
ld a, [hli]
@@ -1023,11 +1023,11 @@
ld a, [$ff9b]
and 2
jr nz, .asm_fc743
- ld hl, $d020
+ ld hl, Unkn1Pals + $20
jr .asm_fc746
.asm_fc743
- ld hl, $d022
+ ld hl, Unkn1Pals + $22
.asm_fc746
ld a, [hli]
--- a/wram.asm
+++ b/wram.asm
@@ -1142,8 +1142,7 @@
ds SCREEN_WIDTH * SCREEN_HEIGHT
AttrMapEnd::
- ds 1
-
+wcf41:: ds 1
wcf42:: ds 2
wcf44:: ds 1
wcf45:: ds 12
@@ -1343,7 +1342,8 @@
wd017:: ds 1
wd018:: ds 1
wd019:: ds 1
-wd01a:: ds 6
+wd01a:: ds 5
+wd01f:: ds 1
wd020:: ds 3
wd023:: ds 5
wd028:: ds 2
@@ -1480,6 +1480,7 @@
wd10c:: ds 1
wd10d:: ds 1
+wd10e::
TempMon::
party_struct TempMon
@@ -1512,9 +1513,9 @@
wd153:: ds 1
UsedSprites:: ; d154
- ds 32
-; d174
+ ds 31 ; 64
+wd173:: ds 1
ds 13
wd181:: ds 1
wd182:: ds 1
@@ -1857,7 +1858,11 @@
ScriptDelay:: ; d44d
ds 1
- ds 11
+ ds 4
+wd452:: ds 1
+wd453:: ds 1
+wd454:: ds 1
+ ds 4
wd459:: ds 2
wd45b:: ds 1
@@ -2006,6 +2011,7 @@
ds 40
; d6de
+wd6de::
ds 64
MapObjects:: ; d71e
@@ -2217,7 +2223,8 @@
; 8 chars + $50
wBoxNames:: ds 9 * NUM_BOXES ; db75
- ds 2
+wdbf3:: ds 1
+ ds 1
BikeFlags:: ; dbf5
; bit 1: always on bike
@@ -2284,7 +2291,8 @@
wdc2d:: ds 4
wdc31:: ds 4
-wdc35:: ds 5
+wdc35:: ds 4
+wdc39:: ds 1
wdc3a:: ds 1
wdc3b:: ds 5
wdc40:: ds 1