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...?
This commit is contained in:
Kaz 2020-09-19 13:37:24 -04:00
parent 1404cf3330
commit 847878eae9
16 changed files with 57 additions and 61 deletions

View File

@ -584,7 +584,11 @@ struct BattleSpriteData
struct MonSpritesGfx struct MonSpritesGfx
{ {
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon 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 SpriteTemplate templates[4];
struct SpriteFrameImage field_74[4][4]; struct SpriteFrameImage field_74[4][4];
u8 field_F4[0x80]; u8 field_F4[0x80];

View File

@ -2291,7 +2291,7 @@ void AnimTask_TransformMon(u8 taskId)
else else
position = GetBattlerPosition(gBattleAnimAttacker); position = GetBattlerPosition(gBattleAnimAttacker);
src = gMonSpritesGfxPtr->sprites[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); src = gMonSpritesGfxPtr->sprites.ptr[position] + (gBattleMonForms[gBattleAnimAttacker] << 11);
dest = animBg.bgTiles; dest = animBg.bgTiles;
CpuCopy32(src, dest, 0x800); CpuCopy32(src, dest, 0x800);
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);

View File

@ -6,6 +6,7 @@
#include "constants/battle_anim.h" #include "constants/battle_anim.h"
#include "battle_interface.h" #include "battle_interface.h"
#include "main.h" #include "main.h"
#include "dma3.h"
#include "malloc.h" #include "malloc.h"
#include "graphics.h" #include "graphics.h"
#include "random.h" #include "random.h"
@ -568,7 +569,7 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
otId = GetMonData(mon, MON_DATA_OT_ID); otId = GetMonData(mon, MON_DATA_OT_ID);
position = GetBattlerPosition(battlerId); position = GetBattlerPosition(battlerId);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
species, currentPersonality); species, currentPersonality);
paletteOffset = 0x100 + battlerId * 16; 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) if (sub_80688F8(1, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE)
{ {
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
species, currentPersonality); species, currentPersonality);
} }
else else
{ {
HandleLoadSpecialPokePic(&gMonBackPicTable[species], HandleLoadSpecialPokePic(&gMonBackPicTable[species],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
species, currentPersonality); species, currentPersonality);
} }
@ -672,7 +673,7 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId)
{ {
u8 position = GetBattlerPosition(battlerId); u8 position = GetBattlerPosition(battlerId);
DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId], DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
SPECIES_NONE); SPECIES_NONE);
LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[frontPicId]); LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[frontPicId]);
} }
@ -681,7 +682,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId)
{ {
u8 position = GetBattlerPosition(battlerId); u8 position = GetBattlerPosition(battlerId);
DecompressPicFromTable_2(&gTrainerBackPicTable[backPicId], DecompressPicFromTable_2(&gTrainerBackPicTable[backPicId],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
SPECIES_NONE); SPECIES_NONE);
LoadCompressedPalette(gTrainerBackPicPaletteTable[backPicId].data, LoadCompressedPalette(gTrainerBackPicPaletteTable[backPicId].data,
0x100 + 16 * battlerId, 0x20); 0x100 + 16 * battlerId, 0x20);
@ -921,7 +922,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
otId = gContestResources->moveAnim->otId; otId = gContestResources->moveAnim->otId;
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies], HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
gMonSpritesGfxPtr->sprites[0], gMonSpritesGfxPtr->sprites.ptr[0],
targetSpecies, targetSpecies,
gContestResources->moveAnim->targetPersonality); gContestResources->moveAnim->targetPersonality);
} }
@ -940,7 +941,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID); otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies], HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
targetSpecies, targetSpecies,
gTransformedPersonalities[battlerAtk]); gTransformedPersonalities[battlerAtk]);
} }
@ -950,13 +951,13 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID); otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[targetSpecies], HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[targetSpecies],
gMonSpritesGfxPtr->sprites[position], gMonSpritesGfxPtr->sprites.ptr[position],
targetSpecies, targetSpecies,
gTransformedPersonalities[battlerAtk]); gTransformedPersonalities[battlerAtk]);
} }
} }
src = gMonSpritesGfxPtr->sprites[position]; src = gMonSpritesGfxPtr->sprites.ptr[position];
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32); dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
DmaCopy32(3, src, dst, 0x800); DmaCopy32(3, src, dst, 0x800);
paletteOffset = 0x100 + battlerAtk * 16; paletteOffset = 0x100 + battlerAtk * 16;
@ -997,18 +998,15 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
position = GetBattlerPosition(battlerId); position = GetBattlerPosition(battlerId);
if (IsContest()) if (IsContest())
LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]); LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites.ptr[position]);
else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites[position]); LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites.ptr[position]);
else else
LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]); LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites.ptr[position]);
for (i = 1; i < 4; i++) for (i = 1; i < 4; i++)
{ {
u8 (*ptr)[4][0x800] = gMonSpritesGfxPtr->sprites[position]; Dma3CopyLarge32_(gMonSpritesGfxPtr->sprites.ptr[position], &gMonSpritesGfxPtr->sprites.byte[position][0x800 * i], 0x800);
ptr++;ptr--; // Needed to match.
DmaCopy32Defvars(3, (*ptr)[0], (*ptr)[i], 0x800);
} }
palOffset = (battlerId * 16) + 0x100; palOffset = (battlerId * 16) + 0x100;
@ -1245,12 +1243,12 @@ void AllocateMonSpritesGfx(void)
for (i = 0; i < MAX_BATTLERS_COUNT; i++) 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]; *(gMonSpritesGfxPtr->templates + i) = gUnknown_08329D98[i];
for (j = 0; j < 4; j++) 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; 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->barFontGfx);
FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed); FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed);
gMonSpritesGfxPtr->sprites[0] = NULL; gMonSpritesGfxPtr->sprites.ptr[0] = NULL;
gMonSpritesGfxPtr->sprites[1] = NULL; gMonSpritesGfxPtr->sprites.ptr[1] = NULL;
gMonSpritesGfxPtr->sprites[2] = NULL; gMonSpritesGfxPtr->sprites.ptr[2] = NULL;
gMonSpritesGfxPtr->sprites[3] = NULL; gMonSpritesGfxPtr->sprites.ptr[3] = NULL;
FREE_AND_SET_NULL(gMonSpritesGfxPtr); FREE_AND_SET_NULL(gMonSpritesGfxPtr);
} }

