shithub: pokecrystal

Download patch

ref: 2b144fcfd4f55f4ef56bf1c7993ea17979bf9369
parent: 78c70bffe4d394238463dab4b1b1668c7d0cd3bd
author: yenatch <[email protected]>
date: Sun Mar 2 11:02:55 EST 2014

Finish off SGB and CGB code and data.

That should be it for bank 2.

--- a/engine/color.asm
+++ b/engine/color.asm
@@ -81,7 +81,7 @@
 Function8aa4: ; 8aa4
 	push de
 	push bc
-	ld hl, $5ce6
+	ld hl, PalPacket_9ce6
 	ld de, $cda9
 	ld bc, $0010
 	call CopyBytes
@@ -104,7 +104,7 @@
 
 
 Function8ad1: ; 8ad1
-	ld hl, $5c57
+	ld hl, PalPacket_9c56 + 1
 	call Function9610
 	call Function971a
 	call Function9699
@@ -224,7 +224,7 @@
 	ret z
 	ld a, c
 	push af
-	ld hl, $5ce6
+	ld hl, PalPacket_9ce6
 	ld de, $cda9
 	ld bc, $0010
 	call CopyBytes
@@ -393,8 +393,8 @@
 Function8c8a: ; 8c8a
 	call CheckCGB
 	ret z
-	ld hl, $4f6a
-	ld b, $0
+	ld hl, Unknown_8f6a
+	ld b, 0
 	dec c
 	add hl, bc
 	add hl, bc
@@ -417,7 +417,7 @@
 
 Function8cb4: ; 8cb4
 	ld l, e
-	ld h, $0
+	ld h, 0
 	add hl, hl
 	add hl, hl
 	add hl, hl
@@ -426,7 +426,7 @@
 	call CheckCGB
 	jr nz, .asm_8cf0
 	push hl
-	ld hl, $5ce6
+	ld hl, PalPacket_9ce6
 	ld de, $cda9
 	ld bc, $0010
 	call CopyBytes
@@ -557,7 +557,7 @@
 	add hl, hl
 	add hl, hl
 	add hl, hl
-	ld bc, $5df6
+	ld bc, Palettes_9df6
 	add hl, bc
 	ret
 ; 9630
@@ -749,8 +749,8 @@
 
 
 Function971a: ; 971a
-	ld hl, $7681
-	ld de, MartPointer
+	ld hl, Palettes_b681
+	ld de, Unkn2Pals
 	ld bc, $0010
 	ld a, $5
 	call FarCopyWRAM
@@ -992,7 +992,7 @@
 	call Function992c
 	call Function9a7a
 	call Function993f
-	ld hl, $5d66
+	ld hl, PalPacket_9d66
 	call Function981a
 
 .asm_988a
@@ -1078,15 +1078,15 @@
 ; 98ff
 
 Unknown_98ff: ; 98ff
-	dw $5d56
-	dw $5d76
-	dw $5d86
-	dw $5d96
-	dw $5da6
-	dw $5db6
-	dw $5dc6
-	dw $5dd6
-	dw $5de6
+	dw PalPacket_9d56
+	dw PalPacket_9d76
+	dw PalPacket_9d86
+	dw PalPacket_9d96
+	dw PalPacket_9da6
+	dw PalPacket_9db6
+	dw PalPacket_9dc6
+	dw PalPacket_9dd6
+	dw PalPacket_9de6
 ; 9911
 
 Function9911: ; 9911
@@ -1093,12 +1093,12 @@
 	di
 	xor a
 	ld [rJOYP], a
-	ld hl, $5d56
+	ld hl, PalPacket_9d56
 	call Function981a
 	call Function992c
 	call Function9a7a
 	call Function993f
-	ld hl, $5d66
+	ld hl, PalPacket_9d66
 	call Function981a
 	ei
 	ret
@@ -1128,7 +1128,7 @@
 ; 994a
 
 Function994a: ; 994a
-	ld hl, $5d26
+	ld hl, PalPacket_9d26
 	call Function981a
 	call Function9a7a
 	ld a, [rJOYP]
@@ -1177,7 +1177,7 @@
 ; 99ab
 
 Function99ab: ; 99ab
