shithub: pokecrystal

Download patch

ref: b3f0e11567ca84b855c233c0621d18f3aaac8495
parent: 82591369114ea1d7723e433c7b9e49a639b4919b
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Tue Dec 26 15:33:41 EST 2017

Various cleanup

--- a/constants/gfx_constants.asm
+++ b/constants/gfx_constants.asm
@@ -20,5 +20,4 @@
 EXP_BAR_LENGTH EQU 8 ; tiles
 EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * TILE_WIDTH ; pixels
 
-
 PALPACKET_LENGTH EQU $10
--- /dev/null
+++ b/data/palettes/tilesets/battle_tower.pal
@@ -1,0 +1,40 @@
+; gray
+	RGB 30, 28, 26
+	RGB 19, 19, 19
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+; red
+	RGB 30, 28, 26
+	RGB 31, 19, 24
+	RGB 30, 10, 06
+	RGB 07, 07, 07
+; green
+	RGB 18, 24, 09
+	RGB 15, 20, 01
+	RGB 09, 13, 00
+	RGB 07, 07, 07
+; water (blue)
+	RGB 30, 28, 26
+	RGB 15, 16, 31
+	RGB 09, 09, 31
+	RGB 07, 07, 07
+; yellow
+	RGB 30, 28, 26
+	RGB 31, 31, 07
+	RGB 31, 16, 01
+	RGB 07, 07, 07
+; brown
+	RGB 26, 24, 17
+	RGB 21, 17, 07
+	RGB 16, 13, 03
+	RGB 07, 07, 07
+; roof
+	RGB 05, 05, 16
+	RGB 08, 19, 28
+	RGB 00, 00, 00
+	RGB 31, 31, 31
+; text
+	RGB 31, 31, 16
+	RGB 31, 31, 16
+	RGB 14, 09, 00
+	RGB 00, 00, 00
--- /dev/null
+++ b/data/palettes/tilesets/house_1.pal
@@ -1,0 +1,40 @@
+; gray
+	RGB 30, 28, 26
+	RGB 19, 19, 19
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+; red
+	RGB 30, 28, 26
+	RGB 31, 19, 24
+	RGB 30, 10, 06
+	RGB 07, 07, 07
+; green
+	RGB 30, 28, 26
+	RGB 15, 20, 01
+	RGB 09, 13, 00
+	RGB 07, 07, 07
+; water (blue)
+	RGB 30, 28, 26
+	RGB 15, 16, 31
+	RGB 09, 09, 31
+	RGB 07, 07, 07
+; yellow
+	RGB 30, 28, 26
+	RGB 31, 31, 07
+	RGB 31, 16, 01
+	RGB 07, 07, 07
+; brown
+	RGB 26, 24, 17
+	RGB 21, 17, 07
+	RGB 16, 13, 03
+	RGB 07, 07, 07
+; roof (glass)
+	RGB 30, 28, 26
+	RGB 31, 19, 24
+	RGB 16, 13, 03
+	RGB 07, 07, 07
+; text
+	RGB 31, 31, 16
+	RGB 31, 31, 16
+	RGB 14, 09, 00
+	RGB 00, 00, 00
--- /dev/null
+++ b/data/palettes/tilesets/ice_path.pal
@@ -1,0 +1,40 @@
+; gray
+	RGB 15, 14, 24
+	RGB 11, 11, 19
+	RGB 07, 07, 12
+	RGB 00, 00, 00
+; red
+	RGB 15, 14, 24
+	RGB 14, 07, 17
+	RGB 13, 00, 08
+	RGB 00, 00, 00
+; green (ice)
+	RGB 22, 29, 31
+	RGB 10, 27, 31
+	RGB 31, 31, 31
+	RGB 05, 00, 09
+; water
+	RGB 15, 14, 24
+	RGB 05, 05, 17
+	RGB 03, 03, 10
+	RGB 00, 00, 00
+; yellow
+	RGB 30, 30, 11
+	RGB 16, 14, 18
+	RGB 16, 14, 10
+	RGB 00, 00, 00
+; brown
+	RGB 15, 14, 24
+	RGB 12, 09, 15
+	RGB 08, 04, 05
+	RGB 00, 00, 00
+; roof (snow)
+	RGB 25, 31, 31
+	RGB 09, 28, 31
+	RGB 16, 11, 31
+	RGB 05, 00, 09
+; text
+	RGB 31, 31, 16
+	RGB 31, 31, 16
+	RGB 14, 09, 00
+	RGB 00, 00, 00
--- /dev/null
+++ b/data/palettes/tilesets/pokecom_center.pal
@@ -1,0 +1,40 @@
+; gray
+	RGB 30, 28, 26
+	RGB 19, 19, 19
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+; red
+	RGB 30, 28, 26
+	RGB 31, 19, 24
+	RGB 30, 10, 06
+	RGB 07, 07, 07
+; green
+	RGB 18, 24, 09
+	RGB 15, 20, 01
+	RGB 09, 13, 00
+	RGB 07, 07, 07
+; water (blue)
+	RGB 30, 28, 26
+	RGB 17, 19, 31
+	RGB 14, 16, 31
+	RGB 07, 07, 07
+; yellow
+	RGB 31, 26, 21
+	RGB 31, 20, 01
+	RGB 14, 16, 31
+	RGB 07, 07, 07
+; brown
+	RGB 21, 17, 07
+	RGB 17, 19, 31
+	RGB 16, 13, 03
+	RGB 07, 07, 07
+; roof
+	RGB 05, 05, 16
+	RGB 08, 19, 28
+	RGB 00, 00, 00
+	RGB 31, 31, 31
+; text
+	RGB 31, 31, 16
+	RGB 31, 31, 16
+	RGB 14, 09, 00
+	RGB 00, 00, 00
--- /dev/null
+++ b/data/palettes/tilesets/radio_tower.pal
@@ -1,0 +1,39 @@
+	RGB 27, 31, 27
+	RGB 21, 21, 21
+	RGB 13, 13, 13
+	RGB 07, 07, 07
+
+	RGB 27, 31, 27
+	RGB 31, 19, 24
+	RGB 30, 10, 06
+	RGB 07, 07, 07
+
+	RGB 08, 12, 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 27, 31, 27
+	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 27, 31, 27
+	RGB 15, 31, 31
+	RGB 05, 17, 31
+	RGB 07, 07, 07
+
+	RGB 31, 31, 16
+	RGB 31, 31, 16
+	RGB 14, 09, 00
+	RGB 00, 00, 00
--- a/data/type_matchups.asm
+++ b/data/type_matchups.asm
@@ -5,7 +5,7 @@
 NO_EFFECT          EQU 00
 
 TypeMatchups: ; 34bb1