View File

@ -586,7 +586,7 @@ void sub_8118FBC(int bgId, u8 arg1, u8 arg2, u8 battlerPosition, u8 arg4, u8 *ar
int i, j; int i, j;
u8 battler = GetBattlerAtPosition(battlerPosition); u8 battler = GetBattlerAtPosition(battlerPosition);
int offset = tilesOffset; 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); LoadBgTiles(bgId, arg5, 0x1000, tilesOffset);
for (i = arg2; i < arg2 + 8; i++) 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; 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); offset = (arg5 >> 5) - (arg7 << 9);
for (i = arg1; i < arg1 + 8; i++) for (i = arg1; i < arg1 + 8; i++)
{ {

View File

@ -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. 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++) for (i = 0; i < 0x100; i++)
*(dst++) = 0; *(dst++) = 0;

View File

@ -1956,10 +1956,7 @@ static bool8 Phase2_Ripple_Func2(struct Task *task)
for (i = 0; i < 160; i++, r4 += r8) for (i = 0; i < 160; i++, r4 += r8)
{ {
s16 var = r4 >> 8; s16 var = r4 >> 8;
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(var & 0xffff, r3);
var++;
var--;
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(var, r3);
} }
if (++task->tData3 == 81) if (++task->tData3 == 81)

View File

@ -3119,9 +3119,9 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind
species = SanitizeSpecies(species); species = SanitizeSpecies(species);
if (index == gContestPlayerMonIndex) if (index == gContestPlayerMonIndex)
HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites[0], species, personality); HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[0], species, personality);
else 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); LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20);
SetMultiuseSpriteTemplateToPokemon(species, 0); SetMultiuseSpriteTemplateToPokemon(species, 0);

