shithub: pokecrystal

Download patch

ref: 5a546068a84d57454c7f95395250346ac14da81e
parent: 169470378aa890ecbb6a177183f080fcd54fec61
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sun Oct 4 14:32:33 EDT 2020

Identify SGB blk/pal packets

--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -79,7 +79,7 @@
 SGB_ApplyCreditsPals: ; unreferenced
 	push de
 	push bc
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -95,7 +95,7 @@
 	ld [wSGBPals + 6], a
 	ld hl, wSGBPals
 	call PushSGBPals
-	ld hl, BlkPacket_9a86
+	ld hl, BlkPacket_AllPal0
 	call PushSGBPals
 	ret
 
@@ -172,7 +172,7 @@
 	ldh a, [hSGB]
 	and a
 	ret z
-	ld hl, BlkPacket_9a86
+	ld hl, BlkPacket_AllPal0
 	jp PushSGBPals
 
 Function8b4d: ; unreferenced
@@ -213,7 +213,7 @@
 	ret z
 	ld a, c
 	push af
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -410,7 +410,7 @@
 	call CheckCGB
 	jr nz, .cgb
 	push hl
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -427,7 +427,7 @@
 	ld [wSGBPals + 6], a
 	ld hl, wSGBPals
 	call PushSGBPals
-	ld hl, BlkPacket_9a86
+	ld hl, BlkPacket_AllPal0
 	call PushSGBPals
 	ret
 
--- a/engine/gfx/sgb_layouts.asm
+++ b/engine/gfx/sgb_layouts.asm
@@ -63,7 +63,7 @@
 	ld hl, BlkPacket_Battle
 	call PushSGBPals
 
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -102,7 +102,7 @@
 	ld a, [hl]
 	ld [wSGBPals + 12], a
 
-	ld hl, PalPacket_9cf6
+	ld hl, PalPacket_Pal23
 	ld de, wSGBPals + PALPACKET_LENGTH
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -134,7 +134,7 @@
 	ret
 
 .SGB_MoveList:
-	ld hl, PalPacket_9bd6
+	ld hl, PalPacket_Routes
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -153,11 +153,11 @@
 
 .SGB_PokegearPals:
 	ld hl, PalPacket_Pokegear
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_StatsScreenHPPals:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -197,7 +197,7 @@
 	ret
 
 .SGB_Pokedex:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -224,7 +224,7 @@
 	ret
 
 .SGB_BillsPC:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -257,7 +257,7 @@
 	ret
 
 .SGB_PokedexSearchOption:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -270,12 +270,12 @@
 	inc hl
 	ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
 	ld hl, wSGBPals
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_PackPals:
 	ld hl, PalPacket_Pack
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_SlotMachine:
@@ -291,7 +291,7 @@
 .SGB_Diploma:
 .SGB_MysteryGift:
 	ld hl, PalPacket_Diploma
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_GSIntro:
@@ -310,9 +310,9 @@
 	ret
 
 .BlkPacketTable_GSIntro:
-	dw BlkPacket_9a86, PalPacket_GSIntroShellderLapras
+	dw BlkPacket_AllPal0, PalPacket_GSIntroShellderLapras
 	dw BlkPacket_GSIntroJigglypuffPikachu, PalPacket_GSIntroJigglypuffPikachu
-	dw BlkPacket_9a86, PalPacket_GSIntroStartersTransition
+	dw BlkPacket_AllPal0, PalPacket_GSIntroStartersTransition
 
 .SGB_GSTitleScreen:
 	ld hl, PalPacket_GSTitleScreen
@@ -328,20 +328,20 @@
 
 .SGB_BetaPikachuMinigame:
 	ld hl, PalPacket_BetaPikachuMinigame
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_BetaPoker:
-	ld hl, BlkPacket_9a86
+	ld hl, BlkPacket_AllPal0
 	ld de, wBetaPokerSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
 	ld hl, PalPacket_BetaPoker
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_MapPals:
-	ld hl, PalPacket_9bd6
+	ld hl, PalPacket_Routes
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -348,7 +348,7 @@
 	call .GetMapPalsIndex
 	ld hl, wSGBPals + 1
 	ld [hld], a
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ld a, SCGB_MAPPALS
 	ld [wDefaultSGBLayout], a
 	ret
