Document cable_club.c

This commit is contained in:
GriffinR 2020-06-03 18:00:53 -04:00
parent 9190af73b7
commit 3f97763181
32 changed files with 591 additions and 535 deletions

View File

@ -786,19 +786,19 @@ BattleFrontier_BattleTowerLobby_EventScript_TryCableLink:: @ 823F2C5
setvar VAR_0x8005, 0 setvar VAR_0x8005, 0
special TryBattleLinkup special TryBattleLinkup
waitstate waitstate
compare VAR_RESULT, 1 compare VAR_RESULT, LINKUP_SUCCESS
goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful
compare VAR_RESULT, 2 compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY
goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady
compare VAR_RESULT, 3 compare VAR_RESULT, LINKUP_DIFF_SELECTIONS
goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLinkDifferentSelections goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLinkDifferentSelections
compare VAR_RESULT, 4 compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS
goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLinkIncorrectNumberOfPlayers goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLinkIncorrectNumberOfPlayers
compare VAR_RESULT, 5 compare VAR_RESULT, LINKUP_FAILED
goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge
compare VAR_RESULT, 6 compare VAR_RESULT, LINKUP_CONNECTION_ERROR
goto_if_eq CableClub_EventScript_AbortLinkConnectionError goto_if_eq CableClub_EventScript_AbortLinkConnectionError
compare VAR_RESULT, 11 compare VAR_RESULT, LINKUP_FAILED_BATTLE_TOWER
goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLink goto_if_eq BattleFrontier_BattleTowerLobby_EventScript_AbortLink
end end
@ -853,7 +853,7 @@ BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful:: @ 823F3AF
message BattleFrontier_BattleTowerLobby_Text_SaveGameBeforeShowingIn message BattleFrontier_BattleTowerLobby_Text_SaveGameBeforeShowingIn
waitmessage waitmessage
tower_save CHALLENGE_STATUS_SAVING tower_save CHALLENGE_STATUS_SAVING
special sub_80A08CC special SaveForBattleTowerLink
waitstate waitstate
playse SE_SAVE playse SE_SAVE
waitse waitse
@ -914,7 +914,7 @@ BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful:: @ 823F496
message BattleFrontier_BattleTowerLobby_Text_SaveGameBeforeShowingIn message BattleFrontier_BattleTowerLobby_Text_SaveGameBeforeShowingIn
waitmessage waitmessage
tower_save CHALLENGE_STATUS_SAVING tower_save CHALLENGE_STATUS_SAVING
special sub_80A08CC special SaveForBattleTowerLink
waitstate waitstate
playse SE_SAVE playse SE_SAVE
waitse waitse

View File

@ -767,15 +767,15 @@ LilycoveCity_ContestLobby_EventScript_TrySetUpLinkContest:: @ 821AA15
call_if_eq LilycoveCity_ContestLobby_EventScript_TryLinkGMode call_if_eq LilycoveCity_ContestLobby_EventScript_TryLinkGMode
compare VAR_TEMP_C, 2 compare VAR_TEMP_C, 2
goto_if_ge LilycoveCity_ContestLobby_EventScript_CancelLinkContest goto_if_ge LilycoveCity_ContestLobby_EventScript_CancelLinkContest
compare VAR_RESULT, 4 compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices
compare VAR_RESULT, 3 compare VAR_RESULT, LINKUP_DIFF_SELECTIONS
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices
compare VAR_RESULT, 5 compare VAR_RESULT, LINKUP_FAILED
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkContest goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkContest
compare VAR_RESULT, 6 compare VAR_RESULT, LINKUP_CONNECTION_ERROR
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkError goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkError
compare VAR_RESULT, 10 compare VAR_RESULT, LINKUP_FAILED_CONTEST_GMODE
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkModeDifference goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkModeDifference
message3 LilycoveCity_ContestLobby_Text_Transmitting message3 LilycoveCity_ContestLobby_Text_Transmitting
contestlinktransfer contestlinktransfer

View File

@ -600,15 +600,15 @@ BerryBlender_EventScript_TryDoLinkBlender: @ 82940BB
waitmessage waitmessage
special TryBerryBlenderLinkup special TryBerryBlenderLinkup
waitstate waitstate
compare VAR_RESULT, 1 compare VAR_RESULT, LINKUP_SUCCESS
goto_if_eq BerryBlender_EventScript_SpawnLinkPartners goto_if_eq BerryBlender_EventScript_SpawnLinkPartners
compare VAR_RESULT, 2 compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY
goto_if_eq BerryBlender_EventScript_CloseLinkNotReady goto_if_eq BerryBlender_EventScript_CloseLinkNotReady
compare VAR_RESULT, 3 compare VAR_RESULT, LINKUP_DIFF_SELECTIONS
goto_if_eq BerryBlender_EventScript_CloseLinkDifferentSelections goto_if_eq BerryBlender_EventScript_CloseLinkDifferentSelections
compare VAR_RESULT, 5 compare VAR_RESULT, LINKUP_FAILED
goto_if_eq BerryBlender_EventScript_CloseLink goto_if_eq BerryBlender_EventScript_CloseLink
compare VAR_RESULT, 6 compare VAR_RESULT, LINKUP_CONNECTION_ERROR
goto_if_eq BerryBlender_EventScript_LinkError goto_if_eq BerryBlender_EventScript_LinkError
end end

View File