-	ld hl, $5d16
+	ld hl, PalPacket_9d16
 	call Function981a
 	jp Function9a7a
 ; 99b4
@@ -1186,7 +1186,7 @@
 	call DisableLCD
 	ld a, $e4
 	ld [rBGP], a
-	ld hl, $5df6
+	ld hl, Palettes_9df6
 	ld de, VTiles1
 	ld bc, $1000
 	call CopyData
@@ -1193,7 +1193,7 @@
 	call DrawDefaultTiles
 	ld a, $e3
 	ld [rLCDC], a
-	ld hl, $5d06
+	ld hl, PalPacket_9d06
 	call Function981a
 	xor a
 	ld [rBGP], a
@@ -1228,7 +1228,7 @@
 	call DrawDefaultTiles
 	ld a, $e3
 	ld [rLCDC], a
-	ld hl, $5d46
+	ld hl, PalPacket_9d46
 	call Function981a
 	xor a
 	ld [rBGP], a
@@ -1253,7 +1253,7 @@
 	call DrawDefaultTiles
 	ld a, $e3
 	ld [rLCDC], a
-	ld hl, $5d36
+	ld hl, PalPacket_9d36
 	call Function981a
 	xor a
 	ld [rBGP], a
@@ -1924,9 +1924,11 @@
 	RGB 30, 26, 15
 	RGB 31, 00, 00
 
+Palettes_a8ca: ; a8ca
 	RGB 30, 26, 15
 	RGB 04, 17, 31
 
+Palettes_a8ce: ; a8ce
 	RGB 30, 22, 17
 	RGB 16, 14, 19
 
@@ -1985,7 +1987,7 @@
 	ld e, l
 	ld d, h
 	pop hl
-	ld c, $8
+	ld c, 8
 .asm_b222
 	ld a, [de]
 	inc de
@@ -2002,8 +2004,8 @@
 .asm_b230
 	ld a, [TimeOfDayPal]
 	and 3
-	ld bc, $0040
-	ld hl, $7469
+	ld bc, $40
+	ld hl, Palettes_b469
 	call AddNTimes
 	ld de, Unkn2Pals
 	ld bc, $0040
@@ -2010,23 +2012,23 @@
 	ld a, $5
 	call FarCopyWRAM
 	ld a, [$d19a]
-	cp $1
+	cp 1
 	jr z, .asm_b253
-	cp $2
+	cp 2
 	ret nz
 
 .asm_b253
 	ld a, [MapGroup]
 	ld l, a
-	ld h, $0
+	ld h, 0
 	add hl, hl
 	add hl, hl
 	add hl, hl
-	ld de, $7569
+	ld de, Palettes_b569
 	add hl, de
 	ld a, [TimeOfDayPal]
-	and $3
-	cp $2
+	and 3
+	cp 2
 	jr c, .asm_b26d
 	inc hl
 	inc hl
@@ -2099,7 +2101,510 @@
 INCLUDE "tilesets/dark.pal"
 ; 0xb419
 
