Second pass on documenting union room
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
#define USING_MINIGAME 8
|
||||
#define USING_BATTLE_TOWER 9
|
||||
|
||||
// Return states for the group of specials that use CreateLinkupTask
|
||||
// A few also used by TryBecomeLinkLeader and TryJoinLinkGroup
|
||||
#define LINKUP_ONGOING 0
|
||||
#define LINKUP_SUCCESS 1
|
||||
#define LINKUP_SOMEONE_NOT_READY 2
|
||||
@@ -20,7 +22,7 @@
|
||||
#define LINKUP_FAILED 5
|
||||
#define LINKUP_CONNECTION_ERROR 6
|
||||
#define LINKUP_PLAYER_NOT_READY 7
|
||||
#define LINKUP_UNK8 8
|
||||
#define LINKUP_RETRY_ROLE_ASSIGN 8
|
||||
#define LINKUP_PARTNER_NOT_READY 9
|
||||
#define LINKUP_FAILED_CONTEST_GMODE 10
|
||||
#define LINKUP_FAILED_BATTLE_TOWER 11
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#define ACTIVITY_BATTLE_TOWER 28
|
||||
#define ACTIVITY_29 29
|
||||
|
||||
#define IN_UNION_ROOM 0x40
|
||||
#define IN_UNION_ROOM (1 << 6)
|
||||
|
||||
// Used in UR_AddTextPrinterParameterized
|
||||
#define UR_COLOR_DKE_WHT_LTE 0
|
||||
@@ -83,4 +83,20 @@
|
||||
#define UR_TRADE_NOTYPE 1
|
||||
#define UR_TRADE_NOEGG 2
|
||||
|
||||
#define UR_TRADE_READY 0
|
||||
#define UR_TRADE_PLAYER_NOT_READY 1
|
||||
#define UR_TRADE_PARTNER_NOT_READY 2
|
||||
|
||||
#define UR_INTERACT_PLAYER_1 1
|
||||
#define UR_INTERACT_PLAYER_2 2
|
||||
#define UR_INTERACT_PLAYER_3 3
|
||||
#define UR_INTERACT_PLAYER_4 4
|
||||
#define UR_INTERACT_PLAYER_5 5
|
||||
#define UR_INTERACT_PLAYER_6 6
|
||||
#define UR_INTERACT_PLAYER_7 7
|
||||
#define UR_INTERACT_PLAYER_8 8
|
||||
#define UR_INTERACT_ATTENDANT 9
|
||||
#define UR_INTERACT_UNUSED 10
|
||||
#define UR_INTERACT_START_MENU 11
|
||||
|
||||
#endif //GUARD_CONSTANTS_UNION_ROOM_H
|
||||
|
||||
@@ -29,6 +29,20 @@
|
||||
#define BACKUP_QUEUE_NUM_SLOTS 2
|
||||
#define BACKUP_QUEUE_SLOT_LENGTH 14
|
||||
|
||||
#define RFU_STATUS_OK 0
|
||||
#define RFU_STATUS_FATAL_ERROR 1
|
||||
#define RFU_STATUS_CONNECTION_ERROR 2
|
||||
#define RFU_STATUS_CHILD_SEND_COMPLETE 3
|
||||
#define RFU_STATUS_NEW_CHILD_DETECTED 4
|
||||
#define RFU_STATUS_JOIN_GROUP_OK 5
|
||||
#define RFU_STATUS_JOIN_GROUP_NO 6
|
||||
#define RFU_STATUS_WAIT_ACK_JOIN_GROUP 7
|
||||
#define RFU_STATUS_LEAVE_GROUP_NOTICE 8
|
||||
#define RFU_STATUS_LEAVE_GROUP 9
|
||||
#define RFU_STATUS_10 10
|
||||
#define RFU_STATUS_11 11
|
||||
#define RFU_STATUS_ACK_JOIN_GROUP 12
|
||||
|
||||
// RfuTgtData.gname is read as these structs.
|
||||
struct GFtgtGnameSub
|
||||
{
|
||||
@@ -125,7 +139,7 @@ struct GFRfuManager
|
||||
/* 0x0ee */ vu8 errorState;
|
||||
/* 0x0ef */ bool8 isShuttingDown;
|
||||
/* 0x0f0 */ u8 linkLossRecoveryState;
|
||||
/* 0x0f1 */ u8 errorStatus;
|
||||
/* 0x0f1 */ u8 status;
|
||||
/* 0x0f2 */ u16 unk_f2[6];
|
||||
/* 0x0fe */ u16 unk_fe;
|
||||
/* 0x100 */ u16 unk_100;
|
||||
@@ -142,14 +156,14 @@ struct GFRfuManager
|
||||
/* 0xc3e */ vu8 childSlot;
|
||||
/* 0xc3f */ u8 unk_c3f[70];
|
||||
/* 0xc85 */ u8 unk_c85;
|
||||
/* 0xc86 */ u8 unk_c86;
|
||||
/* 0xc86 */ u8 recvStatus;
|
||||
/* 0xc87 */ u8 recvCmds[5][7][2];
|
||||
/* 0xccd */ u8 parentId;
|
||||
/* 0xcce */ u8 multiplayerId;
|
||||
/* 0xccf */ u8 unk_ccf;
|
||||
/* 0xcd0 */ vu8 unk_cd0;
|
||||
/* 0xcd1 */ u8 unk_cd1[4];
|
||||
/* 0xcd5 */ u8 unk_cd5[4];
|
||||
/* 0xcd1 */ u8 partnerSendStatuses[RFU_CHILD_MAX];
|
||||
/* 0xcd5 */ u8 partnerRecvStatuses[RFU_CHILD_MAX];
|
||||
/* 0xcd9 */ u8 unk_cd9;
|
||||
/* 0xcda */ u8 unk_cda;
|
||||
/* 0xcdb */ vbool8 unk_cdb;
|
||||
@@ -199,36 +213,36 @@ void UpdateWirelessStatusIndicatorSprite(void);
|
||||
void InitRFU(void);
|
||||
bool32 sub_8010EC0(void);
|
||||
bool32 sub_8010F1C(void);
|
||||
bool32 RfuIsErrorStatus1or2(void);
|
||||
bool32 RfuHasErrored(void);
|
||||
bool32 IsRfuRecvQueueEmpty(void);
|
||||
u32 GetRfuRecvQueueLength(void);
|
||||
void RfuVSync(void);
|
||||
void sub_80111B0(bool32 a0);
|
||||
u8 RfuGetErrorStatus(void);
|
||||
u8 RfuGetStatus(void);
|
||||
struct GFtgtGname *GetHostRFUtgtGname(void);
|
||||
void UpdateGameData_GroupLockedIn(u8 a0);
|
||||
void GetLinkmanErrorParams(u32 a0);
|
||||
void RfuSetErrorStatus(u8 a0, u16 a1);
|
||||
void RfuSetStatus(u8 a0, u16 a1);
|
||||
u8 sub_801048C(bool32 a0);
|
||||
void LinkRfu3_SetGnameUnameFromStaticBuffers(struct GFtgtGname *buff1, u8 *buff2);
|
||||
void SetHostRFUtgtGname(u8 a0, u32 a1, u32 a2);
|
||||
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, bool32 started);
|
||||
void InitializeRfuLinkManager_LinkLeader(u32 a0);
|
||||
bool32 sub_8012240(void);
|
||||
void LinkRfu_StopManagerAndFinalizeSlots(void);
|
||||
bool32 sub_80105EC(void);
|
||||
bool32 TrainerIdAndNameStillInPartnersList(u16 a0, const u8 *a1);
|
||||
void SendByteToPartnerByIdAndName(u8 a0, u16 a1, const u8 *a2);
|
||||
u32 WaitSendByteToPartnerByIdAndName(u16 a0, const u8 *a1);
|
||||
bool32 HasTrainerLeftPartnersList(u16 trainerId, const u8 *name);
|
||||
void SendRfuStatusToPartner(u8 status, u16 trainerId, const u8 *name);
|
||||
u32 WaitSendRfuStatusToPartner(u16 trainerId, const u8 *name);
|
||||
void RequestDisconnectSlotByTrainerNameAndId(const u8 *a0, u16 a1);
|
||||
bool8 LmanAcceptSlotFlagIsNotZero(void);
|
||||
bool32 WaitRfuState(bool32 a0);
|
||||
void sub_801103C(void);
|
||||
void InitializeRfuLinkManager_JoinGroup(void);
|
||||
void LinkRfuNIsend8(void);
|
||||
void SendLeaveGroupNotice(void);
|
||||
void RecordMixTrainerNames(void);
|
||||
void LinkRfu_CreateConnectionAsParent(void);
|
||||
void LinkRfu_StopManagerBeforeEnteringChat(void);
|
||||
void UpdateGameDataWithActivitySpriteGendersFlag(u8 a0, u32 a1, u32 a2);
|
||||
void UpdateGameData_SetActivity(u8 activity, u32 flags, bool32 started);
|
||||
void CreateTask_RfuReconnectWithParent(const u8 *src, u16 trainerId);
|
||||
void SetGnameBufferWonderFlags(bool32 a0, bool32 a1);
|
||||
void ClearAndInitHostRFUtgtGname(void);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define GUARD_UNION_ROOM_H
|
||||
|
||||
#include "link_rfu.h"
|
||||
#include "link.h"
|
||||
#include "constants/union_room.h"
|
||||
|
||||
// Exported type declarations
|
||||
@@ -12,22 +13,20 @@ struct WirelessGnameUnamePair
|
||||
u8 ALIGNED(4) playerName[PLAYER_NAME_LENGTH + 1];
|
||||
};
|
||||
|
||||
struct UnkStruct_x1C // WirelessLink_Member?
|
||||
struct UnkStruct_x1C
|
||||
{
|
||||
struct WirelessGnameUnamePair gname_uname;
|
||||
u8 active:1;
|
||||
};
|
||||
|
||||
struct UnkStruct_x20 // WirelessLink_Member?
|
||||
struct UnkStruct_x20
|
||||
{
|
||||
struct WirelessGnameUnamePair gname_uname;
|
||||
u16 field_18;
|
||||
u16 timeoutCounter;
|
||||
u8 groupScheduledAnim:2;
|
||||
u8 field_1A_1:1;
|
||||
bool8 useRedText:1; // Never set
|
||||
u8 field_1B;
|
||||
u8 field_1D;
|
||||
u8 field_1E;
|
||||
u8 field_1F;
|
||||
u8 filler[3];
|
||||
};
|
||||
|
||||
struct UnkStruct_Main0
|
||||
@@ -37,12 +36,12 @@ struct UnkStruct_Main0
|
||||
|
||||
struct UnkStruct_Main4
|
||||
{
|
||||
struct UnkStruct_x1C arr[5];
|
||||
struct UnkStruct_x1C arr[MAX_RFU_PLAYERS];
|
||||
};
|
||||
|
||||
struct UnkStruct_Main8
|
||||
{
|
||||
struct UnkStruct_x20 arr[5];
|
||||
struct UnkStruct_x20 arr[MAX_RFU_PLAYERS];
|
||||
};
|
||||
|
||||
struct WirelessLink_Leader
|
||||
@@ -62,8 +61,8 @@ struct WirelessLink_Leader
|
||||
u8 field_16;
|
||||
u8 listenTaskId;
|
||||
u8 activity;
|
||||
u8 field_19;
|
||||
u16 field_1A;
|
||||
u8 joinRequestAnswer;
|
||||
u16 memberConfirmTimeout;
|
||||
};
|
||||
|
||||
struct WirelessLink_Group
|
||||
@@ -100,32 +99,29 @@ struct WirelessLink_URoom
|
||||
struct UnkStruct_Main4 *field_4;
|
||||
struct UnkStruct_Main0 *field_8;
|
||||
struct UnkStruct_Main4 *field_C;
|
||||
u16 field_10;
|
||||
u16 unknown; // Never read
|
||||
u16 field_12;
|
||||
u8 state;
|
||||
u8 stateAfterPrint;
|
||||
u8 textState;
|
||||
u8 field_17;
|
||||
u8 field_18;
|
||||
u8 field_19;
|
||||
u8 field_1A;
|
||||
u8 filler[4];
|
||||
u8 topListMenuWindowId;
|
||||
u8 topListMenuId;
|
||||
u8 tradeBoardSelectWindowId;
|
||||
u8 tradeBoardDetailsWindowId;
|
||||
u8 field_1F;
|
||||
u8 field_20;
|
||||
u8 unused1;
|
||||
u8 searchTaskId;
|
||||
u8 spriteIds[40];
|
||||
u8 field_49;
|
||||
u8 field_4A;
|
||||
u8 unused2;
|
||||
u8 tradeBoardListMenuId;
|
||||
u16 playerSendBuffer[6];
|
||||
u8 activityRequestStrbufs[4][16];
|
||||
u16 partnerYesNoResponse;
|
||||
u16 recvActivityRequest[3];
|
||||
struct UnionRoomObject objects[MAX_UNION_ROOM_PLAYERS];
|
||||
u8 field_C0[12][15];
|
||||
u8 field_174[48];
|
||||
u8 field_1A4[200];
|
||||
u8 trainerCardStrBuffer[12][15];
|
||||
u8 trainerCardColorStrBuffer[48];
|
||||
u8 trainerCardMsgStrBuffer[200];
|
||||
};
|
||||
|
||||
union WirelessLink_Main
|
||||
@@ -137,16 +133,16 @@ union WirelessLink_Main
|
||||
|
||||
struct UnionRoomTrade
|
||||
{
|
||||
u16 field_0;
|
||||
u16 state;
|
||||
u16 type;
|
||||
u32 playerPersonality;
|
||||
u8 field_8;
|
||||
u8 field_9;
|
||||
u8 offerPlayerId;
|
||||
u8 filler1;
|
||||
u16 playerSpecies;
|
||||
u16 playerLevel;
|
||||
u16 species;
|
||||
u16 level;
|
||||
u16 field_12;
|
||||
u16 filler2;
|
||||
u32 personality;
|
||||
};
|
||||
|
||||
@@ -162,7 +158,7 @@ extern u8 gUnionRoomRequestedMonType;
|
||||
// Exported ROM declarations
|
||||
|
||||
u8 CreateTask_CreateTradeMenu(void);
|
||||
void var_800D_set_xB(void);
|
||||
void SetUsingUnionRoomStartMenu(void);
|
||||
void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0);
|
||||
void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0);
|
||||
void MEvent_CreateTask_Leader(u32 arg0);
|
||||
|
||||
@@ -8,7 +8,7 @@ void DestroyGroupMemberSprites(u8 *spriteIds);
|
||||
void SetTilesAroundUnionRoomPlayersPassable(void);
|
||||
void ScheduleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom);
|
||||
void HandleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom);
|
||||
bool32 TrySetUnionRoomMemberFacePlayer(struct UnkStruct_Main0 *main0, s16 *directionPtr, s16 *playerIdxPtr, u8 *spriteIds);
|
||||
bool32 TryInteractWithUnionRoomMember(struct UnkStruct_Main0 *main0, s16 *directionPtr, s16 *playerIdxPtr, u8 *spriteIds);
|
||||
void UpdateUnionRoomMemberFacing(u32 currDirection, u32 playerIdx, struct UnkStruct_Main0 *main0);
|
||||
|
||||
#endif //GUARD_UNION_ROOM_PLAYER_AVATAR_H
|
||||
|
||||
Reference in New Issue
Block a user