From 847878eae9a9f0ac4a722c27c1cdf1a2d3ff1d67 Mon Sep 17 00:00:00 2001 From: Kaz Date: Sat, 19 Sep 2020 13:37:24 -0400 Subject: [PATCH] battle_gfx_sfx_util.c: Very annoying fakematch fix. daycare.c: -g eliminates the need for the brace hack. battle_transition.c: Fix Phase2_Ripple_Func2...? --- include/battle.h | 6 +++++- src/battle_anim_effects_3.c | 2 +- src/battle_gfx_sfx_util.c | 42 +++++++++++++++++------------------- src/battle_intro.c | 4 ++-- src/battle_main.c | 2 +- src/battle_transition.c | 5 +---- src/contest.c | 4 ++-- src/contest_painting.c | 8 +++---- src/contest_util.c | 8 +++---- src/daycare.c | 3 --- src/egg_hatch.c | 2 +- src/evolution_scene.c | 10 ++++----- src/pokeblock_feed.c | 2 +- src/pokemon.c | 4 ++-- src/pokemon_summary_screen.c | 8 +++---- src/trade.c | 8 +++---- 16 files changed, 57 insertions(+), 61 deletions(-) diff --git a/include/battle.h b/include/battle.h index 5a04c1eec6..0f7a262ce8 100644 --- a/include/battle.h +++ b/include/battle.h @@ -584,7 +584,11 @@ struct BattleSpriteData struct MonSpritesGfx { void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon - void* sprites[4]; + union + { + void* ptr[4]; + u8* byte[4]; + } sprites; struct SpriteTemplate templates[4]; struct SpriteFrameImage field_74[4][4]; u8 field_F4[0x80]; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 58d3351975..4ba2ad1f1b 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2291,7 +2291,7 @@ void AnimTask_TransformMon(u8 taskId) else position = GetBattlerPosition(gBattleAnimAttacker); - src = gMonSpritesGfxPtr->sprites[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); + src = gMonSpritesGfxPtr->sprites.ptr[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); dest = animBg.bgTiles; CpuCopy32(src, dest, 0x800); LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index e3e63f0e84..58b5d82286 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -6,6 +6,7 @@ #include "constants/battle_anim.h" #include "battle_interface.h" #include "main.h" +#include "dma3.h" #include "malloc.h" #include "graphics.h" #include "random.h" @@ -568,7 +569,7 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId) otId = GetMonData(mon, MON_DATA_OT_ID); position = GetBattlerPosition(battlerId); HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], species, currentPersonality); paletteOffset = 0x100 + battlerId * 16; @@ -624,13 +625,13 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId) if (sub_80688F8(1, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) { HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], species, currentPersonality); } else { HandleLoadSpecialPokePic(&gMonBackPicTable[species], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], species, currentPersonality); } @@ -672,7 +673,7 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId) { u8 position = GetBattlerPosition(battlerId); DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], SPECIES_NONE); LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[frontPicId]); } @@ -681,7 +682,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId) { u8 position = GetBattlerPosition(battlerId); DecompressPicFromTable_2(&gTrainerBackPicTable[backPicId], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], SPECIES_NONE); LoadCompressedPalette(gTrainerBackPicPaletteTable[backPicId].data, 0x100 + 16 * battlerId, 0x20); @@ -921,7 +922,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform otId = gContestResources->moveAnim->otId; HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies], - gMonSpritesGfxPtr->sprites[0], + gMonSpritesGfxPtr->sprites.ptr[0], targetSpecies, gContestResources->moveAnim->targetPersonality); } @@ -940,7 +941,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID); HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], targetSpecies, gTransformedPersonalities[battlerAtk]); } @@ -950,13 +951,13 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID); HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[targetSpecies], - gMonSpritesGfxPtr->sprites[position], + gMonSpritesGfxPtr->sprites.ptr[position], targetSpecies, gTransformedPersonalities[battlerAtk]); } } - src = gMonSpritesGfxPtr->sprites[position]; + src = gMonSpritesGfxPtr->sprites.ptr[position]; dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32); DmaCopy32(3, src, dst, 0x800); paletteOffset = 0x100 + battlerAtk * 16; @@ -997,18 +998,15 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) position = GetBattlerPosition(battlerId); if (IsContest()) - LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]); + LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites.ptr[position]); else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) - LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites[position]); + LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites.ptr[position]); else - LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]); + LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites.ptr[position]); for (i = 1; i < 4; i++) { - u8 (*ptr)[4][0x800] = gMonSpritesGfxPtr->sprites[position]; - ptr++;ptr--; // Needed to match. - - DmaCopy32Defvars(3, (*ptr)[0], (*ptr)[i], 0x800); + Dma3CopyLarge32_(gMonSpritesGfxPtr->sprites.ptr[position], &gMonSpritesGfxPtr->sprites.byte[position][0x800 * i], 0x800); } palOffset = (battlerId * 16) + 0x100; @@ -1245,12 +1243,12 @@ void AllocateMonSpritesGfx(void) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - gMonSpritesGfxPtr->sprites[i] = gMonSpritesGfxPtr->firstDecompressed + (i * 0x2000); + gMonSpritesGfxPtr->sprites.ptr[i] = gMonSpritesGfxPtr->firstDecompressed + (i * 0x2000); *(gMonSpritesGfxPtr->templates + i) = gUnknown_08329D98[i]; for (j = 0; j < 4; j++) { - gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites[i] + (j * 0x800); + gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * 0x800); gMonSpritesGfxPtr->field_74[i][j].size = 0x800; } @@ -1272,10 +1270,10 @@ void FreeMonSpritesGfx(void) FREE_AND_SET_NULL(gMonSpritesGfxPtr->barFontGfx); FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed); - gMonSpritesGfxPtr->sprites[0] = NULL; - gMonSpritesGfxPtr->sprites[1] = NULL; - gMonSpritesGfxPtr->sprites[2] = NULL; - gMonSpritesGfxPtr->sprites[3] = NULL; + gMonSpritesGfxPtr->sprites.ptr[0] = NULL; + gMonSpritesGfxPtr->sprites.ptr[1] = NULL; + gMonSpritesGfxPtr->sprites.ptr[2] = NULL; + gMonSpritesGfxPtr->sprites.ptr[3] = NULL; FREE_AND_SET_NULL(gMonSpritesGfxPtr); } diff --git a/src/battle_intro.c b/src/battle_intro.c index 6964428a35..36ff325f51 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -586,7 +586,7 @@ void sub_8118FBC(int bgId, u8 arg1, u8 arg2, u8 battlerPosition, u8 arg4, u8 *ar int i, j; u8 battler = GetBattlerAtPosition(battlerPosition); int offset = tilesOffset; - CpuCopy16(gMonSpritesGfxPtr->sprites[battlerPosition] + BG_SCREEN_SIZE * gBattleMonForms[battler], arg5, BG_SCREEN_SIZE); + CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition] + BG_SCREEN_SIZE * gBattleMonForms[battler], arg5, BG_SCREEN_SIZE); LoadBgTiles(bgId, arg5, 0x1000, tilesOffset); for (i = arg2; i < arg2 + 8; i++) { @@ -604,7 +604,7 @@ void unref_sub_8119094(u8 arg0, u8 arg1, u8 battlerPosition, u8 arg3, u8 arg4, u { int i, j, offset; - DmaCopy16(3, gMonSpritesGfxPtr->sprites[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE); + DmaCopy16(3, gMonSpritesGfxPtr->sprites.ptr[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE); offset = (arg5 >> 5) - (arg7 << 9); for (i = arg1; i < arg1 + 8; i++) { diff --git a/src/battle_main.c b/src/battle_main.c index bf0fdc1aad..f0fedbd134 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2762,7 +2762,7 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite) } else // Erase bottom part of the sprite to create a smooth illusion of mon falling down. { - u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8); + u8* dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8); for (i = 0; i < 0x100; i++) *(dst++) = 0; diff --git a/src/battle_transition.c b/src/battle_transition.c index 4a9d263031..43a90ac98c 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1956,10 +1956,7 @@ static bool8 Phase2_Ripple_Func2(struct Task *task) for (i = 0; i < 160; i++, r4 += r8) { s16 var = r4 >> 8; - - var++; - var--; - gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(var, r3); + gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(var & 0xffff, r3); } if (++task->tData3 == 81) diff --git a/src/contest.c b/src/contest.c index 612d79562d..61a159bc49 100644 --- a/src/contest.c +++ b/src/contest.c @@ -3119,9 +3119,9 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind species = SanitizeSpecies(species); if (index == gContestPlayerMonIndex) - HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites[0], species, personality); + HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[0], species, personality); else - HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites[0], species, personality); + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[0], species, personality); LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20); SetMultiuseSpriteTemplateToPokemon(species, 0); diff --git a/src/contest_painting.c b/src/contest_painting.c index ceef8a9021..e903edbbbe 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -368,19 +368,19 @@ static void InitContestMonPixels(u16 species, u8 whichSprite) { HandleLoadSpecialPokePic_DontHandleDeoxys( &gMonFrontPicTable[species], - gMonSpritesGfxPtr->sprites[1], + gMonSpritesGfxPtr->sprites.ptr[1], species, gContestPaintingWinner->personality); - _InitContestMonPixels(gMonSpritesGfxPtr->sprites[1], gContestPaintingMonPalette, (void *)gContestMonPixels); + _InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[1], gContestPaintingMonPalette, (void *)gContestMonPixels); } else { HandleLoadSpecialPokePic_DontHandleDeoxys( &gMonBackPicTable[species], - gMonSpritesGfxPtr->sprites[0], + gMonSpritesGfxPtr->sprites.ptr[0], species, gContestPaintingWinner->personality); - _InitContestMonPixels(gMonSpritesGfxPtr->sprites[0], gContestPaintingMonPalette, (void *)gContestMonPixels); + _InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[0], gContestPaintingMonPalette, (void *)gContestMonPixels); } } diff --git a/src/contest_util.c b/src/contest_util.c index ae76eda6b4..dbc1e28ed6 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -880,7 +880,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId) { HandleLoadSpecialPokePic_2( &gMonFrontPicTable[species], - gMonSpritesGfxPtr->sprites[1], + gMonSpritesGfxPtr->sprites.ptr[1], species, personality); } @@ -888,7 +888,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId) { HandleLoadSpecialPokePic_DontHandleDeoxys( &gMonFrontPicTable[species], - gMonSpritesGfxPtr->sprites[1], + gMonSpritesGfxPtr->sprites.ptr[1], species, personality); } @@ -2552,9 +2552,9 @@ void ShowContestEntryMonPic(void) gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = species; if (gSpecialVar_0x8006 == gContestPlayerMonIndex) - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality); else - HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality); palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality); LoadCompressedSpritePalette(palette); diff --git a/src/daycare.c b/src/daycare.c index 69043a5139..1490d37427 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -615,10 +615,7 @@ static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves) for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++) { if (gEggMoves[eggMoveIdx + i] > EGG_MOVES_SPECIES_OFFSET) - { - // TODO: the curly braces around this if statement are required for a matching build. break; - } eggMoves[i] = gEggMoves[eggMoveIdx + i]; numEggMoves++; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 87f0a13fd5..f90441b68b 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -434,7 +434,7 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc u16 species = GetMonData(mon, MON_DATA_SPECIES); u32 pid = GetMonData(mon, MON_DATA_PERSONALITY); HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], - gMonSpritesGfxPtr->sprites[(a0 * 2) + 1], + gMonSpritesGfxPtr->sprites.ptr [(a0 * 2) + 1], species, pid); LoadCompressedSpritePalette(GetMonSpritePalStruct(mon)); *speciesLoc = species; diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 61065367cc..faa6195b0a 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -256,7 +256,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, trainerId = GetMonData(mon, MON_DATA_OT_ID); personality = GetMonData(mon, MON_DATA_PERSONALITY); DecompressPicFromTable_2(&gMonFrontPicTable[currSpecies], - gMonSpritesGfxPtr->sprites[1], + gMonSpritesGfxPtr->sprites.ptr[1], currSpecies); pokePal = GetMonSpritePalStructFromOtIdPersonality(currSpecies, trainerId, personality); LoadCompressedPalette(pokePal->data, 0x110, 0x20); @@ -271,7 +271,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, // postEvo sprite DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve], - gMonSpritesGfxPtr->sprites[3], + gMonSpritesGfxPtr->sprites.ptr[3], speciesToEvolve); pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality); LoadCompressedPalette(pokePal->data, 0x120, 0x20); @@ -348,7 +348,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) gReservedSpritePaletteCount = 4; DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies], - gMonSpritesGfxPtr->sprites[3], + gMonSpritesGfxPtr->sprites.ptr[3], postEvoSpecies); pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality); @@ -420,7 +420,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void) u32 trainerId = GetMonData(Mon, MON_DATA_OT_ID); u32 personality = GetMonData(Mon, MON_DATA_PERSONALITY); DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies], - gMonSpritesGfxPtr->sprites[3], + gMonSpritesGfxPtr->sprites.ptr[3], postEvoSpecies); pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality); LoadCompressedPalette(pokePal->data, 0x120, 0x20); @@ -484,7 +484,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpri sEvoStructPtr->preEvoSpriteID = preEvoSpriteID; DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve], - gMonSpritesGfxPtr->sprites[1], + gMonSpritesGfxPtr->sprites.ptr[1], speciesToEvolve); pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality); diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 797771f800..32db6c717e 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -646,7 +646,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) case 0: species = GetMonData(mon, MON_DATA_SPECIES2); personality = GetMonData(mon, MON_DATA_PERSONALITY); - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality); sPokeblockFeed->loadGfxState++; break; case 1: diff --git a/src/pokemon.c b/src/pokemon.c index a0e655d1e6..72fb4984c8 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5591,8 +5591,8 @@ u16 SpeciesToCryId(u16 species) void sub_806D544(u16 species, u32 personality, u8 *dest) { if (species == SPECIES_SPINDA - && dest != gMonSpritesGfxPtr->sprites[0] - && dest != gMonSpritesGfxPtr->sprites[2]) + && dest != gMonSpritesGfxPtr->sprites.ptr[0] + && dest != gMonSpritesGfxPtr->sprites.ptr[2]) { int i; for (i = 0; i < 4; i++) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index bfd849229d..805f695424 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3859,18 +3859,18 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) if (gMain.inBattle) { if (sub_80688F8(3, sMonSummaryScreen->curMonIndex)) - HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); else - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); } else { if (gMonSpritesGfxPtr != NULL) { if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); else - HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); } else { diff --git a/src/trade.c b/src/trade.c index 17aaba565a..f48e453a8a 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2725,9 +2725,9 @@ static void LoadTradeMonPic(u8 whichParty, u8 state) personality = GetMonData(mon, MON_DATA_PERSONALITY); if (whichParty == TRADE_PLAYER) - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality); else - HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[whichParty * 2 + 1], species, personality); + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[whichParty * 2 + 1], species, personality); LoadCompressedSpritePalette(GetMonSpritePalStruct(mon)); sTradeData->monSpecies[whichParty] = species; @@ -3660,7 +3660,7 @@ static bool8 AnimateTradeSequenceCable(void) case 65: if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy) { - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites.ptr[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]); sTradeData->state++; } break; @@ -4175,7 +4175,7 @@ static bool8 AnimateTradeSequenceWireless(void) case 65: if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy) { - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]); + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites.ptr[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]); sTradeData->state++; } break;