shithub: pokecrystal

Download patch

ref: f5ac9b0eb7773a9d05108b1ee6e41140d53020cd
parent: 26d764de5d3c7cd48ecae95f0cbfb9f368388162
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sat Jul 4 12:18:16 EDT 2020

SCGB_PARTY_MENU_HP_PALS -> SCGB_PARTY_MENU_HP_BARS, and SCGB_RAM -> SCGB_DEFAULT

--- a/constants/scgb_constants.asm
+++ b/constants/scgb_constants.asm
@@ -32,8 +32,8 @@
 	const SCGB_MYSTERY_GIFT
 	const SCGB_1E
 
-SCGB_PARTY_MENU_HP_PALS  EQU -4
-SCGB_RAM EQU -1
+SCGB_PARTY_MENU_HP_BARS EQU $fc
+SCGB_DEFAULT EQU $ff
 
 ; PredefPals indexes (see gfx/sgb/predef.pal)
 ; GetPredefPal arguments (see engine/gfx/color.asm)
--- a/engine/gfx/cgb_layouts.asm
+++ b/engine/gfx/cgb_layouts.asm
@@ -7,11 +7,11 @@
 
 LoadSGBLayoutCGB:
 	ld a, b
-	cp SCGB_RAM
-	jr nz, .not_ram
-	ld a, [wSGBPredef]
-.not_ram
-	cp SCGB_PARTY_MENU_HP_PALS
+	cp SCGB_DEFAULT
+	jr nz, .not_default
+	ld a, [wDefaultSGBLayout]
+.not_default
+	cp SCGB_PARTY_MENU_HP_BARS
 	jp z, CGB_ApplyPartyMenuHPPals
 	call ResetBGPals
 	ld l, a
@@ -109,7 +109,7 @@
 	pop hl
 	call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_PLAYER
 	ld a, SCGB_BATTLE_COLORS
-	ld [wSGBPredef], a
+	ld [wDefaultSGBLayout], a
 	call ApplyPals
 _CGB_FinishBattleScreenLayout:
 	call InitPartyMenuBGPal7
@@ -531,7 +531,7 @@
 _CGB_MapPals:
 	call LoadMapPals
 	ld a, SCGB_MAPPALS
-	ld [wSGBPredef], a
+	ld [wDefaultSGBLayout], a
 	ret
 
 _CGB_PartyMenu:
@@ -589,7 +589,7 @@
 	ld a, BANK(wOBPals1)
 	call FarCopyWRAM
 	ld a, SCGB_DIPLOMA
-	ld [wSGBPredef], a
+	ld [wDefaultSGBLayout], a
 	call ApplyPals
 	ld a, $1
 	ldh [hCGBPalUpdate], a
--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -106,7 +106,7 @@
 	call WipeAttrmap
 	ret
 
-; SGB layout for SCGB_PARTY_MENU_HP_PALS
+; SGB layout for SCGB_PARTY_MENU_HP_BARS
 SGB_ApplyPartyMenuHPPals:
 	ld hl, wHPPals
 	ld a, [wSGBPals]
@@ -630,7 +630,7 @@
 	ldh [rVBK], a
 	ret
 
-; CGB layout for SCGB_PARTY_MENU_HP_PALS
+; CGB layout for SCGB_PARTY_MENU_HP_BARS
 CGB_ApplyPartyMenuHPPals:
 	ld hl, wHPPals
 	ld a, [wSGBPals]
--- a/engine/gfx/crystal_layouts.asm
+++ b/engine/gfx/crystal_layouts.asm
@@ -1,8 +1,8 @@
 GetMysteryGift_MobileAdapterLayout:
 	ld a, b
-	cp SCGB_RAM
+	cp SCGB_DEFAULT
 	jr nz, .not_ram
-	ld a, [wSGBPredef]
+	ld a, [wDefaultSGBLayout]
 .not_ram
 	push af
 	farcall ResetBGPals
--- a/engine/gfx/sgb_layouts.asm
+++ b/engine/gfx/sgb_layouts.asm
@@ -3,11 +3,11 @@
 	jp nz, LoadSGBLayoutCGB
 
 	ld a, b
-	cp SCGB_RAM
-	jr nz, .not_ram
-	ld a, [wSGBPredef]
-.not_ram
-	cp SCGB_PARTY_MENU_HP_PALS
+	cp SCGB_DEFAULT
+	jr nz, .not_default
+	ld a, [wDefaultSGBLayout]
+.not_default
+	cp SCGB_PARTY_MENU_HP_BARS
 	jp z, SGB_ApplyPartyMenuHPPals
 	ld l, a
 	ld h, 0
@@ -130,7 +130,7 @@
 	ld hl, wSGBPals
 	ld de, wSGBPals + PALPACKET_LENGTH
 	ld a, SCGB_BATTLE_COLORS
-	ld [wSGBPredef], a
+	ld [wDefaultSGBLayout], a
 	ret
 
 .SGB_MoveList:
@@ -318,7 +318,7 @@
 	ld hl, PalPacket_GSTitleScreen
 	ld de, BlkPacket_GSTitleScreen
 	ld a, SCGB_DIPLOMA
-	ld [wSGBPredef], a
+	ld [wDefaultSGBLayout], a
 	ret
 
 .SGB_MagnetTrain:
@@ -350,7 +350,7 @@
 	ld [hld], a
 	ld de, BlkPacket_9a86
 	ld a, SCGB_MAPPALS
-	ld [wSGBPredef], a
+	ld [wDefaultSGBLayout], a
 	ret
 
 .SGB_Evolution:
--- a/engine/pokemon/party_menu.asm
+++ b/engine/pokemon/party_menu.asm
@@ -138,7 +138,7 @@
 	ld b, $0
 	add hl, bc
 	call SetHPPal
-	ld b, SCGB_PARTY_MENU_HP_PALS
+	ld b, SCGB_PARTY_MENU_HP_BARS
 	call GetSGBLayout
 .skip
 	ld hl, wSGBPals
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -202,7 +202,7 @@
 	ret
 
 GetMemSGBLayout::
-	ld b, SCGB_RAM
+	ld b, SCGB_DEFAULT
 GetSGBLayout::
 ; load sgb packets unless dmg
 
--- a/wram.asm
+++ b/wram.asm
@@ -1336,7 +1336,7 @@
 wcd8d:: ds 11
 ENDU
 
-wSGBPredef:: db
+wDefaultSGBLayout:: db
 
 wPlayerHPPal:: db
 wEnemyHPPal:: db