@ -452,21 +452,21 @@ CableClub_EventScript_TradeCenter:: @ 82770B2
waitmessage waitmessage
special TryTradeLinkup special TryTradeLinkup
waitstate waitstate
compare VAR_RESULT, 1 compare VAR_RESULT, LINKUP_SUCCESS
goto_if_eq CableClub_EventScript_EnterTradeCenter goto_if_eq CableClub_EventScript_EnterTradeCenter
compare VAR_RESULT, 2 compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY
goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady
compare VAR_RESULT, 3 compare VAR_RESULT, LINKUP_DIFF_SELECTIONS
goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections
compare VAR_RESULT, 4 compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS
goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants
compare VAR_RESULT, 5 compare VAR_RESULT, LINKUP_FAILED
goto_if_eq CableClub_EventScript_AbortLink goto_if_eq CableClub_EventScript_AbortLink
compare VAR_RESULT, 6 compare VAR_RESULT, LINKUP_CONNECTION_ERROR
goto_if_eq CableClub_EventScript_AbortLinkConnectionError goto_if_eq CableClub_EventScript_AbortLinkConnectionError
compare VAR_RESULT, 7 compare VAR_RESULT, LINKUP_PLAYER_NOT_READY
goto_if_eq CableClub_EventScript_AbortLinkPlayerNotReady goto_if_eq CableClub_EventScript_AbortLinkPlayerNotReady
compare VAR_RESULT, 9 compare VAR_RESULT, LINKUP_PARTNER_NOT_READY
goto_if_eq CableClub_EventScript_AbortLinkOtherTrainerNotReady goto_if_eq CableClub_EventScript_AbortLinkOtherTrainerNotReady
end end
@ -527,21 +527,21 @@ CableClub_EventScript_RecordCorner:: @ 82771DB
waitmessage waitmessage
special TryRecordMixLinkup special TryRecordMixLinkup
waitstate waitstate
special sub_80B2EA8 special ValidateMixingGameLanguage
waitstate waitstate
compare VAR_RESULT, 12 compare VAR_RESULT, LINKUP_FOREIGN_GAME
goto_if_eq CableClub_EventScript_AbortLinkForeignGame goto_if_eq CableClub_EventScript_AbortLinkForeignGame
compare VAR_RESULT, 1 compare VAR_RESULT, LINKUP_SUCCESS
goto_if_eq CableClub_EventScript_EnterRecordCorner goto_if_eq CableClub_EventScript_EnterRecordCorner
compare VAR_RESULT, 2 compare VAR_RESULT, LINKUP_SOMEONE_NOT_READY
goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady goto_if_eq CableClub_EventScript_AbortLinkSomeoneNotReady
compare VAR_RESULT, 3 compare VAR_RESULT, LINKUP_DIFF_SELECTIONS
goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections goto_if_eq CableClub_EventScript_AbortLinkDifferentSelections
compare VAR_RESULT, 4 compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS
goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants goto_if_eq CableClub_EventScript_AbortLinkIncorrectNumberOfParticipants
compare VAR_RESULT, 5 compare VAR_RESULT, LINKUP_FAILED
goto_if_eq CableClub_EventScript_AbortLink goto_if_eq CableClub_EventScript_AbortLink
compare VAR_RESULT, 6 compare VAR_RESULT, LINKUP_CONNECTION_ERROR
goto_if_eq CableClub_EventScript_AbortLinkConnectionError goto_if_eq CableClub_EventScript_AbortLinkConnectionError
end end

View File

@ -39,7 +39,7 @@ gSpecials:: @ 81DBA64
def_special TryBattleLinkup def_special TryBattleLinkup
def_special TryTradeLinkup def_special TryTradeLinkup
def_special TryRecordMixLinkup def_special TryRecordMixLinkup
def_special sub_80B2EA8 def_special ValidateMixingGameLanguage
def_special CloseLink def_special CloseLink
def_special ColosseumPlayerSpotTriggered def_special ColosseumPlayerSpotTriggered
def_special PlayerEnteredTradeSeat def_special PlayerEnteredTradeSeat
@ -502,7 +502,7 @@ gSpecials:: @ 81DBA64
def_special CreateAbnormalWeatherEvent def_special CreateAbnormalWeatherEvent
def_special GetAbnormalWeatherMapNameAndType def_special GetAbnormalWeatherMapNameAndType
def_special GetMartEmployeeObjectEventId def_special GetMartEmployeeObjectEventId
def_special sub_80A08CC def_special SaveForBattleTowerLink
def_special Unused_SetWeatherSunny def_special Unused_SetWeatherSunny
def_special SetUnlockedPokedexFlags def_special SetUnlockedPokedexFlags
def_special IsTrainerRegistered def_special IsTrainerRegistered

View File

@ -9,12 +9,12 @@
// Exported ROM declarations // Exported ROM declarations
void sub_80B37D4(TaskFunc taskFunc); void CreateTask_EnterCableClubSeat(TaskFunc taskFunc);
u8 sub_80B3050(void); u8 CreateTask_ReestablishCableClubLink(void);
void CB2_ReturnFromCableClubBattle(void); void CB2_ReturnFromCableClubBattle(void);
bool32 sub_80B2AF4(u16 *arg0, u16 *arg1); bool32 AreBattleTowerLinkSpeciesSame(u16 *speciesList1, u16 *speciesList2);
void sub_80B3AF8(u8 taskId); void sub_80B3AF8(u8 taskId);
void task00_08081A90(u8 taskId); void Task_WaitForLinkPlayerConnection(u8 taskId);
bool32 GetLinkTrainerCardColor(u8 linkPlayerIndex); bool32 GetLinkTrainerCardColor(u8 linkPlayerIndex);
#endif //GUARD_CABLE_CLUB_H #endif //GUARD_CABLE_CLUB_H

View File

@ -12,4 +12,22 @@
#define USING_MINIGAME 8 #define USING_MINIGAME 8
#define USING_BATTLE_TOWER 9 #define USING_BATTLE_TOWER 9
#define LINKUP_ONGOING 0
#define LINKUP_SUCCESS 1
#define LINKUP_SOMEONE_NOT_READY 2
#define LINKUP_DIFF_SELECTIONS 3
#define LINKUP_WRONG_NUM_PLAYERS 4
#define LINKUP_FAILED 5
#define LINKUP_CONNECTION_ERROR 6
#define LINKUP_PLAYER_NOT_READY 7
#define LINKUP_UNK8 8
#define LINKUP_PARTNER_NOT_READY 9
#define LINKUP_FAILED_CONTEST_GMODE 10
#define LINKUP_FAILED_BATTLE_TOWER 11
#define LINKUP_FOREIGN_GAME 12
#define LINK_BATTLE_TOWER_SAME_MON 1
#define LINK_BATTLE_TOWER_SAME_MONS 2
#define LINK_BATTLE_TOWER_DIFF_MODE 3
#endif //GUARD_CONSTANTS_CABLE_CLUB_H #endif //GUARD_CONSTANTS_CABLE_CLUB_H