-INCBIN "baserom.gbc", $b419, $b729 - $b419
+; There are actually a lot more of these.
+
+; b419
+
+	RGB 30, 28, 26
+	RGB 19, 19, 19
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+
+	RGB 30, 28, 26
+	RGB 31, 19, 24
+	RGB 30, 10, 06
+	RGB 07, 07, 07
+
+	RGB 18, 24, 09
+	RGB 15, 20, 01
+	RGB 09, 13, 00
+	RGB 07, 07, 07
+
+	RGB 30, 28, 26
+	RGB 15, 16, 31
+	RGB 09, 09, 31
+	RGB 07, 07, 07
+
+	RGB 30, 28, 26
+	RGB 31, 31, 07
+	RGB 31, 16, 01
+	RGB 07, 07, 07
+
+	RGB 26, 24, 17
+	RGB 21, 17, 07
+	RGB 16, 13, 03
+	RGB 07, 07, 07
+
+	RGB 30, 28, 26
+	RGB 17, 19, 31
+	RGB 14, 16, 31
+	RGB 07, 07, 07
+
+	RGB 31, 31, 16
+	RGB 31, 31, 16
+	RGB 14, 09, 00
+	RGB 00, 00, 00
+
+	RGB 23, 23, 31
+	RGB 18, 19, 31
+	RGB 13, 12, 31
+	RGB 07, 07, 07
+
+	RGB 15, 13, 27
+	RGB 10, 09, 20
+	RGB 04, 03, 18
+	RGB 00, 00, 00
+; b469
+
+Palettes_b469: ; b469
+	RGB 28, 31, 16
+	RGB 31, 19, 10
+	RGB 31, 07, 01
+	RGB 00, 00, 00
+
+	RGB 28, 31, 16
+	RGB 31, 19, 10
+	RGB 10, 09, 31
+	RGB 00, 00, 00
+
+	RGB 28, 31, 16
+	RGB 31, 19, 10
+	RGB 07, 23, 03
+	RGB 00, 00, 00
+
+	RGB 28, 31, 16
+	RGB 31, 19, 10
+	RGB 15, 10, 03
+	RGB 00, 00, 00
+
+	RGB 28, 31, 16
+	RGB 31, 19, 10
+	RGB 30, 10, 06
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 31, 31, 31
+	RGB 13, 13, 13
+	RGB 00, 00, 00
+
+	RGB 22, 31, 10
+	RGB 12, 25, 01
+	RGB 05, 14, 00
+	RGB 07, 07, 07
+
+	RGB 28, 31, 16
+	RGB 24, 18, 07
+	RGB 20, 15, 03
+	RGB 07, 07, 07
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 01
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 10, 09, 31
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 07, 23, 03
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 15, 10, 03
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 30, 10, 06
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 31, 31, 31
+	RGB 13, 13, 13
+	RGB 00, 00, 00
+
+	RGB 22, 31, 10
+	RGB 12, 25, 01
+	RGB 05, 14, 00
+	RGB 07, 07, 07
+
+	RGB 27, 31, 27
+	RGB 24, 18, 07
+	RGB 20, 15, 03
+	RGB 07, 07, 07
+
+	RGB 15, 14, 24
+	RGB 31, 19, 10
+	RGB 31, 07, 01
+	RGB 00, 00, 00
+
+	RGB 15, 14, 24
+	RGB 31, 19, 10
+	RGB 10, 09, 31
+	RGB 00, 00, 00
+
+	RGB 15, 14, 24
+	RGB 31, 19, 10
+	RGB 07, 23, 03
+	RGB 00, 00, 00
+
+	RGB 15, 14, 24
+	RGB 31, 19, 10
+	RGB 15, 10, 03
+	RGB 00, 00, 00
+
+	RGB 15, 14, 24
+	RGB 31, 19, 10
+	RGB 30, 10, 06
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 31, 31, 31
+	RGB 13, 13, 13
+	RGB 00, 00, 00
+
+	RGB 15, 14, 24
+	RGB 08, 13, 19
+	RGB 00, 11, 13
+	RGB 00, 00, 00
+
+	RGB 15, 14, 24
+	RGB 12, 09, 15
+	RGB 08, 04, 05
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 31, 19, 10
+	RGB 31, 07, 01
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 31, 19, 10
+	RGB 10, 09, 31
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 31, 19, 10
+	RGB 07, 23, 03
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 31, 19, 10
+	RGB 15, 10, 03
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 31, 19, 10
+	RGB 30, 10, 06
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 31, 31, 31
+	RGB 13, 13, 13
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 00, 00, 00
+	RGB 00, 00, 00
+	RGB 00, 00, 00
+
+	RGB 01, 01, 02
+	RGB 00, 00, 00
+	RGB 00, 00, 00
+	RGB 00, 00, 00
+; b569
+
+Palettes_b569: ; b569
+	RGB 21, 21, 21
+	RGB 11, 11, 11
+	RGB 21, 21, 21
+	RGB 11, 11, 11
+
+	RGB 14, 17, 31
+	RGB 07, 11, 15
+	RGB 09, 09, 17
+	RGB 05, 07, 13
+
+	RGB 12, 19, 00
+	RGB 06, 10, 00
+	RGB 06, 09, 07
+	RGB 04, 05, 06
+
+	RGB 21, 21, 21
+	RGB 11, 11, 11
+	RGB 21, 21, 21
+	RGB 17, 08, 07
+
+	RGB 31, 19, 00
+	RGB 27, 10, 05
+	RGB 15, 07, 02
+	RGB 11, 04, 02
+
+	RGB 11, 10, 16
+	RGB 05, 06, 07
+	RGB 03, 04, 08
+	RGB 00, 00, 00
+
+	RGB 31, 10, 00
+	RGB 18, 06, 00
+	RGB 18, 05, 09
+	RGB 17, 08, 07
+
+	RGB 17, 27, 31
+	RGB 05, 15, 31
+	RGB 07, 08, 22
+	RGB 07, 07, 16
+
+	RGB 22, 20, 10
+	RGB 17, 14, 03
+	RGB 11, 11, 05
+	RGB 10, 09, 07
+
+	RGB 31, 08, 04
+	RGB 09, 09, 08
+	RGB 18, 05, 09
+	RGB 09, 09, 08
+
+	RGB 24, 14, 31
+	RGB 13, 07, 21
+	RGB 12, 03, 18
+	RGB 09, 03, 15
+
+	RGB 25, 25, 00
+	RGB 20, 17, 08
+	RGB 12, 12, 00
+	RGB 10, 09, 05
+
+	RGB 27, 23, 01
+	RGB 23, 11, 00
+	RGB 15, 11, 01
+	RGB 11, 10, 01
+
+	RGB 27, 28, 31
+	RGB 17, 19, 22
+	RGB 14, 14, 18
+	RGB 10, 09, 13
+
+	RGB 19, 19, 16
+	RGB 10, 12, 15
+	RGB 09, 09, 11
+	RGB 04, 05, 07
+
+	RGB 14, 17, 31
+	RGB 07, 11, 15
+	RGB 09, 13, 19
+	RGB 07, 07, 16
+
+	RGB 21, 21, 21
+	RGB 13, 13, 13
+	RGB 11, 11, 19
+	RGB 07, 07, 12
+
+	RGB 31, 18, 29
+	RGB 17, 13, 20
+	RGB 14, 06, 12
+	RGB 11, 03, 10
+
+	RGB 23, 15, 31
+	RGB 16, 05, 31
+	RGB 12, 07, 17
+	RGB 08, 06, 10
+
+	RGB 21, 21, 25
+	RGB 16, 16, 16
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+
+	RGB 21, 21, 21
+	RGB 11, 11, 11
+	RGB 21, 21, 21
+	RGB 11, 11, 11
+
+	RGB 19, 31, 15
+	RGB 31, 22, 02
+	RGB 12, 13, 09
+	RGB 09, 12, 03
+
+	RGB 15, 10, 31
+	RGB 07, 05, 15
+	RGB 06, 05, 17
+	RGB 02, 02, 08
+
+	RGB 21, 31, 07
+	RGB 13, 25, 04
+	RGB 09, 14, 08
+	RGB 06, 10, 04
+
+	RGB 20, 31, 14
+	RGB 11, 23, 05
+	RGB 09, 13, 08
+	RGB 06, 09, 04
+
+	RGB 31, 26, 00
+	RGB 31, 15, 00
+	RGB 13, 13, 01
+	RGB 08, 08, 01
+
+	RGB 31, 14, 28
+	RGB 31, 05, 21
+	RGB 14, 07, 17
+	RGB 13, 00, 08
+
+Palettes_b641: ; b641
+	RGB 27, 31, 27
+	RGB 21, 21, 21
+	RGB 13, 13, 13
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 07, 06
+	RGB 20, 02, 03
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 10, 31, 09
+	RGB 04, 14, 01
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 08, 12, 31
+	RGB 01, 04, 31
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 31, 07
+	RGB 31, 16, 01
+	RGB 00, 00, 00
+; b669
+
+	RGB 27, 31, 27
+	RGB 22, 16, 08
+	RGB 13, 07, 01
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 15, 31, 31
+	RGB 05, 17, 31
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 11, 11, 19
+	RGB 07, 07, 12
+	RGB 00, 00, 00
+; b681
+
+Palettes_b681: ; b681
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 10, 14, 20
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 27, 31, 27
+	RGB 31, 19, 10
+	RGB 31, 07, 04
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 21, 21, 21
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+
+	RGB 31, 31, 31
+	RGB 31, 31, 07
+	RGB 31, 16, 01
+	RGB 07, 07, 07
+
+	RGB 31, 31, 31
+	RGB 31, 19, 24
+	RGB 30, 10, 06
+	RGB 07, 07, 07
+
+	RGB 31, 31, 31
+	RGB 12, 25, 01
+	RGB 05, 14, 00
+	RGB 07, 07, 07
+
+	RGB 31, 31, 31
+	RGB 08, 12, 31
+	RGB 01, 04, 31
+	RGB 07, 07, 07
+
+	RGB 31, 31, 31
+	RGB 24, 18, 07
+	RGB 20, 15, 03
+	RGB 07, 07, 07
+
+Palettes_b6f1: ; b6f1
+	RGB 31, 31, 31
+	RGB 18, 23, 31
+	RGB 15, 20, 31
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 22, 00, 31
+	RGB 15, 20, 31
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 31, 00, 00
+	RGB 15, 20, 31
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 25, 22, 00
+	RGB 15, 20, 31
+	RGB 00, 00, 00
+
+	RGB 31, 31, 31
+	RGB 23, 26, 31
+	RGB 18, 23, 31
+	RGB 00, 00, 00
+
+Palettes_b719: ; b719
+	RGB 31, 31, 31
+	RGB 07, 06, 03
+	RGB 07, 06, 03
+	RGB 07, 06, 03
+
+	RGB 31, 31, 31
+	RGB 31, 31, 00
+	RGB 26, 22, 00
+	RGB 00, 00, 00
+; b729
 
 Palettes_b729: ; b729
 	RGB 28, 31, 20
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -68,15 +68,15 @@
 ; 8db8
 
 Function8db8: ; 8db8
