adjustments and fakematch fix

This commit is contained in:
PokeCodec 2020-09-10 10:07:16 -04:00
parent 029db24adb
commit 6967b234d4

View file

@ -160,7 +160,7 @@ struct BerryCrushGame
u16 unk16; u16 unk16;
s16 unk18; s16 unk18;
s16 unk1A; s16 unk1A;
int unk1C; s32 unk1C;
s32 unk20; s32 unk20;
u8 unk24; u8 unk24;
u8 unk25_0:1; u8 unk25_0:1;
@ -1986,29 +1986,29 @@ static u32 BerryCrushCommand_BeginNormalPaletteFade(struct BerryCrushGame *game,
// byte 9: if TRUE, communicate on fade complete // byte 9: if TRUE, communicate on fade complete
u16 color; u16 color;
u32 selectedPals; u32 selectedPals[2];
selectedPals = ({
#ifndef NONMATCHING
register u32 value asm("r2");
register u32 b asm("r3");
#else
u32 value;
u32 b;
#endif //NONMATCHING
value = params[0] << 0;
value |= (b = params[1] << 8);
value |= (b = params[2] << 16);
value |= (b = params[3] << 24);
value;
});
params[0] = params[9]; selectedPals[0] = (u32)params[0];
selectedPals[1] = (u32)params[1];
selectedPals[1] <<= 8;
color = params[8] << 8; selectedPals[0] |= selectedPals[1];
color |= params[7] << 0; selectedPals[1] = (u32)params[2];
selectedPals[1] <<= 16;
selectedPals[0] |= selectedPals[1];
selectedPals[1] = (u32)params[3];
selectedPals[1] <<= 24;
selectedPals[0] |= selectedPals[1];
params[0] = params[9];
color = params[8];
color <<= 8;
color |= params[7];
gPaletteFade.bufferTransferDisabled = FALSE; gPaletteFade.bufferTransferDisabled = FALSE;
BeginNormalPaletteFade(selectedPals, params[4], params[5], params[6], color); BeginNormalPaletteFade(selectedPals[0], params[4], params[5], params[6], color);
UpdatePaletteFade(); UpdatePaletteFade();
game->unkE = 2; game->unkE = 2;
return 0; return 0;
@ -2390,7 +2390,7 @@ void sub_802339C(struct BerryCrushGame *r4)
} }
} }
} }
if (r8 > 1) if (r8 >= 2)
{ {
for (r7 = 0; r7 < r4->unk9; ++r7) for (r7 = 0; r7 < r4->unk9; ++r7)
{ {
@ -2580,6 +2580,7 @@ void sub_802385C(struct BerryCrushGame *r5)
for (r4 = 0; r4 < r5->unk9; ++r4) for (r4 = 0; r4 < r5->unk9; ++r4)
r5->unk68.as_four_players.others[r4].unk4.as_2d_bytes[1][5] = 0; r5->unk68.as_four_players.others[r4].unk4.as_2d_bytes[1][5] = 0;
#endif #endif
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET
|| gRecvCmds[0][1] != 2) || gRecvCmds[0][1] != 2)
{ {