replaced magic numbers for background palette size

This commit is contained in:
cellos51
2025-08-28 16:09:46 -04:00
parent 06ca593e8a
commit bc32707126
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -24,6 +24,7 @@
#define AFFINE_BG_SBB 2 #define AFFINE_BG_SBB 2
#define AFFINE_BG_CBB 2 #define AFFINE_BG_CBB 2
#define PAL_ROW_LEN 16 #define PAL_ROW_LEN 16
#define PAL_BG_MAX_SIZE (PAL_ROW_LEN * 9)
#define NUM_PALETTES 16 #define NUM_PALETTES 16
#define TTE_BIT_UNPACK_OFFSET 14 #define TTE_BIT_UNPACK_OFFSET 14
+4 -4
View File
@@ -445,7 +445,7 @@ void change_background(int id)
// Load the tiles and palette // Load the tiles and palette
// Background // Background
memcpy(pal_bg_mem, background_gfxPal, 64); // This '64" isn't a specific number, I'm just using it to prevent the text colors from being overridden memcpy16(pal_bg_mem, background_gfxPal, PAL_BG_MAX_SIZE); // This '64" isn't a specific number, I'm just using it to prevent the text colors from being overridden
GRIT_CPY(&tile8_mem[MAIN_BG_CBB], background_gfxTiles); // Deadass i have no clue how any of these memory things work but I just messed with them until stuff worked GRIT_CPY(&tile8_mem[MAIN_BG_CBB], background_gfxTiles); // Deadass i have no clue how any of these memory things work but I just messed with them until stuff worked
GRIT_CPY(&se_mem[MAIN_BG_SBB], background_gfxMap); GRIT_CPY(&se_mem[MAIN_BG_SBB], background_gfxMap);
@@ -507,7 +507,7 @@ void change_background(int id)
{ {
toggle_windows(false, true); toggle_windows(false, true);
memcpy16(pal_bg_mem, background_shop_gfxPal, 64); memcpy16(pal_bg_mem, background_shop_gfxPal, PAL_BG_MAX_SIZE);
GRIT_CPY(&tile_mem[MAIN_BG_CBB], background_shop_gfxTiles); GRIT_CPY(&tile_mem[MAIN_BG_CBB], background_shop_gfxTiles);
GRIT_CPY(&se_mem[MAIN_BG_SBB], background_shop_gfxMap); GRIT_CPY(&se_mem[MAIN_BG_SBB], background_shop_gfxMap);
@@ -536,7 +536,7 @@ void change_background(int id)
toggle_windows(false, true); toggle_windows(false, true);
memcpy16(pal_bg_mem, background_blind_select_gfxPal, 64); memcpy16(pal_bg_mem, background_blind_select_gfxPal, PAL_BG_MAX_SIZE);
GRIT_CPY(&tile_mem[MAIN_BG_CBB], background_blind_select_gfxTiles); GRIT_CPY(&tile_mem[MAIN_BG_CBB], background_blind_select_gfxTiles);
GRIT_CPY(&se_mem[MAIN_BG_SBB], background_blind_select_gfxMap); GRIT_CPY(&se_mem[MAIN_BG_SBB], background_blind_select_gfxMap);
@@ -638,7 +638,7 @@ void change_background(int id)
toggle_windows(false, false); toggle_windows(false, false);
tte_erase_screen(); tte_erase_screen();
memcpy16(pal_bg_mem, background_main_menu_gfxPal, PAL_ROW_LEN * 9); memcpy16(pal_bg_mem, background_main_menu_gfxPal, PAL_BG_MAX_SIZE);
GRIT_CPY(&tile_mem[MAIN_BG_CBB], background_main_menu_gfxTiles); GRIT_CPY(&tile_mem[MAIN_BG_CBB], background_main_menu_gfxTiles);
GRIT_CPY(&se_mem[MAIN_BG_SBB], background_main_menu_gfxMap); GRIT_CPY(&se_mem[MAIN_BG_SBB], background_main_menu_gfxMap);