-	ld hl, $5c67
+	ld hl, PalPacket_9c66 + 1
 	ld de, $d000
 	ld c, $4
 	call Function9615
-	ld hl, $5c67
+	ld hl, PalPacket_9c66 + 1
 	ld de, $d020
 	ld c, $4
 	call Function9615
-	ld hl, $5c67
+	ld hl, PalPacket_9c66 + 1
 	ld de, MartPointer
 	ld c, $2
 	call Function9615
@@ -95,7 +95,7 @@
 	ld h, $0
 	add hl, hl
 	add hl, hl
-	ld bc, $68be
+	ld bc, Palettes_a8be
 	add hl, bc
 	call Function9643
 	ld a, [PlayerHPPal]
@@ -103,10 +103,10 @@
 	ld h, $0
 	add hl, hl
 	add hl, hl
-	ld bc, $68be
+	ld bc, Palettes_a8be
 	add hl, bc
 	call Function9643
-	ld hl, $68ca
+	ld hl, Palettes_a8ca
 	call Function9643
 	ld de, MartPointer
 	pop hl
@@ -147,7 +147,7 @@
 	ld bc, $0078
 	ld a, $7
 	call ByteFill
-	ld hl, $579c
+	ld hl, Palettes_979c
 	ld de, $d050
 	ld bc, $0030
 	ld a, $5
