From c9c59dc34323a5e0b1886db5f845c8d41620826e Mon Sep 17 00:00:00 2001 From: Rangi Date: Fri, 3 Jul 2020 12:44:47 -0400 Subject: Reorganize constants/ To do: add comments associating constants with data and code --- constants/palette_constants.asm | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'constants/palette_constants.asm') diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm index 1413ad98..da63651a 100755 --- a/constants/palette_constants.asm +++ b/constants/palette_constants.asm @@ -5,25 +5,27 @@ const DARK_GRAY const BLACK -SET_PAL_BATTLE_BLACK EQU $00 -SET_PAL_BATTLE EQU $01 -SET_PAL_TOWN_MAP EQU $02 -SET_PAL_STATUS_SCREEN EQU $03 -SET_PAL_POKEDEX EQU $04 -SET_PAL_SLOTS EQU $05 -SET_PAL_TITLE_SCREEN EQU $06 -SET_PAL_NIDORINO_INTRO EQU $07 -SET_PAL_GENERIC EQU $08 -SET_PAL_OVERWORLD EQU $09 -SET_PAL_PARTY_MENU EQU $0A -SET_PAL_POKEMON_WHOLE_SCREEN EQU $0B -SET_PAL_GAME_FREAK_INTRO EQU $0C -SET_PAL_TRAINER_CARD EQU $0D -UPDATE_PARTY_MENU_BLK_PACKET EQU $FC - -; super game boy palettes -const_value = 0 +; pal/blk packets + const_def + const SET_PAL_BATTLE_BLACK ; $00 + const SET_PAL_BATTLE ; $01 + const SET_PAL_TOWN_MAP ; $02 + const SET_PAL_STATUS_SCREEN ; $03 + const SET_PAL_POKEDEX ; $04 + const SET_PAL_SLOTS ; $05 + const SET_PAL_TITLE_SCREEN ; $06 + const SET_PAL_NIDORINO_INTRO ; $07 + const SET_PAL_GENERIC ; $08 + const SET_PAL_OVERWORLD ; $09 + const SET_PAL_PARTY_MENU ; $0A + const SET_PAL_POKEMON_WHOLE_SCREEN ; $0B + const SET_PAL_GAME_FREAK_INTRO ; $0C + const SET_PAL_TRAINER_CARD ; $0D +const_value = -4 + const UPDATE_PARTY_MENU_BLK_PACKET ; $FC +; sgb palettes + const_def const PAL_ROUTE ; $00 const PAL_PALLET ; $01 const PAL_VIRIDIAN ; $02 -- cgit v1.3.1-sl0p From 7e92d5ba8c7d7c255a49bce76239ec12d6398cef Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 4 Jul 2020 00:37:10 -0400 Subject: Make suggested changes from review --- constants/music_constants.asm | 1 + constants/palette_constants.asm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'constants/palette_constants.asm') diff --git a/constants/music_constants.asm b/constants/music_constants.asm index 7bbe5c62..3f3f111e 100644 --- a/constants/music_constants.asm +++ b/constants/music_constants.asm @@ -166,6 +166,7 @@ MAX_SFX_ID_1 EQUS "SFX_SAFARI_ZONE_PA" ; AUDIO_2 music_const SFX_LEVEL_UP, SFX_Level_Up + music_const SFX_BALL_TOSS, SFX_Ball_Toss music_const SFX_BALL_POOF, SFX_Ball_Poof music_const SFX_FAINT_THUD, SFX_Faint_Thud diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm index da63651a..567c3cfc 100755 --- a/constants/palette_constants.asm +++ b/constants/palette_constants.asm @@ -21,8 +21,8 @@ const SET_PAL_POKEMON_WHOLE_SCREEN ; $0B const SET_PAL_GAME_FREAK_INTRO ; $0C const SET_PAL_TRAINER_CARD ; $0D -const_value = -4 - const UPDATE_PARTY_MENU_BLK_PACKET ; $FC + +UPDATE_PARTY_MENU_BLK_PACKET EQU $fc ; sgb palettes const_def -- cgit v1.3.1-sl0p From 36f8cd1477b8ebe0537e99abd3ba53471a2e16c4 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 4 Jul 2020 16:16:29 -0400 Subject: UPDATE_PARTY_MENU_BLK_PACKET -> SET_PAL_PARTY_MENU_HP_BARS, and introduce SET_PAL_DEFAULT --- constants/palette_constants.asm | 3 ++- engine/gfx/palettes.asm | 10 +++++----- engine/menus/party_menu.asm | 2 +- home.asm | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'constants/palette_constants.asm') diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm index 567c3cfc..c0c397ee 100755 --- a/constants/palette_constants.asm +++ b/constants/palette_constants.asm @@ -22,7 +22,8 @@ const SET_PAL_GAME_FREAK_INTRO ; $0C const SET_PAL_TRAINER_CARD ; $0D -UPDATE_PARTY_MENU_BLK_PACKET EQU $fc +SET_PAL_PARTY_MENU_HP_BARS EQU $fc +SET_PAL_DEFAULT EQU $ff ; sgb palettes const_def diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 9ec0f04a..58e08e86 100755 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -1,11 +1,11 @@ _RunPaletteCommand: call GetPredefRegisters ld a, b - cp $ff - jr nz, .next - ld a, [wDefaultPaletteCommand] ; use default command if command ID is $ff -.next - cp UPDATE_PARTY_MENU_BLK_PACKET + cp SET_PAL_DEFAULT + jr nz, .not_default + ld a, [wDefaultPaletteCommand] +.not_default + cp SET_PAL_PARTY_MENU_HP_BARS jp z, UpdatePartyMenuBlkPacket ld l, a ld h, 0 diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index b64c1af8..9ae5706e 100755 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -318,7 +318,7 @@ SetPartyMenuHPBarColor: ld b, 0 add hl, bc call GetHealthBarColor - ld b, UPDATE_PARTY_MENU_BLK_PACKET + ld b, SET_PAL_PARTY_MENU_HP_BARS call RunPaletteCommand ld hl, wWhichPartyMenuHPBar inc [hl] diff --git a/home.asm b/home.asm index 8507bf0d..19101c9a 100644 --- a/home.asm +++ b/home.asm @@ -1654,7 +1654,7 @@ GBPalWhiteOut:: ret RunDefaultPaletteCommand:: - ld b, $ff + ld b, SET_PAL_DEFAULT RunPaletteCommand:: ld a, [wOnSGB] and a -- cgit v1.3.1-sl0p