View File

@ -368,19 +368,19 @@ static void InitContestMonPixels(u16 species, u8 whichSprite)
{ {
HandleLoadSpecialPokePic_DontHandleDeoxys( HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonFrontPicTable[species], &gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[1], gMonSpritesGfxPtr->sprites.ptr[1],
species, species,
gContestPaintingWinner->personality); gContestPaintingWinner->personality);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites[1], gContestPaintingMonPalette, (void *)gContestMonPixels); _InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[1], gContestPaintingMonPalette, (void *)gContestMonPixels);
} }
else else
{ {
HandleLoadSpecialPokePic_DontHandleDeoxys( HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonBackPicTable[species], &gMonBackPicTable[species],
gMonSpritesGfxPtr->sprites[0], gMonSpritesGfxPtr->sprites.ptr[0],
species, species,
gContestPaintingWinner->personality); gContestPaintingWinner->personality);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites[0], gContestPaintingMonPalette, (void *)gContestMonPixels); _InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[0], gContestPaintingMonPalette, (void *)gContestMonPixels);
} }
} }

View File

@ -880,7 +880,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
{ {
HandleLoadSpecialPokePic_2( HandleLoadSpecialPokePic_2(
&gMonFrontPicTable[species], &gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[1], gMonSpritesGfxPtr->sprites.ptr[1],
species, species,
personality); personality);
} }
@ -888,7 +888,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
{ {
HandleLoadSpecialPokePic_DontHandleDeoxys( HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonFrontPicTable[species], &gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[1], gMonSpritesGfxPtr->sprites.ptr[1],
species, species,
personality); personality);
} }
@ -2552,9 +2552,9 @@ void ShowContestEntryMonPic(void)
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = species; gTasks[taskId].data[1] = species;
if (gSpecialVar_0x8006 == gContestPlayerMonIndex) if (gSpecialVar_0x8006 == gContestPlayerMonIndex)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality);
else 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); palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
LoadCompressedSpritePalette(palette); LoadCompressedSpritePalette(palette);

View File

@ -615,10 +615,7 @@ static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves)
for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++) for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++)
{ {
if (gEggMoves[eggMoveIdx + i] > EGG_MOVES_SPECIES_OFFSET) if (gEggMoves[eggMoveIdx + i] > EGG_MOVES_SPECIES_OFFSET)
{
// TODO: the curly braces around this if statement are required for a matching build.
break; break;
}
eggMoves[i] = gEggMoves[eggMoveIdx + i]; eggMoves[i] = gEggMoves[eggMoveIdx + i];
numEggMoves++; numEggMoves++;

View File

@ -434,7 +434,7 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc
u16 species = GetMonData(mon, MON_DATA_SPECIES); u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY); u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[(a0 * 2) + 1], gMonSpritesGfxPtr->sprites.ptr [(a0 * 2) + 1],
species, pid); species, pid);
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon)); LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
*speciesLoc = species; *speciesLoc = species;

View File