@@ -215,7 +215,7 @@
 	ld h, $0
 	add hl, hl
 	add hl, hl
-	ld bc, $68be
+	ld bc, Palettes_a8be
 	add hl, bc
 	call Function9643
 	ld a, [CurPartySpecies]
@@ -222,7 +222,7 @@
 	ld bc, TempMonDVs
 	call Function974b
 	call Function9643
-	ld hl, $68ca
+	ld hl, Palettes_a8ca
 	call Function9643
 	ld hl, Palette8f52
 	ld de, $d018
@@ -274,8 +274,14 @@
 	RGB 00, 00, 00
 ; 8f6a
 
-INCBIN "baserom.gbc", $8f6a, $8f70 - $8f6a
+Unknown_8f6a: ; 8f6a
+	RGB 31, 19, 31
 
+	RGB 21, 31, 14
+
+	RGB 17, 31, 31
+; 8f70
+
 Function8f70: ; 8f70
 	ld de, Unkn1Pals
 	ld a, $1d
@@ -355,8 +361,29 @@
 	ret
 ; 9009
 
-INCBIN "baserom.gbc", $9009, $9036 - $9009
+Function9009: ; 9009
+	ld hl, Palette9036
+	call Function9630
+	jr .asm_901a
 
+	ld bc, TempMonDVs
+	call Function974b
+	call Function9643
+
+.asm_901a
+	call Function9699
+	ld hl, $cdee
+	ld bc, $0707
+	ld a, $1
+	call Function9663
+	call Function971a
+	call Function96b3
+	call Function96a4
+	ld a, $1
+	ld [hCGBPalUpdate], a
+	ret
+; 9036
+
 Palette9036: ; 9036
 	RGB 31, 15, 00
 	RGB 23, 12, 00
