summaryrefslogtreecommitdiff
path: root/predef/cgb.asm
diff options
context:
space:
mode:
Diffstat (limited to 'predef/cgb.asm')
-rw-r--r--predef/cgb.asm178
1 files changed, 92 insertions, 86 deletions
diff --git a/predef/cgb.asm b/predef/cgb.asm
index af762221e..7ede2768f 100644
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -69,15 +69,15 @@ Predef_LoadSGBLayoutCGB: ; 8d59
_CGB_BattleGrayscale: ; 8db8
ld hl, PalPacket_9c66 + 1
ld de, UnknBGPals
- ld c, $4
+ ld c, 4
call CopyPalettes
ld hl, PalPacket_9c66 + 1
- ld de, UnknBGPals + 4 palettes
- ld c, $4
+ ld de, UnknBGPals palette PAL_BATTLE_BG_EXP
+ ld c, 4
call CopyPalettes
ld hl, PalPacket_9c66 + 1
ld de, UnknOBPals
- ld c, $2
+ ld c, 2
call CopyPalettes
jr _CGB_FinishBattleScreenLayout
@@ -85,10 +85,10 @@ _CGB_BattleColors: ; 8ddb
ld de, UnknBGPals
call GetBattlemonBackpicPalettePointer
push hl
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_PLAYER
call GetEnemyFrontpicPalettePointer
push hl
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_ENEMY
ld a, [EnemyHPPal]
ld l, a
ld h, $0
@@ -96,7 +96,7 @@ _CGB_BattleColors: ; 8ddb
add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_ENEMY_HP
ld a, [PlayerHPPal]
ld l, a
ld h, $0
@@ -104,14 +104,14 @@ _CGB_BattleColors: ; 8ddb
add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_PLAYER_HP
ld hl, Palettes_a8ca
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_EXP
ld de, UnknOBPals
pop hl
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_ENEMY
pop hl
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_PLAYER
ld a, SCGB_BATTLE_COLORS
ld [SGBPredef], a
call ApplyPals
@@ -119,34 +119,34 @@ _CGB_FinishBattleScreenLayout: ; 8e23
call InitPartyMenuBGPal7
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
- ld a, $2
+ ld a, PAL_BATTLE_BG_ENEMY_HP
call ByteFill
hlcoord 0, 4, AttrMap
lb bc, 8, 10
- ld a, $0
+ ld a, PAL_BATTLE_BG_PLAYER
call FillBoxCGB
hlcoord 10, 0, AttrMap
lb bc, 7, 10
- ld a, $1
+ ld a, PAL_BATTLE_BG_ENEMY
call FillBoxCGB
hlcoord 0, 0, AttrMap
lb bc, 4, 10
- ld a, $2
+ ld a, PAL_BATTLE_BG_ENEMY_HP
call FillBoxCGB
hlcoord 10, 7, AttrMap
lb bc, 5, 10
- ld a, $3
+ ld a, PAL_BATTLE_BG_PLAYER_HP
call FillBoxCGB
hlcoord 10, 11, AttrMap
lb bc, 1, 9
- ld a, $4
+ ld a, PAL_BATTLE_BG_EXP
call FillBoxCGB
hlcoord 0, 12, AttrMap
ld bc, 6 * SCREEN_WIDTH
- ld a, $7
+ ld a, PAL_BATTLE_BG_TEXT
call ByteFill
ld hl, Palettes_979c
- ld de, UnknOBPals + 2 palettes
+ ld de, UnknOBPals palette PAL_BATTLE_OB_GRAY
ld bc, 6 palettes
ld a, $5
call FarCopyWRAM
@@ -162,7 +162,7 @@ Mobile_InitPartyMenuBGPal7: ; 8e8b
jr nc, .not_mobile
ld hl, Palette_b309
.not_mobile
- ld de, UnknBGPals + 8 * 7
+ ld de, UnknBGPals palette 7
ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
@@ -175,7 +175,7 @@ InitPartyMenuBGPal0: ; 8e9f
jr nc, .not_mobile
ld hl, Palette_b309
.not_mobile
- ld de, UnknBGPals
+ ld de, UnknBGPals palette 0
ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
@@ -211,43 +211,43 @@ _CGB_StatsScreenHPPals: ; 8edb
add hl, hl
ld bc, Palettes_a8be
add hl, bc
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; hp palette
ld a, [CurPartySpecies]
ld bc, TempMonDVs
call GetPlayerOrMonPalettePointer
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; mon palette
ld hl, Palettes_a8ca
- call LoadPalette_White_Col1_Col2_Black
- ld hl, Palette8f52
- ld de, UnknBGPals + 8 * 3
- ld bc, 3 palettes
+ call LoadPalette_White_Col1_Col2_Black ; exp palette
+ ld hl, StatsScreenPagePals
+ ld de, UnknBGPals palette 3
+ ld bc, 3 palettes ; pink, green, and blue page palettes
ld a, $5
call FarCopyWRAM
call WipeAttrMap
hlcoord 0, 0, AttrMap
lb bc, 8, SCREEN_WIDTH
- ld a, $1
+ ld a, $1 ; mon palette
call FillBoxCGB
hlcoord 10, 16, AttrMap
ld bc, 10
- ld a, $2
+ ld a, $2 ; exp palette
call ByteFill
hlcoord 13, 5, AttrMap
lb bc, 2, 2
- ld a, $3
+ ld a, $3 ; pink page palette
call FillBoxCGB
hlcoord 15, 5, AttrMap
lb bc, 2, 2
- ld a, $4
+ ld a, $4 ; green page palette
call FillBoxCGB
hlcoord 17, 5, AttrMap
lb bc, 2, 2
- ld a, $5
+ ld a, $5 ; blue page palette
call FillBoxCGB
call ApplyAttrMap
@@ -257,17 +257,18 @@ _CGB_StatsScreenHPPals: ; 8edb
ret
; 8f52
-Palette8f52: ; 8f52
+StatsScreenPagePals: ; 8f52
+; pink
RGB 31, 31, 31
RGB 31, 19, 31
RGB 31, 15, 31
RGB 00, 00, 00
-
+; green
RGB 31, 31, 31
RGB 21, 31, 14
RGB 17, 31, 00
RGB 00, 00, 00
-
+; blue
RGB 31, 31, 31
RGB 17, 31, 31
RGB 17, 31, 31
@@ -275,10 +276,11 @@ Palette8f52: ; 8f52
; 8f6a
StatsScreenPals: ; 8f6a
+; pink
RGB 31, 19, 31
-
+; green
RGB 21, 31, 14
-
+; blue
RGB 17, 31, 31
; 8f70
@@ -286,26 +288,26 @@ _CGB_Pokedex: ; 8f70
ld de, UnknBGPals
ld a, $1d
call GetPredefPal
- call LoadHLPaletteIntoDE
+ call LoadHLPaletteIntoDE ; dex interface palette
ld a, [CurPartySpecies]
cp $ff
jr nz, .is_pokemon
- ld hl, Palette8fba
- call LoadHLPaletteIntoDE
+ ld hl, .PokedexQuestionMarkPalette
+ call LoadHLPaletteIntoDE ; green question mark palette
jr .got_palette
.is_pokemon
call GetMonPalettePointer_
- call LoadPalette_White_Col1_Col2_Black
+ call LoadPalette_White_Col1_Col2_Black ; mon palette
.got_palette
call WipeAttrMap
hlcoord 1, 1, AttrMap
lb bc, 7, 7
- ld a, $1
+ ld a, $1 ; green question mark palette
call FillBoxCGB
call InitPartyMenuOBPals
- ld hl, Palette8fc2
- ld de, UnknOBPals + 7 palettes
+ ld hl, .PokedexCursorPalette
+ ld de, UnknOBPals palette 7 ; green cursor palette
ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
@@ -316,13 +318,13 @@ _CGB_Pokedex: ; 8f70
ret
; 8fba
-Palette8fba: ; 8fba
+.PokedexQuestionMarkPalette: ; 8fba
RGB 11, 23, 00
RGB 07, 17, 00
RGB 06, 16, 03
RGB 05, 12, 01
-Palette8fc2: ; 8fc2
+.PokedexCursorPalette: ; 8fc2
RGB 00, 00, 00
RGB 11, 23, 00
RGB 07, 17, 00
@@ -337,7 +339,7 @@ _CGB_BillsPC: ; 8fca
ld a, [CurPartySpecies]
cp $ff
jr nz, .GetMonPalette
- ld hl, Palette9036
+ ld hl, .BillsPCOrangePalette
call LoadHLPaletteIntoDE
jr .Resume
@@ -359,8 +361,8 @@ _CGB_BillsPC: ; 8fca
ret
; 9009
-Function9009: ; 9009
- ld hl, Palette9036
+.Function9009: ; 9009
+ ld hl, .BillsPCOrangePalette
call LoadHLPaletteIntoDE
jr .asm_901a
@@ -382,7 +384,7 @@ Function9009: ; 9009
ret
; 9036
-Palette9036: ; 9036
+.BillsPCOrangePalette: ; 9036
RGB 31, 15, 00
RGB 23, 12, 00
RGB 15, 07, 00
@@ -411,9 +413,9 @@ _CGB_PokedexUnownMode: ; 903e
; 906e
_CGB_SlotMachine: ; 906e
- ld hl, Palettes_b7a9
+ ld hl, SlotMachinePals
ld de, UnknBGPals
- ld bc, $80
+ ld bc, 16 palettes
ld a, $5
call FarCopyWRAM
call WipeAttrMap
@@ -485,7 +487,7 @@ _CGB06: ; 90f8
_CGB07: ; 9122
ld b, 0
- ld hl, Jumptable_912d
+ ld hl, .Jumptable
add hl, bc
add hl, bc
ld a, [hli]
@@ -494,17 +496,17 @@ _CGB07: ; 9122
jp hl
; 912d
-Jumptable_912d: ; 912d
- dw Function9133
- dw Function9166
- dw Function9180
+.Jumptable: ; 912d
+ dw .Function9133
+ dw .Function9166
+ dw .Function9180
; 9133
-Function9133: ; 9133
- ld hl, Palette_914e
+.Function9133: ; 9133
+ ld hl, .Palette_914e
ld de, UnknBGPals
call LoadHLPaletteIntoDE
- ld hl, Palette_9156
+ ld hl, .Palette_9156
ld de, UnknOBPals
ld bc, 2 palettes
ld a, $5
@@ -513,13 +515,13 @@ Function9133: ; 9133
ret
; 914e
-Palette_914e: ; 914e
+.Palette_914e: ; 914e
RGB 19, 31, 19
RGB 18, 23, 31
RGB 11, 21, 28
RGB 04, 16, 24
-Palette_9156: ; 9156
+.Palette_9156: ; 9156
RGB 29, 29, 29
RGB 20, 19, 20
RGB 19, 06, 04
@@ -531,7 +533,7 @@ Palette_9156: ; 9156
RGB 03, 04, 06
; 9166
-Function9166: ; 9166
+.Function9166: ; 9166
ld de, UnknBGPals
ld a, $38
call GetPredefPal
@@ -545,7 +547,7 @@ Function9166: ; 9166
ret
; 9180
-Function9180: ; 9180
+.Function9180: ; 9180
ld hl, PalPacket_9c36 + 1
call CopyFourPalettes
ld de, UnknOBPals
@@ -620,7 +622,7 @@ _CGB_Evolution: ; 91e4
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
ld hl, Palettes_979c
- ld de, UnknOBPals + 2 palettes
+ ld de, UnknOBPals palette 2
ld bc, 6 palettes
ld a, $5
call FarCopyWRAM
@@ -686,82 +688,86 @@ _CGB_UnownPuzzle: ; 925e
_CGB_TrainerCard: ; 9289
ld de, UnknBGPals
- xor a
+ xor a ; CHRIS
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $1
+ ld a, FALKNER ; KRIS
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $3
+ ld a, BUGSY
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $2
+ ld a, WHITNEY
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $4
+ ld a, MORTY
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $7
+ ld a, CHUCK
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $6
+ ld a, JASMINE
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
- ld a, $5
+ ld a, PRYCE
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
ld a, $24
call GetPredefPal
call LoadHLPaletteIntoDE
+ ; fill screen with opposite-gender palette for the card border
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, [PlayerGender]
and a
- ld a, $1
+ ld a, $1 ; kris
jr z, .got_gender
- ld a, $0
+ ld a, $0 ; chris
.got_gender
call ByteFill
+ ; fill trainer sprite area with same-gender palette
hlcoord 14, 1, AttrMap
lb bc, 7, 5
ld a, [PlayerGender]
and a
- ld a, $0
+ ld a, $0 ; chris
jr z, .got_gender2
- ld a, $1
+ ld a, $1 ; kris
.got_gender2
call FillBoxCGB
+ ; top-right corner still uses the border's palette
hlcoord 18, 1, AttrMap
ld [hl], $1
hlcoord 2, 11, AttrMap
lb bc, 2, 4
- ld a, $1
+ ld a, $1 ; falkner
call FillBoxCGB
hlcoord 6, 11, AttrMap
lb bc, 2, 4
- ld a, $2
+ ld a, $2 ; bugsy
call FillBoxCGB
hlcoord 10, 11, AttrMap
lb bc, 2, 4
- ld a, $3
+ ld a, $3 ; whitney
call FillBoxCGB
hlcoord 14, 11, AttrMap
lb bc, 2, 4
- ld a, $4
+ ld a, $4 ; morty
call FillBoxCGB
hlcoord 2, 14, AttrMap
lb bc, 2, 4
- ld a, $5
+ ld a, $5 ; chuck
call FillBoxCGB
hlcoord 6, 14, AttrMap
lb bc, 2, 4
- ld a, $6
+ ld a, $6 ; jasmine
call FillBoxCGB
hlcoord 10, 14, AttrMap
lb bc, 2, 4
- ld a, $7
+ ld a, $7 ; pryce
call FillBoxCGB
+ ; clair uses kris's palette
ld a, [PlayerGender]
and a
push af
@@ -1011,7 +1017,7 @@ _CGB_GamefreakLogo: ; 94fa
ld de, UnknOBPals
call LoadHLPaletteIntoDE
ld hl, .Palette
- ld de, UnknOBPals + 1 palettes
+ ld de, UnknOBPals palette 1
call LoadHLPaletteIntoDE
call WipeAttrMap
call ApplyAttrMap
@@ -1056,7 +1062,7 @@ _CGB_TradeTube: ; 9555
ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
- ld de, UnknOBPals + 7 palettes
+ ld de, UnknOBPals palette 7
ld a, $1c
call GetPredefPal
call LoadHLPaletteIntoDE