Name remaining funcs in union_room.c

This commit is contained in:
PikalaxALT
2020-02-06 10:44:22 -05:00
parent 6af7391add
commit 78caeff45b
26 changed files with 428 additions and 401 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ void sub_815A5BC(s32 a0)
struct Padded_U8 data[2];
data[0].value = 1;
data[1].value = a0;
sub_80F9E2C(data);
RfuPrepareSend0x2f00(data);
}
u8 sub_815A5E8(s32 a0)
+1 -1
View File
@@ -93,7 +93,7 @@ void sub_80696C0(void)
UnfreezeObjectEvents();
}
void sub_80696F0(void)
void UnionRoom_UnlockPlayerAndChatPartner(void)
{
u8 objectEventId;
if (gObjectEvents[gSelectedObjectEvent].active)
+1 -1
View File
@@ -309,7 +309,7 @@ static void MoveRelearnerLoadBgGfx(void)
FillBgTilemapBufferRect(0, 0x000, 0, 0, 30, 20, 0xF);
SetBgTilemapBuffer(1, sMoveRelearner->bg1TilemapBuffer);
TextWindow_SetUserSelectedFrame(0, 1, 0xE0);
sub_8107D38(0xD0, 1);
ListMenuLoadStdPalAt(0xD0, 1);
LoadPalette(gUnknown_8E97DDC, 0x00, 0x20);
DecompressAndLoadBgGfxUsingHeap(1, gUnknown_8E97DFC, 0, 0, 0);
CopyToBgTilemapBuffer(1, gUnknown_8E97EC4, 0, 0);
+39 -39
View File
@@ -398,7 +398,7 @@ static void sub_80F8AEC(void)
static void sub_80F8B34(u8 taskId)
{
if (GetHostRFUtgtGname()->activity == (0x14 | IN_UNION_ROOM) && RfuGetErrorStatus() == 4)
if (GetHostRFUtgtGname()->activity == (ACTIVITY_PLYRTALK | IN_UNION_ROOM) && RfuGetErrorStatus() == 4)
{
rfu_REQ_disconnect(lman.acceptSlot_flag);
rfu_waitREQComplete();
@@ -444,7 +444,7 @@ static void sub_80F8B34(u8 taskId)
case 16:
Rfu.unk_cdb = 0;
rfu_LMAN_setMSCCallback(sub_80F8DA8);
sub_80FAFE0(1);
UpdateGameData_GroupLockedIn(1);
sub_80F8AA4();
sub_80F8AEC();
Rfu.state = 20;
@@ -542,7 +542,7 @@ static void CreateTask_LinkLeaderSearchForChildren(void)
Rfu.unk_67 = CreateTask(Task_LinkLeaderSearchForChildren, 1);
}
static bool8 sub_80F8EA4(void)
static bool8 RfuStateIs7AndPlayerIsChild(void)
{
if (Rfu.state == 7 && Rfu.parentId)
{
@@ -551,7 +551,7 @@ static bool8 sub_80F8EA4(void)
return FALSE;
}
static bool32 sub_80F8ECC(void)
static bool32 IsParentSuccessfullyReconnected(void)
{
if (Rfu.state == 7 && !rfu_LMAN_CHILD_connectParent(gRfuLinkStatus->partner[Rfu.unk_c3d].id, 240))
{
@@ -568,7 +568,7 @@ static void CreateTask_JoinGroupSearchForParent(void)
Rfu.unk_67 = CreateTask(Task_JoinGroupSearchForParent, 1);
}
bool8 sub_80F8F40(void)
bool8 LmanAcceptSlotFlagIsNotZero(void)
{
if (lman.acceptSlot_flag)
{
@@ -580,12 +580,12 @@ bool8 sub_80F8F40(void)
void sub_80F8F5C(void)
{
Rfu.state = 4;
Rfu.unk_ce7 = lman.acceptSlot_flag;
Rfu.acceptSlot_flag = lman.acceptSlot_flag;
}
bool32 sub_80F8F7C(bool32 a0)
bool32 WaitRfuState(bool32 force)
{
if (Rfu.state == 17 || a0)
if (Rfu.state == 17 || force)
{
Rfu.state = 18;
return TRUE;
@@ -1175,7 +1175,7 @@ static void RfuPrepareSendBuffer(u16 command)
}
}
void sub_80F9E2C(void * data)
void RfuPrepareSend0x2f00(void * data)
{
if (gSendCmd[0] == 0 && !RfuIsErrorStatus1or2())
{
@@ -1544,7 +1544,7 @@ bool32 sub_80FA5D4(void)
return FALSE;
}
bool32 sub_80FA634(u16 trainerId, const u8 *trainerName)
bool32 TrainerIdAndNameStillInPartnersList(u16 trainerId, const u8 *trainerName)
{
u8 r1 = GetPartnerIndexByNameAndTrainerID(trainerName, trainerId);
if (r1 == 0xFF)
@@ -1554,27 +1554,27 @@ bool32 sub_80FA634(u16 trainerId, const u8 *trainerName)
return FALSE;
}
void sub_80FA670(u8 a0, u16 a1, const u8 *a2)
void SendByteToPartnerByIdAndName(u8 value, u16 trainerId, const u8 *trainerName)
{
u8 r4 = GetPartnerIndexByNameAndTrainerID(a2, a1);
Rfu.unk_cd1[r4] = a0;
rfu_clearSlot(TYPE_NI_SEND, r4);
rfu_NI_setSendData(1 << r4, 8, Rfu.unk_cd1 + r4, 1);
u8 slotNo = GetPartnerIndexByNameAndTrainerID(trainerName, trainerId);
Rfu.unk_cd1[slotNo] = value;
rfu_clearSlot(TYPE_NI_SEND, slotNo);
rfu_NI_setSendData(1 << slotNo, 8, Rfu.unk_cd1 + slotNo, 1);
}
void sub_80FA6BC(void)
void LinkRfuNIsend8(void)
{
Rfu.unk_c85 = 8;
rfu_clearSlot(TYPE_NI_SEND, Rfu.child_slot);
rfu_NI_setSendData(1 << Rfu.child_slot, 8, &Rfu.unk_c85, 1);
}
u32 sub_80FA6FC(u16 trainerId, const u8 *trainerName)
u32 WaitSendByteToPartnerByIdAndName(u16 trainerId, const u8 *trainerName)
{
u8 r0 = GetPartnerIndexByNameAndTrainerID(trainerName, trainerId);
if (r0 == 0xFF)
return 2;
if (gRfuSlotStatusNI[r0]->send.state == 0)
if (gRfuSlotStatusNI[r0]->send.state == SLOT_STATE_READY)
return 1;
return 0;
}
@@ -1917,12 +1917,12 @@ static void CopyPlayerNameToUnameBuffer(void)
void ClearAndInitHostRFUtgtGname(void)
{
memset(&gHostRFUtgtGnameBuffer, 0, RFU_GAME_NAME_LENGTH);
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, 0, 0, 0);
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, 0, FALSE, 0);
}
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, u32 a2)
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, u32 started)
{
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, activity, a2, child_sprite_genders);
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, activity, started, child_sprite_genders);
}
void SetGnameBufferWonderFlags(bool32 hasNews, bool32 hasCard)
@@ -1938,16 +1938,16 @@ void RfuUpdatePlayerGnameStateAndSend(u32 type, u32 species, u32 level)
gHostRFUtgtGnameBuffer.level = level;
}
void sub_80FAFE0(bool8 unk_0a_7)
void UpdateGameData_GroupLockedIn(bool8 started)
{
gHostRFUtgtGnameBuffer.unk_0a_7 = unk_0a_7;
gHostRFUtgtGnameBuffer.started = started;
rfu_REQ_configGameData(0, 0x0002, (void *)&gHostRFUtgtGnameBuffer, gHostRFUtgtUnameBuffer);
}
void sub_80FB008(u8 activity, u32 child_sprite_genders, u32 a2)
void UpdateGameDataWithActivitySpriteGendersFlag(u8 activity, u32 child_sprite_genders, u32 started)
{
if (activity)
SetHostRFUtgtGname(activity, child_sprite_genders, a2);
SetHostRFUtgtGname(activity, child_sprite_genders, started);
rfu_REQ_configGameData(0, 0x0002, (void *)&gHostRFUtgtGnameBuffer, gHostRFUtgtUnameBuffer);
}
@@ -1976,7 +1976,7 @@ void sub_80FB030(u32 linkPlayerCount)
break;
}
}
sub_80FB008(ACTIVITY_CHAT | IN_UNION_ROOM, child_sprite_genders, 0);
UpdateGameDataWithActivitySpriteGendersFlag(ACTIVITY_CHAT | IN_UNION_ROOM, child_sprite_genders, 0);
}
}
@@ -2056,12 +2056,12 @@ static void LmanCallback_Parent2(u8 msg, u8 param_count)
case LMAN_MSG_SEARCH_CHILD_PERIOD_EXPIRED:
break;
case LMAN_MSG_END_WAIT_CHILD_NAME:
if (Rfu.unk_ce7 != lman.acceptSlot_flag)
if (Rfu.acceptSlot_flag != lman.acceptSlot_flag)
{
rfu_REQ_disconnect(Rfu.unk_ce7 ^ lman.acceptSlot_flag);
rfu_REQ_disconnect(Rfu.acceptSlot_flag ^ lman.acceptSlot_flag);
rfu_waitREQComplete();
}
Rfu.state = 0x11;
Rfu.state = 17;
break;
case LMAN_MSG_LINK_LOSS_DETECTED_AND_START_RECOVERY:
Rfu.linkLossRecoveryState = 1;
@@ -2216,7 +2216,7 @@ static void LmanCallback_Parent(u8 msg, u8 param_count)
switch (msg)
{
case LMAN_MSG_INITIALIZE_COMPLETED:
Rfu.state = 0x11;
Rfu.state = 17;
break;
case LMAN_MSG_NEW_CHILD_CONNECT_DETECTED:
RfuSetErrorStatus(4, 0);
@@ -2245,7 +2245,7 @@ static void LmanCallback_Parent(u8 msg, u8 param_count)
Rfu.unk_ce4 = 2;
}
}
else if (GetHostRFUtgtGname()->activity == (0x40 | 20))
else if (GetHostRFUtgtGname()->activity == (ACTIVITY_PLYRTALK | IN_UNION_ROOM))
{
rfu_REQ_disconnect(lman.acceptSlot_flag);
rfu_waitREQComplete();
@@ -2264,7 +2264,7 @@ static void LmanCallback_Parent(u8 msg, u8 param_count)
rfu_waitREQComplete();
}
if (Rfu.state == 0xF)
Rfu.state = 0x10;
Rfu.state = 16;
break;
case LMAN_MSG_PARENT_FOUND:
Rfu.parentId = lman.param[0];
@@ -2275,7 +2275,7 @@ static void LmanCallback_Parent(u8 msg, u8 param_count)
Rfu.child_slot = lman.param[0];
break;
case LMAN_MSG_CONNECT_PARENT_FAILED:
Rfu.state = 0x12;
Rfu.state = 18;
if (Rfu.unk_ccf < 2)
{
Rfu.unk_ccf++;
@@ -2287,7 +2287,7 @@ static void LmanCallback_Parent(u8 msg, u8 param_count)
}
break;
case LMAN_MSG_CHILD_NAME_SEND_COMPLETED:
Rfu.state = 0xD;
Rfu.state = 13;
RfuSetErrorStatus(3, 0);
rfu_setRecvBuffer(TYPE_UNI, Rfu.child_slot, Rfu.unk_c3f, sizeof(Rfu.unk_c3f));
break;
@@ -2534,7 +2534,7 @@ static void RfuReqDisconnectSlot(u32 bmDisconnectSlot)
Rfu.unk_cda = sub_80F886C(Rfu.bm_PartnerFlags);
}
void sub_80FBD4C(const u8 *trainerName, u16 trainerId)
void RequestDisconnectSlotByTrainerNameAndId(const u8 *trainerName, u16 trainerId)
{
u8 var = GetPartnerIndexByNameAndTrainerID(trainerName, trainerId);
if (var != 0xFF)
@@ -2591,7 +2591,7 @@ static void sub_80FBE80(u8 taskId)
{
s16 *data = gTasks[taskId].data;
if (sub_80F8EA4())
if (RfuStateIs7AndPlayerIsChild())
{
u8 id = GetPartnerIndexByNameAndTrainerID((u8*)data, ReadU16(&data[8]));
if (id != 0xFF)
@@ -2599,7 +2599,7 @@ static void sub_80FBE80(u8 taskId)
if (gRfuLinkStatus->partner[id].slot != 0xFF)
{
Rfu.unk_c3d = id;
if (sub_80F8ECC())
if (IsParentSuccessfullyReconnected())
DestroyTask(taskId);
}
else if (GetHostRFUtgtGname()->activity == ACTIVITY_WCARD2 || GetHostRFUtgtGname()->activity == ACTIVITY_WNEWS2)
@@ -2630,7 +2630,7 @@ static void sub_80FBE80(u8 taskId)
}
}
void sub_80FBF54(const u8 *src, u16 trainerId)
void CreateTask_sub_80FBE80(const u8 *trainerName, u16 trainerId)
{
u8 taskId;
s16 *data;
@@ -2638,7 +2638,7 @@ void sub_80FBF54(const u8 *src, u16 trainerId)
Rfu.unk_f1 = 0;
taskId = CreateTask(sub_80FBE80, 3);
data = gTasks[taskId].data;
StringCopy((u8*)(data), src);
StringCopy((u8*)(data), trainerName);
data[8] = trainerId;
}
+2 -2
View File
@@ -603,7 +603,7 @@ static u8 GetConnectedChildStrength(u8 maxFlags)
}
#endif
void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 r2, s32 child_sprite_genders)
void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 started, s32 child_sprite_genders)
{
s32 i;
@@ -618,7 +618,7 @@ void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 r2, s32 ch
}
data->playerGender = gSaveBlock2Ptr->playerGender;
data->activity = activity;
data->unk_0a_7 = r2;
data->started = started;
data->unk_00.language = GAME_LANGUAGE;
data->unk_00.version = GAME_VERSION;
data->unk_00.hasNews = FALSE;
+1 -1
View File
@@ -763,7 +763,7 @@ void sub_8107CF8(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality, 1), x, y, 32, 32);
}
void sub_8107D38(u8 palOffset, u8 palId)
void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
{
const u16 *palette;
+5 -5
View File
@@ -952,7 +952,7 @@ void ResetReceivedWonderCardFlag(void)
sReceivedWonderCardIsValid = FALSE;
}
bool32 sub_81446D0(u16 cardId)
bool32 MEventHandleReceivedWonderCard(u16 cardId)
{
sReceivedWonderCardIsValid = FALSE;
if (cardId == 0)
@@ -965,19 +965,19 @@ bool32 sub_81446D0(u16 cardId)
return TRUE;
}
void sub_8144714(u32 eventId, u32 trainerId)
void MEvent_RecordIdOfWonderCardSenderByEventType(u32 eventId, u32 trainerId)
{
if (sReceivedWonderCardIsValid)
{
switch (eventId)
{
case 2:
case 2: // trade
RecordIdOfWonderCardSender(2, trainerId, gSaveBlock1Ptr->mysteryEventBuffers.unk_344[1], 5);
break;
case 0:
case 0: // link win
RecordIdOfWonderCardSender(0, trainerId, gSaveBlock1Ptr->mysteryEventBuffers.unk_344[0], 5);
break;
case 1:
case 1: // link loss
RecordIdOfWonderCardSender(1, trainerId, gSaveBlock1Ptr->mysteryEventBuffers.unk_344[0], 5);
break;
default:
+4 -4
View File
@@ -562,8 +562,8 @@ void sub_8102F80(u8 taskId)
switch (gUnknown_203ACF0->field_01)
{
case 0:
sub_8107D38(0x10, 0);
sub_8107D38(0x20, 1);
ListMenuLoadStdPalAt(0x10, 0);
ListMenuLoadStdPalAt(0x20, 1);
gUnknown_203ACF0->field_48 = sub_8103518(gUnknown_203ACF0->field_42);
gUnknown_203ACF0->field_01 = 2;
break;
@@ -648,8 +648,8 @@ void sub_8103238(u8 taskId)
switch (gUnknown_203ACF0->field_01)
{
case 0:
sub_8107D38(0x10, 0);
sub_8107D38(0x20, 1);
ListMenuLoadStdPalAt(0x10, 0);
ListMenuLoadStdPalAt(0x20, 1);
gUnknown_203ACF0->field_48 = sub_8103518(gUnknown_203ACF0->field_42);
gUnknown_203ACF0->field_01 = 2;
break;
+1 -1
View File
@@ -1304,7 +1304,7 @@ static void InitWindowTemplatesAndPals(void)
LoadPalette(gTMCaseMainWindowPalette, 0xA0, 0x20);
LoadPalette(sPal3Override, 0xF6, 0x04);
LoadPalette(sPal3Override, 0xD6, 0x04);
sub_8107D38(0xc0, 0x01);
ListMenuLoadStdPalAt(0xc0, 0x01);
for (i = 0; i < 9; i++)
FillWindowPixelBuffer(i, 0x00);
PutWindowTilemap(0);
+1 -1
View File
@@ -2594,7 +2594,7 @@ static void sub_8053E8C(void)
}
if (gWirelessCommType)
{
sub_8144714(2, gLinkPlayers[GetMultiplayerId() ^ 1].trainerId);
MEvent_RecordIdOfWonderCardSenderByEventType(2, gLinkPlayers[GetMultiplayerId() ^ 1].trainerId);
}
SetContinueGameWarpStatusToDynamicWarp();
sub_80DA3AC();
+322 -296
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -47,7 +47,7 @@ static const u8 gUnknown_84571A8[] = {1, 2, 3};
static void SetUpPartiesAndStartBattle(void)
{
s32 i;
sub_81173C0(BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER);
StartUnionRoomBattle(BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER);
for (i = 0; i < 2; i++)
{
gEnemyParty[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1];
+1 -1
View File
@@ -5,7 +5,7 @@
ALIGNED(4) const u8 gUnionRoomActivity_Blank[] = _("");
ALIGNED(4) const u8 gUnknown_84571B0[] = _(":");
ALIGNED(4) const u8 gUnknown_84571B4[] = _("{EXTRA 7}");
ALIGNED(4) const u8 gUnknown_84571B4[] = _("{ID}");
ALIGNED(4) const u8 gUnknown_84571B8[] = _("Please start over from the beginning.");
ALIGNED(4) const u8 gUnknown_84571E0[] = _("The WIRELESS COMMUNICATION\nSYSTEM search has been canceled.");
ALIGNED(4) const u8 gUnref_845721C[] = _("ともだちからの れんらくを\nまっています");