-	;  attacker  defender*=
+	;  attacker,  defender,  *=
 	db NORMAL,    ROCK,      NOT_VERY_EFFECTIVE
 	db NORMAL,    STEEL,     NOT_VERY_EFFECTIVE
 	db FIRE,      FIRE,      NOT_VERY_EFFECTIVE
--- a/engine/mail.asm
+++ b/engine/mail.asm
@@ -383,7 +383,7 @@
 
 MailboxPC: ; 0x44806
 	xor a
-	ld [OBPals + 8 * 6], a
+	ld [OBPals palette 6], a
 	ld a, 1
 	ld [wCurMessageIndex], a
 .loop
@@ -397,11 +397,11 @@
 
 	ld a, [wCurMessageIndex]
 	ld [wMenuCursorBuffer], a
-	ld a, [OBPals + 8 * 6]
+	ld a, [OBPals palette 6]
 	ld [wMenuScrollPosition], a
 	call ScrollingMenu
 	ld a, [wMenuScrollPosition]
-	ld [OBPals + 8 * 6], a
+	ld [OBPals palette 6], a
 	ld a, [wMenuCursorY]
 	ld [wCurMessageIndex], a
 
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -41,19 +41,18 @@
 ; update palette id
 	ld [TimeOfDayPal], a
 
+; save bg palette 7
+	ld hl, UnknBGPals palette PAL_BG_TEXT
 
-; save bg palette 8
-	ld hl, UnknBGPals + 8 * 7 ; UnknBGPals + 7 pals
-
 ; save wram bank
 	ld a, [rSVBK]
 	ld b, a
 ; wram bank 5