@ -256,7 +256,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
trainerId = GetMonData(mon, MON_DATA_OT_ID); trainerId = GetMonData(mon, MON_DATA_OT_ID);
personality = GetMonData(mon, MON_DATA_PERSONALITY); personality = GetMonData(mon, MON_DATA_PERSONALITY);
DecompressPicFromTable_2(&gMonFrontPicTable[currSpecies], DecompressPicFromTable_2(&gMonFrontPicTable[currSpecies],
gMonSpritesGfxPtr->sprites[1], gMonSpritesGfxPtr->sprites.ptr[1],
currSpecies); currSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(currSpecies, trainerId, personality); pokePal = GetMonSpritePalStructFromOtIdPersonality(currSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x110, 0x20); LoadCompressedPalette(pokePal->data, 0x110, 0x20);
@ -271,7 +271,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
// postEvo sprite // postEvo sprite
DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve], DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve],
gMonSpritesGfxPtr->sprites[3], gMonSpritesGfxPtr->sprites.ptr[3],
speciesToEvolve); speciesToEvolve);
pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality); pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x120, 0x20); LoadCompressedPalette(pokePal->data, 0x120, 0x20);
@ -348,7 +348,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
gReservedSpritePaletteCount = 4; gReservedSpritePaletteCount = 4;
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies], DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonSpritesGfxPtr->sprites[3], gMonSpritesGfxPtr->sprites.ptr[3],
postEvoSpecies); postEvoSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality); pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
@ -420,7 +420,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
u32 trainerId = GetMonData(Mon, MON_DATA_OT_ID); u32 trainerId = GetMonData(Mon, MON_DATA_OT_ID);
u32 personality = GetMonData(Mon, MON_DATA_PERSONALITY); u32 personality = GetMonData(Mon, MON_DATA_PERSONALITY);
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies], DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonSpritesGfxPtr->sprites[3], gMonSpritesGfxPtr->sprites.ptr[3],
postEvoSpecies); postEvoSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality); pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x120, 0x20); LoadCompressedPalette(pokePal->data, 0x120, 0x20);
@ -484,7 +484,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpri
sEvoStructPtr->preEvoSpriteID = preEvoSpriteID; sEvoStructPtr->preEvoSpriteID = preEvoSpriteID;
DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve], DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve],
gMonSpritesGfxPtr->sprites[1], gMonSpritesGfxPtr->sprites.ptr[1],
speciesToEvolve); speciesToEvolve);
pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality); pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality);

View File

@ -646,7 +646,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon)
case 0: case 0:
species = GetMonData(mon, MON_DATA_SPECIES2); species = GetMonData(mon, MON_DATA_SPECIES2);
personality = GetMonData(mon, MON_DATA_PERSONALITY); 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++; sPokeblockFeed->loadGfxState++;
break; break;
case 1: case 1:

View File

@ -5591,8 +5591,8 @@ u16 SpeciesToCryId(u16 species)
void sub_806D544(u16 species, u32 personality, u8 *dest) void sub_806D544(u16 species, u32 personality, u8 *dest)
{ {
if (species == SPECIES_SPINDA if (species == SPECIES_SPINDA
&& dest != gMonSpritesGfxPtr->sprites[0] && dest != gMonSpritesGfxPtr->sprites.ptr[0]
&& dest != gMonSpritesGfxPtr->sprites[2]) && dest != gMonSpritesGfxPtr->sprites.ptr[2])
{ {
int i; int i;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)

View File

@ -3859,18 +3859,18 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
if (gMain.inBattle) if (gMain.inBattle)
{ {
if (sub_80688F8(3, sMonSummaryScreen->curMonIndex)) 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 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 else
{ {
if (gMonSpritesGfxPtr != NULL) if (gMonSpritesGfxPtr != NULL)
{ {
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) 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 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 else
{ {

View File

@ -2725,9 +2725,9 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
personality = GetMonData(mon, MON_DATA_PERSONALITY); personality = GetMonData(mon, MON_DATA_PERSONALITY);
if (whichParty == TRADE_PLAYER) if (whichParty == TRADE_PLAYER)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality);
else 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)); LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
sTradeData->monSpecies[whichParty] = species; sTradeData->monSpecies[whichParty] = species;
@ -3660,7 +3660,7 @@ static bool8 AnimateTradeSequenceCable(void)
case 65: case 65:
if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy) 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++; sTradeData->state++;
} }
break; break;
@ -4175,7 +4175,7 @@ static bool8 AnimateTradeSequenceWireless(void)
case 65: case 65:
if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy) 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++; sTradeData->state++;
} }
break; break;