@@ -440,7 +467,7 @@
 ; 90f8
 
 Function90f8: ; 90f8
-	ld hl, $5ca7
+	ld hl, PalPacket_9ca6 + 1
 	call Function9610
 	call Function9699
 	ld de, Unkn2Pals
@@ -459,8 +486,8 @@
 ; 9122
 
 Function9122: ; 9122
-	ld b, $0
-	ld hl, $512d
+	ld b, 0
+	ld hl, Jumptable_912d
 	add hl, bc
 	add hl, bc
 	ld a, [hli]
@@ -469,8 +496,67 @@
 	jp [hl]
 ; 912d
 
-INCBIN "baserom.gbc", $912d, $9195 - $912d
+Jumptable_912d: ; 912d
+	dw Function9133
+	dw Function9166
+	dw Function9180
+; 9133
 
+Function9133: ; 9133
+	ld hl, Palette_914e
+	ld de, Unkn1Pals
+	call Function9630
+	ld hl, Palette_9156
+	ld de, Unkn2Pals
+	ld bc, $0010
+	ld a, $5
+	call FarCopyWRAM
+	call Function9699
+	ret
+; 914e
+
+Palette_914e: ; 914e
+	RGB 19, 31, 19
+	RGB 18, 23, 31
+	RGB 11, 21, 28
+	RGB 04, 16, 24
+
+Palette_9156: ; 9156
+	RGB 29, 29, 29
+	RGB 20, 19, 20
+	RGB 19, 06, 04
+	RGB 03, 04, 06
+
+	RGB 31, 31, 31
+	RGB 31, 31, 31
+	RGB 31, 00, 00
+	RGB 03, 04, 06
+; 9166
+
+Function9166: ; 9166
+	ld de, Unkn1Pals
+	ld a, $38
+	call Function9625
+	call Function9630
+	ld de, Unkn2Pals
+	ld a, $39
+	call Function9625
+	call Function9630
+	call Function9699
+	ret
+; 9180
+
+Function9180: ; 9180
+	ld hl, PalPacket_9c36 + 1
+	call Function9610
+	ld de, Unkn2Pals
+	ld a, $3a
+	call Function9625
+	call Function9630
+	call Function9699
+	ret
+; 9195
+
 Function9195: ; 9195
 	ld hl, Palettes_b789
 	ld de, Unkn1Pals
@@ -484,12 +570,12 @@
 ; 91ad
 
 Function91ad: ; 91ad
-	ld hl, $7641
+	ld hl, Palettes_b641
 	ld de, Unkn1Pals
 	ld bc, $0080
 	ld a, $5
 	call FarCopyWRAM
-	ld hl, $5cb7
+	ld hl, PalPacket_9cb6 + 1
 	call Function9610
 	call Function9699
 	call Function96b3
@@ -504,7 +590,7 @@
 ; 91d1
 
 Function91d1: ; 91d1
-	ld hl, $5c57
+	ld hl, PalPacket_9c56 + 1
 	call Function9610
 	call Function8e9f
 	call Function8e85
@@ -533,7 +619,7 @@
 	ld a, [PlayerHPPal]
 	call Function974b
 	call Function9643
-	ld hl, $579c
+	ld hl, Palettes_979c
 	ld de, $d050
 	ld bc, $0030
 	ld a, $5
@@ -549,12 +635,12 @@
 ; 9228
 
 Function9228: ; 9228
-	ld hl, $76f1
+	ld hl, Palettes_b6f1
 	ld de, Unkn1Pals
 	ld bc, $0028
 	ld a, $5
 	call FarCopyWRAM
-	ld hl, $7719
+	ld hl, Palettes_b719
 	ld de, Unkn2Pals
 	ld bc, $0010
 	ld a, $5
@@ -568,7 +654,7 @@
 ; 9251
 
 Function9251: ; 9251
