diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 2de46e31b..bc3de9ac2 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -873,12 +873,12 @@ INCLUDE "gfx/slots/slots.pal" LevelSelectionMenuMalePals: table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuMalePals INCLUDE "gfx/level_selection_menu/background_male.pal" - assert_table_length NUM_DAYTIMES + assert_table_length (NUM_DAYTIMES + NUM_DAYTIMES * 2) LevelSelectionMenuFemalePals: table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuFemalePals INCLUDE "gfx/level_selection_menu/background_female.pal" - assert_table_length NUM_DAYTIMES + assert_table_length (NUM_DAYTIMES + NUM_DAYTIMES * 2) LevelSelectionMenuStageTrophiesPals: INCLUDE "gfx/level_selection_menu/stage_trophies.pal" diff --git a/gfx/level_selection_menu/background_female.pal b/gfx/level_selection_menu/background_female.pal index db8e0eb37..e81625b41 100755 --- a/gfx/level_selection_menu/background_female.pal +++ b/gfx/level_selection_menu/background_female.pal @@ -1,5 +1,7 @@ ; morn + rgbpals_fade_src "lsm_f_morn" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -7,13 +9,13 @@ RGB 00, 00, 00 ; earth RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 07, 31, 03 + RGB 05, 05, 31 RGB 00, 00, 00 ; mountain RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 07, 31, 03 + RGB 19, 11, 00 RGB 00, 00, 00 ; city (girl) RGB 28, 31, 20 @@ -22,17 +24,21 @@ RGB 00, 00, 00 ; point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 07, 31, 03 + RGB 05, 05, 31 RGB 31, 00, 00 ; mountain point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 07, 31, 03 + RGB 19, 11, 00 RGB 31, 00, 00 + rgbpals_fade_src_end + ; day (original) + rgbpals_fade_src "lsm_f_day" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -64,8 +70,12 @@ RGB 15, 07, 00 RGB 31, 00, 00 + rgbpals_fade_src_end + ; nite + rgbpals_fade_src "lsm_f_nite" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -73,13 +83,13 @@ RGB 00, 00, 00 ; earth RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 00, 15, 00 + RGB 00, 00, 15 RGB 00, 00, 00 ; mountain RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 00, 15, 00 + RGB 09, 05, 00 RGB 00, 00, 00 ; city (girl) RGB 28, 31, 20 @@ -88,17 +98,21 @@ RGB 00, 00, 00 ; point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 00, 15, 00 + RGB 00, 00, 15 RGB 31, 00, 00 ; mountain point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 00, 15, 00 + RGB 09, 05, 00 RGB 31, 00, 00 + rgbpals_fade_src_end + ; eve + rgbpals_fade_src "lsm_f_eve" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -106,13 +120,13 @@ RGB 00, 00, 00 ; earth RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 04, 22, 00 + RGB 04, 00, 22 RGB 00, 00, 00 ; mountain RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 04, 22, 00 + RGB 13, 05, 00 RGB 00, 00, 00 ; city (girl) RGB 28, 31, 20 @@ -121,11 +135,18 @@ RGB 00, 00, 00 ; point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 04, 22, 00 + RGB 04, 00, 22 RGB 31, 00, 00 ; mountain point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 - RGB 31, 00, 00 \ No newline at end of file + RGB 04, 22, 00 + RGB 13, 05, 00 + RGB 31, 00, 00 + + rgbpals_fade_src_end + + rgbpals_fade_apply "lsm_f_morn", "lsm_f_day", 2 + rgbpals_fade_apply "lsm_f_day", "lsm_f_eve", 2 + rgbpals_fade_apply "lsm_f_eve", "lsm_f_nite", 2 + rgbpals_fade_apply "lsm_f_nite", "lsm_f_morn", 2 diff --git a/gfx/level_selection_menu/background_male.pal b/gfx/level_selection_menu/background_male.pal index c8007208a..884e58edc 100755 --- a/gfx/level_selection_menu/background_male.pal +++ b/gfx/level_selection_menu/background_male.pal @@ -1,5 +1,7 @@ ; morn + rgbpals_fade_src "lsm_m_morn" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -7,13 +9,13 @@ RGB 00, 00, 00 ; earth RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 07, 31, 03 + RGB 05, 05, 31 RGB 00, 00, 00 ; mountain RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 07, 31, 03 + RGB 19, 11, 00 RGB 00, 00, 00 ; city (boy) RGB 28, 31, 20 @@ -22,17 +24,21 @@ RGB 00, 00, 00 ; point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 07, 31, 03 + RGB 05, 05, 31 RGB 31, 00, 00 ; mountain point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 07, 31, 03 + RGB 19, 11, 00 RGB 31, 00, 00 + rgbpals_fade_src_end + ; day (original) + rgbpals_fade_src "lsm_m_day" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -64,8 +70,12 @@ RGB 15, 07, 00 RGB 31, 00, 00 + rgbpals_fade_src_end + ; nite + rgbpals_fade_src "lsm_m_nite" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -73,13 +83,13 @@ RGB 00, 00, 00 ; earth RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 00, 15, 00 + RGB 00, 00, 15 RGB 00, 00, 00 ; mountain RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 00, 15, 00 + RGB 09, 05, 00 RGB 00, 00, 00 ; city (boy) RGB 28, 31, 20 @@ -88,17 +98,21 @@ RGB 00, 00, 00 ; point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 00, 15, 00 + RGB 00, 00, 15 RGB 31, 00, 00 ; mountain point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 00, 15, 00 + RGB 09, 05, 00 RGB 31, 00, 00 + rgbpals_fade_src_end + ; eve + rgbpals_fade_src "lsm_m_eve" + ; border RGB 28, 31, 20 RGB 21, 21, 21 @@ -106,13 +120,13 @@ RGB 00, 00, 00 ; earth RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 04, 22, 00 + RGB 04, 00, 22 RGB 00, 00, 00 ; mountain RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 + RGB 04, 22, 00 + RGB 13, 05, 00 RGB 00, 00, 00 ; city (boy) RGB 28, 31, 20 @@ -121,11 +135,18 @@ RGB 00, 00, 00 ; point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 00, 00, 31 + RGB 04, 22, 00 + RGB 04, 00, 22 RGB 31, 00, 00 ; mountain point of interest RGB 28, 31, 20 - RGB 00, 31, 00 - RGB 15, 07, 00 - RGB 31, 00, 00 \ No newline at end of file + RGB 04, 22, 00 + RGB 13, 05, 00 + RGB 31, 00, 00 + + rgbpals_fade_src_end + + rgbpals_fade_apply "lsm_m_morn", "lsm_m_day", 2 + rgbpals_fade_apply "lsm_m_day", "lsm_m_eve", 2 + rgbpals_fade_apply "lsm_m_eve", "lsm_m_nite", 2 + rgbpals_fade_apply "lsm_m_nite", "lsm_m_morn", 2 diff --git a/macros/gfx.asm b/macros/gfx.asm index 630b131cd..4a49e7a0c 100644 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -1,5 +1,9 @@ ; Graphics macros +DEF palred EQUS "(1 << 0) *" +DEF palgreen EQUS "(1 << 5) *" +DEF palblue EQUS "(1 << 10) *" + MACRO assert_valid_rgb rept _NARG assert 0 <= (\1) && (\1) <= 31, "RGB channel must be 0-31" @@ -11,13 +15,53 @@ MACRO RGB rept _NARG / 3 assert_valid_rgb \1, \2, \3 dw palred (\1) + palgreen (\2) + palblue (\3) + if DEF(fade_src) + DEF {fade_src}_{d:color_index} EQU \1 + DEF color_index += 1 + DEF {fade_src}_{d:color_index} EQU \2 + DEF color_index += 1 + DEF {fade_src}_{d:color_index} EQU \3 + DEF color_index += 1 + endc shift 3 endr ENDM -DEF palred EQUS "(1 << 0) *" -DEF palgreen EQUS "(1 << 5) *" -DEF palblue EQUS "(1 << 10) *" +MACRO rgbpals_fade_src + DEF fade_src EQUS \1 + DEF color_index = 0 +ENDM + +MACRO rgbpals_fade_src_end + DEF {fade_src}_len = color_index + PURGE fade_src +ENDM + +MACRO rgbpals_fade_apply + DEF fade_from EQUS \1 + DEF fade_to EQUS \2 + assert {fade_from}_len == {fade_to}_len, "fade_from pals and fade_to pals must be same length" + for i, \3 + for j, 0, {fade_from}_len, 3 + DEF rgbch_red = {j} + 0 + DEF rgbch_green = {j} + 1 + DEF rgbch_blue = {j} + 2 + DEF palred_value = {fade_from}_{d:rgbch_red} + ({fade_to}_{d:rgbch_red} - {fade_from}_{d:rgbch_red}) * i / \3 + DEF palgreen_value = {fade_from}_{d:rgbch_green} + ({fade_to}_{d:rgbch_green} - {fade_from}_{d:rgbch_green}) * i / \3 + DEF palblue_value = {fade_from}_{d:rgbch_blue} + ({fade_to}_{d:rgbch_blue} - {fade_from}_{d:rgbch_blue}) * i / \3 + dw palred (palred_value) + palgreen (palgreen_value) + palblue (palblue_value) + endr + endr + PURGE fade_from, fade_to, rgbch_red, rgbch_green, rgbch_blue, palred_value, palgreen_value, palblue_value +ENDM + +/* MACRO rgbpals_fade_end + rept _NARG + for i, + endr + shift + endr +ENDM */ DEF palettes EQUS "* PALETTE_SIZE" DEF palette EQUS "+ PALETTE_SIZE *"