View File

@ -16,7 +16,7 @@ bool8 ShowFieldAutoScrollMessage(const u8 *message);
void HideFieldMessageBox(void); void HideFieldMessageBox(void);
bool8 IsFieldMessageBoxHidden(void); bool8 IsFieldMessageBoxHidden(void);
u8 GetFieldMessageBoxMode(void); u8 GetFieldMessageBoxMode(void);
void sub_8098374(void); void StopFieldMessage(void);
void InitFieldMessageBox(void); void InitFieldMessageBox(void);
#endif // GUARD_FIELD_MESSAGE_BOX_H #endif // GUARD_FIELD_MESSAGE_BOX_H

View File

@ -73,10 +73,10 @@
#define LINKCMD_CANCEL_TRADE 0xEEBB #define LINKCMD_CANCEL_TRADE 0xEEBB
#define LINKCMD_0xEECC 0xEECC #define LINKCMD_0xEECC 0xEECC
#define LINKTYPE_0x1111 0x1111 // trade #define LINKTYPE_TRADE 0x1111
#define LINKTYPE_0x1122 0x1122 // trade #define LINKTYPE_TRADE_CONNECTING 0x1122
#define LINKTYPE_0x1133 0x1133 // trade #define LINKTYPE_TRADE_SETUP 0x1133
#define LINKTYPE_0x1144 0x1144 // trade #define LINKTYPE_TRADE_DISCONNECTED 0x1144
#define LINKTYPE_BATTLE 0x2211 #define LINKTYPE_BATTLE 0x2211
#define LINKTYPE_0x2222 0x2222 // unused battle? #define LINKTYPE_0x2222 0x2222 // unused battle?
#define LINKTYPE_SINGLE_BATTLE 0x2233 #define LINKTYPE_SINGLE_BATTLE 0x2233
@ -85,13 +85,13 @@
#define LINKTYPE_BATTLE_TOWER_50 0x2266 #define LINKTYPE_BATTLE_TOWER_50 0x2266
#define LINKTYPE_BATTLE_TOWER_OPEN 0x2277 #define LINKTYPE_BATTLE_TOWER_OPEN 0x2277
#define LINKTYPE_BATTLE_TOWER 0x2288 #define LINKTYPE_BATTLE_TOWER 0x2288
#define LINKTYPE_0x3311 0x3311 #define LINKTYPE_RECORD_MIX_BEFORE 0x3311
#define LINKTYPE_0x3322 0x3322 #define LINKTYPE_RECORD_MIX_AFTER 0x3322
#define LINKTYPE_BERRY_BLENDER_SETUP 0x4411 #define LINKTYPE_BERRY_BLENDER_SETUP 0x4411
#define LINKTYPE_BERRY_BLENDER 0x4422 #define LINKTYPE_BERRY_BLENDER 0x4422
#define LINKTYPE_0x5501 0x5501 // mystery event #define LINKTYPE_MYSTERY_EVENT 0x5501
#define LINKTYPE_0x5502 0x5502 // unused? #define LINKTYPE_0x5502 0x5502 // unused?
#define LINKTYPE_0x5503 0x5503 // eReader #define LINKTYPE_EREADER 0x5503
#define LINKTYPE_CONTEST_GMODE 0x6601 #define LINKTYPE_CONTEST_GMODE 0x6601
#define LINKTYPE_CONTEST_EMODE 0x6602 #define LINKTYPE_CONTEST_EMODE 0x6602
@ -126,10 +126,10 @@ enum
EXCHANGE_NOT_STARTED, EXCHANGE_NOT_STARTED,
EXCHANGE_COMPLETE, EXCHANGE_COMPLETE,
EXCHANGE_TIMED_OUT, EXCHANGE_TIMED_OUT,
EXCHANGE_IN_PROGRESS, EXCHANGE_DIFF_SELECTIONS,
EXCHANGE_PLAYER_NOT_READY, EXCHANGE_PLAYER_NOT_READY,
EXCHANGE_PARTNER_NOT_READY, EXCHANGE_PARTNER_NOT_READY,
EXCHANGE_STAT_6, EXCHANGE_WRONG_NUM_PLAYERS,
EXCHANGE_STAT_7 EXCHANGE_STAT_7
}; };

View File

@ -1,6 +1,6 @@
#ifndef GUARD_MEVENT2_H #ifndef GUARD_MEVENT2_H
#define GUARD_MEVENT2_H #define GUARD_MEVENT2_H
void sub_801B990(u32, u32); void RecordIdOfWonderCardSenderByEventType(u32, u32);
#endif //GUARD_MEVENT2_H #endif //GUARD_MEVENT2_H

View File

@ -102,7 +102,7 @@ u8 Save_LoadGameData(u8 saveType);
u16 sub_815355C(void); u16 sub_815355C(void);
u32 TryReadSpecialSaveSection(u8 sector, u8* dst); u32 TryReadSpecialSaveSection(u8 sector, u8* dst);
u32 TryWriteSpecialSaveSection(u8 sector, u8* src); u32 TryWriteSpecialSaveSection(u8 sector, u8* src);
void sub_8153688(u8 taskId); void Task_LinkSave(u8 taskId);
// save_failed_screen.c // save_failed_screen.c
void DoSaveFailedScreen(u8 saveType); void DoSaveFailedScreen(u8 saveType);

View File

