summaryrefslogtreecommitdiff
path: root/predef/cgb.asm
diff options
context:
space:
mode:
Diffstat (limited to 'predef/cgb.asm')
-rw-r--r--predef/cgb.asm543
1 files changed, 273 insertions, 270 deletions
diff --git a/predef/cgb.asm b/predef/cgb.asm
index 300ca9f9a..9a24dfce1 100644
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -11,15 +11,14 @@ Predef_LoadSGBLayoutCGB: ; 8d59
cp SCGB_RAM
jr nz, .not_ram
ld a, [SGBPredef]
-
.not_ram
- cp SCGB_FC
- jp z, Function96f3
+ cp SCGB_PARTY_MENU_HP_PALS
+ jp z, CGB_ApplyPartyMenuHPPals
call Function9673
ld l, a
ld h, 0
add hl, hl
- ld de, .jumptable
+ ld de, .dw
add hl, de
ld a, [hli]
ld h, [hl]
@@ -33,17 +32,17 @@ Predef_LoadSGBLayoutCGB: ; 8d59
ret
; 8d7a
-.jumptable: ; 8d7a
- dw _CGB00
- dw _CGB01
- dw _CGB02
- dw _CGB03
+.dw: ; 8d7a
+ dw _CGB_BattleGrayscale
+ dw _CGB_BattleColors
+ dw _CGB_PokegearPals
+ dw _CGB_StatsScreenHPPals
dw _CGB04
- dw _CGB05
+ dw _CGB_SlotMachine
dw _CGB06
dw _CGB07
dw _CGB08
- dw _CGB09
+ dw _CGB_MapPals
dw _CGB0a
dw _CGB0b
dw _CGB0c
@@ -54,73 +53,70 @@ Predef_LoadSGBLayoutCGB: ; 8d59
dw _CGB11
dw _CGB12
dw _CGB13
- dw _CGB14
- dw _CGB15
+ dw _CGB_PackPals
+ dw _CGB_TrainerCard
dw _CGB16
dw _CGB17
dw _CGB18
dw _CGB19
dw _CGB1a
dw _CGB1b
- dw _CGB1c
+ dw _CGB_FrontpicPals
dw _CGB1d
dw _CGB1e
; 8db8
-_CGB00: ; 8db8
+_CGB_BattleGrayscale: ; 8db8
ld hl, PalPacket_9c66 + 1
ld de, UnknBGPals
ld c, $4
call CopyPalettes
ld hl, PalPacket_9c66 + 1
- ld de, UnknBGPals + $20
+ ld de, UnknBGPals + 4 palettes
ld c, $4
call CopyPalettes
ld hl, PalPacket_9c66 + 1
ld de, UnknOBPals
ld c, $2
call CopyPalettes
- jr Function8e23
+ jr _CGB_FinishBattleScreenLayout
-_CGB01: ; 8ddb
+_CGB_BattleColors: ; 8ddb
ld de, UnknBGPals
- call Function9729
+ call GetBattlemonBackpicPalettePointer
push hl
- call Function9643
- call Function973a
+ call LoadPalette_White_Col1_Col2_Black
+ call GetEnemyFrontpicPalettePointer
push hl
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
ld a, [EnemyHPPal]
ld l, a
ld h, $0
-rept 2
add hl, hl
-endr
+ add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
ld a, [PlayerHPPal]
ld l, a
ld h, $0
-rept 2
add hl, hl
-endr
+ add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
ld hl, Palettes_a8ca
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
ld de, UnknOBPals
pop hl
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
pop hl
- call Function9643
- ld a, SCGB_01
+ call LoadPalette_White_Col1_Col2_Black
+ ld a, SCGB_BATTLE_COLORS
ld [SGBPredef], a
- call Function96a4
-
-Function8e23: ; 8e23
- call Function8e85
+ call ApplyPals
+_CGB_FinishBattleScreenLayout: ; 8e23
+ call InitPartyMenuBGPal7
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, $2
@@ -150,111 +146,112 @@ Function8e23: ; 8e23
ld a, $7
call ByteFill
ld hl, Palettes_979c
- ld de, UnknOBPals + $10
- ld bc, $0030
+ ld de, UnknOBPals + 2 palettes
+ ld bc, 6 palettes
ld a, $5
call FarCopyWRAM
- call Function96b3
+ call ApplyAttrMap
ret
; 8e85
-Function8e85: ; 8e85
+InitPartyMenuBGPal7: ; 8e85
callba Function100dc0
-
-Function8e8b: ; 8e8b
+Mobile_InitPartyMenuBGPal7: ; 8e8b
ld hl, Palette_b311
- jr nc, .asm_8e93
+ jr nc, .not_mobile
ld hl, Palette_b309
-
-.asm_8e93
+.not_mobile
ld de, UnknBGPals + 8 * 7
- ld bc, $0008
+ ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
ret
; 8e9f
-Function8e9f: ; 8e9f
+InitPartyMenuBGPal0: ; 8e9f
callba Function100dc0
ld hl, Palette_b311
- jr nc, .asm_8ead
+ jr nc, .not_mobile
ld hl, Palette_b309
-
-.asm_8ead
+.not_mobile
ld de, UnknBGPals
- ld bc, $0008
+ ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
ret
; 8eb9
-_CGB02: ; 8eb9
+_CGB_PokegearPals: ; 8eb9
ld a, [PlayerGender]
bit 0, a
- jr z, .asm_8ec5
- ld hl, Palettes_b759
- jr .asm_8ec8
-
-.asm_8ec5
- ld hl, Palettes_b729
+ jr z, .male
+ ld hl, FemalePokegearPals
+ jr .got_pals
-.asm_8ec8
+.male
+ ld hl, MalePokegearPals
+.got_pals
ld de, UnknBGPals
- ld bc, $0030
+ ld bc, 6 palettes
ld a, $5
call FarCopyWRAM
- call Function96a4
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
; 8edb
-_CGB03: ; 8edb
+_CGB_StatsScreenHPPals: ; 8edb
ld de, UnknBGPals
ld a, [wcda1]
ld l, a
ld h, $0
-rept 2
add hl, hl
-endr
+ add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
ld a, [CurPartySpecies]
ld bc, TempMonDVs
- call Function974b
- call Function9643
+ call GetPlayerOrMonPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld hl, Palettes_a8ca
- call Function9643
+ call LoadPalette_White_Col1_Col2_Black
ld hl, Palette8f52
ld de, UnknBGPals + 8 * 3
- ld bc, $0018
+ ld bc, 3 palettes
ld a, $5
call FarCopyWRAM
- call Function9699
+ call WipeAttrMap
+
hlcoord 0, 0, AttrMap
lb bc, 8, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
+
hlcoord 10, 16, AttrMap
- ld bc, $000a
+ ld bc, 10
ld a, $2
call ByteFill
+
hlcoord 13, 5, AttrMap
lb bc, 2, 2
ld a, $3
call FillBoxCGB
+
hlcoord 15, 5, AttrMap
lb bc, 2, 2
ld a, $4
call FillBoxCGB
+
hlcoord 17, 5, AttrMap
lb bc, 2, 2
ld a, $5
call FillBoxCGB
- call Function96b3
- call Function96a4
+
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -277,7 +274,7 @@ Palette8f52: ; 8f52
RGB 00, 00, 00
; 8f6a
-Unknown_8f6a: ; 8f6a
+StatsScreenPals: ; 8f6a
RGB 31, 19, 31
RGB 21, 31, 14
@@ -288,33 +285,32 @@ Unknown_8f6a: ; 8f6a
_CGB04: ; 8f70
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
cp $ff
- jr nz, .asm_8f8a
+ jr nz, .is_pokemon
ld hl, Palette8fba
call LoadHLPaletteIntoDE
- jr .asm_8f90
+ jr .got_palette
-.asm_8f8a
- call Function9775
- call Function9643
-
-.asm_8f90
- call Function9699
+.is_pokemon
+ call GetMonPalettePointer_
+ call LoadPalette_White_Col1_Col2_Black
+.got_palette
+ call WipeAttrMap
hlcoord 1, 1, AttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
- call Function971a
+ call InitPartyMenuOBPals
ld hl, Palette8fc2
- ld de, UnknOBPals + $38
- ld bc, $0008
+ ld de, UnknOBPals + 7 palettes
+ ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -336,29 +332,28 @@ Palette8fc2: ; 8fc2
_CGB17: ; 8fca
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
cp $ff
- jr nz, .asm_8fe4
+ jr nz, .GetMonPalette
ld hl, Palette9036
call LoadHLPaletteIntoDE
- jr .asm_8fed
+ jr .Resume
-.asm_8fe4
+.GetMonPalette
ld bc, TempMonDVs
- call Function974b
- call Function9643
-
-.asm_8fed
- call Function9699
+ call GetPlayerOrMonPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
+.Resume
+ call WipeAttrMap
hlcoord 1, 4, AttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
- call Function971a
- call Function96b3
- call Function96a4
+ call InitPartyMenuOBPals
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -369,19 +364,19 @@ Function9009: ; 9009
call LoadHLPaletteIntoDE
jr .asm_901a
+.unused
ld bc, TempMonDVs
- call Function974b
- call Function9643
-
+ call GetPlayerOrMonPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
.asm_901a
- call Function9699
+ call WipeAttrMap
hlcoord 1, 1, AttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
- call Function971a
- call Function96b3
- call Function96a4
+ call InitPartyMenuOBPals
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -397,31 +392,31 @@ Palette9036: ; 9036
_CGB16: ; 903e
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
- call Function9775
- call Function9643
- call Function9699
+ call GetMonPalettePointer_
+ call LoadPalette_White_Col1_Col2_Black
+ call WipeAttrMap
hlcoord 7, 5, AttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
- call Function971a
- call Function96b3
- call Function96a4
+ call InitPartyMenuOBPals
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
; 906e
-_CGB05: ; 906e
+_CGB_SlotMachine: ; 906e
ld hl, Palettes_b7a9
ld de, UnknBGPals
- ld bc, $0080
+ ld bc, $80
ld a, $5
call FarCopyWRAM
- call Function9699
+ call WipeAttrMap
hlcoord 0, 2, AttrMap
lb bc, 10, 3
ld a, $2
@@ -459,11 +454,11 @@ _CGB05: ; 906e
ld a, $1
call FillBoxCGB
hlcoord 0, 12, AttrMap
- ld bc, $0078
+ ld bc, $78
ld a, $7
call ByteFill
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -472,17 +467,17 @@ _CGB05: ; 906e
_CGB06: ; 90f8
ld hl, PalPacket_9ca6 + 1
call CopyFourPalettes
- call Function9699
+ call WipeAttrMap
ld de, UnknOBPals
ld a, $3c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
hlcoord 0, 6, AttrMap
lb bc, 12, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -491,9 +486,8 @@ _CGB06: ; 90f8
_CGB07: ; 9122
ld b, 0
ld hl, Jumptable_912d
-rept 2
add hl, bc
-endr
+ add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
@@ -512,10 +506,10 @@ Function9133: ; 9133
call LoadHLPaletteIntoDE
ld hl, Palette_9156
ld de, UnknOBPals
- ld bc, $0010
+ ld bc, 2 palettes
ld a, $5
call FarCopyWRAM
- call Function9699
+ call WipeAttrMap
ret
; 914e
@@ -540,13 +534,14 @@ Palette_9156: ; 9156
Function9166: ; 9166
ld de, UnknBGPals
ld a, $38
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
+
ld de, UnknOBPals
ld a, $39
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- call Function9699
+ call WipeAttrMap
ret
; 9180
@@ -555,40 +550,41 @@ Function9180: ; 9180
call CopyFourPalettes
ld de, UnknOBPals
ld a, $3a
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- call Function9699
+ call WipeAttrMap
ret
; 9195
_CGB11: ; 9195
ld hl, Palettes_b789
ld de, UnknBGPals
- ld bc, $0028
+ ld bc, 5 palettes
ld a, $5
call FarCopyWRAM
- call Function96a4
- call Function9699
- call Function96b3
+ call ApplyPals
+ call WipeAttrMap
+ call ApplyAttrMap
ret
; 91ad
_CGB08: ; 91ad
ld hl, Palettes_b641
ld de, UnknBGPals
- ld bc, $0080
+ ld bc, 16 palettes
ld a, $5
call FarCopyWRAM
+
ld hl, PalPacket_9cb6 + 1
call CopyFourPalettes
- call Function9699
- call Function96b3
+ call WipeAttrMap
+ call ApplyAttrMap
ret
; 91c8
-_CGB09: ; 91c8
- call Functionb1de
- ld a, SCGB_09
+_CGB_MapPals: ; 91c8
+ call LoadMapPals
+ ld a, SCGB_MAPPALS
ld [SGBPredef], a
ret
; 91d1
@@ -596,10 +592,10 @@ _CGB09: ; 91c8
_CGB0a: ; 91d1
ld hl, PalPacket_9c56 + 1
call CopyFourPalettes
- call Function8e9f
- call Function8e85
- call Function971a
- call Function96b3
+ call InitPartyMenuBGPal0
+ call InitPartyMenuBGPal7
+ call InitPartyMenuOBPals
+ call ApplyAttrMap
ret
; 91e4
@@ -607,13 +603,13 @@ _CGB0b: ; 91e4
ld de, UnknBGPals
ld a, c
and a
- jr z, .asm_91f5
+ jr z, .pokemon
ld a, $1a
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- jr .asm_921a
+ jr .got_palette
-.asm_91f5
+.pokemon
ld hl, PartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [CurPartyMon]
@@ -621,18 +617,18 @@ _CGB0b: ; 91e4
ld c, l
ld b, h
ld a, [PlayerHPPal]
- call Function974b
- call Function9643
+ call GetPlayerOrMonPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld hl, Palettes_979c
- ld de, UnknOBPals + $10
- ld bc, $0030
+ ld de, UnknOBPals + 2 palettes
+ ld bc, 6 palettes
ld a, $5
call FarCopyWRAM
-.asm_921a
- call Function9699
- call Function96b3
- call Function96a4
+.got_palette
+ call WipeAttrMap
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -641,17 +637,17 @@ _CGB0b: ; 91e4
_CGB0c: ; 9228
ld hl, Palettes_b6f1
ld de, UnknBGPals
- ld bc, $0028
+ ld bc, 5 palettes
ld a, $5
call FarCopyWRAM
ld hl, Palettes_b719
ld de, UnknOBPals
- ld bc, $0010
+ ld bc, 2 palettes
ld a, $5
call FarCopyWRAM
ld a, SCGB_08
ld [SGBPredef], a
- call Function96a4
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -660,8 +656,8 @@ _CGB0c: ; 9228
_CGB0d: ; 9251
ld hl, PalPacket_9cb6 + 1
call CopyFourPalettes
- call Function9699
- call Function96b3
+ call WipeAttrMap
+ call ApplyAttrMap
ret
; 925e
@@ -670,7 +666,7 @@ _CGB18: ; 925e
call CopyFourPalettes
ld de, UnknOBPals
ld a, $4c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [rSVBK]
push af
@@ -683,59 +679,58 @@ _CGB18: ; 925e
ld [hl], a
pop af
ld [rSVBK], a
- call Function9699
- call Function96b3
+ call WipeAttrMap
+ call ApplyAttrMap
ret
; 9289
-_CGB15: ; 9289
+_CGB_TrainerCard: ; 9289
ld de, UnknBGPals
xor a
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $1
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $3
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $2
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $4
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $7
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $6
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $5
- call Function976b
- call Function9643
+ call GetTrainerPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
ld a, $24
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
+
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, [PlayerGender]
and a
ld a, $1
- jr z, .asm_92e3
+ jr z, .got_gender
ld a, $0
-
-.asm_92e3
+.got_gender
call ByteFill
hlcoord 14, 1, AttrMap
lb bc, 7, 5
ld a, [PlayerGender]
and a
ld a, $0
- jr z, .asm_92f6
+ jr z, .got_gender2
ld a, $1
-
-.asm_92f6
+.got_gender2
call FillBoxCGB
hlcoord 18, 1, AttrMap
ld [hl], $1
@@ -770,24 +765,22 @@ _CGB15: ; 9289
ld a, [PlayerGender]
and a
push af
- jr z, .asm_935d
+ jr z, .got_gender3
hlcoord 14, 14, AttrMap
lb bc, 2, 4
ld a, $1
call FillBoxCGB
-
-.asm_935d
+.got_gender3
pop af
ld c, $0
- jr nz, .asm_9363
+ jr nz, .got_gender4
inc c
-
-.asm_9363
+.got_gender4
ld a, c
hlcoord 18, 1, AttrMap
ld [hl], a
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -796,24 +789,23 @@ _CGB15: ; 9289
_CGB0e: ; 9373
ld de, UnknBGPals
ld a, $10
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [PlayerHPPal]
ld l, a
ld h, 0
-rept 2
add hl, hl
-endr
+ add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call Function9643
- call Function9699
+ call LoadPalette_White_Col1_Col2_Black
+ call WipeAttrMap
hlcoord 11, 1, AttrMap
lb bc, 2, 9
ld a, $1
call FillBoxCGB
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -822,9 +814,9 @@ endr
_CGB0f: ; 93a6
ld hl, PalPacket_9c46 + 1
call CopyFourPalettes
- call Function9699
- call Function96b3
- call Function96a4
+ call WipeAttrMap
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -833,37 +825,38 @@ _CGB0f: ; 93a6
_CGB10: ; 93ba
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- call Function9699
- call Function96b3
- call Function96a4
+ call WipeAttrMap
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
; 93d3
-_CGB14: ; 93d3
+_CGB_PackPals: ; 93d3
+; pack pals
ld a, [BattleType]
cp BATTLETYPE_TUTORIAL
- jr z, .asm_93e6
+ jr z, .tutorial_male
ld a, [PlayerGender]
bit 0, a
- jr z, .asm_93e6
+ jr z, .tutorial_male
- ld hl, Palettes_9469
- jr .asm_93e9
+ ld hl, .KrisPackPals
+ jr .got_gender
-.asm_93e6
- ld hl, Palettes_9439
+.tutorial_male
+ ld hl, .ChrisPackPals
-.asm_93e9
+.got_gender
ld de, UnknBGPals
- ld bc, $0040
+ ld bc, 8 palettes ; 6 palettes?
ld a, $5
call FarCopyWRAM
- call Function9699
+ call WipeAttrMap
hlcoord 0, 0, AttrMap
lb bc, 1, 10
ld a, $1
@@ -884,61 +877,71 @@ _CGB14: ; 93d3
lb bc, 3, 5
ld a, $5
call FillBoxCGB
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
; 9439
-Palettes_9439: ; 9439
+.ChrisPackPals: ; 9439
RGB 31, 31, 31
RGB 15, 15, 31
RGB 00, 00, 31
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 15, 15, 31
RGB 00, 00, 31
RGB 00, 00, 00
+
RGB 31, 11, 31
RGB 15, 15, 31
RGB 00, 00, 31
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 15, 15, 31
RGB 00, 00, 31
RGB 31, 00, 00
+
RGB 31, 31, 31
RGB 15, 15, 31
RGB 31, 00, 00
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 07, 19, 07
RGB 07, 19, 07
RGB 00, 00, 00
; 9469
-Palettes_9469: ; 9469
+.KrisPackPals: ; 9469
RGB 31, 31, 31
RGB 31, 14, 31
RGB 31, 07, 31
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 31, 14, 31
RGB 31, 07, 31
RGB 00, 00, 00
+
RGB 15, 15, 31
RGB 31, 14, 31
RGB 31, 07, 31
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 31, 14, 31
RGB 31, 07, 31
RGB 31, 00, 00
+
RGB 31, 31, 31
RGB 31, 14, 31
RGB 31, 00, 00
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 07, 19, 07
RGB 07, 19, 07
@@ -946,18 +949,18 @@ Palettes_9469: ; 9469
; 9499
_CGB12: ; 9499
- call _CGB09
- ld de, $0014
+ call _CGB_MapPals
+ ld de, SCREEN_WIDTH
hlcoord 0, 0, AttrMap
ld a, [wMenuBorderTopCoord]
-.asm_94a5
+.loop
and a
- jr z, .asm_94ac
+ jr z, .found_top
dec a
add hl, de
- jr .asm_94a5
+ jr .loop
-.asm_94ac
+.found_top
ld a, [wMenuBorderLeftCoord]
ld e, a
ld d, $0
@@ -976,14 +979,14 @@ _CGB12: ; 9499
ld c, a
ld a, $0
call FillBoxCGB
- call Function96b3
+ call ApplyAttrMap
ret
; 94d0
_CGB13: ; 94d0
ld hl, PalPacket_9ba6 + 1
call CopyFourPalettes
- call Function9699
+ call WipeAttrMap
hlcoord 0, 4, AttrMap
lb bc, 10, SCREEN_WIDTH
ld a, $2
@@ -992,8 +995,8 @@ _CGB13: ; 94d0
lb bc, 6, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
- call Function96b3
- call Function96a4
+ call ApplyAttrMap
+ call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
ret
@@ -1002,21 +1005,21 @@ _CGB13: ; 94d0
_CGB19: ; 94fa
ld de, UnknBGPals
ld a, $4e
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- ld hl, Palette_9521
+ ld hl, .Palette
ld de, UnknOBPals
call LoadHLPaletteIntoDE
- ld hl, Palette_9521
- ld de, UnknOBPals + 8
+ ld hl, .Palette
+ ld de, UnknOBPals + 1 palettes
call LoadHLPaletteIntoDE
- call Function9699
- call Function96b3
- call Function96a4
+ call WipeAttrMap
+ call ApplyAttrMap
+ call ApplyPals
ret
; 9521
-Palette_9521: ; 9521
+.Palette: ; 9521
RGB 31, 31, 31
RGB 13, 11, 00
RGB 23, 12, 28
@@ -1027,21 +1030,21 @@ _CGB1a: ; 9529
ld de, UnknBGPals
ld a, [CurPartySpecies]
ld bc, TempMonDVs
- call Function974b
- call Function9643
- call Function9699
- call Function96b3
- call Function96a4
+ call GetPlayerOrMonPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
+ call WipeAttrMap
+ call ApplyAttrMap
+ call ApplyPals
ret
; 9542
_CGB1e: ; 9542
ld de, UnknBGPals
ld a, [CurPartySpecies]
- call Function9775
- call Function9643
- call Function9699
- call Function96b3
+ call GetMonPalettePointer_
+ call LoadPalette_White_Col1_Col2_Black
+ call WipeAttrMap
+ call ApplyAttrMap
ret
; 9555
@@ -1050,37 +1053,37 @@ _CGB1b: ; 9555
call CopyFourPalettes
ld hl, Palettes_b681
ld de, UnknOBPals
- ld bc, $0008
+ ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
- ld de, UnknOBPals + $38
+ ld de, UnknOBPals + 7 palettes
ld a, $1c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- call Function9699
+ call WipeAttrMap
ret
; 9578
-_CGB1c: ; 9578
+_CGB_FrontpicPals: ; 9578
ld de, UnknBGPals
ld a, [CurPartySpecies]
ld bc, TempMonDVs
- call Function9764
- call Function9643
- call Function9699
- call Function96b3
- call Function96a4
+ call GetFrontpicPalettePointer
+ call LoadPalette_White_Col1_Col2_Black
+ call WipeAttrMap
+ call ApplyAttrMap
+ call ApplyPals
ret
; 9591
_CGB1d: ; 9591
- ld hl, Palette95e0
+ ld hl, .Palettes
ld de, UnknBGPals
- ld bc, $0010
+ ld bc, 2 palettes
ld a, $5
call FarCopyWRAM
- call Function96a4
- call Function9699
+ call ApplyPals
+ call WipeAttrMap
hlcoord 3, 7, AttrMap
lb bc, 8, 14
ld a, $1
@@ -1101,11 +1104,11 @@ _CGB1d: ; 9591
lb bc, 12, 1
ld a, $1
call FillBoxCGB
- call Function96b3
+ call ApplyAttrMap
ret
; 95e0
-Palette95e0: ; 95e0
+.Palettes: ; 95e0
RGB 31, 31, 31
RGB 16, 31, 14
RGB 05, 14, 21