-	ld a, 5
+	ld a, $5
 	ld [rSVBK], a
 
 ; push palette
-	ld c, 4 ; NUM_PAL_COLORS
+	ld c, NUM_PAL_COLORS
 .push
 	ld d, [hl]
 	inc hl
@@ -73,7 +72,7 @@
 	call GetSGBLayout
 
 
-; restore bg palette 8
+; restore bg palette 7
 	ld hl, UnknOBPals - 1 ; last byte in UnknBGPals
 
 ; save wram bank
@@ -84,7 +83,7 @@
 	ld [rSVBK], a
 
 ; pop palette
-	ld e, 4 ; NUM_PAL_COLORS
+	ld e, NUM_PAL_COLORS
 .pop
 	pop bc
 	ld [hl], c
--- a/event/heal_machine_anim.asm
+++ b/event/heal_machine_anim.asm
@@ -126,14 +126,14 @@
 ; 123dc
 
 .PC_ElmsLab_OAM: ; 123dc
-	dsprite   4, 0,   4, 2, $7c, $16
-	dsprite   4, 0,   4, 6, $7c, $16
-	dsprite   4, 6,   4, 0, $7d, $16
-	dsprite   4, 6,   5, 0, $7d, $36 ; xflip
-	dsprite   5, 3,   4, 0, $7d, $16
-	dsprite   5, 3,   5, 0, $7d, $36 ; xflip
-	dsprite   6, 0,   4, 0, $7d, $16
-	dsprite   6, 0,   5, 0, $7d, $36 ; xflip
+	dsprite   4, 0,   4, 2, $7c, PAL_OW_TREE | OBP_NUM
+	dsprite   4, 0,   4, 6, $7c, PAL_OW_TREE | OBP_NUM
+	dsprite   4, 6,   4, 0, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   4, 6,   5, 0, $7d, PAL_OW_TREE | OBP_NUM | X_FLIP
+	dsprite   5, 3,   4, 0, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   5, 3,   5, 0, $7d, PAL_OW_TREE | OBP_NUM | X_FLIP
+	dsprite   6, 0,   4, 0, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   6, 0,   5, 0, $7d, PAL_OW_TREE | OBP_NUM | X_FLIP
 ; 123fc
 
 .HealMachineGFX: ; 123fc
@@ -141,12 +141,12 @@
 ; 1241c
 
 .HOF_OAM: ; 1241c
-	dsprite   7, 4,  10, 1, $7d, $16
-	dsprite   7, 4,  10, 6, $7d, $16
-	dsprite   7, 3,   9, 5, $7d, $16
-	dsprite   7, 3,  11, 2, $7d, $16
-	dsprite   7, 1,   9, 1, $7d, $16
-	dsprite   7, 1,  11, 5, $7d, $16
+	dsprite   7, 4,  10, 1, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   7, 4,  10, 6, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   7, 3,   9, 5, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   7, 3,  11, 2, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   7, 1,   9, 1, $7d, PAL_OW_TREE | OBP_NUM
+	dsprite   7, 1,  11, 5, $7d, PAL_OW_TREE | OBP_NUM
 ; 12434
 
 .LoadPalettes: ; 12434
@@ -158,8 +158,8 @@
 
 .cgb
 	ld hl, .palettes
-	ld de, OBPals + 8 * 6
-	ld bc, 8
+	ld de, OBPals palette PAL_OW_TREE
+	ld bc, 1 palettes
 	ld a, $5
 	call FarCopyWRAM
 	ld a, $1
@@ -201,7 +201,7 @@
 	ld a, $5
 	ld [rSVBK], a
 
-	ld hl, OBPals + 8 * 6
+	ld hl, OBPals palette PAL_OW_TREE
 	ld a, [hli]
 	ld e, a
 	ld a, [hli]
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -246,7 +246,7 @@
 ; copy c palettes in order b from de to hl
 
 	push bc
-	ld c, 4 ; NUM_PAL_COLORS
+	ld c, NUM_PAL_COLORS
 .loop
 	push de
 	push hl
@@ -280,7 +280,7 @@
 	jr nz, .loop
 
 ; de += 8 (next pal)
