summaryrefslogtreecommitdiff
path: root/mobile
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2018-01-01 16:54:45 -0500
committerGitHub <noreply@github.com>2018-01-01 16:54:45 -0500
commitf27f79488a460f0a89670f3611e1e9e175baf5d6 (patch)
tree92134b1da650d7894a2fde59e0048f75d36c7dbf /mobile
parent8c3905c4cdb4f24810473da51d52cc3e16062173 (diff)
parente5fa3f9a11fb6936709cd0c36e945bd6e018cb37 (diff)
Merge pull request #455 from xCrystal/master
Use more palette(s) constants, rename BG/OBP wram addresses, and rBGPI+rOBPI auto-increment constants (from Rangi)
Diffstat (limited to 'mobile')
-rwxr-xr-xmobile/fixed_words.asm2
-rw-r--r--mobile/mobile_22.asm20
-rw-r--r--mobile/mobile_22_2.asm4
-rw-r--r--mobile/mobile_40.asm2
-rw-r--r--mobile/mobile_42.asm40
-rw-r--r--mobile/mobile_45.asm2
-rwxr-xr-xmobile/mobile_45_sprite_engine.asm12
-rwxr-xr-xmobile/mobile_46.asm2
-rwxr-xr-xmobile/mobile_5b.asm38
-rwxr-xr-xmobile/mobile_5c.asm14
-rw-r--r--mobile/mobile_5e.asm20
-rw-r--r--mobile/mobile_5f.asm30
12 files changed, 93 insertions, 93 deletions
diff --git a/mobile/fixed_words.asm b/mobile/fixed_words.asm
index b3f33fafe..a1ddb5ad2 100755
--- a/mobile/fixed_words.asm
+++ b/mobile/fixed_words.asm
@@ -2921,7 +2921,7 @@ Function11d323: ; 11d323
ld a, $5
ld [rSVBK], a
ld hl, Palette_11d33a
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 16 palettes
call CopyBytes
pop af
diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm
index b82280482..9180c29e0 100644
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -631,7 +631,7 @@ Function8949c: ; 8949c
ld a, 5
ld [rSVBK], a
ld hl, Palette_894b3
- ld de, UnknBGPals palette 7
+ ld de, wBGPals1 palette 7
ld bc, 1 palettes
call CopyBytes
pop af
@@ -682,11 +682,11 @@ Function894dc: ; 894dc
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 3 palettes
call CopyBytes
ld hl, .Pals345
- ld de, UnknBGPals + 3 palettes
+ ld de, wBGPals1 + 3 palettes
ld bc, 3 palettes
call CopyBytes
@@ -2161,7 +2161,7 @@ Function89d0d: ; 89d0d (22:5d0d)
ld [rSVBK], a
ld c, 8
- ld de, UnknBGPals
+ ld de, wBGPals1
.loop
push bc
ld hl, .Palette1
@@ -2172,7 +2172,7 @@ Function89d0d: ; 89d0d (22:5d0d)
jr nz, .loop
ld hl, .Palette2
- ld de, UnknBGPals + 2 palettes
+ ld de, wBGPals1 + 2 palettes
ld bc, 1 palettes
call CopyBytes
@@ -2394,7 +2394,7 @@ Function89e9a: ; 89e9a (22:5e9a)
ld a, $5
ld [rSVBK], a
ld hl, Palette_89eb1
- ld de, UnknBGPals palette 5
+ ld de, wBGPals1 palette 5
ld bc, 1 palettes
call CopyBytes
pop af
@@ -3399,15 +3399,15 @@ Function8a5b6: ; 8a5b6 (22:65b6)
ld a, $5
ld [rSVBK], a
ld hl, Palette_8a5e5
- ld de, UnknBGPals + 4 palettes
+ ld de, wBGPals1 + 4 palettes
ld bc, 3 palettes
call CopyBytes
ld hl, Palette_8a5fd
- ld de, UnknOBPals
+ ld de, wOBPals1
ld bc, 1 palettes
call CopyBytes
ld hl, Palette_8a605
- ld de, UnknOBPals + 1 palettes
+ ld de, wOBPals1 + 1 palettes
ld bc, 1 palettes
call CopyBytes
pop af
@@ -3452,7 +3452,7 @@ Function8a60d: ; 8a60d
ld a, $5
ld [rSVBK], a
ld hl, Palette_8a624
- ld de, UnknOBPals
+ ld de, wOBPals1
ld bc, 1 palettes
call CopyBytes
pop af
diff --git a/mobile/mobile_22_2.asm b/mobile/mobile_22_2.asm
index 824643632..37b3d60b8 100644
--- a/mobile/mobile_22_2.asm
+++ b/mobile/mobile_22_2.asm
@@ -620,8 +620,8 @@ Function8b6bb: ; 8b6bb
ld a, $5
ld [rSVBK], a
ld hl, Palette_8b6d5
- ld de, UnknBGPals
- ld bc, $0018
+ ld de, wBGPals1
+ ld bc, 3 palettes
call CopyBytes
pop af
ld [rSVBK], a
diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm
index 0d29239e0..84be87ce4 100644
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -6853,7 +6853,7 @@ Function102dd3: ; 102dd3
Function102dec: ; 102dec
ld hl, Palettes_1032e2
- ld de, UnknOBPals
+ ld de, wOBPals1
ld bc, 4 palettes
ld a, $05
call FarCopyWRAM
diff --git a/mobile/mobile_42.asm b/mobile/mobile_42.asm
index 82158c1c7..4e956229c 100644
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -836,7 +836,7 @@ MobileTradeAnim_02: ; 108638
ld a, $5
ld [rSVBK], a
ld hl, Palette_109107
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
pop af
@@ -882,7 +882,7 @@ MobileTradeAnim_10: ; 108689
ld a, $5
ld [rSVBK], a
ld hl, Palette_109107
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
pop af
@@ -926,7 +926,7 @@ MobileTradeAnim_11: ; 1086f4
ld a, $5
ld [rSVBK], a
ld hl, Palette_109107
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
pop af
@@ -946,7 +946,7 @@ MobileTradeAnim_GiveTrademon1: ; 108763
ld de, SFX_GIVE_TRADEMON
call PlaySFX
ld c, 40
- ld hl, BGPals palette 6
+ ld hl, wBGPals2 palette 6
call Function1082f0
call Function108af4
.loop
@@ -1010,7 +1010,7 @@ MobileTradeAnim_GiveTrademon1: ; 108763
MobileTradeAnim_GiveTrademon2: ; 1087cf
ld c, 40
- ld hl, BGPals + 1 palettes
+ ld hl, wBGPals2 + 1 palettes
call Function1082f0
call Function108af4
call Function108b5a
@@ -1109,12 +1109,12 @@ MobileTradeAnim_GetTrademon1: ; 108863
MobileTradeAnim_GetTrademon2: ; 108894
ld c, 20
- ld hl, BGPals + 1 palettes
+ ld hl, wBGPals2 + 1 palettes
call Function1082fa
ld de, SFX_GIVE_TRADEMON
call PlaySFX
ld c, 20
- ld hl, BGPals + 1 palettes
+ ld hl, wBGPals2 + 1 palettes
call Function1082fa
call Function108af4
.asm_1088ad
@@ -1178,7 +1178,7 @@ MobileTradeAnim_GetTrademon2: ; 108894
MobileTradeAnim_GetTrademon3: ; 10890a
ld c, 40
- ld hl, BGPals palette 6
+ ld hl, wBGPals2 palette 6
call Function1082f0
call Function108af4
call GetMobileTradeAnimByte
@@ -1449,22 +1449,22 @@ Function108af4: ; 108af4
and $1
jr z, .copy_palette_109147
ld hl, Palette_109187
- ld de, UnknOBPals
+ ld de, wOBPals1
ld bc, 8 palettes
call CopyBytes
ld hl, Palette_109187
- ld de, OBPals
+ ld de, wOBPals2
ld bc, 8 palettes
call CopyBytes
jr .done_copy
.copy_palette_109147
ld hl, Palette_109147
- ld de, UnknOBPals
+ ld de, wOBPals1
ld bc, 8 palettes
call CopyBytes
ld hl, Palette_109147
- ld de, OBPals
+ ld de, wOBPals2
ld bc, 8 palettes
call CopyBytes
@@ -1484,8 +1484,8 @@ Function108b45: ; 108b45
push af
ld a, $5
ld [rSVBK], a
- ld de, (31 << 10) + (31 << 5) + 31 ; $7fff
- ld hl, UnknBGPals
+ ld de, palred 31 + palgreen 31 + palblue 31
+ ld hl, wBGPals1
ld a, e
ld [hli], a
ld d, a
@@ -1500,8 +1500,8 @@ Function108b5a: ; 108b5a
push af
ld a, $5
ld [rSVBK], a
- ld de, (15 << 10) + (31 << 5) + 18 ; $3ff2
- ld hl, BGPals + 4 palettes
+ ld de, palred 18 + palgreen 31 + palblue 15
+ ld hl, wBGPals2 + 4 palettes
ld c, $10
.loop
ld a, e
@@ -1525,11 +1525,11 @@ Function108b78: ; 108b78
ld a, c
and $2
jr z, .Orange
- ld de, (31 << 10) + (31 << 5) + 31 ; $7fff
+ ld de, palred 31 + palgreen 31 + palblue 31
jr .load_pal
.Orange:
- ld de, ( 1 << 10) + (15 << 5) + 31 ; $05ff
+ ld de, palred 31 + palgreen 15 + palblue 1
.load_pal
ld a, e
ld [hli], a
@@ -1561,7 +1561,7 @@ Function108b98: ; 108b98
.asm_108bad
ld hl, Palette_108b98
.asm_108bb0
- ld de, UnknBGPals + 7 palettes
+ ld de, wBGPals1 + 7 palettes
ld bc, 8 palettes
call CopyBytes
pop af
@@ -1806,7 +1806,7 @@ Function108d07: ; 108d07
ld hl, Palette_1093c7
call AddNTimes
ld a, $5
- ld de, UnknBGPals + 4 palettes
+ ld de, wBGPals1 + 4 palettes
ld bc, 1 palettes
call FarCopyWRAM
ret
diff --git a/mobile/mobile_45.asm b/mobile/mobile_45.asm
index 180ab3758..5fc5eaa7e 100644
--- a/mobile/mobile_45.asm
+++ b/mobile/mobile_45.asm
@@ -7607,7 +7607,7 @@ Function117c4a:
push af
ld a, $5
ld [rSVBK], a
- ld hl, UnknBGPals
+ ld hl, wBGPals1
ld de, 1 palettes
ld c, 8
.loop
diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm
index a9335ba3d..b114e5166 100755
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -523,12 +523,12 @@ Function116294: ; 116294
push af
ld a, $5
ld [rSVBK], a
- ld hl, UnknBGPals palette 6
+ ld hl, wBGPals1 palette 6
ld de, $c320
ld bc, 2 palettes
call CopyBytes
ld hl, Palette_11734e
- ld de, UnknBGPals palette 7
+ ld de, wBGPals1 palette 7
ld bc, 1 palettes
call CopyBytes
call SetPalettes
@@ -550,7 +550,7 @@ Function1162cb: ; 1162cb
ld a, $5
ld [rSVBK], a
ld hl, Palette_11730e
- ld de, UnknOBPals + 2 palettes
+ ld de, wOBPals1 + 2 palettes
ld bc, 6 palettes
call CopyBytes
call SetPalettes
@@ -656,9 +656,9 @@ Function11636e: ; 11636e
push af
ld a, $5
ld [rSVBK], a
- ld hl, BGPals
- ld de, UnknBGPals
- ld bc, $0040
+ ld hl, wBGPals2
+ ld de, wBGPals1
+ ld bc, 8 palettes
call CopyBytes
pop af
ld [rSVBK], a
diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm
index e3503a00c..10a97e426 100755
--- a/mobile/mobile_46.asm
+++ b/mobile/mobile_46.asm
@@ -3449,7 +3449,7 @@ Function119987: ; 119987
ld l, a
ld a, [wcf65]
ld h, a
- ld de, BGPals
+ ld de, wBGPals2
ld a, $22
jp Function119e2b
diff --git a/mobile/mobile_5b.asm b/mobile/mobile_5b.asm
index 5d2e3277b..f16391871 100755
--- a/mobile/mobile_5b.asm
+++ b/mobile/mobile_5b.asm
@@ -187,7 +187,7 @@ MobileSystemSplashScreen_InitGFX: ; 16c108
; 16c130
.LoadPals: ; 16c130
- ld de, UnknBGPals
+ ld de, wBGPals1
ld hl, UnknownMobilePalettes_16c903
ld bc, 8
ld a, $5
@@ -243,8 +243,8 @@ Function16c943: ; 16c943
ld a, $5
ld [rSVBK], a
ld a, $ff
- ld bc, $0008
- ld hl, UnknBGPals
+ ld bc, 1 palettes
+ ld hl, wBGPals1
call ByteFill
pop af
ld [rSVBK], a
@@ -261,7 +261,7 @@ Function16c943: ; 16c943
call Function16cab6
call Function16cabb
ld d, a
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cabb
cp d
@@ -275,7 +275,7 @@ Function16c943: ; 16c943
jr nz, .asm_16c981
.asm_16c988
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cadc
@@ -284,7 +284,7 @@ Function16c943: ; 16c943
call Function16cab6
call Function16cad8
ld d, a
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cad8
cp d
@@ -298,7 +298,7 @@ Function16c943: ; 16c943
jr nz, .asm_16c9a9
.asm_16c9b0
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cb08
@@ -307,7 +307,7 @@ Function16c943: ; 16c943
call Function16cab6
call Function16cac4
ld d, a
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cac4
cp d
@@ -321,7 +321,7 @@ Function16c943: ; 16c943
jr nz, .asm_16c9d1
.asm_16c9d8
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cae8
@@ -371,7 +371,7 @@ Function16ca11: ; 16ca11
ld e, $0
ld a, $0
.asm_16ca28
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cabb
cp $1f
@@ -385,12 +385,12 @@ Function16ca11: ; 16ca11
jr nz, .asm_16ca37
.asm_16ca3f
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cadc
.asm_16ca48
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cad8
cp $1f
@@ -404,12 +404,12 @@ Function16ca11: ; 16ca11
jr nz, .asm_16ca57
.asm_16ca5f
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cb08
.asm_16ca68
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cac4
cp $1f
@@ -423,7 +423,7 @@ Function16ca11: ; 16ca11
jr nz, .asm_16ca77
.asm_16ca7f
- ld hl, UnknBGPals
+ ld hl, wBGPals1
call Function16cab6
call Function16cae8
@@ -682,7 +682,7 @@ Function16cbd1: ; 16cbd1
ld bc, 2
ld hl, Unknown_16cfa3
call AddNTimes
- ld de, UnknBGPals + 1 palettes + 4
+ ld de, wBGPals1 + 1 palettes + 4
ld bc, 2
ld a, $5
call FarCopyWRAM
@@ -717,13 +717,13 @@ Function16cc18: ; 16cc18
Function16cc25: ; 16cc25
ld hl, Unknown_16cfa9
- ld de, UnknBGPals + 1 palettes
+ ld de, wBGPals1 + 1 palettes
call .CopyPal
ld hl, Unknown_16cfb1
- ld de, UnknOBPals
+ ld de, wOBPals1
call .CopyPal
ld hl, Unknown_16cfb9
- ld de, UnknOBPals + 1 palettes
+ ld de, wOBPals1 + 1 palettes
call .CopyPal
ret
; 16cc41
diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm
index 18ae114cc..0e2f7d024 100755
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -281,7 +281,7 @@ Function170cc6: ; 170cc6
ld hl, LZ_1715a4
ld de, wd000
call Decompress
- ld de, UnknBGPals
+ ld de, wBGPals1
ld hl, vTiles0
lb bc, $6, $53
call Get2bpp
@@ -716,8 +716,8 @@ Function171ccd: ; 171ccd (5c:5ccd)
ld a, $5
ld [rSVBK], a
ld hl, Palette_171d71
- ld de, UnknBGPals
- ld bc, $40
+ ld de, wBGPals1
+ ld bc, 8 palettes
call CopyBytes
ld hl, EngineBuffer5
ld a, $ff
@@ -884,12 +884,12 @@ Function172eb9:
ld a, $5
ld [rSVBK], a
ld hl, Palette_172edf
- ld de, UnknBGPals
- ld bc, $40
+ ld de, wBGPals1
+ ld bc, 8 palettes
call CopyBytes
ld hl, Palette_172edf
- ld de, BGPals
- ld bc, $40
+ ld de, wBGPals2
+ ld bc, 8 palettes
call CopyBytes
call SetPalettes
pop af
diff --git a/mobile/mobile_5e.asm b/mobile/mobile_5e.asm
index 78a9e5211..daef4318f 100644
--- a/mobile/mobile_5e.asm
+++ b/mobile/mobile_5e.asm
@@ -760,27 +760,27 @@ Function17aba0: ; 17aba0 (5e:6ba0)
Function17abcf: ; 17abcf (5e:6bcf)
ld a, [rSVBK]
push af
- ld a, BANK(UnknBGPals)
+ ld a, BANK(wBGPals1)
ld [rSVBK], a
ld hl, Palette_17ac55
- ld de, UnknBGPals ; $d000
- ld bc, $30
+ ld de, wBGPals1 ; $d000
+ ld bc, 6 palettes
call CopyBytes
ld hl, Palette_17ac95
- ld de, UnknOBPals
- ld bc, $40
+ ld de, wOBPals1
+ ld bc, 8 palettes
call CopyBytes
ld hl, GFX_17afa5 + $510
- ld de, UnknOBPals + 2 * 4
- ld bc, $10
+ ld de, wOBPals1 palette 1
+ ld bc, 2 palettes
call CopyBytes
- ld hl, MapObjectPals + 8
- ld de, UnknOBPals + 6 * 4
- ld bc, $8
+ ld hl, MapObjectPals palette 1
+ ld de, wOBPals1 palette 3
+ ld bc, 1 palettes
ld a, BANK(MapObjectPals)
call FarCopyBytes
diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm
index 0228c8030..5731f01fc 100644
--- a/mobile/mobile_5f.asm
+++ b/mobile/mobile_5f.asm
@@ -44,12 +44,12 @@ Function17c000: ; 17c000
ld a, [rSVBK]
push af
- ld a, 5 ; BANK(UnknBGPals)
+ ld a, 5 ; BANK(wBGPals1)
ld [rSVBK], a
ld hl, HaveWantPals
- ld de, UnknBGPals
- ld bc, $80
+ ld de, wBGPals1
+ ld bc, 16 palettes
call CopyBytes
pop af
@@ -662,7 +662,7 @@ Function17d370: ; 17d370
ld a, $6
call GetSRAMBank
ld hl, $a006
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, $1000
call CopyBytes
call CloseSRAM
@@ -703,7 +703,7 @@ Function17d405:
ld a, $5
ld [rSVBK], a
ld hl, Palette_17eff6
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
call SetPalettes
@@ -970,7 +970,7 @@ Function17d5f6: ; 17d5f6
ld a, $5
ld [rSVBK], a
ld hl, $c608
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
ld a, $4
@@ -1218,7 +1218,7 @@ Function17d78d: ; 17d78d
call GetSRAMBank
ld hl, $a006
add hl, bc
- ld de, UnknBGPals
+ ld de, wBGPals1
ld bc, $1000
call CopyBytes
call CloseSRAM
@@ -1342,7 +1342,7 @@ Function17d85d: ; 17d85d
ld a, [hli]
ld d, a
push hl
- ld hl, UnknBGPals
+ ld hl, wBGPals1
add hl, de
ld de, wcc60
.asm_17d86c
@@ -1411,7 +1411,7 @@ Function17d85d: ; 17d85d
ld a, $3
ld [rSVBK], a
ld hl, $c608
- ld de, UnknBGPals
+ ld de, wBGPals1
ld b, $0
call CopyBytes
ld a, $4
@@ -1446,7 +1446,7 @@ Function17d902: ; 17d902
call Function17e41e
call Function17e32b
pop de
- ld hl, UnknBGPals
+ ld hl, wBGPals1
add hl, de
ld de, wcc60
.asm_17d918
@@ -1963,9 +1963,9 @@ Function17dca9: ; 17dca9
Function17dcaf:
ld a, $5
ld [rSVBK], a
- ld hl, UnknBGPals
- ld de, $8
- ld c, $8
+ ld hl, wBGPals1
+ ld de, 1 palettes
+ ld c, 8
.asm_17dcbb
push hl
ld a, $ff
@@ -3135,7 +3135,7 @@ Function17e409: ; 17e409
; 17e40f
Function17e40f: ; 17e40f
- ld de, UnknBGPals
+ ld de, wBGPals1
add hl, de
jr Function17e41e
@@ -4377,7 +4377,7 @@ Function17f3f0: ; 17f3f0
ld e, a
ld a, [hli]
ld d, a
- ld hl, UnknBGPals
+ ld hl, wBGPals1
add hl, de
ld e, l
ld d, h