2017-10-21 19:42:31 +00:00
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RFU_RESET = 0x10,
|
|
|
|
RFU_LINK_STATUS,
|
|
|
|
RFU_VERSION_STATUS,
|
|
|
|
RFU_SYSTEM_STATUS,
|
|
|
|
RFU_SLOT_STATUS,
|
|
|
|
RFU_CONFIG_STATUS,
|
|
|
|
RFU_GAME_CONFIG,
|
|
|
|
RFU_SYSTEM_CONFIG,
|
|
|
|
RFU_UNK18,
|
|
|
|
RFU_SC_START,
|
|
|
|
RFU_SC_POLLING,
|
|
|
|
RFU_SC_END,
|
|
|
|
RFU_SP_START,
|
|
|
|
RFU_SP_POLLING,
|
|
|
|
RFU_SP_END,
|
|
|
|
RFU_CP_START,
|
|
|
|
RFU_CP_POLLING,
|
|
|
|
RFU_CP_END,
|
|
|
|
RFU_UNK22,
|
|
|
|
RFU_UNK23,
|
|
|
|
RFU_DATA_TX,
|
|
|
|
RFU_DATA_TX_AND_CHANGE,
|
|
|
|
RFU_DATA_RX,
|
|
|
|
RFU_MS_CHANGE,
|
|
|
|
RFU_DATA_READY_AND_CHANGE,
|
|
|
|
RFU_DISCONNECTED_AND_CHANGE,
|
|
|
|
RFU_UNK2A,
|
|
|
|
RFU_UNK2B,
|
|
|
|
RFU_UNK2C,
|
|
|
|
RFU_UNK2D,
|
|
|
|
RFU_UNK2E,
|
|
|
|
RFU_UNK2F,
|
|
|
|
RFU_DISCONNECT,
|
|
|
|
RFU_TEST_MODE,
|
|
|
|
RFU_CPR_START,
|
|
|
|
RFU_CPR_POLLING,
|
|
|
|
RFU_CPR_END,
|
|
|
|
RFU_UNK35,
|
|
|
|
RFU_UNK36,
|
|
|
|
RFU_RESUME_RETRANSMIT_AND_CHANGE,
|
|
|
|
RFU_UNK38,
|
|
|
|
RFU_UNK39,
|
|
|
|
RFU_UNK3A,
|
|
|
|
RFU_UNK3B,
|
|
|
|
RFU_UNK3C,
|
|
|
|
RFU_STOP_MODE, //3D
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuPacket8
|
|
|
|
{
|
|
|
|
u8 data[0x74];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuPacket32
|
|
|
|
{
|
|
|
|
u32 command;
|
|
|
|
u32 data[0x1C];
|
|
|
|
};
|
|
|
|
|
|
|
|
union RfuPacket
|
|
|
|
{
|
|
|
|
struct RfuPacket32 rfuPacket32;
|
|
|
|
struct RfuPacket8 rfuPacket8;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuStruct
|
|
|
|
{
|
|
|
|
vs32 unk_0;
|
|
|
|
u8 txParams;
|
|
|
|
u8 unk_5;
|
|
|
|
u8 activeCommand;
|
|
|
|
u8 unk_7;
|
|
|
|
u8 unk_8;
|
|
|
|
u8 unk_9;
|
|
|
|
u8 timerSelect;
|
|
|
|
u8 unk_b;
|
|
|
|
int timerState;
|
|
|
|
vu8 timerActive;
|
|
|
|
u8 unk_11;
|
|
|
|
vu16 unk_12;
|
|
|
|
vu8 msMode;
|
|
|
|
u8 unk_15;
|
|
|
|
u8 unk_16;
|
|
|
|
u8 unk_17;
|
|
|
|
void (*callbackM)();
|
|
|
|
void (*callbackS)();
|
|
|
|
u32 callbackID;
|
|
|
|
union RfuPacket *txPacket;
|
|
|
|
union RfuPacket *rxPacket;
|
|
|
|
vu8 unk_2c;
|
|
|
|
u8 padding[3];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuIntrStruct
|
|
|
|
{
|
|
|
|
u8 rxPacketAlloc[0x74];
|
|
|
|
u8 txPacketAlloc[0x74];
|
|
|
|
u8 block1[0x960];
|
|
|
|
u8 block2[0x30];
|
|
|
|
};
|
|
|
|
|
2017-11-17 05:05:28 +00:00
|
|
|
struct RfuUnk1
|
|
|
|
{
|
2017-11-30 05:19:44 +00:00
|
|
|
u16 unk_0;
|
|
|
|
u8 unk_2;
|
|
|
|
u8 unk_3;
|
|
|
|
u8 fill_4[0x10];
|
2017-11-17 05:05:28 +00:00
|
|
|
u32 unk_14;
|
|
|
|
u32 unk_18;
|
|
|
|
struct RfuIntrStruct unk_1c;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuUnk2
|
|
|
|
{
|
2017-11-29 13:46:16 +00:00
|
|
|
u16 unk_0;
|
2017-11-30 05:19:44 +00:00
|
|
|
u8 fill_2[0x18];
|
|
|
|
u8 unk_1a;
|
|
|
|
u8 fill_1b[0x19];
|
2017-11-29 00:41:32 +00:00
|
|
|
u16 unk_34;
|
2017-11-30 05:19:44 +00:00
|
|
|
u8 fill_36[0x18];
|
|
|
|
u8 unk_4e;
|
|
|
|
u8 fill_4f[0x12];
|
2017-11-29 00:41:32 +00:00
|
|
|
u8 unk_61;
|
|
|
|
u8 fill_62[6];
|
2017-11-17 05:05:28 +00:00
|
|
|
u32 unk_68;
|
|
|
|
u32 unk_6c;
|
|
|
|
u8 unk_70[0x70];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuUnk3
|
|
|
|
{
|
|
|
|
u32 unk_0;
|
|
|
|
u32 unk_4;
|
|
|
|
u8 unk_8[0xD4];
|
|
|
|
u32 unk_dc;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RfuUnk5
|
|
|
|
{
|
|
|
|
u8 unk_00;
|
2017-11-21 14:14:43 +00:00
|
|
|
u8 unk_01;
|
|
|
|
u8 unk_02;
|
2017-11-19 01:55:57 +00:00
|
|
|
u8 unk_03;
|
2017-11-29 00:41:32 +00:00
|
|
|
u8 unk_04;
|
|
|
|
u8 unk_05;
|
|
|
|
u8 unk_06;
|
|
|
|
u8 unk_07;
|
2017-11-19 01:55:57 +00:00
|
|
|
u8 unk_08;
|
|
|
|
u8 filler_09[11];
|
2017-11-30 05:19:44 +00:00
|
|
|
struct RfuUnk5Sub {
|
|
|
|
u16 unk_00;
|
|
|
|
u8 unk_02;
|
|
|
|
u16 unk_04;
|
|
|
|
u8 filler_06[26];
|
|
|
|
} unk_14[4];
|
2017-11-17 05:05:28 +00:00
|
|
|
};
|
|
|
|
|
2017-10-21 19:42:31 +00:00
|
|
|
extern struct RfuStruct *gRfuState;
|
|
|
|
|
2017-11-17 05:05:28 +00:00
|
|
|
extern struct RfuUnk5 *gUnknown_03007890;
|
|
|
|
extern u32 *gUnknown_03007894;
|
|
|
|
extern struct RfuUnk3* gUnknown_03007898;
|
|
|
|
extern struct RfuUnk2* gUnknown_03007880[4];
|
|
|
|
extern struct RfuUnk1* gUnknown_03007870[4];
|
|
|
|
extern void* sub_82E53F4;
|
|
|
|
extern void rfu_STC_clearAPIVariables(void);
|
|
|
|
|
2017-10-21 19:42:31 +00:00
|
|
|
void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, bool8 copyInterruptToRam);
|
2017-11-08 01:25:24 +00:00
|
|
|
void rfu_REQ_stopMode(void);
|
|
|
|
void rfu_waitREQComplete(void);
|
2017-11-17 04:37:09 +00:00
|
|
|
u32 rfu_REQBN_softReset_and_checkID(void);
|
2017-11-17 05:05:28 +00:00
|
|
|
void rfu_REQ_sendData(u8);
|
2017-11-17 13:33:25 +00:00
|
|
|
void rfu_setMSCCallback(void (*func)(u16));
|
|
|
|
void rfu_setREQCallback(void (*func)(u16, u16));
|
2017-11-18 20:00:38 +00:00
|
|
|
bool8 rfu_getMasterSlave(void);
|
2017-11-19 15:20:44 +00:00
|
|
|
void rfu_REQBN_watchLink(u16 a0, u8 *a1, u8 *a2, u8 *a3);
|
2017-11-19 21:54:49 +00:00
|
|
|
bool16 rfu_syncVBlank(void);
|
|
|
|
void rfu_REQ_reset(void);
|
|
|
|
void rfu_REQ_configSystem(u16, u8, u8);
|
|
|
|
void rfu_REQ_configGameData(u8, u16, u32, u32);
|
|
|
|
void rfu_REQ_startSearchChild(void);
|
|
|
|
void rfu_REQ_pollSearchChild(void);
|
|
|
|
void rfu_REQ_endSearchChild(void);
|
|
|
|
void rfu_REQ_startSearchParent(void);
|
|
|
|
void rfu_REQ_pollSearchParent(void);
|
|
|
|
void rfu_REQ_endSearchParent(void);
|
|
|
|
void rfu_REQ_startConnectParent(u16);
|
|
|
|
void rfu_REQ_pollConnectParent(void);
|
|
|
|
void rfu_REQ_endConnectParent(void);
|
|
|
|
void rfu_REQ_CHILD_startConnectRecovery(u8);
|
|
|
|
void rfu_REQ_CHILD_pollConnectRecovery(void);
|
|
|
|
void rfu_REQ_CHILD_endConnectRecovery(void);
|
|
|
|
void rfu_REQ_changeMasterSlave(void);
|
2017-11-21 14:14:43 +00:00
|
|
|
void rfu_REQ_RFUStatus(void);
|
|
|
|
void rfu_getRFUStatus(u8 *status);
|
|
|
|
u8 *rfu_getSTWIRecvBuffer(void);
|
|
|
|
u8 rfu_NI_CHILD_setSendGameName(u8 a0, u8 a1);
|
|
|
|
void rfu_clearSlot(u8 a0, u8 a1);
|
|
|
|
bool16 rfu_CHILD_getConnectRecoveryStatus(u8 *status);
|
|
|
|
bool16 rfu_getConnectParentStatus(u8 *status, u8 *a1);
|
2017-11-22 05:16:00 +00:00
|
|
|
bool16 rfu_UNI_PARENT_getDRAC_ACK(u8 *a0);
|
2017-11-30 05:19:44 +00:00
|
|
|
void rfu_REQ_disconnect(u8 who);
|
|
|
|
void rfu_changeSendTarget(u8 a0, u8 who, u8 a2);
|
|
|
|
void rfu_NI_stopReceivingData(u8 who);
|