diff --git a/src/pokemon_storage_system_graphics.c b/src/pokemon_storage_system_graphics.c index fc5f99d8a..55822aa2c 100644 --- a/src/pokemon_storage_system_graphics.c +++ b/src/pokemon_storage_system_graphics.c @@ -76,75 +76,72 @@ static const union AffineAnimCmd *const sAffineAnims_ReleaseMon[] = { [RELEASE_ANIM_COME_BACK] = sAffineAnim_ReleaseMon_ComeBack, }; -static const u16 sWallpaperPalettes_Forest[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/forest/tiles.gbapal"); +static const u16 sWallpaperPalettes_Forest[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/forest/tiles.gbapal"); static const u32 sWallpaperTiles_Forest[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/forest/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Forest[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/forest/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_City[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/city/tiles.gbapal"); +static const u16 sWallpaperPalettes_City[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/city/tiles.gbapal"); static const u32 sWallpaperTiles_City[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/city/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_City[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/city/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Desert[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/desert/tiles.gbapal"); +static const u16 sWallpaperPalettes_Desert[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/desert/tiles.gbapal"); static const u32 sWallpaperTiles_Desert[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/desert/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Desert[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/desert/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Savanna[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/savanna/tiles.gbapal"); +static const u16 sWallpaperPalettes_Savanna[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/savanna/tiles.gbapal"); static const u32 sWallpaperTiles_Savanna[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/savanna/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Savanna[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/savanna/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Crag[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/crag/tiles.gbapal"); +static const u16 sWallpaperPalettes_Crag[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/crag/tiles.gbapal"); static const u32 sWallpaperTiles_Crag[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/crag/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Crag[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/crag/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Volcano[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/volcano/tiles.gbapal"); +static const u16 sWallpaperPalettes_Volcano[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/volcano/tiles.gbapal"); static const u32 sWallpaperTiles_Volcano[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/volcano/tiles.4bpp.lz"); static const u8 sUnusedSpace1[4] = {}; static const u32 sWallpaperTilemap_Volcano[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/volcano/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Snow[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/snow/tiles.gbapal"); +static const u16 sWallpaperPalettes_Snow[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/snow/tiles.gbapal"); static const u32 sWallpaperTiles_Snow[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/snow/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Snow[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/snow/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Cave[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/cave/tiles.gbapal"); +static const u16 sWallpaperPalettes_Cave[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/cave/tiles.gbapal"); static const u32 sWallpaperTiles_Cave[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/cave/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Cave[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/cave/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Beach[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/beach/tiles.gbapal"); +static const u16 sWallpaperPalettes_Beach[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/beach/tiles.gbapal"); static const u32 sWallpaperTiles_Beach[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/beach/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Beach[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/beach/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Seafloor[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/seafloor/tiles.gbapal"); +static const u16 sWallpaperPalettes_Seafloor[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/seafloor/tiles.gbapal"); static const u32 sWallpaperTiles_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/seafloor/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/seafloor/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_River[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/river/tiles.gbapal"); +static const u16 sWallpaperPalettes_River[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/river/tiles.gbapal"); static const u32 sWallpaperTiles_River[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/river/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_River[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/river/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Sky[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/sky/tiles.gbapal"); +static const u16 sWallpaperPalettes_Sky[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/sky/tiles.gbapal"); static const u32 sWallpaperTiles_Sky[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/sky/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Sky[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/sky/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Stars[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/stars/tiles.gbapal"); +static const u16 sWallpaperPalettes_Stars[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/stars/tiles.gbapal"); static const u8 sUnusedSpace2[32] = {}; static const u32 sWallpaperTiles_Stars[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/stars/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Stars[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/stars/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Pokecenter[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/pokecenter/tiles.gbapal"); +static const u16 sWallpaperPalettes_Pokecenter[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/pokecenter/tiles.gbapal"); static const u32 sWallpaperTiles_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pokecenter/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pokecenter/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Tiles[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/tiles/tiles.gbapal"); +static const u16 sWallpaperPalettes_Tiles[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/tiles/tiles.gbapal"); static const u32 sWallpaperTiles_Tiles[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/tiles/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Tiles[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/tiles/tilemap.bin.lz"); -static const u16 sWallpaperPalettes_Simple[][16] = INCBIN_U16("graphics/pokemon_storage/wallpapers/simple/tiles.gbapal"); +static const u16 sWallpaperPalettes_Simple[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/simple/tiles.gbapal"); static const u32 sWallpaperTiles_Simple[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/simple/tiles.4bpp.lz"); static const u32 sWallpaperTilemap_Simple[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/simple/tilemap.bin.lz"); -// Unused -static const u16 sWallpaperTilemap_Unused[] = INCBIN_U16("graphics/pokemon_storage/wallpapers/unused.bin"); - // Shadow color, text color static const u16 sBoxTitleColors[][2] = { {RGB( 7, 7, 7), RGB_WHITE}, @@ -166,22 +163,22 @@ static const u16 sBoxTitleColors[][2] = { }; static const struct Wallpaper sWallpapers[] = { - {sWallpaperTiles_Forest, sWallpaperTilemap_Forest, *sWallpaperPalettes_Forest }, - {sWallpaperTiles_City, sWallpaperTilemap_City, *sWallpaperPalettes_City }, - {sWallpaperTiles_Desert, sWallpaperTilemap_Desert, *sWallpaperPalettes_Desert }, - {sWallpaperTiles_Savanna, sWallpaperTilemap_Savanna, *sWallpaperPalettes_Savanna }, - {sWallpaperTiles_Crag, sWallpaperTilemap_Crag, *sWallpaperPalettes_Crag }, - {sWallpaperTiles_Volcano, sWallpaperTilemap_Volcano, *sWallpaperPalettes_Volcano }, - {sWallpaperTiles_Snow, sWallpaperTilemap_Snow, *sWallpaperPalettes_Snow }, - {sWallpaperTiles_Cave, sWallpaperTilemap_Cave, *sWallpaperPalettes_Cave }, - {sWallpaperTiles_Beach, sWallpaperTilemap_Beach, *sWallpaperPalettes_Beach }, - {sWallpaperTiles_Seafloor, sWallpaperTilemap_Seafloor, *sWallpaperPalettes_Seafloor }, - {sWallpaperTiles_River, sWallpaperTilemap_River, *sWallpaperPalettes_River }, - {sWallpaperTiles_Sky, sWallpaperTilemap_Sky, *sWallpaperPalettes_Sky }, - {sWallpaperTiles_Stars, sWallpaperTilemap_Stars, *sWallpaperPalettes_Stars }, - {sWallpaperTiles_Pokecenter, sWallpaperTilemap_Pokecenter, *sWallpaperPalettes_Pokecenter}, - {sWallpaperTiles_Tiles, sWallpaperTilemap_Tiles, *sWallpaperPalettes_Tiles }, - {sWallpaperTiles_Simple, sWallpaperTilemap_Simple, *sWallpaperPalettes_Simple }, + {sWallpaperTiles_Forest, sWallpaperTilemap_Forest, sWallpaperPalettes_Forest }, + {sWallpaperTiles_City, sWallpaperTilemap_City, sWallpaperPalettes_City }, + {sWallpaperTiles_Desert, sWallpaperTilemap_Desert, sWallpaperPalettes_Desert }, + {sWallpaperTiles_Savanna, sWallpaperTilemap_Savanna, sWallpaperPalettes_Savanna }, + {sWallpaperTiles_Crag, sWallpaperTilemap_Crag, sWallpaperPalettes_Crag }, + {sWallpaperTiles_Volcano, sWallpaperTilemap_Volcano, sWallpaperPalettes_Volcano }, + {sWallpaperTiles_Snow, sWallpaperTilemap_Snow, sWallpaperPalettes_Snow }, + {sWallpaperTiles_Cave, sWallpaperTilemap_Cave, sWallpaperPalettes_Cave }, + {sWallpaperTiles_Beach, sWallpaperTilemap_Beach, sWallpaperPalettes_Beach }, + {sWallpaperTiles_Seafloor, sWallpaperTilemap_Seafloor, sWallpaperPalettes_Seafloor }, + {sWallpaperTiles_River, sWallpaperTilemap_River, sWallpaperPalettes_River }, + {sWallpaperTiles_Sky, sWallpaperTilemap_Sky, sWallpaperPalettes_Sky }, + {sWallpaperTiles_Stars, sWallpaperTilemap_Stars, sWallpaperPalettes_Stars }, + {sWallpaperTiles_Pokecenter, sWallpaperTilemap_Pokecenter, sWallpaperPalettes_Pokecenter}, + {sWallpaperTiles_Tiles, sWallpaperTilemap_Tiles, sWallpaperPalettes_Tiles }, + {sWallpaperTiles_Simple, sWallpaperTilemap_Simple, sWallpaperPalettes_Simple }, }; static const u16 sBoxScrollArrow_Gfx[] = INCBIN_U16("graphics/pokemon_storage/box_scroll_arrow.4bpp"); diff --git a/src/slot_machine.c b/src/slot_machine.c index 2ce525b61..60e67d4c3 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -396,12 +396,12 @@ static const u16 sPayoutTable[] = { }; #if defined(FIRERED) -static const u16 sReelIcons_Pal[][16] = INCBIN_U16("graphics/slot_machine/firered/reel_icons.gbapal"); +static const u16 sReelIcons_Pal[] = INCBIN_U16("graphics/slot_machine/firered/reel_icons.gbapal"); static const u32 sReelIcons_Tiles[] = INCBIN_U32("graphics/slot_machine/firered/reel_icons.4bpp.lz"); static const u16 sClefairy_Pal[] = INCBIN_U16("graphics/slot_machine/firered/clefairy.gbapal"); static const u32 sClefairy_Tiles[] = INCBIN_U32("graphics/slot_machine/firered/clefairy.4bpp.lz"); #elif defined(LEAFGREEN) -static const u16 sReelIcons_Pal[][16] = INCBIN_U16("graphics/slot_machine/leafgreen/reel_icons.gbapal"); +static const u16 sReelIcons_Pal[] = INCBIN_U16("graphics/slot_machine/leafgreen/reel_icons.gbapal"); static const u32 sReelIcons_Tiles[] = INCBIN_U32("graphics/slot_machine/leafgreen/reel_icons.4bpp.lz"); static const u16 sClefairy_Pal[] = INCBIN_U16("graphics/slot_machine/leafgreen/clefairy.gbapal"); static const u32 sClefairy_Tiles[] = INCBIN_U32("graphics/slot_machine/leafgreen/clefairy.4bpp.lz"); @@ -415,17 +415,21 @@ static const struct CompressedSpriteSheet sSpriteSheets[] = { {.data = sDigits_Tiles, .size = 0x280, .tag = GFXTAG_DIGITS}, }; +#define SLOTS_PALETTE_SIZE 16 + static const struct SpritePalette sSpritePalettes[] = { - {.data = sReelIcons_Pal[0], .tag = PALTAG_REEL_ICONS_0}, - {.data = sReelIcons_Pal[1], .tag = PALTAG_REEL_ICONS_1}, - {.data = sReelIcons_Pal[2], .tag = PALTAG_REEL_ICONS_2}, - {.data = sReelIcons_Pal[3], .tag = PALTAG_REEL_ICONS_3}, - {.data = sReelIcons_Pal[4], .tag = PALTAG_REEL_ICONS_4}, + {.data = &sReelIcons_Pal[SLOTS_PALETTE_SIZE * 0], .tag = PALTAG_REEL_ICONS_0}, + {.data = &sReelIcons_Pal[SLOTS_PALETTE_SIZE * 1], .tag = PALTAG_REEL_ICONS_1}, + {.data = &sReelIcons_Pal[SLOTS_PALETTE_SIZE * 2], .tag = PALTAG_REEL_ICONS_2}, + {.data = &sReelIcons_Pal[SLOTS_PALETTE_SIZE * 3], .tag = PALTAG_REEL_ICONS_3}, + {.data = &sReelIcons_Pal[SLOTS_PALETTE_SIZE * 4], .tag = PALTAG_REEL_ICONS_4}, {.data = sClefairy_Pal, .tag = PALTAG_CLEFAIRY}, {.data = sDigits_Pal, .tag = PALTAG_DIGITS}, {} }; +#undef SLOTS_PALETTE_SIZE + static const u16 sReelIconPaletteTags[] = { #if defined(FIRERED) [ICON_7] = PALTAG_REEL_ICONS_2, @@ -736,21 +740,21 @@ bool8 (*const sSlotMachineSetupTasks[])(u8 *, struct SlotMachineSetupTaskData *) }; #if defined(FIRERED) -static const u16 sBg_Pal[][16] = INCBIN_U16("graphics/slot_machine/firered/bg.gbapal"); +static const u16 sBg_Pal[] = INCBIN_U16("graphics/slot_machine/firered/bg.gbapal"); static const u32 sBg_Tiles[] = INCBIN_U32("graphics/slot_machine/firered/bg.4bpp.lz"); static const u32 sBg_Tilemap[] = INCBIN_U32("graphics/slot_machine/firered/bg.bin.lz"); static const u16 sBgPal_MatchLines[] = INCBIN_U16("graphics/slot_machine/firered/match_lines.gbapal"); -static const u16 sBgPal_PayoutLight[][16] = INCBIN_U16("graphics/slot_machine/firered/payout_lights.gbapal"); +static const u16 sBgPal_PayoutLight[] = INCBIN_U16("graphics/slot_machine/firered/payout_lights.gbapal"); static const u32 sButtonPressed_Tiles[] = INCBIN_U32("graphics/slot_machine/firered/button_pressed.4bpp.lz"); static const u16 sCombosWindow_Pal[] = INCBIN_U16("graphics/slot_machine/firered/combos_window.gbapal"); static const u32 sCombosWindow_Tiles[] = INCBIN_U32("graphics/slot_machine/firered/combos_window.4bpp.lz"); static const u32 sCombosWindow_Tilemap[] = INCBIN_U32("graphics/slot_machine/firered/combos_window.bin.lz"); #elif defined(LEAFGREEN) -static const u16 sBg_Pal[][16] = INCBIN_U16("graphics/slot_machine/leafgreen/bg.gbapal"); +static const u16 sBg_Pal[] = INCBIN_U16("graphics/slot_machine/leafgreen/bg.gbapal"); static const u32 sBg_Tiles[] = INCBIN_U32("graphics/slot_machine/leafgreen/bg.4bpp.lz"); static const u32 sBg_Tilemap[] = INCBIN_U32("graphics/slot_machine/leafgreen/bg.bin.lz"); static const u16 sBgPal_MatchLines[] = INCBIN_U16("graphics/slot_machine/leafgreen/match_lines.gbapal"); -static const u16 sBgPal_PayoutLight[][16] = INCBIN_U16("graphics/slot_machine/leafgreen/payout_lights.gbapal"); +static const u16 sBgPal_PayoutLight[] = INCBIN_U16("graphics/slot_machine/leafgreen/payout_lights.gbapal"); static const u32 sButtonPressed_Tiles[] = INCBIN_U32("graphics/slot_machine/leafgreen/button_pressed.4bpp.lz"); static const u16 sCombosWindow_Pal[] = INCBIN_U16("graphics/slot_machine/leafgreen/combos_window.gbapal"); static const u32 sCombosWindow_Tiles[] = INCBIN_U32("graphics/slot_machine/leafgreen/combos_window.4bpp.lz"); @@ -2377,6 +2381,8 @@ static void SetLineState(u16 * bgTilemapBuffer, u16 whichLine, u16 paletteNum) } } +#define PALETTE_SIZE 16 + static void Task_FlashWinningLine(u8 taskId) { s16 * data = gTasks[taskId].data; @@ -2398,7 +2404,7 @@ static void Task_FlashWinningLine(u8 taskId) if (data[1] == 0) { u16 y = gSineTable[data[2]] >> 7; - LoadPalette(&sBgPal_PayoutLight[y], BG_PLTT_ID(1), sizeof(sBgPal_PayoutLight[0])); + LoadPalette(&sBgPal_PayoutLight[y * 16], BG_PLTT_ID(1), 32); data[2] += 32; data[2] &= 0x7F; data[1] = 8; @@ -2437,7 +2443,7 @@ static void Task_FlashWinningLine(u8 taskId) } // Restore payout lights to normal color - LoadPalette(&sBg_Pal[1], BG_PLTT_ID(1), sizeof(sBg_Pal[1])); + LoadPalette(&sBg_Pal[PALETTE_SIZE], BG_PLTT_ID(1), sizeof(sBg_Pal[PALETTE_SIZE]) * PALETTE_SIZE); CopyBgTilemapBufferToVram(2); data[0]++; @@ -2449,6 +2455,8 @@ static void Task_FlashWinningLine(u8 taskId) } } +#undef PALETTE_SIZE + static void SignalStopWinningLineFlashTask(void) { gTasks[FindTaskIdByFunc(Task_FlashWinningLine)].data[0] = 2;