Two fakematches out

This commit is contained in:
DizzyEggg 2019-07-29 21:09:05 +02:00
parent a4a382a004
commit ff2dcf5413
3 changed files with 25 additions and 36 deletions

View File

@ -4083,7 +4083,7 @@ extern const u32 gContestConfetti_Pal[];
extern const u32 gUnknown_08C093F0[];
extern const u32 gSubstituteDollTilemap[];
extern const u32 gSubstituteDollGfx[];
extern const u16 gSubstituteDollPal[];
extern const u32 gSubstituteDollPal[];
extern const u32 gHealthboxSinglesPlayerGfx[];
extern const u32 gHealthboxSinglesOpponentGfx[];
extern const u32 gHealthboxDoublesPlayerGfx[];

View File

@ -819,15 +819,11 @@ static void Task_HandleSendLinkBuffersData(u8 taskId)
}
}
// fix me
void sub_8033648(void)
{
u8 i;
s32 j;
u16 r6;
u8 *recvBuffer;
u8 *dest;
u8 *src;
if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_20))
{
@ -838,25 +834,24 @@ void sub_8033648(void)
{
ResetBlockReceivedFlag(i);
recvBuffer = (u8 *)gBlockRecvBuffer[i];
#ifndef NONMATCHING
asm("");
recvBuffer = (u8 *)&gBlockRecvBuffer[i];
#endif
r6 = gBlockRecvBuffer[i][2];
if (gTasks[sLinkReceiveTaskId].data[14] + 9 + r6 > 0x1000)
{
gTasks[sLinkReceiveTaskId].data[12] = gTasks[sLinkReceiveTaskId].data[14];
gTasks[sLinkReceiveTaskId].data[14] = 0;
u8 *dest, *src;
u16 r6 = gBlockRecvBuffer[i][2];
if (gTasks[sLinkReceiveTaskId].data[14] + 9 + r6 > 0x1000)
{
gTasks[sLinkReceiveTaskId].data[12] = gTasks[sLinkReceiveTaskId].data[14];
gTasks[sLinkReceiveTaskId].data[14] = 0;
}
dest = &gLinkBattleRecvBuffer[gTasks[sLinkReceiveTaskId].data[14]];
src = recvBuffer;
for (j = 0; j < r6 + 8; j++)
dest[j] = src[j];
gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + r6 + 8;
}
dest = &gLinkBattleRecvBuffer[gTasks[sLinkReceiveTaskId].data[14]];
src = recvBuffer;
for (j = 0; j < r6 + 8; j++)
dest[j] = src[j];
gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + r6 + 8;
}
}
}

View File

@ -945,10 +945,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
{
u8 position;
s32 i;
u32 var;
const void *substitutePal;
s32 i, position, palOffset;
if (!loadMonSprite)
{
@ -964,19 +961,16 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
else
LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]);
i = 1;
var = battlerId * 16;
substitutePal = gSubstituteDollPal;
for (; i < 4; i++)
for (i = 1; i < 4; i++)
{
register void *dmaSrc asm("r0") = gMonSpritesGfxPtr->sprites[position];
void *dmaDst = (i * 0x800) + dmaSrc;
u32 dmaSize = 0x800;
DmaCopy32(3, dmaSrc, dmaDst, dmaSize);
i++;i--;
u8 (*ptr)[4][0x800] = gMonSpritesGfxPtr->sprites[position];
ptr++;ptr--; // Needed to match.
DmaCopy32Defvars(3, (*ptr)[0], (*ptr)[i], 0x800);
}
LoadCompressedPalette(substitutePal, 0x100 + var, 32);
palOffset = (battlerId * 16) + 0x100;
LoadCompressedPalette(gSubstituteDollPal, palOffset, 32);
}
else
{