Sync link_rfu_2
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
gHostRFUtgtGnameBuffer
|
||||
gHostRfuGameData
|
||||
Rfu
|
||||
gHostRFUtgtUnameBuffer
|
||||
gHostRfuUsername
|
||||
|
||||
+14
-14
@@ -57,7 +57,7 @@
|
||||
#define RFU_RECV_FINISHED 2
|
||||
|
||||
// RfuTgtData.gname is read as these structs.
|
||||
struct GFtgtGnameSub
|
||||
struct RfuGameCompatibilityData
|
||||
{
|
||||
u16 language:4;
|
||||
u16 hasNews:1;
|
||||
@@ -71,9 +71,9 @@ struct GFtgtGnameSub
|
||||
u8 playerTrainerId[2];
|
||||
};
|
||||
|
||||
struct __attribute__((packed, aligned(2))) GFtgtGname
|
||||
struct __attribute__((packed, aligned(2))) RfuGameData
|
||||
{
|
||||
struct GFtgtGnameSub unk_00;
|
||||
struct RfuGameCompatibilityData unk_00;
|
||||
u8 child_sprite_gender[RFU_CHILD_MAX]; // u8 sprite_idx:3;
|
||||
// u8 gender:1;
|
||||
// u8 unk_4:3
|
||||
@@ -139,7 +139,7 @@ struct RfuUnusedQueue
|
||||
/* 0x203 */ vu8 full;
|
||||
};
|
||||
|
||||
typedef struct UnkRfuStruct_2
|
||||
struct RfuManager
|
||||
{
|
||||
/* 0x000 */ void (*RfuFunc)(void);
|
||||
/* 0x004 */ u16 state;
|
||||
@@ -204,11 +204,11 @@ typedef struct UnkRfuStruct_2
|
||||
/* 0x9a1 */ u8 unk_ce9;
|
||||
/* 0x9a2 */ u8 unk_cea[RFU_CHILD_MAX];
|
||||
/* 0x9a6 */ u8 unk_cee[RFU_CHILD_MAX];
|
||||
} GF_RFU_MANAGER; // size: 0x9AC
|
||||
}; // size: 0x9AC
|
||||
|
||||
extern struct GFtgtGname gHostRFUtgtGnameBuffer;
|
||||
extern u8 gHostRFUtgtUnameBuffer[];
|
||||
extern GF_RFU_MANAGER Rfu;
|
||||
extern struct RfuGameData gHostRfuGameData;
|
||||
extern u8 gHostRfuUsername[];
|
||||
extern struct RfuManager Rfu;
|
||||
|
||||
// GameFreak signatures
|
||||
void AddTextPrinterToWindow1(const u8 *str);
|
||||
@@ -246,7 +246,7 @@ void LinkRfu_Shutdown(void);
|
||||
void LinkRfu_CreateIdleTask(void);
|
||||
bool8 ToggleLMANlinkRecovery(bool32 enable);
|
||||
void var_800D_set_xB(void);
|
||||
struct GFtgtGname *GetHostRFUtgtGname(void);
|
||||
struct RfuGameData *GetHostRFUtgtGname(void);
|
||||
void UpdateWirelessStatusIndicatorSprite(void);
|
||||
void InitRFU(void);
|
||||
bool32 RfuHasErrored(void);
|
||||
@@ -262,7 +262,7 @@ bool8 RfuBackupQueue_Dequeue(struct RfuBackupQueue *queue, u8 *dest);
|
||||
void RfuBackupQueue_Enqueue(struct RfuBackupQueue *queue, const u8 *dest);
|
||||
bool8 RfuRecvQueue_Dequeue(struct RfuRecvQueue * queue, u8 *dest);
|
||||
void RfuSendQueue_Enqueue(struct RfuSendQueue * queue, u8 *src);
|
||||
void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 started, s32 child_sprite_genders);
|
||||
void InitHostRFUtgtGname(struct RfuGameData *data, u8 activity, bool32 started, s32 child_sprite_genders);
|
||||
void UpdateGameData_GroupLockedIn(bool8 started);
|
||||
bool32 IsRfuSerialNumberValid(u32 serialNo);
|
||||
bool8 IsRfuRecoveringFromLinkLoss(void);
|
||||
@@ -277,7 +277,7 @@ u32 WaitSendByteToPartnerByIdAndName(u16 a0, const u8 *a1);
|
||||
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, u32 a2);
|
||||
void InitializeRfuLinkManager_LinkLeader(u32 availSlots);
|
||||
void RequestDisconnectSlotByTrainerNameAndId(const u8 *trainerName, u16 trainerId);
|
||||
void LinkRfu3_SetGnameUnameFromStaticBuffers(struct GFtgtGname *gname, u8 *uname);
|
||||
void LinkRfu3_SetGnameUnameFromStaticBuffers(struct RfuGameData *gname, u8 *uname);
|
||||
void InitializeRfuLinkManager_JoinGroup(void);
|
||||
void SendLeaveGroupNotice(void);
|
||||
void CreateTask_RfuReconnectWithParent(const u8 *src, u16 trainerId);
|
||||
@@ -292,10 +292,10 @@ void RfuUpdatePlayerGnameStateAndSend(u32 type, u32 species, u32 level);
|
||||
bool32 IsUnionRoomListenTaskActive(void);
|
||||
void InitializeRfuLinkManager_EnterUnionRoom(void);
|
||||
void sub_80FBD6C(u32 a0);
|
||||
void sub_80FC114(const u8 *name, struct GFtgtGname *structPtr, u8 a2);
|
||||
void sub_80FC114(const u8 *name, struct RfuGameData *structPtr, u8 a2);
|
||||
bool32 PlayerHasMetTrainerBefore(u16 id, u8 *name);
|
||||
bool8 LinkRfu_GetNameIfCompatible(struct GFtgtGname *gname, u8 *uname, u8 idx);
|
||||
bool8 LinkRfu_GetNameIfSerial7F7D(struct GFtgtGname *gname, u8 *uname, u8 idx);
|
||||
bool8 LinkRfu_GetNameIfCompatible(struct RfuGameData *gname, u8 *uname, u8 idx);
|
||||
bool8 LinkRfu_GetNameIfSerial7F7D(struct RfuGameData *gname, u8 *uname, u8 idx);
|
||||
bool32 RfuHasFoundNewLeader(void);
|
||||
void Rfu_UnionRoomChat_StopLinkManager(void);
|
||||
void sub_80FB9D0(void);
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ extern const u8 gText_GenderlessSymbol[];
|
||||
extern const u16 gTradeOrHatchMonShadowTilemap[];
|
||||
void CB2_ReturnFromLinkTrade(void);
|
||||
s32 Trade_CalcLinkPlayerCompatibilityParam(void);
|
||||
s32 CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isEventLegal);
|
||||
s32 GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal);
|
||||
s32 CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData rfuPlayer, u16 species2, u16 species, u8 isEventLegal);
|
||||
s32 GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData rfuPlayer, struct RfuGameCompatibilityData rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal);
|
||||
void CB2_ReturnToTradeMenuFromSummary(void);
|
||||
|
||||
#endif //GUARD_TRADE_H
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
struct UnionGnameUnamePair
|
||||
{
|
||||
struct GFtgtGname gname;
|
||||
struct RfuGameData gname;
|
||||
u8 ALIGNED(4) uname[PLAYER_NAME_LENGTH + 1];
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ struct UnionRoomTrade
|
||||
u32 personality;
|
||||
};
|
||||
|
||||
extern struct GFtgtGnameSub gPartnerTgtGnameSub;
|
||||
extern struct RfuGameCompatibilityData gPartnerTgtGnameSub;
|
||||
extern u16 gUnionRoomOfferedSpecies;
|
||||
extern u8 gUnionRoomRequestedMonType;
|
||||
|
||||
|
||||
+51
-51
@@ -13,37 +13,37 @@
|
||||
|
||||
struct SioInfo
|
||||
{
|
||||
char magic[15]; // PokemonSioInfo
|
||||
char magic[sizeof("PokemonSioInfo")];
|
||||
u8 playerCount;
|
||||
u8 linkPlayerIdx[RFU_CHILD_MAX];
|
||||
struct LinkPlayer linkPlayers[MAX_RFU_PLAYERS];
|
||||
u8 fill_a0[0x5c];
|
||||
u8 filler[92];
|
||||
};
|
||||
|
||||
struct RfuDebug
|
||||
{
|
||||
u8 fill_00[6];
|
||||
u16 unk_06;
|
||||
u8 fill_08[6];
|
||||
vu8 unk_0e;
|
||||
u8 unk_0f;
|
||||
u8 fill_10[0x54];
|
||||
u16 unk_64;
|
||||
u8 fill_66[0x1d];
|
||||
u8 unk_83;
|
||||
u8 fill_84[0x58];
|
||||
u8 unused0[6];
|
||||
u16 recvCount;
|
||||
u8 unused1[6];
|
||||
vu8 unkFlag;
|
||||
bool8 childJoined;
|
||||
u8 unused2[84];
|
||||
u16 blockSendFailures;
|
||||
u8 unused3[29];
|
||||
u8 blockSendTime;
|
||||
u8 unused4[88];
|
||||
};
|
||||
|
||||
static EWRAM_DATA INIT_PARAM sRfuReqConfig = {};
|
||||
static EWRAM_DATA struct RfuDebug sRfuDebug = {};
|
||||
|
||||
static u32 gf_rfu_REQ_api[RFU_API_BUFF_SIZE_RAM / 4];
|
||||
static u8 sResendBlock8[14];
|
||||
static u16 sResendBlock16[7];
|
||||
static u32 sRfuAPIBuffer[RFU_API_BUFF_SIZE_RAM / 4];
|
||||
static u8 sResendBlock8[CMD_LENGTH * 2];
|
||||
static u16 sResendBlock16[CMD_LENGTH];
|
||||
|
||||
struct GFtgtGname gHostRFUtgtGnameBuffer;
|
||||
GF_RFU_MANAGER Rfu;
|
||||
u8 gHostRFUtgtUnameBuffer[PLAYER_NAME_LENGTH + 1];
|
||||
struct RfuGameData gHostRfuGameData;
|
||||
struct RfuManager Rfu;
|
||||
u8 gHostRfuUsername[PLAYER_NAME_LENGTH + 1];
|
||||
|
||||
static void sub_80F8AA4(void);
|
||||
static void sub_80F8AEC(void);
|
||||
@@ -80,8 +80,8 @@ static const INIT_PARAM sRfuReqConfigTemplate = {
|
||||
.availSlot_flag = 0,
|
||||
.mboot_flag = 0,
|
||||
.serialNo = 0x0002,
|
||||
.gameName = (void *)&gHostRFUtgtGnameBuffer,
|
||||
.userName = gHostRFUtgtUnameBuffer,
|
||||
.gameName = (void *)&gHostRfuGameData,
|
||||
.userName = gHostRfuUsername,
|
||||
.fastSearchParent_flag = TRUE,
|
||||
.linkRecovery_enable = FALSE,
|
||||
.linkRecovery_period = 600,
|
||||
@@ -257,7 +257,7 @@ void InitRFU(void)
|
||||
|
||||
void InitRFUAPI(void)
|
||||
{
|
||||
if (!rfu_initializeAPI(gf_rfu_REQ_api, RFU_API_BUFF_SIZE_RAM, gIntrTable + 1, TRUE))
|
||||
if (!rfu_initializeAPI(sRfuAPIBuffer, RFU_API_BUFF_SIZE_RAM, gIntrTable + 1, TRUE))
|
||||
{
|
||||
gLinkType = 0;
|
||||
// ClearSavedLinkPlayers(); // Em fix
|
||||
@@ -402,10 +402,10 @@ static void Task_JoinGroupSearchForParent(u8 taskId)
|
||||
rfu_UNI_setSendData(bmChildSlot, Rfu.lastCmdBeforeCommInterrupt, sizeof(Rfu.lastCmdBeforeCommInterrupt));
|
||||
gTasks[taskId].data[1] = 8;
|
||||
DestroyTask(taskId);
|
||||
if (sRfuDebug.unk_0f == 0)
|
||||
if (!sRfuDebug.childJoined)
|
||||
{
|
||||
Debug_PrintEmpty();
|
||||
sRfuDebug.unk_0f++;
|
||||
sRfuDebug.childJoined++;
|
||||
}
|
||||
CreateTask(sub_80FA834, 5);
|
||||
break;
|
||||
@@ -523,7 +523,7 @@ static void MscCallback_Child(u16 unused)
|
||||
{
|
||||
Rfu.sem_UNI_SendRecv++;
|
||||
RfuRecvQueue_Enqueue(&Rfu.recvQueue, Rfu.unk_c3f);
|
||||
sRfuDebug.unk_06++;
|
||||
sRfuDebug.recvCount++;
|
||||
UpdateBackupQueue();
|
||||
rfu_UNI_readySendData(Rfu.child_slot);
|
||||
rfu_UNI_clearRecvNewDataFlag(Rfu.child_slot);
|
||||
@@ -662,7 +662,7 @@ static void MoveRecvCmdsToRfuBuffer(void)
|
||||
|
||||
for (i = 0; i < MAX_RFU_PLAYERS; i++)
|
||||
{
|
||||
GF_RFU_MANAGER *ptr = &Rfu;
|
||||
struct RfuManager *ptr = &Rfu;
|
||||
for (j = 0; j < CMD_LENGTH - 1; j++)
|
||||
{
|
||||
ptr->recvCmds[i][j][1] = gRecvCmds[i][j] >> 8;
|
||||
@@ -797,7 +797,7 @@ static bool32 sub_80F9204(void)
|
||||
if ((lman.parentAck_flag & Rfu.bm_PartnerFlags) == Rfu.bm_PartnerFlags)
|
||||
{
|
||||
Rfu.unk_cdc = 0;
|
||||
sRfuDebug.unk_06++;
|
||||
sRfuDebug.recvCount++;
|
||||
flags = lman.acceptSlot_flag;
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
@@ -833,7 +833,7 @@ static bool32 sub_80F9204(void)
|
||||
CallRfuFunc();
|
||||
if (Rfu.bmChatLeaderMaybe && !Rfu.linkClosing)
|
||||
{
|
||||
sRfuDebug.unk_0e = FALSE;
|
||||
sRfuDebug.unkFlag = FALSE;
|
||||
rfu_clearSlot(TYPE_UNI_SEND | TYPE_UNI_RECV, Rfu.unk_cda);
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
@@ -1000,9 +1000,9 @@ static void RfuFunc_SendKeysToRfu(void)
|
||||
}
|
||||
}
|
||||
|
||||
struct GFtgtGname *GetHostRFUtgtGname(void)
|
||||
struct RfuGameData *GetHostRFUtgtGname(void)
|
||||
{
|
||||
return &gHostRFUtgtGnameBuffer;
|
||||
return &gHostRfuGameData;
|
||||
}
|
||||
|
||||
bool32 IsSendingKeysToRfu(void)
|
||||
@@ -1239,7 +1239,7 @@ bool32 Rfu_InitBlockSend(const u8 *src, size_t size)
|
||||
return FALSE;
|
||||
if (Rfu.sendBlock.sending != 0)
|
||||
{
|
||||
sRfuDebug.unk_83++;
|
||||
sRfuDebug.blockSendTime++;
|
||||
return FALSE;
|
||||
}
|
||||
sizeHasModulo = (size % 12) != 0;
|
||||
@@ -1308,7 +1308,7 @@ static void SendLastBlock(void)
|
||||
if (Rfu.recvBlock[mpId].receivedFlags != sAllBlocksReceived[Rfu.recvBlock[mpId].count])
|
||||
{
|
||||
HandleSendFailure(mpId, Rfu.recvBlock[mpId].receivedFlags);
|
||||
sRfuDebug.unk_64++;
|
||||
sRfuDebug.blockSendFailures++;
|
||||
}
|
||||
else
|
||||
Rfu.RfuFunc = NULL;
|
||||
@@ -1965,44 +1965,44 @@ bool32 LinkRfuMain2(void)
|
||||
|
||||
static void CopyPlayerNameToUnameBuffer(void)
|
||||
{
|
||||
StringCopy(gHostRFUtgtUnameBuffer, gSaveBlock2Ptr->playerName);
|
||||
StringCopy(gHostRfuUsername, gSaveBlock2Ptr->playerName);
|
||||
}
|
||||
|
||||
void ClearAndInitHostRFUtgtGname(void)
|
||||
{
|
||||
memset(&gHostRFUtgtGnameBuffer, 0, RFU_GAME_NAME_LENGTH);
|
||||
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, ACTIVITY_NONE, FALSE, 0);
|
||||
memset(&gHostRfuGameData, 0, RFU_GAME_NAME_LENGTH);
|
||||
InitHostRFUtgtGname(&gHostRfuGameData, ACTIVITY_NONE, FALSE, 0);
|
||||
}
|
||||
|
||||
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, u32 started)
|
||||
{
|
||||
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, activity, started, child_sprite_genders);
|
||||
InitHostRFUtgtGname(&gHostRfuGameData, activity, started, child_sprite_genders);
|
||||
}
|
||||
|
||||
void SetGnameBufferWonderFlags(bool32 hasNews, bool32 hasCard)
|
||||
{
|
||||
gHostRFUtgtGnameBuffer.unk_00.hasNews = hasNews;
|
||||
gHostRFUtgtGnameBuffer.unk_00.hasCard = hasCard;
|
||||
gHostRfuGameData.unk_00.hasNews = hasNews;
|
||||
gHostRfuGameData.unk_00.hasCard = hasCard;
|
||||
}
|
||||
|
||||
void RfuUpdatePlayerGnameStateAndSend(u32 type, u32 species, u32 level)
|
||||
{
|
||||
gHostRFUtgtGnameBuffer.type = type;
|
||||
gHostRFUtgtGnameBuffer.species = species;
|
||||
gHostRFUtgtGnameBuffer.level = level;
|
||||
gHostRfuGameData.type = type;
|
||||
gHostRfuGameData.species = species;
|
||||
gHostRfuGameData.level = level;
|
||||
}
|
||||
|
||||
void UpdateGameData_GroupLockedIn(bool8 started)
|
||||
{
|
||||
gHostRFUtgtGnameBuffer.started = started;
|
||||
rfu_REQ_configGameData(0, 0x0002, (void *)&gHostRFUtgtGnameBuffer, gHostRFUtgtUnameBuffer);
|
||||
gHostRfuGameData.started = started;
|
||||
rfu_REQ_configGameData(0, 0x0002, (void *)&gHostRfuGameData, gHostRfuUsername);
|
||||
}
|
||||
|
||||
void UpdateGameDataWithActivitySpriteGendersFlag(u8 activity, u32 child_sprite_genders, u32 started)
|
||||
{
|
||||
if (activity)
|
||||
SetHostRFUtgtGname(activity, child_sprite_genders, started);
|
||||
rfu_REQ_configGameData(0, 0x0002, (void *)&gHostRFUtgtGnameBuffer, gHostRFUtgtUnameBuffer);
|
||||
rfu_REQ_configGameData(0, 0x0002, (void *)&gHostRfuGameData, gHostRfuUsername);
|
||||
}
|
||||
|
||||
void sub_80FB030(u32 linkPlayerCount)
|
||||
@@ -2086,7 +2086,7 @@ static void LmanCallback_Parent2(u8 msg, u8 param_count)
|
||||
{
|
||||
if ((lman.param[0] >> i) & 1)
|
||||
{
|
||||
struct GFtgtGname *structPtr = (void *)&gRfuLinkStatus->partner[i].gname;
|
||||
struct RfuGameData *structPtr = (void *)&gRfuLinkStatus->partner[i].gname;
|
||||
if (structPtr->activity == GetHostRFUtgtGname()->activity)
|
||||
{
|
||||
Rfu.partnerSendStatuses[i] = RFU_STATUS_OK;
|
||||
@@ -2254,7 +2254,7 @@ static u8 GetNewChildrenInUnionRoomChat(s32 bmNewChildSlot)
|
||||
{
|
||||
if ((bmNewChildSlot >> i) & 1)
|
||||
{
|
||||
struct GFtgtGname *structPtr = (void *)&gRfuLinkStatus->partner[i].gname;
|
||||
struct RfuGameData *structPtr = (void *)&gRfuLinkStatus->partner[i].gname;
|
||||
if (structPtr->activity == (ACTIVITY_CHAT | IN_UNION_ROOM))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
@@ -2564,7 +2564,7 @@ static u8 GetPartnerIndexByNameAndTrainerID(const u8 *trainerName, u16 trainerId
|
||||
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
u16 partnerTrainerId = ReadU16(((struct GFtgtGname *)gRfuLinkStatus->partner[i].gname)->unk_00.playerTrainerId);
|
||||
u16 partnerTrainerId = ReadU16(((struct RfuGameData *)gRfuLinkStatus->partner[i].gname)->unk_00.playerTrainerId);
|
||||
if (IsRfuSerialNumberValid(gRfuLinkStatus->partner[i].serialNo)
|
||||
&& !StringCompare(trainerName, gRfuLinkStatus->partner[i].uname)
|
||||
&& trainerId == partnerTrainerId)
|
||||
@@ -2696,7 +2696,7 @@ void CreateTask_RfuReconnectWithParent(const u8 *trainerName, u16 trainerId)
|
||||
data[8] = trainerId;
|
||||
}
|
||||
|
||||
static bool32 ShouldRejectPartnerConnectionBasedOnActivity(s16 activity, struct GFtgtGname *partnerGname)
|
||||
static bool32 ShouldRejectPartnerConnectionBasedOnActivity(s16 activity, struct RfuGameData *partnerGname)
|
||||
{
|
||||
if (GetHostRFUtgtGname()->activity == (ACTIVITY_CHAT | IN_UNION_ROOM))
|
||||
{
|
||||
@@ -2709,7 +2709,7 @@ static bool32 ShouldRejectPartnerConnectionBasedOnActivity(s16 activity, struct
|
||||
}
|
||||
else if (activity == (ACTIVITY_TRADE | IN_UNION_ROOM))
|
||||
{
|
||||
struct GFtgtGname *myTradeGname = (struct GFtgtGname *)&Rfu.tgtData.gname;
|
||||
struct RfuGameData *myTradeGname = (struct RfuGameData *)&Rfu.tgtData.gname;
|
||||
if (myTradeGname->species == SPECIES_EGG)
|
||||
{
|
||||
if (partnerGname->species == myTradeGname->species)
|
||||
@@ -2741,11 +2741,11 @@ static void sub_80FC028(u8 taskId)
|
||||
|
||||
if (Rfu.parentId != 0 && lman.parent_child == MODE_CHILD)
|
||||
{
|
||||
u16 trainerId = ReadU16(((struct GFtgtGname *)&Rfu.tgtData.gname)->unk_00.playerTrainerId);
|
||||
u16 trainerId = ReadU16(((struct RfuGameData *)&Rfu.tgtData.gname)->unk_00.playerTrainerId);
|
||||
u8 id = GetPartnerIndexByNameAndTrainerID(Rfu.tgtData.uname, trainerId);
|
||||
if (id != 0xFF)
|
||||
{
|
||||
if (!ShouldRejectPartnerConnectionBasedOnActivity(gTasks[taskId].data[1], (struct GFtgtGname *)&gRfuLinkStatus->partner[id].gname))
|
||||
if (!ShouldRejectPartnerConnectionBasedOnActivity(gTasks[taskId].data[1], (struct RfuGameData *)&gRfuLinkStatus->partner[id].gname))
|
||||
{
|
||||
if (gRfuLinkStatus->partner[id].slot != 0xFF && !rfu_LMAN_CHILD_connectParent(gRfuLinkStatus->partner[id].id, 90))
|
||||
{
|
||||
@@ -2762,7 +2762,7 @@ static void sub_80FC028(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC114(const u8 *name, struct GFtgtGname *structPtr, u8 activity)
|
||||
void sub_80FC114(const u8 *name, struct RfuGameData *structPtr, u8 activity)
|
||||
{
|
||||
u8 taskId, taskId2;
|
||||
|
||||
|
||||
+6
-6
@@ -661,7 +661,7 @@ static u8 GetConnectedChildStrength(u8 maxFlags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 started, s32 child_sprite_genders)
|
||||
void InitHostRFUtgtGname(struct RfuGameData *data, u8 activity, bool32 started, s32 child_sprite_genders)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -694,7 +694,7 @@ void InitHostRFUtgtGname(struct GFtgtGname *data, u8 activity, bool32 started, s
|
||||
* Otherwise, blanks these.
|
||||
* ==========================================================
|
||||
*/
|
||||
bool8 LinkRfu_GetNameIfCompatible(struct GFtgtGname *gname, u8 *uname, u8 idx)
|
||||
bool8 LinkRfu_GetNameIfCompatible(struct RfuGameData *gname, u8 *uname, u8 idx)
|
||||
{
|
||||
bool8 retVal;
|
||||
|
||||
@@ -735,7 +735,7 @@ bool8 LinkRfu_GetNameIfCompatible(struct GFtgtGname *gname, u8 *uname, u8 idx)
|
||||
* which comes from ???
|
||||
* ==========================================================
|
||||
*/
|
||||
bool8 LinkRfu_GetNameIfSerial7F7D(struct GFtgtGname *gname, u8 *uname, u8 idx)
|
||||
bool8 LinkRfu_GetNameIfSerial7F7D(struct RfuGameData *gname, u8 *uname, u8 idx)
|
||||
{
|
||||
bool8 retVal = FALSE;
|
||||
if (gRfuLinkStatus->partner[idx].serialNo == RFU_SERIAL_7F7D)
|
||||
@@ -752,10 +752,10 @@ bool8 LinkRfu_GetNameIfSerial7F7D(struct GFtgtGname *gname, u8 *uname, u8 idx)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void LinkRfu3_SetGnameUnameFromStaticBuffers(struct GFtgtGname *gname, u8 *uname)
|
||||
void LinkRfu3_SetGnameUnameFromStaticBuffers(struct RfuGameData *gname, u8 *uname)
|
||||
{
|
||||
memcpy(gname, &gHostRFUtgtGnameBuffer, RFU_GAME_NAME_LENGTH);
|
||||
memcpy(uname, gHostRFUtgtUnameBuffer, RFU_USER_NAME_LENGTH);
|
||||
memcpy(gname, &gHostRfuGameData, RFU_GAME_NAME_LENGTH);
|
||||
memcpy(uname, gHostRfuUsername, RFU_USER_NAME_LENGTH);
|
||||
}
|
||||
|
||||
#define sNextAnimNum data[0]
|
||||
|
||||
+2
-2
@@ -3874,7 +3874,7 @@ static void CursorCB_Register(u8 taskId)
|
||||
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
||||
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
|
||||
|
||||
switch (CanRegisterMonForTradingBoard(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), species2, species, isEventLegal))
|
||||
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRFUtgtGname(), species2, species, isEventLegal))
|
||||
{
|
||||
case CANT_REGISTER_MON:
|
||||
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
|
||||
@@ -3900,7 +3900,7 @@ static void CursorCB_Trade1(u8 taskId)
|
||||
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
||||
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
||||
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
|
||||
u32 stringId = GetUnionRoomTradeMessageId(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), gPartnerTgtGnameSub, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
|
||||
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRFUtgtGname(), gPartnerTgtGnameSub, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
|
||||
|
||||
if (stringId != UR_TRADE_MSG_NONE)
|
||||
{
|
||||
|
||||
@@ -466,7 +466,7 @@ void MakeGroupAssemblyAreasPassable(void)
|
||||
}
|
||||
}
|
||||
|
||||
static u8 UnionPartnerObjectGetFacing(u32 member, u32 group, struct GFtgtGname * gname)
|
||||
static u8 UnionPartnerObjectGetFacing(u32 member, u32 group, struct RfuGameData * gname)
|
||||
{
|
||||
if (member != 0)
|
||||
{
|
||||
@@ -487,7 +487,7 @@ static u32 RfuUnionGroupMemberIsInvisible(u32 group, u32 member)
|
||||
return RfuUnionObjectIsInvisible(5 * group + member - 0x38);
|
||||
}
|
||||
|
||||
static void SpawnGroupMember(u32 groupNo, u32 memberNo, u8 direction, struct GFtgtGname * gname)
|
||||
static void SpawnGroupMember(u32 groupNo, u32 memberNo, u8 direction, struct RfuGameData * gname)
|
||||
{
|
||||
s32 x, y;
|
||||
s32 objId = 5 * groupNo + memberNo;
|
||||
@@ -510,7 +510,7 @@ static void DespawnGroupMember(u32 group, u32 member)
|
||||
MapGridSetMetatileImpassabilityAt(x, y, FALSE);
|
||||
}
|
||||
|
||||
static void AssembleGroup(u32 group, struct GFtgtGname * gname)
|
||||
static void AssembleGroup(u32 group, struct RfuGameData * gname)
|
||||
{
|
||||
s16 x, y, x2, y2;
|
||||
s32 i;
|
||||
@@ -538,7 +538,7 @@ static void AssembleGroup(u32 group, struct GFtgtGname * gname)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpawnGroupLeaderAndMembers(u32 group, struct GFtgtGname * gname)
|
||||
static void SpawnGroupLeaderAndMembers(u32 group, struct RfuGameData * gname)
|
||||
{
|
||||
u32 i;
|
||||
switch (gname->activity)
|
||||
@@ -566,7 +566,7 @@ static void SpawnGroupLeaderAndMembers(u32 group, struct GFtgtGname * gname)
|
||||
}
|
||||
}
|
||||
|
||||
static void DespawnGroupLeaderAndMembers(u32 group, struct GFtgtGname * gname)
|
||||
static void DespawnGroupLeaderAndMembers(u32 group, struct RfuGameData * gname)
|
||||
{
|
||||
s32 i;
|
||||
DespawnGroupLeader(group);
|
||||
|
||||
+2
-2
@@ -2730,7 +2730,7 @@ static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int GetUnionRoomTradeMessageId(struct GFtgtGnameSub playerSub, struct GFtgtGnameSub partnerSub, u16 species1, u16 species2, u8 type, u16 species3, u8 isEventLegal)
|
||||
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData playerSub, struct RfuGameCompatibilityData partnerSub, u16 species1, u16 species2, u8 type, u16 species3, u8 isEventLegal)
|
||||
{
|
||||
u8 playerHasNationalDex = playerSub.hasNationalDex;
|
||||
u8 playerIsChampion = playerSub.isChampion;
|
||||
@@ -2810,7 +2810,7 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub playerSub, struct GFtgtGname
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CanRegisterMonForTradingBoard(struct GFtgtGnameSub playerSub, u16 species2, u16 species, u8 isEventLegal)
|
||||
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData playerSub, u16 species2, u16 species, u8 isEventLegal)
|
||||
{
|
||||
u8 canTradeEggAndNational = playerSub.hasNationalDex;
|
||||
|
||||
|
||||
+5
-5
@@ -53,7 +53,7 @@ static EWRAM_DATA u8 sPlayerCurrActivity = 0;
|
||||
static EWRAM_DATA u8 sPlayerActivityGroupSize = 0;
|
||||
static EWRAM_DATA union UnkUnion_Main sUnionRoomMain = {};
|
||||
static EWRAM_DATA u32 sUnref_203B060 = 0;
|
||||
EWRAM_DATA struct GFtgtGnameSub gPartnerTgtGnameSub = {};
|
||||
EWRAM_DATA struct RfuGameCompatibilityData gPartnerTgtGnameSub = {};
|
||||
EWRAM_DATA u16 gUnionRoomOfferedSpecies = SPECIES_NONE;
|
||||
EWRAM_DATA u8 gUnionRoomRequestedMonType = TYPE_NORMAL;
|
||||
static EWRAM_DATA struct UnionRoomTrade sUnionRoomTrade = {};
|
||||
@@ -86,7 +86,7 @@ static bool32 UnionRoom_HandleContactFromOtherPlayer(struct UnkStruct_URoom * uR
|
||||
static void Task_InitUnionRoom(u8 taskId);
|
||||
static u8 HandlePlayerListUpdate(void);
|
||||
static u8 CreateTask_SearchForChildOrParent(struct UnkStruct_Main4 * main4, struct UnkStruct_Main4 * arg1, u32 arg2);
|
||||
static bool32 GetGnameWonderFlagByLinkGroup(struct GFtgtGname * gname, s16 linkGroup);
|
||||
static bool32 GetGnameWonderFlagByLinkGroup(struct RfuGameData * gname, s16 linkGroup);
|
||||
static u8 CreateTask_ListenForPartnersWithCompatibleSerialNos(struct UnkStruct_Main4 * main4, u32 linkGroup);
|
||||
static u8 CreateTask_ListenForPartnersWithSerial7F7D(struct UnkStruct_Main4 * main4, u32 linkGroup);
|
||||
static bool32 UR_PrintFieldMessage(const u8 * str);
|
||||
@@ -3719,7 +3719,7 @@ static void Task_ListenForPartnersWithCompatibleSerialNos(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static bool32 GetGnameWonderFlagByLinkGroup(struct GFtgtGname * gname, s16 linkGroup)
|
||||
static bool32 GetGnameWonderFlagByLinkGroup(struct RfuGameData * gname, s16 linkGroup)
|
||||
{
|
||||
if (linkGroup == LINK_GROUP_WONDER_CARD)
|
||||
{
|
||||
@@ -4315,7 +4315,7 @@ static void nullsub_92(u8 windowId, u32 itemId, u8 y)
|
||||
{
|
||||
}
|
||||
|
||||
static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct GFtgtGname * gname, const u8 * uname, u8 colorIdx)
|
||||
static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct RfuGameData * gname, const u8 * uname, u8 colorIdx)
|
||||
{
|
||||
u8 level_t[4];
|
||||
u16 species = gname->species;
|
||||
@@ -4339,7 +4339,7 @@ static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct GFtgtGname * gname
|
||||
static void TradeBoardListMenuItemPrintFunc(u8 windowId, u32 itemId, u8 y)
|
||||
{
|
||||
struct UnkStruct_Leader * leader = sUnionRoomMain.leader;
|
||||
struct GFtgtGname * rfu;
|
||||
struct RfuGameData * rfu;
|
||||
s32 i, j;
|
||||
u8 uname[RFU_USER_NAME_LENGTH];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user