Merge pull request #1152 from GriffinRichards/doc-blender

Document berry blender
This commit is contained in:
GriffinR
2020-08-30 15:33:17 -04:00
committed by GitHub
27 changed files with 1975 additions and 1721 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -900,7 +900,7 @@ static void sub_8020D8C(void)
void sub_8020E1C(void)
{
DestroyTask(gUnknown_02022C90->unkA);
ChooseBerrySetCallback(sub_8020D8C);
ChooseBerryForMachine(sub_8020D8C);
}
static void sub_8020E3C(void)
@@ -2357,7 +2357,7 @@ void sub_802339C(struct BerryCrushGame *r4)
for (r7 = 0; r7 < r4->unk9; ++r7)
{
r2 = gRecvCmds[r7];
if ((r2[0] & 0xFF00) == 0x2F00
if ((r2[0] & 0xFF00) == RFUCMD_SEND_PACKET
&& r2[1] == 2)
{
if ((u8)r2[2] & 4)
@@ -2559,7 +2559,7 @@ void sub_80236B8(struct BerryCrushGame *r5)
r5->unk5C.unk02_1 = r5->unk25_4;
r5->unk5C.unk0A = r5->unk25_5;
memcpy(r5->unk40.unk2, &r5->unk5C, sizeof(r5->unk40.unk2));
sub_800FE50(r5->unk40.unk2);
Rfu_SendPacket(r5->unk40.unk2);
}
void sub_802385C(struct BerryCrushGame *r5)
@@ -2580,7 +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) != 0x2F00
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET
|| gRecvCmds[0][1] != 2)
{
r5->unk25_2 = 0;

View File

@@ -2748,14 +2748,14 @@ static void sub_8027DD0(u32 arg0)
struct UnkPacket1 packet;
packet.id = 1;
packet.unk4 = arg0;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static u32 sub_8027DFC(u32 arg0)
{
struct UnkPacket1 *packet;
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return 0;
packet = (void *)&gRecvCmds[arg0][1];
@@ -2857,7 +2857,7 @@ static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruc
packet.unkA_3 = arg6;
packet.unkB_1 = arg7;
packet.unkB_0 = arg8;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static u32 sub_8028164(u32 unused, struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 *arg6, u32 *arg7, u32 *arg8)
@@ -2865,7 +2865,7 @@ static u32 sub_8028164(u32 unused, struct DodrioSubstruct_31A0 *arg0, struct Dod
struct UnkPacket2 *packet;
struct DodrioSubstruct_31A0_14 *ptr = &arg0->unk14;
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return 0;
packet = (void *)&gRecvCmds[0][1];
@@ -2935,14 +2935,14 @@ static void sub_80282EC(u8 arg0)
struct UnkPacket3 packet;
packet.id = 3;
packet.unk4 = arg0;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static u32 sub_8028318(u32 arg0, u8 *arg1)
{
struct UnkPacket3 *packet;
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return 0;
packet = (void *)&gRecvCmds[arg0][1];
@@ -2966,14 +2966,14 @@ static void sub_8028350(u32 arg0)
struct UnkPacket4 packet;
packet.id = 4;
packet.unk4 = arg0;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static u32 sub_8028374(u32 arg0)
{
struct UnkPacket4 *packet;
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return 0;
packet = (void *)&gRecvCmds[arg0][1];

View File

@@ -1067,10 +1067,9 @@ const u32 gBattleAnimBgPalette_Solarbeam[] = INCBIN_U32("graphics/battle_anims/b
const u32 gUnknown_E6BC04[] = INCBIN_U32("graphics/unknown/unknown_E6BC04.bin.lz");
const u32 sBlenderCenterGfx[] = INCBIN_U32("graphics/berry_blender/center.8bpp.lz");
const u32 gUnknown_08D91DB8[] = INCBIN_U32("graphics/berry_blender/outer.4bpp.lz");
const u32 gUnknown_08D927EC[] = INCBIN_U32("graphics/berry_blender/outer_map.bin.lz");
const u32 gBerryBlenderCenter_Gfx[] = INCBIN_U32("graphics/berry_blender/center.8bpp.lz");
const u32 gBerryBlenderOuter_Gfx[] = INCBIN_U32("graphics/berry_blender/outer.4bpp.lz");
const u32 gBerryBlenderOuter_Tilemap[] = INCBIN_U32("graphics/berry_blender/outer_map.bin.lz");
const u32 gBattleAnimBgPalette_Cosmic[] = INCBIN_U32("graphics/battle_anims/backgrounds/cosmic.gbapal.lz");
const u32 gBattleAnimBgImage_Cosmic[] = INCBIN_U32("graphics/battle_anims/backgrounds/cosmic.4bpp.lz");
@@ -1352,25 +1351,15 @@ const u16 gPokenavConditionMarker_Pal[] = INCBIN_U16("graphics/pokenav/condition
const u8 gPokenavConditionMarker_Gfx[] = INCBIN_U8("graphics/pokenav/condition/marker.4bpp");
const u16 gBerryBlenderMiscPalette[] = INCBIN_U16("graphics/berry_blender/misc.gbapal");
const u16 gBerryBlenderArrowPalette[] = INCBIN_U16("graphics/berry_blender/arrow.gbapal");
const u8 gBerryBlenderBetaArrow_Gfx[] = INCBIN_U8("graphics/berry_blender/arrow_old.4bpp"); //unused
const u8 gBerryBlenderMarubatsuTiles[] = INCBIN_U8("graphics/berry_blender/marubatsu.4bpp");
const u8 gBerryBlenderParticlesTiles[] = INCBIN_U8("graphics/berry_blender/particles.4bpp");
const u8 gBerryBlenderScoreSymbols_Gfx[] = INCBIN_U8("graphics/berry_blender/score_symbols.4bpp");
const u8 gBerryBlenderParticles_Gfx[] = INCBIN_U8("graphics/berry_blender/particles.4bpp");
static const u8 sEmpty0[0x120] = {0};
const u8 gBerryBlenderCountdownNumbersTiles[] = INCBIN_U8("graphics/berry_blender/countdown_numbers.4bpp");
const u8 gBerryBlenderStartTiles[] = INCBIN_U8("graphics/berry_blender/start.4bpp");
const u8 gBerryBlenderCountdownNumbers_Gfx[] = INCBIN_U8("graphics/berry_blender/countdown_numbers.4bpp");
const u8 gBerryBlenderStart_Gfx[] = INCBIN_U8("graphics/berry_blender/start.4bpp");
static const u8 sEmpty1[0x200] = {0};
const u8 gBerryBlenderArrowTiles[] = INCBIN_U8("graphics/berry_blender/arrow.4bpp");
const u8 gBerryBlenderPlayerArrow_Gfx[] = INCBIN_U8("graphics/berry_blender/arrow.4bpp");
static const u8 sEmpty2[0x2C0] = {0};
const u16 gEasyChatCursor_Pal[] = INCBIN_U16("graphics/easy_chat/cursor.gbapal");

View File

@@ -534,14 +534,16 @@ void CB2_BagMenuFromBattle(void)
GoToBattlePyramidBagMenu(1, CB2_SetUpReshowBattleScreenAfterMenu2);
}
// Choosing berry to plant
void CB2_ChooseBerry(void)
{
GoToBagMenu(ITEMMENULOCATION_BERRY_TREE, BERRIES_POCKET, CB2_ReturnToFieldContinueScript);
}
void ChooseBerrySetCallback(void (*callback)(void))
// Choosing berry for Berry Blender or Berry Crush
void ChooseBerryForMachine(void (*exitCallback)(void))
{
GoToBagMenu(ITEMMENULOCATION_BERRY_BLENDER_CRUSH, BERRIES_POCKET, callback);
GoToBagMenu(ITEMMENULOCATION_BERRY_BLENDER_CRUSH, BERRIES_POCKET, exitCallback);
}
void CB2_GoToSellMenu(void)

View File

@@ -310,51 +310,51 @@ static const struct SpriteTemplate gBerryPicRotatingSpriteTemplate =
.callback = SpriteCallbackDummy,
};
static const struct CompressedTilesPal gBerryPicTable[] =
static const struct CompressedTilesPal sBerryPicTable[] =
{
{gBerryPic_Cheri, gBerryPalette_Cheri},
{gBerryPic_Chesto, gBerryPalette_Chesto},
{gBerryPic_Pecha, gBerryPalette_Pecha},
{gBerryPic_Rawst, gBerryPalette_Rawst},
{gBerryPic_Aspear, gBerryPalette_Aspear},
{gBerryPic_Leppa, gBerryPalette_Leppa},
{gBerryPic_Oran, gBerryPalette_Oran},
{gBerryPic_Persim, gBerryPalette_Persim},
{gBerryPic_Lum, gBerryPalette_Lum},
{gBerryPic_Sitrus, gBerryPalette_Sitrus},
{gBerryPic_Figy, gBerryPalette_Figy},
{gBerryPic_Wiki, gBerryPalette_Wiki},
{gBerryPic_Mago, gBerryPalette_Mago},
{gBerryPic_Aguav, gBerryPalette_Aguav},
{gBerryPic_Iapapa, gBerryPalette_Iapapa},
{gBerryPic_Razz, gBerryPalette_Razz},
{gBerryPic_Bluk, gBerryPalette_Bluk},
{gBerryPic_Nanab, gBerryPalette_Nanab},
{gBerryPic_Wepear, gBerryPalette_Wepear},
{gBerryPic_Pinap, gBerryPalette_Pinap},
{gBerryPic_Pomeg, gBerryPalette_Pomeg},
{gBerryPic_Kelpsy, gBerryPalette_Kelpsy},
{gBerryPic_Qualot, gBerryPalette_Qualot},
{gBerryPic_Hondew, gBerryPalette_Hondew},
{gBerryPic_Grepa, gBerryPalette_Grepa},
{gBerryPic_Tamato, gBerryPalette_Tamato},
{gBerryPic_Cornn, gBerryPalette_Cornn},
{gBerryPic_Magost, gBerryPalette_Magost},
{gBerryPic_Rabuta, gBerryPalette_Rabuta},
{gBerryPic_Nomel, gBerryPalette_Nomel},
{gBerryPic_Spelon, gBerryPalette_Spelon},
{gBerryPic_Pamtre, gBerryPalette_Pamtre},
{gBerryPic_Watmel, gBerryPalette_Watmel},
{gBerryPic_Durin, gBerryPalette_Durin},
{gBerryPic_Belue, gBerryPalette_Belue},
{gBerryPic_Liechi, gBerryPalette_Liechi},
{gBerryPic_Ganlon, gBerryPalette_Ganlon},
{gBerryPic_Salac, gBerryPalette_Salac},
{gBerryPic_Petaya, gBerryPalette_Petaya},
{gBerryPic_Apicot, gBerryPalette_Apicot},
{gBerryPic_Lansat, gBerryPalette_Lansat},
{gBerryPic_Starf, gBerryPalette_Starf},
{gBerryPic_Enigma, gBerryPalette_Enigma},
[ITEM_TO_BERRY(ITEM_CHERI_BERRY) - 1] = {gBerryPic_Cheri, gBerryPalette_Cheri},
[ITEM_TO_BERRY(ITEM_CHESTO_BERRY) - 1] = {gBerryPic_Chesto, gBerryPalette_Chesto},
[ITEM_TO_BERRY(ITEM_PECHA_BERRY) - 1] = {gBerryPic_Pecha, gBerryPalette_Pecha},
[ITEM_TO_BERRY(ITEM_RAWST_BERRY) - 1] = {gBerryPic_Rawst, gBerryPalette_Rawst},
[ITEM_TO_BERRY(ITEM_ASPEAR_BERRY) - 1] = {gBerryPic_Aspear, gBerryPalette_Aspear},
[ITEM_TO_BERRY(ITEM_LEPPA_BERRY) - 1] = {gBerryPic_Leppa, gBerryPalette_Leppa},
[ITEM_TO_BERRY(ITEM_ORAN_BERRY) - 1] = {gBerryPic_Oran, gBerryPalette_Oran},
[ITEM_TO_BERRY(ITEM_PERSIM_BERRY) - 1] = {gBerryPic_Persim, gBerryPalette_Persim},
[ITEM_TO_BERRY(ITEM_LUM_BERRY) - 1] = {gBerryPic_Lum, gBerryPalette_Lum},
[ITEM_TO_BERRY(ITEM_SITRUS_BERRY) - 1] = {gBerryPic_Sitrus, gBerryPalette_Sitrus},
[ITEM_TO_BERRY(ITEM_FIGY_BERRY) - 1] = {gBerryPic_Figy, gBerryPalette_Figy},
[ITEM_TO_BERRY(ITEM_WIKI_BERRY) - 1] = {gBerryPic_Wiki, gBerryPalette_Wiki},
[ITEM_TO_BERRY(ITEM_MAGO_BERRY) - 1] = {gBerryPic_Mago, gBerryPalette_Mago},
[ITEM_TO_BERRY(ITEM_AGUAV_BERRY) - 1] = {gBerryPic_Aguav, gBerryPalette_Aguav},
[ITEM_TO_BERRY(ITEM_IAPAPA_BERRY) - 1] = {gBerryPic_Iapapa, gBerryPalette_Iapapa},
[ITEM_TO_BERRY(ITEM_RAZZ_BERRY) - 1] = {gBerryPic_Razz, gBerryPalette_Razz},
[ITEM_TO_BERRY(ITEM_BLUK_BERRY) - 1] = {gBerryPic_Bluk, gBerryPalette_Bluk},
[ITEM_TO_BERRY(ITEM_NANAB_BERRY) - 1] = {gBerryPic_Nanab, gBerryPalette_Nanab},
[ITEM_TO_BERRY(ITEM_WEPEAR_BERRY) - 1] = {gBerryPic_Wepear, gBerryPalette_Wepear},
[ITEM_TO_BERRY(ITEM_PINAP_BERRY) - 1] = {gBerryPic_Pinap, gBerryPalette_Pinap},
[ITEM_TO_BERRY(ITEM_POMEG_BERRY) - 1] = {gBerryPic_Pomeg, gBerryPalette_Pomeg},
[ITEM_TO_BERRY(ITEM_KELPSY_BERRY) - 1] = {gBerryPic_Kelpsy, gBerryPalette_Kelpsy},
[ITEM_TO_BERRY(ITEM_QUALOT_BERRY) - 1] = {gBerryPic_Qualot, gBerryPalette_Qualot},
[ITEM_TO_BERRY(ITEM_HONDEW_BERRY) - 1] = {gBerryPic_Hondew, gBerryPalette_Hondew},
[ITEM_TO_BERRY(ITEM_GREPA_BERRY) - 1] = {gBerryPic_Grepa, gBerryPalette_Grepa},
[ITEM_TO_BERRY(ITEM_TAMATO_BERRY) - 1] = {gBerryPic_Tamato, gBerryPalette_Tamato},
[ITEM_TO_BERRY(ITEM_CORNN_BERRY) - 1] = {gBerryPic_Cornn, gBerryPalette_Cornn},
[ITEM_TO_BERRY(ITEM_MAGOST_BERRY) - 1] = {gBerryPic_Magost, gBerryPalette_Magost},
[ITEM_TO_BERRY(ITEM_RABUTA_BERRY) - 1] = {gBerryPic_Rabuta, gBerryPalette_Rabuta},
[ITEM_TO_BERRY(ITEM_NOMEL_BERRY) - 1] = {gBerryPic_Nomel, gBerryPalette_Nomel},
[ITEM_TO_BERRY(ITEM_SPELON_BERRY) - 1] = {gBerryPic_Spelon, gBerryPalette_Spelon},
[ITEM_TO_BERRY(ITEM_PAMTRE_BERRY) - 1] = {gBerryPic_Pamtre, gBerryPalette_Pamtre},
[ITEM_TO_BERRY(ITEM_WATMEL_BERRY) - 1] = {gBerryPic_Watmel, gBerryPalette_Watmel},
[ITEM_TO_BERRY(ITEM_DURIN_BERRY) - 1] = {gBerryPic_Durin, gBerryPalette_Durin},
[ITEM_TO_BERRY(ITEM_BELUE_BERRY) - 1] = {gBerryPic_Belue, gBerryPalette_Belue},
[ITEM_TO_BERRY(ITEM_LIECHI_BERRY) - 1] = {gBerryPic_Liechi, gBerryPalette_Liechi},
[ITEM_TO_BERRY(ITEM_GANLON_BERRY) - 1] = {gBerryPic_Ganlon, gBerryPalette_Ganlon},
[ITEM_TO_BERRY(ITEM_SALAC_BERRY) - 1] = {gBerryPic_Salac, gBerryPalette_Salac},
[ITEM_TO_BERRY(ITEM_PETAYA_BERRY) - 1] = {gBerryPic_Petaya, gBerryPalette_Petaya},
[ITEM_TO_BERRY(ITEM_APICOT_BERRY) - 1] = {gBerryPic_Apicot, gBerryPalette_Apicot},
[ITEM_TO_BERRY(ITEM_LANSAT_BERRY) - 1] = {gBerryPic_Lansat, gBerryPalette_Lansat},
[ITEM_TO_BERRY(ITEM_STARF_BERRY) - 1] = {gBerryPic_Starf, gBerryPalette_Starf},
[ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) - 1] = {gBerryPic_Enigma, gBerryPalette_Enigma},
};
const struct CompressedSpriteSheet gBerryCheckCircleSpriteSheet =
@@ -581,10 +581,10 @@ static void LoadBerryGfx(u8 berryId)
// unknown empty if statement
}
pal.data = gBerryPicTable[berryId].pal;
pal.data = sBerryPicTable[berryId].pal;
pal.tag = TAG_BERRY_PIC_PAL;
LoadCompressedSpritePalette(&pal);
LZDecompressWram(gBerryPicTable[berryId].tiles, &gDecompressionBuffer[0x1000]);
LZDecompressWram(sBerryPicTable[berryId].tiles, &gDecompressionBuffer[0x1000]);
sub_80D5018(&gDecompressionBuffer[0x1000], &gDecompressionBuffer[0]);
}
@@ -599,7 +599,8 @@ void FreeBerryTagSpritePalette(void)
FreeSpritePaletteByTag(TAG_BERRY_PIC_PAL);
}
u8 LoadSpinningBerryPicGfx(u8 berryId, u8 x, u8 y, bool8 startAffine)
// For throwing berries into the Berry Blender
u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine)
{
u8 spriteId;

View File

@@ -99,7 +99,7 @@ u16 gLinkSavedIme;
EWRAM_DATA u8 gLinkTestDebugValuesEnabled = 0;
EWRAM_DATA u8 gUnknown_020223BD = 0;
EWRAM_DATA u32 gUnknown_020223C0 = 0;
EWRAM_DATA u32 gBerryBlenderKeySendAttempts = 0;
EWRAM_DATA u16 gBlockRecvBuffer[MAX_RFU_PLAYERS][BLOCK_BUFFER_SIZE / 2] = {};
EWRAM_DATA u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE] = {};
EWRAM_DATA bool8 gLinkOpen = FALSE;
@@ -552,7 +552,7 @@ static void ProcessRecvCmds(u8 unused)
InitBlockSend(block, sizeof(*block));
break;
}
case LINKCMD_SEND_HELD_KEYS:
case LINKCMD_BLENDER_SEND_KEYS:
gLinkPartnersHeldKeys[i] = gRecvCmds[i][1];
break;
case LINKCMD_0x5555:
@@ -636,13 +636,13 @@ static void ProcessRecvCmds(u8 unused)
case LINKCMD_READY_EXIT_STANDBY:
gReadyToExitStandby[i] = TRUE;
break;
case LINKCMD_0xAAAA:
sub_800A418();
case LINKCMD_BLENDER_NO_PBLOCK_SPACE:
SetBerryBlenderLinkCallback();
break;
case LINKCMD_SEND_BLOCK_REQ:
SendBlock(0, sBlockRequests[gRecvCmds[i][1]].address, sBlockRequests[gRecvCmds[i][1]].size);
break;
case LINKCMD_SEND_HELD_KEYS_2:
case LINKCMD_SEND_HELD_KEYS:
gLinkPartnersHeldKeys[i] = gRecvCmds[i][1];
break;
}
@@ -660,8 +660,8 @@ static void BuildSendCmd(u16 command)
case LINKCMD_READY_EXIT_STANDBY:
gSendCmd[0] = LINKCMD_READY_EXIT_STANDBY;
break;
case LINKCMD_SEND_HELD_KEYS:
gSendCmd[0] = LINKCMD_SEND_HELD_KEYS;
case LINKCMD_BLENDER_SEND_KEYS:
gSendCmd[0] = LINKCMD_BLENDER_SEND_KEYS;
gSendCmd[1] = gMain.heldKeys;
break;
case LINKCMD_0x5555:
@@ -687,8 +687,8 @@ static void BuildSendCmd(u16 command)
gSendCmd[1] = sBlockSend.size;
gSendCmd[2] = sBlockSend.multiplayerId + 0x80;
break;
case LINKCMD_0xAAAA:
gSendCmd[0] = LINKCMD_0xAAAA;
case LINKCMD_BLENDER_NO_PBLOCK_SPACE:
gSendCmd[0] = LINKCMD_BLENDER_NO_PBLOCK_SPACE;
break;
case LINKCMD_0xAAAB:
gSendCmd[0] = LINKCMD_0xAAAB;
@@ -705,12 +705,12 @@ static void BuildSendCmd(u16 command)
case LINKCMD_0x5566:
gSendCmd[0] = LINKCMD_0x5566;
break;
case LINKCMD_SEND_HELD_KEYS_2:
case LINKCMD_SEND_HELD_KEYS:
if (gHeldKeyCodeToSend == 0 || gLinkTransferringData)
{
break;
}
gSendCmd[0] = LINKCMD_SEND_HELD_KEYS_2;
gSendCmd[0] = LINKCMD_SEND_HELD_KEYS;
gSendCmd[1] = gHeldKeyCodeToSend;
break;
}
@@ -738,7 +738,7 @@ bool32 IsSendingKeysToLink(void)
static void LinkCB_SendHeldKeys(void)
{
if (gReceivedRemoteLinkPlayers == TRUE)
BuildSendCmd(LINKCMD_SEND_HELD_KEYS_2);
BuildSendCmd(LINKCMD_SEND_HELD_KEYS);
}
void ClearLinkCallback(void)
@@ -1009,34 +1009,36 @@ static void LinkCB_BlockSendEnd(void)
gLinkCallback = NULL;
}
static void sub_800A3F8(void)
static void LinkCB_BerryBlenderSendHeldKeys(void)
{
GetMultiplayerId();
BuildSendCmd(LINKCMD_SEND_HELD_KEYS);
gUnknown_020223C0++;
BuildSendCmd(LINKCMD_BLENDER_SEND_KEYS);
gBerryBlenderKeySendAttempts++;
}
void sub_800A418(void)
void SetBerryBlenderLinkCallback(void)
{
gUnknown_020223C0 = 0;
gBerryBlenderKeySendAttempts = 0;
if (gWirelessCommType)
{
sub_800F850();
Rfu_SetBerryBlenderLinkCallback();
}
else
{
gLinkCallback = sub_800A3F8;
gLinkCallback = LinkCB_BerryBlenderSendHeldKeys;
}
}
u32 sub_800A44C(void)
// Unused
static u32 GetBerryBlenderKeySendAttempts(void)
{
return gUnknown_020223C0;
return gBerryBlenderKeySendAttempts;
}
void sub_800A458(void)
// Unused
static void SendBerryBlenderNoSpaceForPokeblocks(void)
{
BuildSendCmd(LINKCMD_0xAAAA);
BuildSendCmd(LINKCMD_BLENDER_NO_PBLOCK_SPACE);
}
u8 GetMultiplayerId(void)