-	ld hl, $5cb7
+	ld hl, PalPacket_9cb6 + 1
 	call Function9610
 	call Function9699
 	call Function96b3
@@ -576,7 +662,7 @@
 ; 925e
 
 Function925e: ; 925e
-	ld hl, $5bc7
+	ld hl, PalPacket_9bc6 + 1
 	call Function9610
 	ld de, Unkn2Pals
 	ld a, $4c
@@ -710,10 +796,10 @@
 	call Function9630
 	ld a, [PlayerHPPal]
 	ld l, a
-	ld h, $0
+	ld h, 0
 	add hl, hl
 	add hl, hl
-	ld bc, $68be
+	ld bc, Palettes_a8be
 	add hl, bc
 	call Function9643
 	call Function9699
@@ -729,7 +815,7 @@
 ; 93a6
 
 Function93a6: ; 93a6
-	ld hl, $5c47
+	ld hl, PalPacket_9c46 + 1
 	call Function9610
 	call Function9699
 	call Function96b3
@@ -759,11 +845,11 @@
 	ld a, [PlayerGender]
 	bit 0, a
 	jr z, .asm_93e6
-	ld hl, $5469
+	ld hl, Palettes_9469
 	jr .asm_93e9
 
 .asm_93e6
-	ld hl, $5439
+	ld hl, Palettes_9439
 
 .asm_93e9
 	ld de, Unkn1Pals
@@ -798,8 +884,60 @@
 	ret
 ; 9439
 
-INCBIN "baserom.gbc", $9439, $9499 - $9439
+Palettes_9439: ; 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
+	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
+	RGB 00, 00, 00
+; 9499
+
 Function9499: ; 9499
 	call Function91c8
 	ld de, $0014
@@ -836,7 +974,7 @@
 ; 94d0
 
 Function94d0: ; 94d0
-	ld hl, $5ba7
+	ld hl, PalPacket_9ba6 + 1
 	call Function9610
 	call Function9699
 	ld hl, $ce29
@@ -859,10 +997,10 @@
 	ld a, $4e
 	call Function9625
 	call Function9630
-	ld hl, $5521
+	ld hl, Palette_9521
 	ld de, Unkn2Pals
 	call Function9630
-	ld hl, $5521
+	ld hl, Palette_9521
 	ld de, $d048
 	call Function9630
 	call Function9699
@@ -871,7 +1009,12 @@
 	ret
 ; 9521
 
-INCBIN "baserom.gbc", $9521, $9529 - $9521
+Palette_9521: ; 9521
+	RGB 31, 31, 31
+	RGB 13, 11, 00
+	RGB 23, 12, 28
+	RGB 00, 00, 00
+; 9529
 
 Function9529: ; 9529
 	ld de, Unkn1Pals
@@ -896,9 +1039,9 @@
 ; 9555
 
 Function9555: ; 9555
-	ld hl, $5cc7
+	ld hl, PalPacket_9cc6 + 1
 	call Function9610
-	ld hl, $7681
+	ld hl, Palettes_b681
 	ld de, Unkn2Pals
 	ld bc, $0008
 	ld a, $5
--- a/predef/sgb.asm
+++ b/predef/sgb.asm
@@ -60,12 +60,12 @@
 
 Function86ad: ; 86ad
 	ld hl, PalPacket_9c66
-	ld de, $5aa6
+	ld de, BlkPacket_9aa6
 	ret
 ; 86b4
 
 Function86b4: ; 86b4
-	ld hl, $5aa6
+	ld hl, BlkPacket_9aa6
 	call Function9809
 	ld hl, PalPacket_9ce6
 	ld de, $cda9
@@ -73,10 +73,10 @@
 	call CopyBytes
 	ld a, [PlayerHPPal]
 	ld l, a
-	ld h, $0
+	ld h, 0
 	add hl, hl
 	add hl, hl
-	ld de, $68be
+	ld de, Palettes_a8be
 	add hl, de
 	ld a, [hli]
 	ld [$cdac], a
@@ -143,7 +143,7 @@
 	add $2f
 	ld [hl], a
 	ld hl, $cda9
-	ld de, $5ad6
+	ld de, BlkPacket_9ad6
 	ret
 ; 875c
 