@ -8,8 +8,8 @@ void Task_ShowStartMenu(u8 taskId);
void ShowStartMenu(void); void ShowStartMenu(void);
void ShowBattlePyramidStartMenu(void); void ShowBattlePyramidStartMenu(void);
void SaveGame(void); void SaveGame(void);
void sub_80A0514(void); void CB2_SetUpSaveAfterLinkBattle(void);
void sub_80A08CC(void); void SaveForBattleTowerLink(void);
void HideStartMenu(void); void HideStartMenu(void);
void AppendToList(u8* list, u8* pos, u8 newEntry); void AppendToList(u8* list, u8* pos, u8 newEntry);

View File

@ -962,7 +962,7 @@ extern const u8 gText_TwoDashes[];
extern const u8 *const gReturnToXStringsTable2[]; extern const u8 *const gReturnToXStringsTable2[];
extern const u8 gText_XPLink[]; extern const u8 gText_NumPlayerLink[];
extern const u8 gText_ConfirmLinkWhenPlayersReady[]; extern const u8 gText_ConfirmLinkWhenPlayersReady[];
extern const u8 gText_ConfirmStartLinkWithXPlayers[]; extern const u8 gText_ConfirmStartLinkWithXPlayers[];
extern const u8 gText_AwaitingLinkup[]; extern const u8 gText_AwaitingLinkup[];

View File

@ -161,7 +161,7 @@ extern u8 gUnionRoomRequestedMonType;
// Exported ROM declarations // Exported ROM declarations
u8 CreateTask_ReturnFromLinkTrade(void); u8 CreateTask_CreateTradeMenu(void);
void nullsub_89(u8 taskId); void nullsub_89(u8 taskId);
void var_800D_set_xB(void); void var_800D_set_xB(void);
void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0); void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0);

View File

@ -36,7 +36,7 @@ void HandleLinkBattleSetup(void)
SetWirelessCommType1(); SetWirelessCommType1();
if (!gReceivedRemoteLinkPlayers) if (!gReceivedRemoteLinkPlayers)
OpenLink(); OpenLink();
CreateTask(task00_08081A90, 0); CreateTask(Task_WaitForLinkPlayerConnection, 0);
CreateTasksForSendRecvLinkBuffers(); CreateTasksForSendRecvLinkBuffers();
} }
} }

View File

@ -3013,10 +3013,10 @@ static u32 sub_8024134(struct BerryCrushGame *r5, u8 *r4)
DrawDialogueFrame(0, 0); DrawDialogueFrame(0, 0);
AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3);
CopyWindowToVram(0, 3); CopyWindowToVram(0, 3);
CreateTask(sub_8153688, 0); CreateTask(Task_LinkSave, 0);
break; break;
case 3: case 3:
if (FuncIsActiveTask(sub_8153688)) if (FuncIsActiveTask(Task_LinkSave))
return 0; return 0;
break; break;
case 4: case 4:

File diff suppressed because it is too large Load Diff

View File

@ -4483,12 +4483,12 @@ static void sub_802A380(void)
case 2: case 2:
if (!IsDma3ManagerBusyWithBgCopy()) if (!IsDma3ManagerBusyWithBgCopy())
{ {
CreateTask(sub_8153688, 0); CreateTask(Task_LinkSave, 0);
gUnknown_02022CF8->state++; gUnknown_02022CF8->state++;
} }
break; break;
case 3: case 3:
if (!FuncIsActiveTask(sub_8153688)) if (!FuncIsActiveTask(Task_LinkSave))
gUnknown_02022CF8->state++; gUnknown_02022CF8->state++;
break; break;
default: default:

View File

@ -85,10 +85,10 @@ static u8 sub_81D4DE8(struct Unk03006370 *arg0)
return var0; return var0;
} }
static void sub_81D4E30(void) static void OpenEReaderLink(void)
{ {
memset(gDecompressionBuffer, 0, 0x2000); memset(gDecompressionBuffer, 0, 0x2000);
gLinkType = LINKTYPE_0x5503; gLinkType = LINKTYPE_EREADER;
OpenLink(); OpenLink();
SetSuppressLinkErrorMessage(TRUE); SetSuppressLinkErrorMessage(TRUE);
} }
@ -255,7 +255,7 @@ static void sub_81D5084(u8 taskId)
data->unk8 = 1; data->unk8 = 1;
break; break;
case 1: case 1:
sub_81D4E30(); OpenEReaderLink();
sub_81D505C(&data->unk0); sub_81D505C(&data->unk0);
data->unk8 = 2; data->unk8 = 2;
break; break;
@ -285,7 +285,7 @@ static void sub_81D5084(u8 taskId)
case 5: case 5:
if (sub_81D5064(&data->unk0, 90)) if (sub_81D5064(&data->unk0, 90))
{ {
sub_81D4E30(); OpenEReaderLink();
data->unk8 = 6; data->unk8 = 6;
} }
else if (gMain.newKeys & B_BUTTON) else if (gMain.newKeys & B_BUTTON)
@ -319,7 +319,7 @@ static void sub_81D5084(u8 taskId)
else if (sub_81D5064(&data->unk0, 10)) else if (sub_81D5064(&data->unk0, 10))
{ {
CloseLink(); CloseLink();
sub_81D4E30(); OpenEReaderLink();
sub_81D505C(&data->unk0); sub_81D505C(&data->unk0);
} }
break; break;
@ -360,7 +360,7 @@ static void sub_81D5084(u8 taskId)
data->unk8 = 12; data->unk8 = 12;
break; break;
case 12: case 12:
sub_81D4E30(); OpenEReaderLink();
AddTextPrinterToWindow1(gJPText_AllowEReaderToLoadCard); AddTextPrinterToWindow1(gJPText_AllowEReaderToLoadCard);
data->unk8 = 13; data->unk8 = 13;
break; break;

View File