@@ -355,7 +355,7 @@
 
 .SGB_Evolution:
 	push bc
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -394,26 +394,26 @@
 
 .done
 	ld hl, wSGBPals
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB0d:
 .SGB_TrainerCard:
 	ld hl, PalPacket_Diploma
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_UnownPuzzle:
 	ld hl, PalPacket_UnownPuzzle
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_Pokepic:
-	ld hl, PalPacket_9bd6
+	ld hl, PalPacket_Routes
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
-	ld hl, BlkPacket_9a86
+	ld hl, BlkPacket_AllPal0
 	ld de, wSGBPals + PALPACKET_LENGTH
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -438,7 +438,7 @@
 	ret
 
 .SGB1e:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -466,16 +466,16 @@
 	ld a, [hl]
 	ld [wSGBPals + 6], a
 	ld hl, wSGBPals
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_GamefreakLogo:
 	ld hl, PalPacket_GamefreakLogo
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_PlayerOrMonFrontpicPals:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -491,16 +491,16 @@
 	ld a, [hl]
 	ld [wSGBPals + 6], a
 	ld hl, wSGBPals
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_TradeTube:
 	ld hl, PalPacket_TradeTube
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .SGB_TrainerOrMonFrontpicPals:
-	ld hl, PalPacket_9ce6
+	ld hl, PalPacket_Pal01
 	ld de, wSGBPals
 	ld bc, PALPACKET_LENGTH
 	call CopyBytes
@@ -516,7 +516,7 @@
 	ld a, [hl]
 	ld [wSGBPals + 6], a
 	ld hl, wSGBPals
-	ld de, BlkPacket_9a86
+	ld de, BlkPacket_AllPal0
 	ret
 
 .GetMapPalsIndex:
--- a/gfx/sgb/blk_packets.asm
+++ b/gfx/sgb/blk_packets.asm
@@ -13,7 +13,7 @@
 	db \5, \6, \7, \8 ; x1, y1, x2, y2
 ENDM
 
-BlkPacket_9a86:
+BlkPacket_AllPal0:
 	attr_blk 1
 	attr_blk_data %011, 0,0,0, 00,00, 19,17
 	ds 8, 0
--- a/gfx/sgb/pal_packets.asm
+++ b/gfx/sgb/pal_packets.asm
@@ -28,7 +28,7 @@
 PalPacket_UnownPuzzle:
 	sgb_pal_set UNOWN_PUZZLE, UNOWN_PUZZLE, UNOWN_PUZZLE, UNOWN_PUZZLE
 
-PalPacket_9bd6:
+PalPacket_Routes:
 	sgb_pal_set ROUTES, ROUTES, ROUTES, ROUTES
 
 PalPacket_GSIntroShellderLapras:
@@ -61,7 +61,7 @@
 PalPacket_Pokegear:
 	sgb_pal_set POKEGEAR, ROUTES, ROUTES, ROUTES
 
-PalPacket_9c86: ; unreferenced
+PalPacket_Pack2: ; unreferenced
 	sgb_pal_set PACK, ROUTES, ROUTES, ROUTES
 
 PalPacket_SlotMachine:
@@ -79,7 +79,7 @@
 PalPacket_GamefreakLogo:
 	sgb_pal_set GS_INTRO_GAMEFREAK_LOGO, ROUTES, ROUTES, ROUTES
 
-PalPacket_9ce6:
+PalPacket_Pal01:
 	sgb_pal01
 	RGB 31, 31, 31
 rept 6
@@ -87,7 +87,7 @@
 endr
 	db 0
 
-PalPacket_9cf6:
+PalPacket_Pal23:
 	sgb_pal23
 	RGB 31, 31, 31
 rept 6