-	ld a, 1 palettes ; NUM_PAL_COLORS * 2 ; bytes per pal
+	ld a, NUM_PAL_COLORS * 2
 	add e
 	jr nc, .ok
 	inc d
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -631,8 +631,8 @@
 	ld a, 5
 	ld [rSVBK], a
 	ld hl, Palette_894b3
-	ld de, UnknBGPals + 8 * 7
-	ld bc, 8
+	ld de, UnknBGPals palette 7
+	ld bc, 1 palettes
 	call CopyBytes
 	pop af
 	ld [rSVBK], a
--- a/tilesets/palettes/battle_tower.pal
+++ /dev/null
@@ -1,40 +1,0 @@
-; gray
-	RGB 30, 28, 26
-	RGB 19, 19, 19
-	RGB 13, 13, 13
-	RGB 07, 07, 07
-; red
-	RGB 30, 28, 26
-	RGB 31, 19, 24
-	RGB 30, 10, 06
-	RGB 07, 07, 07
-; green
-	RGB 18, 24, 09
-	RGB 15, 20, 01
-	RGB 09, 13, 00
-	RGB 07, 07, 07
-; water (blue)
-	RGB 30, 28, 26
-	RGB 15, 16, 31
-	RGB 09, 09, 31
-	RGB 07, 07, 07
-; yellow
-	RGB 30, 28, 26
-	RGB 31, 31, 07
-	RGB 31, 16, 01
-	RGB 07, 07, 07
-; brown
-	RGB 26, 24, 17
-	RGB 21, 17, 07
-	RGB 16, 13, 03
-	RGB 07, 07, 07
-; roof
-	RGB 05, 05, 16
-	RGB 08, 19, 28
-	RGB 00, 00, 00
-	RGB 31, 31, 31
-; text
-	RGB 31, 31, 16
-	RGB 31, 31, 16
-	RGB 14, 09, 00
-	RGB 00, 00, 00
--- a/tilesets/palettes/house_1.pal
+++ /dev/null
@@ -1,40 +1,0 @@
-; gray
-	RGB 30, 28, 26
-	RGB 19, 19, 19
-	RGB 13, 13, 13
-	RGB 07, 07, 07
-; red
-	RGB 30, 28, 26
-	RGB 31, 19, 24
-	RGB 30, 10, 06
-	RGB 07, 07, 07
-; green
-	RGB 30, 28, 26
-	RGB 15, 20, 01
-	RGB 09, 13, 00
-	RGB 07, 07, 07
-; water (blue)
-	RGB 30, 28, 26
-	RGB 15, 16, 31
-	RGB 09, 09, 31
-	RGB 07, 07, 07
-; yellow
-	RGB 30, 28, 26
-	RGB 31, 31, 07
-	RGB 31, 16, 01
-	RGB 07, 07, 07
-; brown
-	RGB 26, 24, 17
-	RGB 21, 17, 07
-	RGB 16, 13, 03
-	RGB 07, 07, 07
-; roof (glass)
-	RGB 30, 28, 26
-	RGB 31, 19, 24
-	RGB 16, 13, 03
-	RGB 07, 07, 07
-; text
-	RGB 31, 31, 16
-	RGB 31, 31, 16
-	RGB 14, 09, 00
-	RGB 00, 00, 00
--- a/tilesets/palettes/ice_path.pal
+++ /dev/null
@@ -1,40 +1,0 @@
-; gray
-	RGB 15, 14, 24
-	RGB 11, 11, 19
-	RGB 07, 07, 12
-	RGB 00, 00, 00
-; red
-	RGB 15, 14, 24
-	RGB 14, 07, 17
-	RGB 13, 00, 08
-	RGB 00, 00, 00
-; green (ice)
-	RGB 22, 29, 31
-	RGB 10, 27, 31
-	RGB 31, 31, 31
-	RGB 05, 00, 09
-; water
-	RGB 15, 14, 24
-	RGB 05, 05, 17
-	RGB 03, 03, 10
-	RGB 00, 00, 00
-; yellow
-	RGB 30, 30, 11
-	RGB 16, 14, 18
-	RGB 16, 14, 10
-	RGB 00, 00, 00
-; brown
-	RGB 15, 14, 24
-	RGB 12, 09, 15
-	RGB 08, 04, 05
-	RGB 00, 00, 00
-; roof (snow)
-	RGB 25, 31, 31
-	RGB 09, 28, 31
-	RGB 16, 11, 31
-	RGB 05, 00, 09
-; text
-	RGB 31, 31, 16
-	RGB 31, 31, 16
-	RGB 14, 09, 00
-	RGB 00, 00, 00
--- a/tilesets/palettes/pokecom_center.pal
+++ /dev/null
@@ -1,40 +1,0 @@
-; gray
-	RGB 30, 28, 26
-	RGB 19, 19, 19
-	RGB 13, 13, 13
-	RGB 07, 07, 07
-; red
-	RGB 30, 28, 26
-	RGB 31, 19, 24
-	RGB 30, 10, 06
-	RGB 07, 07, 07
-; green
-	RGB 18, 24, 09
-	RGB 15, 20, 01
-	RGB 09, 13, 00
-	RGB 07, 07, 07
-; water (blue)
-	RGB 30, 28, 26
-	RGB 17, 19, 31
-	RGB 14, 16, 31
-	RGB 07, 07, 07
-; yellow
-	RGB 31, 26, 21
-	RGB 31, 20, 01
-	RGB 14, 16, 31
-	RGB 07, 07, 07
-; brown
-	RGB 21, 17, 07
-	RGB 17, 19, 31
-	RGB 16, 13, 03
-	RGB 07, 07, 07
-; roof
-	RGB 05, 05, 16
-	RGB 08, 19, 28
-	RGB 00, 00, 00
-	RGB 31, 31, 31
-; text
-	RGB 31, 31, 16
-	RGB 31, 31, 16
-	RGB 14, 09, 00
-	RGB 00, 00, 00
--- a/tilesets/palettes/radio_tower.pal
+++ /dev/null
@@ -1,39 +1,0 @@
-	RGB 27, 31, 27
-	RGB 21, 21, 21
-	RGB 13, 13, 13
-	RGB 07, 07, 07
-
-	RGB 27, 31, 27
-	RGB 31, 19, 24
-	RGB 30, 10, 06
-	RGB 07, 07, 07
-
-	RGB 08, 12, 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 27, 31, 27
-	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 27, 31, 27
-	RGB 15, 31, 31
-	RGB 05, 17, 31
-	RGB 07, 07, 07
-
-	RGB 31, 31, 16
-	RGB 31, 31, 16
-	RGB 14, 09, 00
-	RGB 00, 00, 00
--- a/tilesets/special_palettes.asm
+++ b/tilesets/special_palettes.asm
@@ -63,7 +63,7 @@
 ; 49501
 
 PokeComPalette: ; 49501