@ -148,7 +148,7 @@ void sub_8098358(void)
sFieldMessageBoxMode = 0; sFieldMessageBoxMode = 0;
} }
void sub_8098374(void) void StopFieldMessage(void)
{ {
task_del_textbox(); task_del_textbox();
sFieldMessageBoxMode = 0; sFieldMessageBoxMode = 0;

View File

@ -162,7 +162,7 @@ static void Task_ReturnToFieldCableLink(u8 taskId)
switch (task->data[0]) switch (task->data[0])
{ {
case 0: case 0:
task->data[1] = sub_80B3050(); task->data[1] = CreateTask_ReestablishCableClubLink();
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:

View File

@ -282,7 +282,7 @@ void LinkTestScreen(void)
ResetTasks(); ResetTasks();
SetVBlankCallback(sub_80096BC); SetVBlankCallback(sub_80096BC);
ResetBlockSend(); ResetBlockSend();
gLinkType = LINKTYPE_0x1111; gLinkType = LINKTYPE_TRADE;
OpenLink(); OpenLink();
SeedRng(gMain.vblankCounter2); SeedRng(gMain.vblankCounter2);
for (i = 0; i < MAX_LINK_PLAYERS; i++) for (i = 0; i < MAX_LINK_PLAYERS; i++)
@ -826,23 +826,23 @@ void OpenLinkTimed(void)
OpenLink(); OpenLink();
} }
u8 GetLinkPlayerDataExchangeStatusTimed(int lower, int upper) u8 GetLinkPlayerDataExchangeStatusTimed(int minPlayers, int maxPlayers)
{ {
int i; int i;
int count; int count;
u32 index; u32 index;
u8 cmpVal; u8 numPlayers;
u32 linkType1; u32 linkType1;
u32 linkType2; u32 linkType2;
count = 0; count = 0;
if (gReceivedRemoteLinkPlayers == TRUE) if (gReceivedRemoteLinkPlayers == TRUE)
{ {
cmpVal = GetLinkPlayerCount_2(); numPlayers = GetLinkPlayerCount_2();
if (lower > cmpVal || cmpVal > upper) if (minPlayers > numPlayers || numPlayers > maxPlayers)
{ {
sPlayerDataExchangeStatus = EXCHANGE_STAT_6; sPlayerDataExchangeStatus = EXCHANGE_WRONG_NUM_PLAYERS;
return 6; return sPlayerDataExchangeStatus;
} }
else else
{ {
@ -860,7 +860,7 @@ u8 GetLinkPlayerDataExchangeStatusTimed(int lower, int upper)
} }
if (count == GetLinkPlayerCount()) if (count == GetLinkPlayerCount())
{ {
if (gLinkPlayers[0].linkType == 0x1133) if (gLinkPlayers[0].linkType == LINKTYPE_TRADE_SETUP)
{ {
switch (GetGameProgressForLinkTrade()) switch (GetGameProgressForLinkTrade())
{ {
@ -882,11 +882,14 @@ u8 GetLinkPlayerDataExchangeStatusTimed(int lower, int upper)
} }
else else
{ {
sPlayerDataExchangeStatus = EXCHANGE_IN_PROGRESS; sPlayerDataExchangeStatus = EXCHANGE_DIFF_SELECTIONS;
linkType1 = gLinkPlayers[GetMultiplayerId()].linkType; linkType1 = gLinkPlayers[GetMultiplayerId()].linkType;
linkType2 = gLinkPlayers[GetMultiplayerId() ^ 1].linkType; linkType2 = gLinkPlayers[GetMultiplayerId() ^ 1].linkType;
if ((linkType1 == 0x2266 && linkType2 == 0x2277) || (linkType1 == 0x2277 && linkType2 == 0x2266)) if ((linkType1 == LINKTYPE_BATTLE_TOWER_50 && linkType2 == LINKTYPE_BATTLE_TOWER_OPEN)
|| (linkType1 == LINKTYPE_BATTLE_TOWER_OPEN && linkType2 == LINKTYPE_BATTLE_TOWER_50))
{ {
// 3 below indicates partner made different level mode selection
// See BattleFrontier_BattleTowerLobby_EventScript_AbortLinkDifferentSelections
gSpecialVar_0x8005 = 3; gSpecialVar_0x8005 = 3;
} }
} }
@ -921,7 +924,7 @@ bool8 IsLinkPlayerDataExchangeComplete(void)
else else
{ {
retval = FALSE; retval = FALSE;
sPlayerDataExchangeStatus = EXCHANGE_IN_PROGRESS; sPlayerDataExchangeStatus = EXCHANGE_DIFF_SELECTIONS;
} }
return retval; return retval;
} }

View File

@ -2408,7 +2408,7 @@ void sub_8011AFC(void)
SetVBlankCallback(sub_8011AE8); SetVBlankCallback(sub_8011AE8);
if (IsWirelessAdapterConnected()) if (IsWirelessAdapterConnected())
{ {
gLinkType = LINKTYPE_0x1111; gLinkType = LINKTYPE_TRADE;
SetWirelessCommType1(); SetWirelessCommType1();
OpenLink(); OpenLink();
SeedRng(gMain.vblankCounter2); SeedRng(gMain.vblankCounter2);

View File

@ -569,7 +569,7 @@ bool32 MEventHandleReceivedWonderCard(u16 a0)
return TRUE; return TRUE;
} }
void sub_801B990(u32 a0, u32 a1) void RecordIdOfWonderCardSenderByEventType(u32 a0, u32 a1)
{ {
if (gUnknown_02022C70) if (gUnknown_02022C70)
{ {

View File

@ -152,7 +152,7 @@ static void CB2_MysteryEventMenu(void)
if (!IsTextPrinterActive(0)) if (!IsTextPrinterActive(0))
{ {
gMain.state++; gMain.state++;
gLinkType = LINKTYPE_0x5501; gLinkType = LINKTYPE_MYSTERY_EVENT;
OpenLink(); OpenLink();
} }
break; break;
@ -206,7 +206,7 @@ static void CB2_MysteryEventMenu(void)
{ {
if (gReceivedRemoteLinkPlayers != 0) if (gReceivedRemoteLinkPlayers != 0)
{ {
if (GetLinkPlayerDataExchangeStatusTimed(2, 2) == 3) if (GetLinkPlayerDataExchangeStatusTimed(2, 2) == EXCHANGE_DIFF_SELECTIONS)
{ {
sub_800AC34(); sub_800AC34();
GetEventLoadMessage(gStringVar4, 1); GetEventLoadMessage(gStringVar4, 1);

View File

@ -1148,12 +1148,12 @@ static bool32 sub_802B720(void)
case 2: case 2:
if (sub_802C70C()) if (sub_802C70C())
{ {
CreateTask(sub_8153688, 6); CreateTask(Task_LinkSave, 6);
gUnknown_02022CFC->unk8++; gUnknown_02022CFC->unk8++;
} }
break; break;
case 3: case 3:
if (!FuncIsActiveTask(sub_8153688)) if (!FuncIsActiveTask(Task_LinkSave))
{ {
sub_802DA14(); sub_802DA14();
gUnknown_02022CFC->unk8++; gUnknown_02022CFC->unk8++;

View File

@ -169,10 +169,9 @@ static const u8 gUnknown_0858CFBE[3][4] =
#define BUFFER_CHUNK_SIZE 200 #define BUFFER_CHUNK_SIZE 200
// Note: VAR_0x8005 contains the spotId.
void RecordMixingPlayerSpotTriggered(void) void RecordMixingPlayerSpotTriggered(void)
{ {
sub_80B37D4(Task_RecordMixing_Main); CreateTask_EnterCableClubSeat(Task_RecordMixing_Main);
} }
// these variables were const in R/S, but had to become changeable because of saveblocks changing RAM position // these variables were const in R/S, but had to become changeable because of saveblocks changing RAM position
@ -351,7 +350,7 @@ static void Task_RecordMixing_Main(u8 taskId)
{ {
tState = 4; tState = 4;
if (gWirelessCommType == 0) if (gWirelessCommType == 0)
data[10] = sub_80B3050(); data[10] = CreateTask_ReestablishCableClubLink();
PrintTextOnRecordMixing(gText_RecordMixingComplete); PrintTextOnRecordMixing(gText_RecordMixingComplete);
data[8] = 0; data[8] = 0;
@ -987,12 +986,12 @@ static void Task_DoRecordMixing(u8 taskId)
case 6: case 6:
if (!sub_801048C(FALSE)) if (!sub_801048C(FALSE))
{ {
CreateTask(sub_8153688, 5); CreateTask(Task_LinkSave, 5);
task->data[0] ++; task->data[0] ++;
} }
break; break;
case 7: // wait for sub_8153688 to finish. case 7: // wait for Task_LinkSave to finish.
if (!FuncIsActiveTask(sub_8153688)) if (!FuncIsActiveTask(Task_LinkSave))
{ {
if (gWirelessCommType) if (gWirelessCommType)
{ {

View File

@ -897,74 +897,78 @@ u32 TryWriteSpecialSaveSection(u8 sector, u8* src)
return SAVE_STATUS_OK; return SAVE_STATUS_OK;
} }
void sub_8153688(u8 taskId) #define tState data[0]
{ #define tTimer data[1]
s16* taskData = gTasks[taskId].data; #define tPartialSave data[2]
switch (taskData[0]) void Task_LinkSave(u8 taskId)
{
s16* data = gTasks[taskId].data;
switch (tState)
{ {
case 0: case 0:
gSoftResetDisabled = TRUE; gSoftResetDisabled = TRUE;
taskData[0] = 1; tState = 1;
break; break;
case 1: case 1:
sub_800ADF8(); sub_800ADF8();
taskData[0] = 2; tState = 2;
break; break;
case 2: case 2:
if (IsLinkTaskFinished()) if (IsLinkTaskFinished())
{ {
if (taskData[2] == 0) if (!tPartialSave)
save_serialize_map(); save_serialize_map();
taskData[0] = 3; tState = 3;
} }
break; break;
case 3: case 3:
if (taskData[2] == 0) if (!tPartialSave)
SetContinueGameWarpStatusToDynamicWarp(); SetContinueGameWarpStatusToDynamicWarp();
sub_8153380(); sub_8153380();
taskData[0] = 4; tState = 4;
break; break;
case 4: case 4:
if (++taskData[1] == 5) if (++tTimer == 5)
{ {
taskData[1] = 0; tTimer = 0;
taskData[0] = 5; tState = 5;
} }
break; break;
case 5: case 5:
if (sub_81533AC()) if (sub_81533AC())
taskData[0] = 6; tState = 6;
else else
taskData[0] = 4; tState = 4;
break; break;
case 6: case 6:
sub_81533E0(); sub_81533E0();
taskData[0] = 7; tState = 7;
break; break;
case 7: case 7:
if (taskData[2] == 0) if (!tPartialSave)
ClearContinueGameWarpStatus2(); ClearContinueGameWarpStatus2();
sub_800ADF8(); sub_800ADF8();
taskData[0] = 8; tState = 8;
break; break;
case 8: case 8:
if (IsLinkTaskFinished()) if (IsLinkTaskFinished())
{ {
sub_8153408(); sub_8153408();
taskData[0] = 9; tState = 9;
} }
break; break;
case 9: case 9:
sub_800ADF8(); sub_800ADF8();
taskData[0] = 10; tState = 10;
break; break;
case 10: case 10:
if (IsLinkTaskFinished()) if (IsLinkTaskFinished())
taskData[0]++; tState++;
break; break;
case 11: case 11:
if (++taskData[1] > 5) if (++tTimer > 5)
{ {
gSoftResetDisabled = FALSE; gSoftResetDisabled = FALSE;
DestroyTask(taskId); DestroyTask(taskId);
@ -972,3 +976,7 @@ void sub_8153688(u8 taskId)
break; break;
} }
} }
#undef tState
#undef tTimer
#undef tPartialSave

View File

@ -133,8 +133,8 @@ static u8 BattlePyramidRetireInputCallback(void);
// Task callbacks // Task callbacks
static void StartMenuTask(u8 taskId); static void StartMenuTask(u8 taskId);
static void SaveGameTask(u8 taskId); static void SaveGameTask(u8 taskId);
static void sub_80A0550(u8 taskId); static void Task_SaveAfterLinkBattle(u8 taskId);
static void sub_80A08A4(u8 taskId); static void Task_WaitForBattleTowerLinkSave(u8 taskId);
static bool8 FieldCB_ReturnToFieldStartMenu(void); static bool8 FieldCB_ReturnToFieldStartMenu(void);
static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8}; static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8};
@ -219,8 +219,8 @@ static bool8 SaveSuccesTimer(void);
static bool8 SaveErrorTimer(void); static bool8 SaveErrorTimer(void);
static void InitBattlePyramidRetire(void); static void InitBattlePyramidRetire(void);
static void sub_80A03D8(void); static void sub_80A03D8(void);
static bool32 sub_80A03E4(u8 *par1); static bool32 InitSaveWindowAfterLinkBattle(u8 *par1);
static void sub_80A0540(void); static void CB2_SaveAfterLinkBattle(void);
static void ShowSaveInfoWindow(void); static void ShowSaveInfoWindow(void);
static void RemoveSaveInfoWindow(void); static void RemoveSaveInfoWindow(void);
static void HideStartMenuWindow(void); static void HideStartMenuWindow(void);
@ -1159,9 +1159,9 @@ static void sub_80A03D8(void)
TransferPlttBuffer(); TransferPlttBuffer();
} }
static bool32 sub_80A03E4(u8 *par1) static bool32 InitSaveWindowAfterLinkBattle(u8 *state)
{ {
switch (*par1) switch (*state)
{ {
case 0: case 0:
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0);
@ -1193,43 +1193,43 @@ static bool32 sub_80A03E4(u8 *par1)
return TRUE; return TRUE;
} }
(*par1)++; (*state)++;
return FALSE; return FALSE;
} }
void sub_80A0514(void) void CB2_SetUpSaveAfterLinkBattle(void)
{ {
if (sub_80A03E4(&gMain.state)) if (InitSaveWindowAfterLinkBattle(&gMain.state))
{ {
CreateTask(sub_80A0550, 0x50); CreateTask(Task_SaveAfterLinkBattle, 0x50);
SetMainCallback2(sub_80A0540); SetMainCallback2(CB2_SaveAfterLinkBattle);
} }
} }
static void sub_80A0540(void) static void CB2_SaveAfterLinkBattle(void)
{ {
RunTasks(); RunTasks();
UpdatePaletteFade(); UpdatePaletteFade();
} }
static void sub_80A0550(u8 taskId) static void Task_SaveAfterLinkBattle(u8 taskId)
{ {
s16 *step = gTasks[taskId].data; s16 *state = gTasks[taskId].data;
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
switch (*step) switch (*state)
{ {
case 0: case 0:
FillWindowPixelBuffer(0, PIXEL_FILL(1)); FillWindowPixelBuffer(0, PIXEL_FILL(1));
AddTextPrinterParameterized2(0, AddTextPrinterParameterized2(0,
1, 1,
gText_SavingDontTurnOffPower, gText_SavingDontTurnOffPower,
255, TEXT_SPEED_FF,
NULL, NULL,
2, TEXT_COLOR_DARK_GREY,
1, TEXT_COLOR_WHITE,
3); TEXT_COLOR_LIGHT_GREY);
DrawTextBorderOuter(0, 8, 14); DrawTextBorderOuter(0, 8, 14);
PutWindowTilemap(0); PutWindowTilemap(0);
CopyWindowToVram(0, 3); CopyWindowToVram(0, 3);
@ -1239,35 +1239,35 @@ static void sub_80A0550(u8 taskId)
{ {
if (sub_800A07C()) if (sub_800A07C())
{ {
*step = 1; *state = 1;
} }
else else
{ {
*step = 5; *state = 5;
} }
} }
else else
{ {
gSoftResetDisabled = 1; gSoftResetDisabled = 1;
*step = 1; *state = 1;
} }
break; break;
case 1: case 1:
SetContinueGameWarpStatusToDynamicWarp(); SetContinueGameWarpStatusToDynamicWarp();
FullSaveGame(); FullSaveGame();
*step = 2; *state = 2;
break; break;
case 2: case 2:
if (CheckSaveFile()) if (CheckSaveFile())
{ {
ClearContinueGameWarpStatus2(); ClearContinueGameWarpStatus2();
*step = 3; *state = 3;
gSoftResetDisabled = 0; gSoftResetDisabled = 0;
} }
break; break;
case 3: case 3:
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
*step = 4; *state = 4;
break; break;
case 4: case 4:
FreeAllWindowBuffers(); FreeAllWindowBuffers();
@ -1275,13 +1275,13 @@ static void sub_80A0550(u8 taskId)
DestroyTask(taskId); DestroyTask(taskId);
break; break;
case 5: case 5:
CreateTask(sub_8153688, 0x5); CreateTask(Task_LinkSave, 5);
*step = 6; *state = 6;
break; break;
case 6: case 6:
if (!FuncIsActiveTask(sub_8153688)) if (!FuncIsActiveTask(Task_LinkSave))
{ {
*step = 3; *state = 3;
} }
break; break;
} }
@ -1357,22 +1357,26 @@ static void RemoveSaveInfoWindow(void)
RemoveWindow(sSaveInfoWindowId); RemoveWindow(sSaveInfoWindowId);
} }
static void sub_80A08A4(u8 taskId) static void Task_WaitForBattleTowerLinkSave(u8 taskId)
{ {
if (!FuncIsActiveTask(sub_8153688)) if (!FuncIsActiveTask(Task_LinkSave))
{ {
DestroyTask(taskId); DestroyTask(taskId);
EnableBothScriptContexts(); EnableBothScriptContexts();
} }
} }
void sub_80A08CC(void) #define tPartialSave data[2]
void SaveForBattleTowerLink(void)
{ {
u8 taskId = CreateTask(sub_8153688, 0x5); u8 taskId = CreateTask(Task_LinkSave, 5);
gTasks[taskId].data[2] = 1; gTasks[taskId].tPartialSave = TRUE;
gTasks[CreateTask(sub_80A08A4, 0x6)].data[1] = taskId; gTasks[CreateTask(Task_WaitForBattleTowerLinkSave, 6)].data[1] = taskId;
} }
#undef tPartialSave
static void HideStartMenuWindow(void) static void HideStartMenuWindow(void)
{ {
ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE); ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE);

View File

@ -1492,7 +1492,7 @@ const u8 gText_FrameTypeNumber[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}");
const u8 gText_ButtonTypeNormal[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}NORMAL"); const u8 gText_ButtonTypeNormal[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}NORMAL");
const u8 gText_ButtonTypeLR[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}LR"); const u8 gText_ButtonTypeLR[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}LR");
const u8 gText_ButtonTypeLEqualsA[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}L=A"); const u8 gText_ButtonTypeLEqualsA[] = _("{COLOR GREEN}{SHADOW LIGHT_GREEN}L=A");
const u8 gText_XPLink[] = _("{STR_VAR_1}P LINK"); const u8 gText_NumPlayerLink[] = _("{STR_VAR_1}P LINK");
const u8 gText_BronzeCard[] = _("BRONZE"); const u8 gText_BronzeCard[] = _("BRONZE");
const u8 gText_CopperCard[] = _("COPPER"); const u8 gText_CopperCard[] = _("COPPER");
const u8 gText_SilverCard[] = _("SILVER"); const u8 gText_SilverCard[] = _("SILVER");

View File

@ -389,7 +389,7 @@ static void CB2_CreateTradeMenu(void)
if (!gReceivedRemoteLinkPlayers) if (!gReceivedRemoteLinkPlayers)
{ {
gLinkType = LINKTYPE_0x1122; gLinkType = LINKTYPE_TRADE_CONNECTING;
sTradeMenuData->timer = 0; sTradeMenuData->timer = 0;
if (gWirelessCommType) if (gWirelessCommType)
@ -402,7 +402,7 @@ static void CB2_CreateTradeMenu(void)
{ {
OpenLink(); OpenLink();
gMain.state++; gMain.state++;
CreateTask(task00_08081A90, 1); CreateTask(Task_WaitForLinkPlayerConnection, 1);
} }
} }
else else
@ -2750,7 +2750,7 @@ void CB2_LinkTrade(void)
case 0: case 0:
if (!gReceivedRemoteLinkPlayers) if (!gReceivedRemoteLinkPlayers)
{ {
gLinkType = LINKTYPE_0x1144; gLinkType = LINKTYPE_TRADE_DISCONNECTED;
CloseLink(); CloseLink();
} }
sTradeData = AllocZeroed(sizeof(*sTradeData)); sTradeData = AllocZeroed(sizeof(*sTradeData));
@ -4597,7 +4597,7 @@ static void CB2_SaveAndEndTrade(void)
IncrementGameStat(GAME_STAT_POKEMON_TRADES); IncrementGameStat(GAME_STAT_POKEMON_TRADES);
if (gWirelessCommType) if (gWirelessCommType)
{ {
sub_801B990(2, gLinkPlayers[GetMultiplayerId() ^ 1].trainerId); RecordIdOfWonderCardSenderByEventType(2, gLinkPlayers[GetMultiplayerId() ^ 1].trainerId);
} }
SetContinueGameWarpStatusToDynamicWarp(); SetContinueGameWarpStatusToDynamicWarp();
sub_8153380(); sub_8153380();

View File

@ -1298,15 +1298,15 @@ static u8 GetNewLeaderCandidate(void)
return ret; return ret;
} }
static void Task_ReturnFromLinkTrade(u8 taskId) static void Task_CreateTradeMenu(u8 taskId)
{ {
CB2_StartCreateTradeMenu(); CB2_StartCreateTradeMenu();
DestroyTask(taskId); DestroyTask(taskId);
} }
u8 CreateTask_ReturnFromLinkTrade(void) u8 CreateTask_CreateTradeMenu(void)
{ {
u8 taskId = CreateTask(Task_ReturnFromLinkTrade, 0); u8 taskId = CreateTask(Task_CreateTradeMenu, 0);
return taskId; return taskId;
} }
@ -1589,7 +1589,7 @@ static void Task_RunScriptAndFadeToActivity(u8 taskId)
switch (data[0]) switch (data[0])
{ {
case 0: case 0:
gSpecialVar_Result = 1; gSpecialVar_Result = LINKUP_SUCCESS;
switch (gPlayerCurrActivity) switch (gPlayerCurrActivity)
{ {
case ACTIVITY_BATTLE_TOWER: case ACTIVITY_BATTLE_TOWER:
@ -1655,9 +1655,9 @@ static void Task_RunScriptAndFadeToActivity(u8 taskId)
if (GetBlockReceivedStatus() == 3) if (GetBlockReceivedStatus() == 3)
{ {
ResetBlockReceivedFlags(); ResetBlockReceivedFlags();
if (sub_80B2AF4(gBlockRecvBuffer[0], gBlockRecvBuffer[1])) if (AreBattleTowerLinkSpeciesSame(gBlockRecvBuffer[0], gBlockRecvBuffer[1]))
{ {
gSpecialVar_Result = 11; gSpecialVar_Result = LINKUP_FAILED_BATTLE_TOWER;
data[0] = 7; data[0] = 7;
} }
else else