diff --git a/include/graphic_utils.h b/include/graphic_utils.h index 7fb6607..523f95c 100644 --- a/include/graphic_utils.h +++ b/include/graphic_utils.h @@ -24,6 +24,7 @@ #define AFFINE_BG_SBB 2 #define AFFINE_BG_CBB 2 #define PAL_ROW_LEN 16 +#define PAL_BG_MAX_SIZE (PAL_ROW_LEN * 9) #define NUM_PALETTES 16 #define TTE_BIT_UNPACK_OFFSET 14 diff --git a/source/game.c b/source/game.c index 52765e5..d0c938c 100644 --- a/source/game.c +++ b/source/game.c @@ -445,7 +445,7 @@ void change_background(int id) // Load the tiles and palette // 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(&se_mem[MAIN_BG_SBB], background_gfxMap); @@ -507,7 +507,7 @@ void change_background(int id) { 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(&se_mem[MAIN_BG_SBB], background_shop_gfxMap); @@ -536,7 +536,7 @@ void change_background(int id) 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(&se_mem[MAIN_BG_SBB], background_blind_select_gfxMap); @@ -638,7 +638,7 @@ void change_background(int id) toggle_windows(false, false); 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(&se_mem[MAIN_BG_SBB], background_main_menu_gfxMap);