View File

@@ -929,7 +929,7 @@ static void HandleSendFailure(u8 unused, u32 flags)
{
if (!(flags & 1))
{
sResendBlock16[0] = RFU_COMMAND_0x8900 | i;
sResendBlock16[0] = RFUCMD_0x8900 | i;
for (j = 0; j < 7; j++)
{
temp = j << 1;
@@ -984,7 +984,7 @@ static void RfuFunc_SendKeysToRfu(void)
{
sHeldKeyCount++;
gHeldKeyCodeToSend |= (sHeldKeyCount << 8);
RfuPrepareSendBuffer(RFU_COMMAND_0xBE00);
RfuPrepareSendBuffer(RFUCMD_SEND_HELD_KEYS);
}
}
@@ -1008,18 +1008,18 @@ void ClearLinkRfuCallback(void)
Rfu.callback = NULL;
}
void sub_800F820(void)
static void Rfu_BerryBlenderSendHeldKeys(void)
{
RfuPrepareSendBuffer(RFU_COMMAND_0x4400);
RfuPrepareSendBuffer(RFUCMD_BLENDER_SEND_KEYS);
if (GetMultiplayerId() == 0)
gSendCmd[6] = GetBlenderArrowPosition();
gUnknown_020223C0++;
gSendCmd[BLENDER_COMM_ARROW_POS] = GetBlenderArrowPosition();
gBerryBlenderKeySendAttempts++;
}
void sub_800F850(void)
void Rfu_SetBerryBlenderLinkCallback(void)
{
if (Rfu.callback == NULL)
Rfu.callback = sub_800F820;
Rfu.callback = Rfu_BerryBlenderSendHeldKeys;
}
static void RfuHandleReceiveCommand(u8 unused)
@@ -1030,18 +1030,18 @@ static void RfuHandleReceiveCommand(u8 unused)
{
switch (gRecvCmds[i][0] & 0xff00)
{
case RFU_COMMAND_0x7800:
case RFUCMD_0x7800:
if (Rfu.parentChild == MODE_CHILD && gReceivedRemoteLinkPlayers)
return;
// fallthrough
case RFU_COMMAND_0x7700:
case RFUCMD_0x7700:
if (gRfuLinkStatus->parentChild == MODE_CHILD)
{
Rfu.playerCount = gRecvCmds[i][1];
Rfu.multiplayerId = sub_800F74C((u8 *)(&gRecvCmds[i][2]));
}
break;
case RFU_COMMAND_0x8800:
case RFUCMD_0x8800:
if (Rfu.recvBlock[i].receiving == 0)
{
Rfu.recvBlock[i].next = 0;
@@ -1052,7 +1052,7 @@ static void RfuHandleReceiveCommand(u8 unused)
Rfu.blockReceived[i] = FALSE;
}
break;
case RFU_COMMAND_0x8900:
case RFUCMD_0x8900:
if (Rfu.recvBlock[i].receiving == 1)
{
Rfu.recvBlock[i].next = gRecvCmds[i][0] & 0xff;
@@ -1068,17 +1068,17 @@ static void RfuHandleReceiveCommand(u8 unused)
}
}
break;
case RFU_COMMAND_SEND_BLOCK_REQ:
case RFUCMD_SEND_BLOCK_REQ:
Rfu_InitBlockSend(sBlockRequests[gRecvCmds[i][1]].address, (u16)sBlockRequests[gRecvCmds[i][1]].size);
break;
case RFU_COMMAND_READY_CLOSE_LINK:
case RFUCMD_READY_CLOSE_LINK:
Rfu.readyCloseLink[i] = TRUE;
break;
case RFU_COMMAND_READY_EXIT_STANDBY:
case RFUCMD_READY_EXIT_STANDBY:
if (Rfu.unk_100 == gRecvCmds[i][1])
Rfu.readyExitStandby[i] = TRUE;
break;
case RFU_COMMAND_0xED00:
case RFUCMD_0xED00:
if (Rfu.parentChild == MODE_CHILD)
{
if (gReceivedRemoteLinkPlayers)
@@ -1095,13 +1095,13 @@ static void RfuHandleReceiveCommand(u8 unused)
}
else
{
RfuPrepareSendBuffer(RFU_COMMAND_0xEE00);
RfuPrepareSendBuffer(RFUCMD_0xEE00);
gSendCmd[1] = gRecvCmds[i][1];
gSendCmd[2] = gRecvCmds[i][2];
gSendCmd[3] = gRecvCmds[i][3];
}
break;
case RFU_COMMAND_0xEE00:
case RFUCMD_0xEE00:
if (Rfu.parentChild == MODE_PARENT)
{
Rfu.unk_ce3 |= gRecvCmds[i][1];
@@ -1109,8 +1109,8 @@ static void RfuHandleReceiveCommand(u8 unused)
ClearSelectedLinkPlayerIds(gRecvCmds[i][1]);
}
break;
case RFU_COMMAND_0x4400:
case RFU_COMMAND_0xBE00:
case RFUCMD_BLENDER_SEND_KEYS:
case RFUCMD_SEND_HELD_KEYS:
gLinkPartnersHeldKeys[i] = gRecvCmds[i][1];
break;
}
@@ -1186,16 +1186,16 @@ static void RfuPrepareSendBuffer(u16 command)
gSendCmd[0] = command;
switch (command)
{
case RFU_COMMAND_0x8800:
case RFUCMD_0x8800:
gSendCmd[1] = Rfu.sendBlock.count;
gSendCmd[2] = Rfu.sendBlock.owner + 0x80;
break;
case RFU_COMMAND_SEND_BLOCK_REQ:
case RFUCMD_SEND_BLOCK_REQ:
if (AreNoPlayersReceiving())
gSendCmd[1] = Rfu.blockRequestType;
break;
case RFU_COMMAND_0x7700:
case RFU_COMMAND_0x7800:
case RFUCMD_0x7700:
case RFUCMD_0x7800:
tmp = Rfu.unk_ce2 ^ Rfu.unk_ce3;
Rfu.playerCount = sUnknown_082ED695[tmp] + 1;
gSendCmd[1] = Rfu.playerCount;
@@ -1203,34 +1203,34 @@ static void RfuPrepareSendBuffer(u16 command)
for (i = 0; i < RFU_CHILD_MAX; i++)
buff[i] = Rfu.linkPlayerIdx[i];
break;
case RFU_COMMAND_READY_EXIT_STANDBY:
case RFU_COMMAND_READY_CLOSE_LINK:
case RFUCMD_READY_EXIT_STANDBY:
case RFUCMD_READY_CLOSE_LINK:
gSendCmd[1] = Rfu.unk_100;
break;
case RFU_COMMAND_0x4400:
case RFUCMD_BLENDER_SEND_KEYS:
gSendCmd[0] = command;
gSendCmd[1] = gMain.heldKeys;
break;
case RFU_COMMAND_0x2F00:
for (i = 0; i < 6; i++)
gSendCmd[1 + i] = Rfu.unk_f2[i];
case RFUCMD_SEND_PACKET:
for (i = 0; i < RFU_PACKET_SIZE; i++)
gSendCmd[1 + i] = Rfu.packet[i];
break;
case RFU_COMMAND_0xBE00:
case RFUCMD_SEND_HELD_KEYS:
gSendCmd[1] = gHeldKeyCodeToSend;
break;
case RFU_COMMAND_0xEE00:
case RFUCMD_0xEE00:
break;
case RFU_COMMAND_0xED00:
case RFUCMD_0xED00:
break;
}
}
void sub_800FE50(void *a0)
void Rfu_SendPacket(void *data)
{
if (gSendCmd[0] == 0 && !RfuHasErrored())
{
memcpy(Rfu.unk_f2, a0, sizeof(Rfu.unk_f2));
RfuPrepareSendBuffer(RFU_COMMAND_0x2F00);
memcpy(Rfu.packet, data, sizeof(Rfu.packet));
RfuPrepareSendBuffer(RFUCMD_SEND_PACKET);
}
}
@@ -1258,7 +1258,7 @@ bool32 Rfu_InitBlockSend(const u8 *src, size_t size)
memcpy(gBlockSendBuffer, src, size);
Rfu.sendBlock.payload = gBlockSendBuffer;
}
RfuPrepareSendBuffer(RFU_COMMAND_0x8800);
RfuPrepareSendBuffer(RFUCMD_0x8800);
Rfu.callback = HandleBlockSend;
Rfu.unk_5b = 0;
return TRUE;
@@ -1268,7 +1268,7 @@ static void HandleBlockSend(void)
{
if (gSendCmd[0] == 0)
{
RfuPrepareSendBuffer(RFU_COMMAND_0x8800);
RfuPrepareSendBuffer(RFUCMD_0x8800);
if (Rfu.parentChild == MODE_PARENT)
{
if (++Rfu.unk_5b > 2)
@@ -1276,7 +1276,7 @@ static void HandleBlockSend(void)
}
else
{
if ((gRecvCmds[GetMultiplayerId()][0] & 0xff00) == RFU_COMMAND_0x8800)
if ((gRecvCmds[GetMultiplayerId()][0] & 0xff00) == RFUCMD_0x8800)
Rfu.callback = SendNextBlock;
}
}
@@ -1286,7 +1286,7 @@ static void SendNextBlock(void)
{
s32 i;
const u8 *src = Rfu.sendBlock.payload;
gSendCmd[0] = RFU_COMMAND_0x8900 | Rfu.sendBlock.next;
gSendCmd[0] = RFUCMD_0x8900 | Rfu.sendBlock.next;
for (i = 0; i < CMD_LENGTH - 1; i++)
gSendCmd[i + 1] = (src[(i << 1) + Rfu.sendBlock.next * 12 + 1] << 8) | src[(i << 1) + Rfu.sendBlock.next * 12 + 0];
Rfu.sendBlock.next++;
@@ -1304,7 +1304,7 @@ static void SendLastBlock(void)
s32 i;
if (Rfu.parentChild == MODE_CHILD)
{
gSendCmd[0] = RFU_COMMAND_0x8900 | (Rfu.sendBlock.count - 1);
gSendCmd[0] = RFUCMD_0x8900 | (Rfu.sendBlock.count - 1);
for (i = 0; i < CMD_LENGTH - 1; i++)
gSendCmd[i + 1] = (src[(i << 1) + (Rfu.sendBlock.count - 1) * 12 + 1] << 8) | src[(i << 1) + (Rfu.sendBlock.count - 1) * 12 + 0];
if ((u8)gRecvCmds[mpId][0] == Rfu.sendBlock.count - 1)
@@ -1325,7 +1325,7 @@ static void SendLastBlock(void)
bool8 Rfu_SendBlockRequest(u8 type)
{
Rfu.blockRequestType = type;
RfuPrepareSendBuffer(RFU_COMMAND_SEND_BLOCK_REQ);
RfuPrepareSendBuffer(RFUCMD_SEND_BLOCK_REQ);
return TRUE;
}
@@ -1394,7 +1394,7 @@ static void SendReadyCloseLink(void)
{
if (gSendCmd[0] == 0 && Rfu.unk_ce8 == 0)
{
RfuPrepareSendBuffer(RFU_COMMAND_READY_CLOSE_LINK);
RfuPrepareSendBuffer(RFUCMD_READY_CLOSE_LINK);
Rfu.callback = WaitAllReadyToCloseLink;
}
}
@@ -1421,7 +1421,7 @@ static void SendReadyExitStandbyUntilAllReady(void)
if (GetMultiplayerId() != 0 && Rfu.recvQueue.count == 0 && Rfu.resendExitStandbyTimer > 60)
{
RfuPrepareSendBuffer(RFU_COMMAND_READY_EXIT_STANDBY);
RfuPrepareSendBuffer(RFUCMD_READY_EXIT_STANDBY);
Rfu.resendExitStandbyTimer = 0;
}
playerCount = GetLinkPlayerCount();
@@ -1444,7 +1444,7 @@ static void LinkLeaderReadyToExitStandby(void)
{
if (Rfu.recvQueue.count == 0 && gSendCmd[0] == 0)
{
RfuPrepareSendBuffer(RFU_COMMAND_READY_EXIT_STANDBY);
RfuPrepareSendBuffer(RFUCMD_READY_EXIT_STANDBY);
Rfu.callback = SendReadyExitStandbyUntilAllReady;
}
}
@@ -1459,7 +1459,7 @@ static void Rfu_LinkStandby(void)
// Not link leader, send exit standby when ready
if (Rfu.recvQueue.count == 0 && gSendCmd[0] == 0)
{
RfuPrepareSendBuffer(RFU_COMMAND_READY_EXIT_STANDBY);
RfuPrepareSendBuffer(RFUCMD_READY_EXIT_STANDBY);
Rfu.callback = SendReadyExitStandbyUntilAllReady;
}
}
@@ -1476,7 +1476,7 @@ static void Rfu_LinkStandby(void)
{
if (Rfu.recvQueue.count == 0 && gSendCmd[0] == 0)
{
RfuPrepareSendBuffer(RFU_COMMAND_READY_EXIT_STANDBY);
RfuPrepareSendBuffer(RFUCMD_READY_EXIT_STANDBY);
Rfu.callback = LinkLeaderReadyToExitStandby;
}
}
@@ -1699,9 +1699,9 @@ static void sub_801084C(u8 taskId)
if (Rfu.parentChild == MODE_PARENT)
{
if (gReceivedRemoteLinkPlayers)
RfuPrepareSendBuffer(RFU_COMMAND_0x7800);
RfuPrepareSendBuffer(RFUCMD_0x7800);
else
RfuPrepareSendBuffer(RFU_COMMAND_0x7700);
RfuPrepareSendBuffer(RFUCMD_0x7700);
gTasks[taskId].data[0] = 101;
}
else
@@ -1721,7 +1721,7 @@ static void sub_801084C(u8 taskId)
if (AreNoPlayersReceiving())
{
Rfu.blockRequestType = 0;
RfuPrepareSendBuffer(RFU_COMMAND_SEND_BLOCK_REQ);
RfuPrepareSendBuffer(RFUCMD_SEND_BLOCK_REQ);
gTasks[taskId].data[0]++;
}
}
@@ -1811,7 +1811,7 @@ static void Task_ExchangeLinkPlayers(u8 taskId)
if (gSendCmd[0] == 0)
{
ResetBlockReceivedFlag(r4);
RfuPrepareSendBuffer(RFU_COMMAND_0x7800);
RfuPrepareSendBuffer(RFUCMD_0x7800);
gTasks[taskId].data[0]++;
}
break;
@@ -2624,7 +2624,7 @@ static void sub_8011E2C(u8 taskId)
{
if (gSendCmd[0] == 0 && Rfu.unk_ce8 == 0)
{
RfuPrepareSendBuffer(RFU_COMMAND_0xED00);
RfuPrepareSendBuffer(RFUCMD_0xED00);
gSendCmd[1] = gTasks[taskId].data[0];
gSendCmd[2] = gTasks[taskId].data[1];
Rfu.playerCount -= sUnknown_082ED695[gTasks[taskId].data[0]];

View File

@@ -262,15 +262,15 @@ static void sub_802EAB0(u8 taskId)
if (gReceivedRemoteLinkPlayers != 0)
{
if (gRecvCmds[0][1] == 0x7FFF)
if (gRecvCmds[0][1] == LINKCMD_0x7FFF)
data[11] = gRecvCmds[0][2];
if (GetMultiplayerId() == 0)
{
data[12]++;
memset(packet, 0, sizeof(packet));
packet[0] = 0x7FFF;
packet[0] = LINKCMD_0x7FFF;
packet[1] = data[12];
sub_800FE50(packet);
Rfu_SendPacket(packet);
}
}
else

View File

@@ -180,21 +180,21 @@ static const struct BgTemplate sBgTemplatesForPokeblockMenu[] =
const u8 *const gPokeblockNames[] =
{
NULL,
gText_RedPokeblock,
gText_BluePokeblock,
gText_PinkPokeblock,
gText_GreenPokeblock,
gText_YellowPokeblock,
gText_PurplePokeblock,
gText_IndigoPokeblock,
gText_BrownPokeblock,
gText_LiteBluePokeblock,
gText_OlivePokeblock,
gText_GrayPokeblock,
gText_BlackPokeblock,
gText_WhitePokeblock,
gText_GoldPokeblock
[PBLOCK_CLR_NONE] = NULL,
[PBLOCK_CLR_RED] = gText_RedPokeblock,
[PBLOCK_CLR_BLUE] = gText_BluePokeblock,
[PBLOCK_CLR_PINK] = gText_PinkPokeblock,
[PBLOCK_CLR_GREEN] = gText_GreenPokeblock,
[PBLOCK_CLR_YELLOW] = gText_YellowPokeblock,
[PBLOCK_CLR_PURPLE] = gText_PurplePokeblock,
[PBLOCK_CLR_INDIGO] = gText_IndigoPokeblock,
[PBLOCK_CLR_BROWN] = gText_BrownPokeblock,
[PBLOCK_CLR_LITE_BLUE] = gText_LiteBluePokeblock,
[PBLOCK_CLR_OLIVE] = gText_OlivePokeblock,
[PBLOCK_CLR_GRAY] = gText_GrayPokeblock,
[PBLOCK_CLR_BLACK] = gText_BlackPokeblock,
[PBLOCK_CLR_WHITE] = gText_WhitePokeblock,
[PBLOCK_CLR_GOLD] = gText_GoldPokeblock
};
static const struct MenuAction sPokeblockMenuActions[] =
@@ -726,7 +726,7 @@ static void PutPokeblockListMenuString(u8 *dst, u16 pkblId)
*(txtPtr++) = EXT_CTRL_CODE_BEGIN;
*(txtPtr++) = EXT_CTRL_CODE_SKIP;
*(txtPtr++) = 87;
*(txtPtr++) = CHAR_BLOCK_1;
ConvertIntToDecimalStringN(gStringVar1, GetHighestPokeblocksFlavorLevel(pkblock), STR_CONV_MODE_LEFT_ALIGN, 3);
StringExpandPlaceholders(txtPtr, gText_LvVar1);
@@ -804,7 +804,7 @@ static void CompactPokeblockSlots(void)
{
for (j = i + 1; j < POKEBLOCKS_COUNT; j++)
{
if (gSaveBlock1Ptr->pokeblocks[i].color == 0)
if (gSaveBlock1Ptr->pokeblocks[i].color == PBLOCK_CLR_NONE)
{
struct Pokeblock temp = gSaveBlock1Ptr->pokeblocks[i];
gSaveBlock1Ptr->pokeblocks[i] = gSaveBlock1Ptr->pokeblocks[j];
@@ -856,7 +856,7 @@ static void SetMenuItemsCountAndMaxShowed(void)
for (sPokeblockMenu->itemsNo = 0, i = 0; i < POKEBLOCKS_COUNT; i++)
{
if (gSaveBlock1Ptr->pokeblocks[i].color != 0)
if (gSaveBlock1Ptr->pokeblocks[i].color != PBLOCK_CLR_NONE)
sPokeblockMenu->itemsNo++;
}
@@ -1322,7 +1322,7 @@ s8 GetFirstFreePokeblockSlot(void)
for (i = 0; i < POKEBLOCKS_COUNT; i++)
{
if (gSaveBlock1Ptr->pokeblocks[i].color == 0)
if (gSaveBlock1Ptr->pokeblocks[i].color == PBLOCK_CLR_NONE)
return i;
}
@@ -1346,7 +1346,7 @@ bool32 AddPokeblock(const struct Pokeblock *pokeblock)
bool32 TryClearPokeblock(u8 pkblId)
{
if (gSaveBlock1Ptr->pokeblocks[pkblId].color == 0)
if (gSaveBlock1Ptr->pokeblocks[pkblId].color == PBLOCK_CLR_NONE)
{
return FALSE;
}

View File

@@ -382,22 +382,23 @@ static const struct WindowTemplate sWindowTemplates[] =
DUMMY_WIN_TEMPLATE
};
// - 1 excludes PBLOCK_CLR_NONE
static const u32* const sPokeblocksPals[] =
{
gPokeblockRed_Pal,
gPokeblockBlue_Pal,
gPokeblockPink_Pal,
gPokeblockGreen_Pal,
gPokeblockYellow_Pal,
gPokeblockPurple_Pal,
gPokeblockIndigo_Pal,
gPokeblockBrown_Pal,
gPokeblockLiteBlue_Pal,
gPokeblockOlive_Pal,
gPokeblockGray_Pal,
gPokeblockBlack_Pal,
gPokeblockWhite_Pal,
gPokeblockGold_Pal
[PBLOCK_CLR_RED - 1] = gPokeblockRed_Pal,
[PBLOCK_CLR_BLUE - 1] = gPokeblockBlue_Pal,
[PBLOCK_CLR_PINK - 1] = gPokeblockPink_Pal,
[PBLOCK_CLR_GREEN - 1] = gPokeblockGreen_Pal,
[PBLOCK_CLR_YELLOW - 1] = gPokeblockYellow_Pal,
[PBLOCK_CLR_PURPLE - 1] = gPokeblockPurple_Pal,
[PBLOCK_CLR_INDIGO - 1] = gPokeblockIndigo_Pal,
[PBLOCK_CLR_BROWN - 1] = gPokeblockBrown_Pal,
[PBLOCK_CLR_LITE_BLUE - 1] = gPokeblockLiteBlue_Pal,
[PBLOCK_CLR_OLIVE - 1] = gPokeblockOlive_Pal,
[PBLOCK_CLR_GRAY - 1] = gPokeblockGray_Pal,
[PBLOCK_CLR_BLACK - 1] = gPokeblockBlack_Pal,
[PBLOCK_CLR_WHITE - 1] = gPokeblockWhite_Pal,
[PBLOCK_CLR_GOLD - 1] = gPokeblockGold_Pal
};
static const union AffineAnimCmd sSpriteAffineAnim_84120DC[] =

View File

@@ -3684,14 +3684,14 @@ static void sub_802E0AC(struct PokemonJump1_MonInfo *arg0)
packet.species = arg0->species,
packet.otId = arg0->otId,
packet.personality = arg0->personality,
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static bool32 sub_802E0D0(int multiplayerId, struct PokemonJump1_MonInfo *arg0)
{
struct MonInfoPacket packet;
if ((gRecvCmds[multiplayerId][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[multiplayerId][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return FALSE;
memcpy(&packet, &gRecvCmds[multiplayerId][1], sizeof(packet));
@@ -3718,7 +3718,7 @@ static void sub_802E120(u32 arg0)
struct UnkPacket2 packet;
packet.id = 2;
packet.unk4 = arg0;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
struct UnkPacket3
@@ -3746,14 +3746,14 @@ static void sub_802E138(struct PokemonJump1_82E4 *arg0, struct PokemonJump1Sub *
packet.unk2 = arg0->unk10;
packet.unk3_1 = arg0->unk14;
packet.unk4 = arg0->unkE;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static bool32 sub_802E1BC(struct PokemonJump1_82E4 *arg0, struct PokemonJump1Sub *arg1)
{
struct UnkPacket3 packet;
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return FALSE;
memcpy(&packet, &gRecvCmds[0][1], sizeof(packet));
@@ -3792,14 +3792,14 @@ static void sub_802E234(struct PokemonJump1_82E4 *arg0, u8 arg1, u16 arg2)
packet.unk4 = arg0->unkE;
packet.unk6 = arg1;
packet.unk8 = arg2;
sub_800FE50(&packet);
Rfu_SendPacket(&packet);
}
static bool32 sub_802E264(struct PokemonJump1_82E4 *arg0, int multiplayerId, u8 *arg2, u16 *arg3)
{
struct UnkPacket4 packet;
if ((gRecvCmds[multiplayerId][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[multiplayerId][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return FALSE;
memcpy(&packet, &gRecvCmds[multiplayerId][1], sizeof(packet));
@@ -3819,7 +3819,7 @@ static bool32 sub_802E2D0(struct PokemonJump1_82E4 *arg0, int multiplayerId)
{
struct UnkPacket4 packet;
if ((gRecvCmds[multiplayerId][0] & 0xFF00) != 0x2F00)
if ((gRecvCmds[multiplayerId][0] & 0xFF00) != RFUCMD_SEND_PACKET)
return FALSE;
memcpy(&packet, &gRecvCmds[multiplayerId][1], sizeof(packet));

View File

@@ -1332,7 +1332,7 @@ void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlaye
}
}
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language)
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 color, u8 sheen, u8 language)
{
TVShow *show;
u8 name[32];
@@ -1355,7 +1355,7 @@ bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unus
StripExtCtrlCodes(name);
StringCopy(show->threeCheers.worstBlenderName, name);
show->threeCheers.flavor = flavor;
show->threeCheers.unk_03_3 = unused;
show->threeCheers.color = color;
show->threeCheers.sheen = sheen;
tv_store_id_2x(show);
show->threeCheers.language = gGameLanguage;

View File

@@ -2677,7 +2677,7 @@ static void Task_RunUnionRoom(u8 taskId)
if (input == -2 || input == IN_UNION_ROOM)
{
uroom->playerSendBuffer[0] = IN_UNION_ROOM;
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
StringCopy(gStringVar4, sIfYouWantToDoSomethingTexts[gLinkPlayers[0].gender]);
uroom->state = UR_STATE_REQUEST_DECLINED;
}
@@ -2692,7 +2692,7 @@ static void Task_RunUnionRoom(u8 taskId)
else
{
uroom->playerSendBuffer[0] = gPlayerCurrActivity | IN_UNION_ROOM;
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
uroom->state = UR_STATE_SEND_ACTIVITY_REQUEST;
}
}
@@ -2721,7 +2721,7 @@ static void Task_RunUnionRoom(u8 taskId)
uroom->playerSendBuffer[0] = ACTIVITY_TRADE | IN_UNION_ROOM;
uroom->playerSendBuffer[1] = sUnionRoomTrade.species;
uroom->playerSendBuffer[2] = sUnionRoomTrade.level;
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
uroom->state = UR_STATE_WAIT_FOR_RESPONSE_TO_REQUEST;
break;
case UR_STATE_WAIT_FOR_RESPONSE_TO_REQUEST:
@@ -2908,32 +2908,32 @@ static void Task_RunUnionRoom(u8 taskId)
if (!HasAtLeastTwoMonsOfLevel30OrLower())
{
uroom->playerSendBuffer[0] = ACTIVITY_DECLINE | IN_UNION_ROOM;
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
uroom->state = UR_STATE_DECLINE_ACTIVITY_REQUEST;
StringCopy(gStringVar4, sText_NeedTwoMonsOfLevel30OrLower2);
}
else
{
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
uroom->state = UR_STATE_PRINT_START_ACTIVITY_MSG;
}
}
else if (gPlayerCurrActivity == (ACTIVITY_CARD | IN_UNION_ROOM))
{
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
ViewURoomPartnerTrainerCard(gStringVar4, uroom, TRUE);
uroom->state = UR_STATE_PRINT_CARD_INFO;
}
else
{
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
uroom->state = UR_STATE_PRINT_START_ACTIVITY_MSG;
}
break;
case 1: // DECLINE
case -1:
uroom->playerSendBuffer[0] = ACTIVITY_DECLINE | IN_UNION_ROOM;
sub_800FE50(uroom->playerSendBuffer);
Rfu_SendPacket(uroom->playerSendBuffer);
uroom->state = UR_STATE_DECLINE_ACTIVITY_REQUEST;
GetYouDeclinedTheOfferMessage(gStringVar4, gPlayerCurrActivity);
break;