@@ -163,7 +163,7 @@
 	ld h, $0
 	add hl, hl
 	add hl, hl
-	ld de, $68be
+	ld de, Palettes_a8be
 	add hl, de
 	ld a, [hli]
 	ld [$cdac], a
@@ -185,7 +185,7 @@
 	ld a, [hl]
 	ld [$cdb5], a
 	ld hl, $cda9
-	ld de, $5ac6
+	ld de, BlkPacket_9ac6
 	ret
 ; 87ab
 
@@ -219,7 +219,7 @@
 	ld a, [hl]
 	ld [$cdb5], a
 	ld hl, $cda9
-	ld de, $5ae6
+	ld de, BlkPacket_9ae6
 	ret
 ; 87e9
 
@@ -248,13 +248,13 @@
 	ld a, [hl]
 	ld [$cdb5], a
 	ld hl, $cda9
-	ld de, $5ae6
+	ld de, BlkPacket_9ae6
 	ret
 ; 8823
 
 Function8823: ; 8823
 	call Function87b2
-	ld de, $5af6
+	ld de, BlkPacket_9af6
 	ret
 ; 882a
 
@@ -284,13 +284,13 @@
 
 Function8852: ; 8852
 	ld hl, PalPacket_9c96
-	ld de, $5b06
+	ld de, BlkPacket_9b06
 	ret
 ; 8859
 
 Function8859: ; 8859
 	ld hl, PalPacket_9ca6
-	ld de, $5b76
+	ld de, BlkPacket_9b76
 	ret
 ; 8860
 
@@ -301,8 +301,8 @@
 ; 8867
 
 Function8867: ; 8867
-	ld b, $0
-	ld hl, $4878
+	ld b, 0
+	ld hl, Unknown_8878
 	add hl, bc
 	add hl, bc
 	add hl, bc
@@ -317,11 +317,15 @@
 	ret
 ; 8878
 
-INCBIN "baserom.gbc", $8878, $8884 - $8878
+Unknown_8878: ; 8878
+	dw BlkPacket_9a86, PalPacket_9be6
+	dw BlkPacket_9a96, PalPacket_9c06
+	dw BlkPacket_9a86, PalPacket_9c16
+; 8884
 
 Function8884: ; 8884
 	ld hl, PalPacket_9b96
-	ld de, $5b56
+	ld de, BlkPacket_9b56
 	ld a, $8
 	ld [SGBPredef], a
 	ret
@@ -329,7 +333,7 @@
 
 Function8890: ; 8890
 	ld hl, PalPacket_9ba6
-	ld de, $5b86
+	ld de, BlkPacket_9b86
 	ret
 ; 8897
 
@@ -456,18 +460,18 @@
 	call CopyBytes
 	ld a, [CurPartySpecies]
 	ld l, a
-	ld h, $0
+	ld h, 0
 	add hl, hl
 	add hl, hl
 	add hl, hl
-	ld de, $68ce
+	ld de, Palettes_a8ce
 	add hl, de
 	ld a, [$cf65]
-	and $3
+	and 3
 	sla a
 	sla a
 	ld c, a
-	ld b, $0
+	ld b, 0
 	add hl, bc
 	ld a, [hli]
 	ld [$cdac], a
@@ -557,8 +561,8 @@
 	jr z, .asm_8a42
 	ld a, [MapGroup]
 	ld e, a
-	ld d, $0
-	ld hl, $4a45
+	ld d, 0
+	ld hl, Unknown_8a45
 	add hl, de
 	ld a, [hl]
 	ret
@@ -580,7 +584,35 @@
 	ret
 ; 8a45
 
-INCBIN "baserom.gbc", $8a45, $8a60 - $8a45
+Unknown_8a45: ; 8a45
+	db $00
+	db $12
+	db $14
+	db $18
+	db $11
+	db $15
+	db $09
+	db $04
+	db $0f
+	db $16
+	db $0e
+	db $10
+	db $06
+	db $01
+	db $03
+	db $06
+	db $0b
+	db $08
+	db $05
+	db $17
+	db $08
+	db $07
+	db $13
+	db $02
+	db $0c
+	db $0a
+	db $0d
+; 8a60
 
 Function8a60: ; 8a60
 	push de