-INCLUDE "tilesets/palettes/pokecom_center.pal"
+INCLUDE "data/palettes/tilesets/pokecom_center.pal"
 ; 49541
 
 LoadBattleTowerPalette: ; 49541
@@ -76,7 +76,7 @@
 ; 49550
 
 BattleTowerPalette: ; 49550
-INCLUDE "tilesets/palettes/battle_tower.pal"
+INCLUDE "data/palettes/tilesets/battle_tower.pal"
 ; 49590
 
 LoadIcePathPalette: ; 49590
@@ -89,7 +89,7 @@
 ; 4959f
 
 IcePathPalette: ; 4959f
-INCLUDE "tilesets/palettes/ice_path.pal"
+INCLUDE "data/palettes/tilesets/ice_path.pal"
 ; 495df
 
 LoadHousePalette: ; 495df
@@ -102,7 +102,7 @@
 ; 495ee
 
 HousePalette: ; 495ee
-INCLUDE "tilesets/palettes/house_1.pal"
+INCLUDE "data/palettes/tilesets/house_1.pal"
 ; 4962e
 
 LoadRadioTowerPalette: ; 4962e
@@ -115,7 +115,7 @@
 ; 4963d
 
 RadioTowerPalette: ; 4963d
-INCLUDE "tilesets/palettes/radio_tower.pal"
+INCLUDE "data/palettes/tilesets/radio_tower.pal"
 ; 4967d
 
 MansionPalette1: ; 4967d