diff --git a/src/berry_crush.c b/src/berry_crush.c index dbbbd20fc6..dc7d3b7e77 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -160,7 +160,7 @@ struct BerryCrushGame u16 unk16; s16 unk18; s16 unk1A; - int unk1C; + s32 unk1C; s32 unk20; u8 unk24; u8 unk25_0:1; @@ -1986,29 +1986,29 @@ static u32 BerryCrushCommand_BeginNormalPaletteFade(struct BerryCrushGame *game, // byte 9: if TRUE, communicate on fade complete u16 color; - u32 selectedPals; - 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; - }); + u32 selectedPals[2]; - params[0] = params[9]; + selectedPals[0] = (u32)params[0]; + selectedPals[1] = (u32)params[1]; + selectedPals[1] <<= 8; - color = params[8] << 8; - color |= params[7] << 0; + selectedPals[0] |= selectedPals[1]; + 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; - BeginNormalPaletteFade(selectedPals, params[4], params[5], params[6], color); + BeginNormalPaletteFade(selectedPals[0], params[4], params[5], params[6], color); UpdatePaletteFade(); game->unkE = 2; 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) { @@ -2580,6 +2580,7 @@ void sub_802385C(struct BerryCrushGame *r5) for (r4 = 0; r4 < r5->unk9; ++r4) r5->unk68.as_four_players.others[r4].unk4.as_2d_bytes[1][5] = 0; #endif + if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET || gRecvCmds[0][1] != 2) {