diff --git a/include/battle_anim.h b/include/battle_anim.h index b25822992..65bd6a393 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -122,7 +122,7 @@ s16 CloneBattlerSpriteWithBlend(u8); void obj_delete_but_dont_free_vram(struct Sprite*); u8 sub_80A89C8(int, u8, int); void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32); -void sub_80A6CC0(u32, const void*, u32); +void sub_80A6CC0(u32, const u32*, u32); void sub_80A6DAC(bool8); void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *); void sub_80A653C(struct Sprite *); @@ -190,7 +190,7 @@ u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, // battle_anim_utility_funcs.s void sub_8116EB4(u8); -void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u8 *arg8, const u8 *arg9, const u16 *palette); +void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); u32 UnpackSelectedBattleAnimPalettes(s16); diff --git a/include/graphics.h b/include/graphics.h index f92ab05f6..40b9744eb 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3071,7 +3071,7 @@ extern const u32 gTrainerBackPicPalette_Leaf[]; // pokeblock extern const u32 gMenuPokeblock_Gfx[]; -extern const u8 gMenuPokeblock_Pal[]; +extern const u32 gMenuPokeblock_Pal[]; extern const u32 gMenuPokeblock_Tilemap[]; extern const u32 gMenuPokeblockDevice_Gfx[]; extern const u32 gMenuPokeblockDevice_Pal[]; @@ -3859,8 +3859,8 @@ extern const u8 gFireRedMenuElements_Gfx[]; // item menu graphics extern const u32 gBagScreen_Gfx[]; -extern const u16 gBagScreenFemale_Pal[]; -extern const u16 gBagScreenMale_Pal[]; +extern const u32 gBagScreenFemale_Pal[]; +extern const u32 gBagScreenMale_Pal[]; extern const u8 gBagMenuHMIcon_Gfx[]; // item menu icons graphics @@ -4100,6 +4100,10 @@ extern const u32 gUnknown_08D83C3C[]; extern const u32 gUnknown_08D83900[]; extern const u32 gBattleFrontierGfx_DomeOptions[]; +extern const u32 gUnknown_08D854E8[]; +extern const u32 gUnknown_08D855E8[]; +extern const u32 gContest2Pal[]; + extern const u32 gBattleAnimSpriteSheet_000[]; extern const u32 gBattleAnimSpriteSheet_001[]; extern const u32 gBattleAnimSpriteSheet_002[]; @@ -4769,5 +4773,7 @@ extern const u16 gCableCar_Pal[]; extern const u16 gUnknown_08DDB3E4[]; extern const u8 gUnknown_08DDB464[]; extern const u16 gUnknown_08DDCF04[]; +extern const u16 gTradeGba2_Pal[]; +extern const u8 gTradeGba_Gfx[]; #endif //GUARD_GRAPHICS_H diff --git a/include/palette.h b/include/palette.h index c14e9f453..540452f3d 100644 --- a/include/palette.h +++ b/include/palette.h @@ -43,7 +43,7 @@ extern u8 gPaletteDecompressionBuffer[]; extern u16 gPlttBufferUnfaded[]; extern u16 gPlttBufferFaded[]; -void LoadCompressedPalette(const void *, u16, u16); +void LoadCompressedPalette(const u32 *, u16, u16); void LoadPalette(const void *, u16, u16); void FillPalette(u16, u16, u16); void TransferPlttBuffer(void); diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index 15a4d2b63..910845c69 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -944,7 +944,7 @@ void sub_80A6C68(u32 bgId) CopyBgTilemapBufferToVram(unkStruct.bgId); } -void sub_80A6CC0(u32 bgId, const void *src, u32 tilesOffset) +void sub_80A6CC0(u32 bgId, const u32 *src, u32 tilesOffset) { CpuFill32(0, gUnknown_0202305C, 0x2000); LZDecompressWram(src, gUnknown_0202305C); diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 244823d13..ba124a6a3 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3390,8 +3390,8 @@ void sub_81064F8(u8 taskId) else sub_80A6D60(&unknownStruct, &gBattleAnimBackgroundTilemap_ScaryFaceOpponent, 0); - sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C249F8, unknownStruct.tilesOffset); - LoadCompressedPalette(&gUnknown_08C249D0, unknownStruct.unk8 << 4, 32); + sub_80A6CC0(unknownStruct.bgId, gUnknown_08C249F8, unknownStruct.tilesOffset); + LoadCompressedPalette(gUnknown_08C249D0, unknownStruct.unk8 << 4, 32); gTasks[taskId].func = sub_81065EC; } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 5f65cb31f..4369bd0a5 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2388,8 +2388,8 @@ void sub_815BB84(u8 taskId) gBattle_BG1_Y = 0; } - sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C2A634, unknownStruct.tilesOffset); - LoadCompressedPalette(&gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); + sub_80A6CC0(unknownStruct.bgId, gUnknown_08C2A634, unknownStruct.tilesOffset); + LoadCompressedPalette(gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); gTasks[taskId].data[10] = gBattle_BG1_X; gTasks[taskId].data[11] = gBattle_BG1_Y; @@ -2594,8 +2594,8 @@ void sub_815C0A4(u8 taskId) gBattle_BG1_Y = 0; } - sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C2A634, unknownStruct.tilesOffset); - LoadCompressedPalette(&gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); + sub_80A6CC0(unknownStruct.bgId, gUnknown_08C2A634, unknownStruct.tilesOffset); + LoadCompressedPalette(gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); gTasks[taskId].data[10] = gBattle_BG1_X; gTasks[taskId].data[11] = gBattle_BG1_Y; gTasks[taskId].data[0]++; diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index f99b1aeac..c9d9bb99c 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -767,7 +767,7 @@ void sub_81177E4(u8 taskId) DestroyAnimVisualTask(taskId); } -void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u8 *arg8, const u8 *arg9, const u16 *palette) +void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette) { u16 species; u8 spriteId, spriteId2; diff --git a/src/battle_arena.c b/src/battle_arena.c index cd2c976da..a4179eca8 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -8,6 +8,7 @@ #include "decompress.h" #include "event_data.h" #include "frontier_util.h" +#include "graphics.h" #include "gpu_regs.h" #include "item.h" #include "m4a.h" @@ -23,9 +24,6 @@ #include "constants/battle_frontier.h" #include "constants/moves.h" -extern const u32 gUnknown_08D854E8[]; -extern const u16 gUnknown_08D855E8[]; - // This file's functions. static void sub_81A58B4(void); static void sub_81A5964(void); diff --git a/src/battle_main.c b/src/battle_main.c index 16025a455..a71d8662d 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -16,6 +16,7 @@ #include "dma3.h" #include "event_data.h" #include "evolution_scene.h" +#include "graphics.h" #include "gpu_regs.h" #include "international_string_util.h" #include "item.h" @@ -73,7 +74,6 @@ extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; extern u8 gUnknown_0203CF00[]; -extern const u16 gBattleTextboxPalette[]; extern const struct BgTemplate gBattleBgTemplates[]; extern const struct WindowTemplate *const gBattleWindowTemplates[]; extern const u8 *const gBattleScriptsForMoveEffects[]; diff --git a/src/contest.c b/src/contest.c index 3d74109cb..b924f1032 100644 --- a/src/contest.c +++ b/src/contest.c @@ -217,7 +217,6 @@ extern const u8 gText_0827D597[]; extern const struct ContestPokemon gContestOpponents[96]; extern const u8 gUnknown_085898A4[96]; extern const struct CompressedSpriteSheet gUnknown_08587C00; -extern const u8 gContest2Pal[]; extern const struct SpriteTemplate gSpriteTemplate_8587BE8; extern const struct CompressedSpriteSheet gUnknown_08587C08; extern const struct CompressedSpritePalette gUnknown_08587C10; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index ed25a2c68..e94069279 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -23,6 +23,7 @@ #include "bg.h" #include "m4a.h" #include "window.h" +#include "graphics.h" #include "constants/abilities.h" #include "daycare.h" #include "overworld.h" @@ -51,11 +52,6 @@ struct EggHatchData }; extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern const u8 gBattleTextboxTiles[]; -extern const u8 gBattleTextboxTilemap[]; -extern const u8 gBattleTextboxPalette[]; -extern const u16 gTradeGba2_Pal[]; // palette, gameboy advance -extern const u32 gTradeGba_Gfx[]; // tileset gameboy advance extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle extern const u8 gText_HatchedFromEgg[]; extern const u8 gText_NickHatchPrompt[]; diff --git a/src/fieldmap.c b/src/fieldmap.c index 7e1fc03eb..cab200208 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -986,7 +986,7 @@ void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOffset, u1 } else { - LoadCompressedPalette((u16*)tileset->palettes, destOffset, size); + LoadCompressedPalette((u32*)tileset->palettes, destOffset, size); nullsub_3(destOffset, size >> 1); } } diff --git a/src/graphics.c b/src/graphics.c index c0deb2883..b2de074bc 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -897,9 +897,9 @@ const u32 gBattleStatMask6_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat6 const u32 gBattleStatMask7_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat7.gbapal.lz"); const u32 gBattleStatMask8_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat8.gbapal.lz"); -const u8 gUnknown_08C2DC68[] = INCBIN_U8("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); -const u16 gUnknown_08C2DDA4[] = INCBIN_U16("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); -const u8 gUnknown_08C2DDC4[] = INCBIN_U8("graphics/battle_anims/masks/cure_bubbles.bin.lz"); +const u32 gUnknown_08C2DC68[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); +const u32 gUnknown_08C2DDA4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); +const u32 gUnknown_08C2DDC4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.bin.lz"); const u32 gBattleAnimSpritePalette_245[] = INCBIN_U32("graphics/battle_anims/sprites/245.gbapal.lz"); const u32 gBattleAnimSpriteSheet_245[] = INCBIN_U32("graphics/battle_anims/sprites/245.4bpp.lz"); diff --git a/src/palette.c b/src/palette.c index 1e92f4bba..deb07b066 100644 --- a/src/palette.c +++ b/src/palette.c @@ -77,7 +77,7 @@ static const u8 sRoundedDownGrayscaleMap[] = { 31, 31 }; -void LoadCompressedPalette(const void *src, u16 offset, u16 size) +void LoadCompressedPalette(const u32 *src, u16 offset, u16 size) { LZDecompressWram(src, gPaletteDecompressionBuffer); CpuCopy16(gPaletteDecompressionBuffer, gPlttBufferUnfaded + offset, size); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index f1c248a1a..4fb20c72b 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1275,7 +1275,7 @@ static bool8 SummaryScreen_DecompressGraphics(void) pssData->unk40F0++; break; case 12: - LoadCompressedPalette(&gMoveTypes_Pal, 0x1D0, 0x60); + LoadCompressedPalette(gMoveTypes_Pal, 0x1D0, 0x60); pssData->unk40F0 = 0; return TRUE; } diff --git a/src/rock.c b/src/rock.c index 20d4ea738..d82fbf9c4 100644 --- a/src/rock.c +++ b/src/rock.c @@ -421,7 +421,7 @@ void AnimTask_LoadSandstormBackground(u8 taskId) sub_80A6B30(&unknownStruct); sub_80A6CC0(unknownStruct.bgId, gUnknown_08D8D58C, unknownStruct.tilesOffset); sub_80A6D60(&unknownStruct, gUnknown_08D8D410, 0); - LoadCompressedPalette(&gBattleAnimSpritePalette_261, unknownStruct.unk8 * 16, 32); + LoadCompressedPalette(gBattleAnimSpritePalette_261, unknownStruct.unk8 * 16, 32); if (gBattleAnimArgs[0] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) var0 = 1;