document symbols

This commit is contained in:
jiangzhengwenjz 2020-01-16 04:46:17 +08:00 committed by huderlem
parent 5fff2f2234
commit 8a5f292618
15 changed files with 596 additions and 596 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ IntrSIO32: @ 82E3554
cmp r0, 0 cmp r0, 0
ldmdbeq r11, {r11,sp,lr} ldmdbeq r11, {r11,sp,lr}
bxeq lr bxeq lr
bl sub_82E3EB0 bl Callback_Dummy_ID
ldmdb r11, {r11,sp,lr} ldmdb r11, {r11,sp,lr}
bx lr bx lr
_082E3590: _082E3590:
@ -33,7 +33,7 @@ _082E35A8:
ldmdb r11, {r11,sp,lr} ldmdb r11, {r11,sp,lr}
bx lr bx lr
.align 2, 0 .align 2, 0
_082E35B4: .4byte gRfuState _082E35B4: .4byte gSTWIStatus
arm_func_end IntrSIO32 arm_func_end IntrSIO32
arm_func_start sio32intr_clock_master arm_func_start sio32intr_clock_master
@ -204,10 +204,10 @@ _082E3800:
beq _082E3840 beq _082E3840
ldrh r1, [r0, 0x12] ldrh r1, [r0, 0x12]
ldrb r0, [r0, 0x6] ldrb r0, [r0, 0x6]
bl sub_82E3EA8 bl Callback_Dummy_M
b _082E3840 b _082E3840
.align 2, 0 .align 2, 0
_082E382C: .4byte gRfuState _082E382C: .4byte gSTWIStatus
_082E3830: _082E3830:
add r3, r5, 0x3 add r3, r5, 0x3
strh r3, [r4] strh r3, [r4]
@ -423,7 +423,7 @@ _082E3AD4:
beq _082E3C4C beq _082E3C4C
mov r0, 0x1EC mov r0, 0x1EC
add r0, r0, 0x2 add r0, r0, 0x2
bl sub_82E3EAC bl Callback_Dummy_S
b _082E3C4C b _082E3C4C
_082E3B48: _082E3B48:
mov r3, 0x120 mov r3, 0x120
@ -445,7 +445,7 @@ _082E3B48:
ldrb r0, [r0, 0x6] ldrb r0, [r0, 0x6]
mov r1, r2 mov r1, r2
orr r0, r0, r3, lsl 8 orr r0, r0, r3, lsl 8
bl sub_82E3EAC bl Callback_Dummy_S
b _082E3C4C b _082E3C4C
_082E3B9C: _082E3B9C:
mov r3, 0x208 mov r3, 0x208
@ -472,7 +472,7 @@ _082E3BE4:
bhi _082E3BE4 bhi _082E3BE4
b _082E3C20 b _082E3C20
.align 2, 0 .align 2, 0
_082E3BF4: .4byte gRfuState _082E3BF4: .4byte gSTWIStatus
_082E3BF8: .4byte 0x996601ee _082E3BF8: .4byte 0x996601ee
_082E3BFC: _082E3BFC:
mov r2, 0xFF00 mov r2, 0xFF00
@ -532,7 +532,7 @@ _082E3CA4:
ldmdb r11, {r11,sp,lr} ldmdb r11, {r11,sp,lr}
bx lr bx lr
.align 2, 0 .align 2, 0
_082E3CB8: .4byte gRfuState _082E3CB8: .4byte gSTWIStatus
arm_func_end handshake_wait arm_func_end handshake_wait
arm_func_start STWI_set_timer_in_RAM arm_func_start STWI_set_timer_in_RAM
@ -588,7 +588,7 @@ _082E3D5C:
mov r3, 0x3 mov r3, 0x3
b _082E3D8C b _082E3D8C
.align 2, 0 .align 2, 0
_082E3D74: .4byte gRfuState _082E3D74: .4byte gSTWIStatus
_082E3D78: _082E3D78:
mvn r3, 0x850 mvn r3, 0x850
sub r3, r3, 0x2 sub r3, r3, 0x2
@ -637,7 +637,7 @@ STWI_stop_timer_in_RAM: @ 82E3DCC
ldmdb r11, {r11,sp,lr} ldmdb r11, {r11,sp,lr}
bx lr bx lr
.align 2, 0 .align 2, 0
_082E3E18: .4byte gRfuState _082E3E18: .4byte gSTWIStatus
arm_func_end STWI_stop_timer_in_RAM arm_func_end STWI_stop_timer_in_RAM
arm_func_start STWI_init_slave arm_func_start STWI_init_slave
@ -677,20 +677,20 @@ STWI_init_slave: @ 82E3E1C
ldmdb r11, {r11,sp,lr} ldmdb r11, {r11,sp,lr}
bx lr bx lr
.align 2, 0 .align 2, 0
_082E3EA4: .4byte gRfuState _082E3EA4: .4byte gSTWIStatus
arm_func_end STWI_init_slave arm_func_end STWI_init_slave
arm_func_start sub_82E3EA8 arm_func_start Callback_Dummy_M
sub_82E3EA8: @ 82E3EA8 Callback_Dummy_M: @ 82E3EA8
bx r2 bx r2
arm_func_end sub_82E3EA8 arm_func_end Callback_Dummy_M
arm_func_start sub_82E3EAC arm_func_start Callback_Dummy_S
sub_82E3EAC: @ 82E3EAC Callback_Dummy_S: @ 82E3EAC
bx r1 bx r1
arm_func_end sub_82E3EAC arm_func_end Callback_Dummy_S
arm_func_start sub_82E3EB0 arm_func_start Callback_Dummy_ID
sub_82E3EB0: @ 82E3EB0 Callback_Dummy_ID: @ 82E3EB0
bx r0 bx r0
arm_func_end sub_82E3EB0 arm_func_end Callback_Dummy_ID

View File

@ -1,6 +1,6 @@
gUnknown_03007870 gRfuSlotStatusUNI
gUnknown_03007880 gRfuSlotStatusNI
gUnknown_03007890 gRfuLinkStatus
gUnknown_03007894 gRfuStatic
gUnknown_03007898 gRfuFixed
gUnknown_030078A0 gRfuSIO32Id

View File

@ -1 +1 @@
gRfuState gSTWIStatus

View File

@ -1,6 +1,6 @@
.section .rodata .section .rodata
gUnknown_089A3220:: @ 89A3220 llsf_struct:: @ 89A3220
.byte 2, 14, 0, 10, 9, 5, 7, 2 .byte 2, 14, 0, 10, 9, 5, 7, 2
.byte 0, 15, 1, 3, 3, 0, 31, 0 .byte 0, 15, 1, 3, 3, 0, 31, 0
.byte 3, 22, 18, 14, 13, 9, 11, 3 .byte 3, 22, 18, 14, 13, 9, 11, 3
@ -9,9 +9,9 @@ gUnknown_089A3220:: @ 89A3220
.asciz "RFU_V1026" .asciz "RFU_V1026"
.align 2 .align 2
gUnknown_089A324C:: @ 89A324C str_checkMbootLL:: @ 89A324C
.asciz "RFU-MBOOT" .asciz "RFU-MBOOT"
.align 2 .align 2
gUnknown_089A3258:: @ 89A3258 Sio32ConnectionData:: @ 89A3258
.asciz "NINTENDOSio32ID_030820" .asciz "NINTENDOSio32ID_030820"

View File

@ -1,6 +1,7 @@
#ifndef GUARD_LIBRFU_H #ifndef GUARD_LIBRFU_H
#define GUARD_LIBRFU_H #define GUARD_LIBRFU_H
#include "global.h"
#include "main.h" #include "main.h"
enum enum
@ -70,34 +71,7 @@ union RfuPacket
struct RfuPacket8 rfuPacket8; struct RfuPacket8 rfuPacket8;
}; };
struct UnkLinkRfuStruct_02022B14Substruct struct STWIStatus
{
u16 unk_00_0:4;
u16 unk_00_4:1;
u16 unk_00_5:1;
u16 unk_00_6:1;
u16 isChampion:1;
u16 hasNationalDex:1;
u16 gameClear:1; // never read, redundant with isChampion
u16 unk_01_2:4; // always 3?
u16 unk_01_6:2;
u8 playerTrainerId[2];
};
struct __attribute__((packed, aligned(2))) UnkLinkRfuStruct_02022B14
{
struct UnkLinkRfuStruct_02022B14Substruct unk_00;
u8 unk_04[4];
u16 species:10;
u16 type:6;
u8 unk_0a_0:7;
u8 unk_0a_7:1;
u8 playerGender:1;
u8 level:7;
u8 unk_0c;
};
struct RfuStruct
{ {
vs32 unk_0; vs32 unk_0;
u8 txParams; u8 txParams;
@ -133,7 +107,7 @@ struct RfuIntrStruct
u8 block2[0x30]; u8 block2[0x30];
}; };
struct RfuUnk1 struct RfuSlotStatusUNI
{ {
u16 unk_0; u16 unk_0;
u8 unk_2; u8 unk_2;
@ -145,7 +119,7 @@ struct RfuUnk1
struct RfuIntrStruct unk_1c; struct RfuIntrStruct unk_1c;
}; };
struct RfuUnk2 struct RfuSlotStatusNI
{ {
u16 unk_0; u16 unk_0;
u16 unk_2; u16 unk_2;
@ -164,7 +138,7 @@ struct RfuUnk2
u8 unk_70[0x70]; u8 unk_70[0x70];
}; };
struct RfuUnk3 struct RfuFixed
{ {
u32 unk_0; u32 unk_0;
u32 unk_4; u32 unk_4;
@ -172,17 +146,19 @@ struct RfuUnk3
u32 unk_dc; u32 unk_dc;
}; };
#define RFU_GAME_NAME_LENGTH 13 // Possible length of game name set by rfu_REQB_configGameData
#define RFU_USER_NAME_LENGTH 8
struct RfuUnk5Sub struct RfuUnk5Sub
{ {
u16 unk_00; u16 unk_00;
u8 unk_02; u8 unk_02;
u16 unk_04; u16 unk_04;
struct UnkLinkRfuStruct_02022B14 unk_06; u8 gname[RFU_GAME_NAME_LENGTH + 2]; // Game name of parent candidate Game name of connection partner
u8 fill_13[1]; u8 uname[RFU_USER_NAME_LENGTH + 1]; // User name for parent candidate User name for connection partner
u8 playerName[PLAYER_NAME_LENGTH + 1];
}; };
struct RfuUnk5 struct RfuLinkStatus
{ {
u8 unk_00; u8 unk_00;
u8 unk_01; u8 unk_01;
@ -196,16 +172,16 @@ struct RfuUnk5
u8 filler_09[1]; u8 filler_09[1];
u8 unk_0a[4]; u8 unk_0a[4];
u8 filler_0e[6]; u8 filler_0e[6];
struct RfuUnk5Sub unk_14[4]; struct RfuUnk5Sub unk_14[5];
}; };
extern struct RfuStruct *gRfuState; extern struct STWIStatus *gSTWIStatus;
extern struct RfuUnk5 *gUnknown_03007890; extern struct RfuLinkStatus *gRfuLinkStatus;
extern u32 *gUnknown_03007894; extern u32 *gRfuStatic;
extern struct RfuUnk3* gUnknown_03007898; extern struct RfuFixed* gRfuFixed;
extern struct RfuUnk2* gUnknown_03007880[4]; extern struct RfuSlotStatusNI* gRfuSlotStatusNI[4];
extern struct RfuUnk1* gUnknown_03007870[4]; extern struct RfuSlotStatusUNI* gRfuSlotStatusUNI[4];
extern void* sub_82E53F4; extern void* sub_82E53F4;
extern void rfu_STC_clearAPIVariables(void); extern void rfu_STC_clearAPIVariables(void);
@ -221,7 +197,7 @@ void rfu_REQBN_watchLink(u16 a0, u8 *a1, u8 *a2, u8 *a3);
bool16 rfu_syncVBlank(void); bool16 rfu_syncVBlank(void);
void rfu_REQ_reset(void); void rfu_REQ_reset(void);
void rfu_REQ_configSystem(u16, u8, u8); void rfu_REQ_configSystem(u16, u8, u8);
void rfu_REQ_configGameData(u8, u16, struct UnkLinkRfuStruct_02022B14 *, u8 *); void rfu_REQ_configGameData(u8, u16, const u8 *gname, const u8 *uname);
void rfu_REQ_startSearchChild(void); void rfu_REQ_startSearchChild(void);
void rfu_REQ_pollSearchChild(void); void rfu_REQ_pollSearchChild(void);
void rfu_REQ_endSearchChild(void); void rfu_REQ_endSearchChild(void);

View File

@ -6,6 +6,33 @@
// Exported type declarations // Exported type declarations
struct UnkLinkRfuStruct_02022B14Substruct
{
u16 unk_00_0:4;
u16 unk_00_4:1;
u16 unk_00_5:1;
u16 unk_00_6:1;
u16 isChampion:1;
u16 hasNationalDex:1;
u16 gameClear:1; // never read, redundant with isChampion
u16 unk_01_2:4; // always 3?
u16 unk_01_6:2;
u8 playerTrainerId[2];
};
struct __attribute__((packed, aligned(2))) UnkLinkRfuStruct_02022B14
{
struct UnkLinkRfuStruct_02022B14Substruct unk_00;
u8 unk_04[4];
u16 species:10;
u16 type:6;
u8 unk_0a_0:7;
u8 unk_0a_7:1;
u8 playerGender:1;
u8 level:7;
u8 unk_0c;
};
struct UnkLinkRfuStruct_02022B2C struct UnkLinkRfuStruct_02022B2C
{ {
u8 unk_00; u8 unk_00;

View File

@ -1,7 +1,7 @@
#ifndef GUARD_UNION_ROOM_H #ifndef GUARD_UNION_ROOM_H
#define GUARD_UNION_ROOM_H #define GUARD_UNION_ROOM_H
#include "librfu.h" #include "link_rfu.h"
// Exported type declarations // Exported type declarations

View File

@ -163,7 +163,7 @@ IntrMain: @ 8000248
IntrMain_FoundIntr: IntrMain_FoundIntr:
strh r0, [r3, OFFSET_REG_IF - 0x200] strh r0, [r3, OFFSET_REG_IF - 0x200]
bic r2, r2, r0 bic r2, r2, r0
ldr r0, =gRfuState ldr r0, =gSTWIStatus
ldr r0, [r0] ldr r0, [r0]
ldrb r0, [r0, 0xA] ldrb r0, [r0, 0xA]
mov r1, 0x8 mov r1, 0x8

View File

@ -1,9 +1,9 @@
#include "global.h" #include "global.h"
#include "librfu.h" #include "librfu.h"
struct RfuUnk1* gUnknown_03007870[4]; struct RfuSlotStatusUNI* gRfuSlotStatusUNI[4];
struct RfuUnk2* gUnknown_03007880[4]; struct RfuSlotStatusNI* gRfuSlotStatusNI[4];
struct RfuUnk5 *gUnknown_03007890; struct RfuLinkStatus *gRfuLinkStatus;
u32 *gUnknown_03007894; u32 *gRfuStatic;
struct RfuUnk3* gUnknown_03007898; struct RfuFixed* gRfuFixed;
u8 gUnknown_030078A0[12]; u8 gRfuSIO32Id[12];

View File

@ -36,33 +36,33 @@
if (unk1 < num) if (unk1 < num)
return 1; return 1;
} }
gUnknown_03007890 = unk0; gRfuLinkStatus = unk0;
gUnknown_03007894 = unk0 + (0xB4 / sizeof(u32)); gRfuStatic = unk0 + (0xB4 / sizeof(u32));
gUnknown_03007898 = (struct RfuUnk3*)(unk0 + (0xDC / sizeof(u32))); gRfuFixed = (struct RfuFixed*)(unk0 + (0xDC / sizeof(u32)));
gUnknown_03007880[0] = (struct RfuUnk2*)(unk0 + (0x1BC / sizeof(u32))); gRfuSlotStatusNI[0] = (struct RfuSlotStatusNI*)(unk0 + (0x1BC / sizeof(u32)));
gUnknown_03007870[0] = (struct RfuUnk1*)(unk0 + (0x37C / sizeof(u32))); gRfuSlotStatusUNI[0] = (struct RfuSlotStatusUNI*)(unk0 + (0x37C / sizeof(u32)));
for (i = 1; i < 4; i++, num) for (i = 1; i < 4; i++, num)
{ {
gUnknown_03007880[i] = (struct RfuUnk2*)&gUnknown_03007880[i-1]->unk_70; gRfuSlotStatusNI[i] = (struct RfuSlotStatusNI*)&gRfuSlotStatusNI[i-1]->unk_70;
gUnknown_03007870[i] = (struct RfuUnk1*)&gUnknown_03007870[i-1]->unk_1c; gRfuSlotStatusUNI[i] = (struct RfuSlotStatusUNI*)&gRfuSlotStatusUNI[i-1]->unk_1c;
} }
gUnknown_03007898->unk_dc = (u32)&gUnknown_03007870[3]->unk_1c; gRfuFixed->unk_dc = (u32)&gRfuSlotStatusUNI[3]->unk_1c;
STWI_init_all(&gUnknown_03007870[3]->unk_1c, interrupt, copyInterruptToRam); STWI_init_all(&gRfuSlotStatusUNI[3]->unk_1c, interrupt, copyInterruptToRam);
rfu_STC_clearAPIVariables(); rfu_STC_clearAPIVariables();
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
gUnknown_03007880[i]->unk_68 = 0; gRfuSlotStatusNI[i]->unk_68 = 0;
gUnknown_03007880[i]->unk_6c = 0; gRfuSlotStatusNI[i]->unk_6c = 0;
gUnknown_03007870[i]->unk_14 = 0; gRfuSlotStatusUNI[i]->unk_14 = 0;
gUnknown_03007870[i]->unk_18 = 0; gRfuSlotStatusUNI[i]->unk_18 = 0;
} }
// Not matching, register differences // Not matching, register differences
v12 = (u16*)((u32)&sub_82E53F4 & ~1); v12 = (u16*)((u32)&sub_82E53F4 & ~1);
v13 = (u16*)gUnknown_03007898->unk_8; v13 = (u16*)gRfuFixed->unk_8;
for (i = 47; i != 0xFFFF; i--) for (i = 47; i != 0xFFFF; i--)
{ {
@ -71,7 +71,7 @@
++v13; ++v13;
} }
gUnknown_03007898->unk_4 = (u32)(&gUnknown_03007898->unk_8[1]); gRfuFixed->unk_4 = (u32)(&gRfuFixed->unk_8[1]);
return 0; return 0;
}*/ }*/

View File

@ -1,7 +1,7 @@
#include "global.h" #include "global.h"
#include "librfu.h" #include "librfu.h"
struct RfuStruct *gRfuState; struct STWIStatus *gSTWIStatus;
extern IntrFunc IntrSIO32(void); extern IntrFunc IntrSIO32(void);
@ -22,34 +22,34 @@ int STWI_reset_ClockCounter(void);
void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, bool8 copyInterruptToRam) void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, bool8 copyInterruptToRam)
{ {
// If we're copying our interrupt into RAM, DMA it to block1 and use // If we're copying our interrupt into RAM, DMA it to block1 and use
// block2 for our RfuStruct, otherwise block1 holds the RfuStruct. // block2 for our STWIStatus, otherwise block1 holds the STWIStatus.
// interrupt usually is a pointer to gIntrTable[1] // interrupt usually is a pointer to gIntrTable[1]
if (copyInterruptToRam == TRUE) if (copyInterruptToRam == TRUE)
{ {
*interrupt = (IntrFunc)interruptStruct->block1; *interrupt = (IntrFunc)interruptStruct->block1;
DmaCopy16(3, &IntrSIO32, interruptStruct->block1, 0x960); DmaCopy16(3, &IntrSIO32, interruptStruct->block1, 0x960);
gRfuState = (struct RfuStruct*)interruptStruct->block2; gSTWIStatus = (struct STWIStatus*)interruptStruct->block2;
} }
else else
{ {
*interrupt = (IntrFunc)IntrSIO32; *interrupt = (IntrFunc)IntrSIO32;
gRfuState = (struct RfuStruct*)interruptStruct->block1; gSTWIStatus = (struct STWIStatus*)interruptStruct->block1;
} }
gRfuState->rxPacket = (union RfuPacket*)interruptStruct->rxPacketAlloc; gSTWIStatus->rxPacket = (union RfuPacket*)interruptStruct->rxPacketAlloc;
gRfuState->txPacket = (union RfuPacket*)interruptStruct->txPacketAlloc; gSTWIStatus->txPacket = (union RfuPacket*)interruptStruct->txPacketAlloc;
gRfuState->msMode = 1; gSTWIStatus->msMode = 1;
gRfuState->unk_0 = 0; gSTWIStatus->unk_0 = 0;
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
gRfuState->unk_5 = 0; gSTWIStatus->unk_5 = 0;
gRfuState->unk_7 = 0; gSTWIStatus->unk_7 = 0;
gRfuState->unk_8 = 0; gSTWIStatus->unk_8 = 0;
gRfuState->unk_9 = 0; gSTWIStatus->unk_9 = 0;
gRfuState->timerState = 0; gSTWIStatus->timerState = 0;
gRfuState->timerActive = 0; gSTWIStatus->timerActive = 0;
gRfuState->unk_12 = 0; gSTWIStatus->unk_12 = 0;
gRfuState->unk_15 = 0; gSTWIStatus->unk_15 = 0;
gRfuState->unk_2c = 0; gSTWIStatus->unk_2c = 0;
REG_RCNT = 0x100; //TODO: mystery bit? REG_RCNT = 0x100; //TODO: mystery bit?
REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS; REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS;
@ -62,9 +62,9 @@ void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, b
void STWI_init_timer(IntrFunc *interrupt, int timerSelect) void STWI_init_timer(IntrFunc *interrupt, int timerSelect)
{ {
*interrupt = STWI_intr_timer; *interrupt = STWI_intr_timer;
gRfuState->timerSelect = timerSelect; gSTWIStatus->timerSelect = timerSelect;
IntrEnable(INTR_FLAG_TIMER0 << gRfuState->timerSelect); IntrEnable(INTR_FLAG_TIMER0 << gSTWIStatus->timerSelect);
} }
void AgbRFU_SoftReset(void) void AgbRFU_SoftReset(void)
@ -74,8 +74,8 @@ void AgbRFU_SoftReset(void)
REG_RCNT = 0x8000; REG_RCNT = 0x8000;
REG_RCNT = 0x80A0; // all these bits are undocumented REG_RCNT = 0x80A0; // all these bits are undocumented
timerL = &REG_TMCNT_L(gRfuState->timerSelect); timerL = &REG_TMCNT_L(gSTWIStatus->timerSelect);
timerH = &REG_TMCNT_H(gRfuState->timerSelect); timerH = &REG_TMCNT_H(gSTWIStatus->timerSelect);
*timerH = 0; *timerH = 0;
*timerL = 0; *timerL = 0;
*timerH = 0x83; *timerH = 0x83;
@ -85,24 +85,24 @@ void AgbRFU_SoftReset(void)
REG_RCNT = 0x80A0; REG_RCNT = 0x80A0;
REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS; REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS;
gRfuState->unk_0 = 0; gSTWIStatus->unk_0 = 0;
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
gRfuState->unk_5 = 0; gSTWIStatus->unk_5 = 0;
gRfuState->activeCommand = 0; gSTWIStatus->activeCommand = 0;
gRfuState->unk_7 = 0; gSTWIStatus->unk_7 = 0;
gRfuState->unk_8 = 0; gSTWIStatus->unk_8 = 0;
gRfuState->unk_9 = 0; gSTWIStatus->unk_9 = 0;
gRfuState->timerState = 0; gSTWIStatus->timerState = 0;
gRfuState->timerActive = 0; gSTWIStatus->timerActive = 0;
gRfuState->unk_12 = 0; gSTWIStatus->unk_12 = 0;
gRfuState->msMode = 1; gSTWIStatus->msMode = 1;
gRfuState->unk_15 = 0; gSTWIStatus->unk_15 = 0;
gRfuState->unk_2c = 0; gSTWIStatus->unk_2c = 0;
} }
void STWI_set_MS_mode(u8 mode) void STWI_set_MS_mode(u8 mode)
{ {
gRfuState->msMode = mode; gSTWIStatus->msMode = mode;
} }
u16 STWI_read_status(u8 index) u16 STWI_read_status(u8 index)
@ -110,13 +110,13 @@ u16 STWI_read_status(u8 index)
switch (index) switch (index)
{ {
case 0: case 0:
return gRfuState->unk_12; return gSTWIStatus->unk_12;
case 1: case 1:
return gRfuState->msMode; return gSTWIStatus->msMode;
case 2: case 2:
return gRfuState->unk_0; return gSTWIStatus->unk_0;
case 3: case 3:
return gRfuState->activeCommand; return gSTWIStatus->activeCommand;
default: default:
return 0xFFFF; return 0xFFFF;
} }
@ -134,31 +134,31 @@ void STWI_init_Callback_S(void)
void STWI_set_Callback_M(void *callback) void STWI_set_Callback_M(void *callback)
{ {
gRfuState->callbackM = callback; gSTWIStatus->callbackM = callback;
} }
void STWI_set_Callback_S(void *callback) void STWI_set_Callback_S(void *callback)
{ {
gRfuState->callbackS = callback; gSTWIStatus->callbackS = callback;
} }
void STWI_set_Callback_ID(u32 id) void STWI_set_Callback_ID(u32 id)
{ {
gRfuState->callbackID = id; gSTWIStatus->callbackID = id;
} }
u16 STWI_poll_CommandEnd(void) u16 STWI_poll_CommandEnd(void)
{ {
while (gRfuState->unk_2c == TRUE) while (gSTWIStatus->unk_2c == TRUE)
; ;
return gRfuState->unk_12; return gSTWIStatus->unk_12;
} }
void STWI_send_ResetREQ(void) void STWI_send_ResetREQ(void)
{ {
if (!STWI_init(RFU_RESET)) if (!STWI_init(RFU_RESET))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -167,7 +167,7 @@ void STWI_send_LinkStatusREQ(void)
{ {
if (!STWI_init(RFU_LINK_STATUS)) if (!STWI_init(RFU_LINK_STATUS))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -176,7 +176,7 @@ void STWI_send_VersionStatusREQ(void)
{ {
if (!STWI_init(RFU_VERSION_STATUS)) if (!STWI_init(RFU_VERSION_STATUS))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -185,7 +185,7 @@ void STWI_send_SystemStatusREQ(void)
{ {
if (!STWI_init(RFU_SYSTEM_STATUS)) if (!STWI_init(RFU_SYSTEM_STATUS))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -194,7 +194,7 @@ void STWI_send_SlotStatusREQ(void)
{ {
if (!STWI_init(RFU_SLOT_STATUS)) if (!STWI_init(RFU_SLOT_STATUS))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -203,7 +203,7 @@ void STWI_send_ConfigStatusREQ(void)
{ {
if (!STWI_init(RFU_CONFIG_STATUS)) if (!STWI_init(RFU_CONFIG_STATUS))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -215,10 +215,10 @@ void STWI_send_GameConfigREQ(u8 * unk1, u8 *data)
if (!STWI_init(RFU_GAME_CONFIG)) if (!STWI_init(RFU_GAME_CONFIG))
{ {
gRfuState->txParams = 6; gSTWIStatus->txParams = 6;
//TODO: what is unk1 //TODO: what is unk1
packetBytes = gRfuState->txPacket->rfuPacket8.data; packetBytes = gSTWIStatus->txPacket->rfuPacket8.data;
packetBytes += sizeof(u32); packetBytes += sizeof(u32);
*(u16*)packetBytes = *(u16*)unk1; *(u16*)packetBytes = *(u16*)unk1;
@ -249,9 +249,9 @@ void STWI_send_SystemConfigREQ(u16 unk1, u8 unk2, u8 unk3)
{ {
u8 *packetBytes; u8 *packetBytes;
gRfuState->txParams = 1; gSTWIStatus->txParams = 1;
packetBytes = gRfuState->txPacket->rfuPacket8.data; packetBytes = gSTWIStatus->txPacket->rfuPacket8.data;
packetBytes += sizeof(u32); packetBytes += sizeof(u32);
*packetBytes++ = unk3; *packetBytes++ = unk3;
@ -265,7 +265,7 @@ void STWI_send_SC_StartREQ(void)
{ {
if (!STWI_init(RFU_SC_START)) if (!STWI_init(RFU_SC_START))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -274,7 +274,7 @@ void STWI_send_SC_PollingREQ(void)
{ {
if (!STWI_init(RFU_SC_POLLING)) if (!STWI_init(RFU_SC_POLLING))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -283,7 +283,7 @@ void STWI_send_SC_EndREQ(void)
{ {
if (!STWI_init(RFU_SC_END)) if (!STWI_init(RFU_SC_END))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -292,7 +292,7 @@ void STWI_send_SP_StartREQ(void)
{ {
if (!STWI_init(RFU_SP_START)) if (!STWI_init(RFU_SP_START))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -301,7 +301,7 @@ void STWI_send_SP_PollingREQ(void)
{ {
if (!STWI_init(RFU_SP_POLLING)) if (!STWI_init(RFU_SP_POLLING))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -310,7 +310,7 @@ void STWI_send_SP_EndREQ(void)
{ {
if (!STWI_init(RFU_SP_END)) if (!STWI_init(RFU_SP_END))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -319,8 +319,8 @@ void STWI_send_CP_StartREQ(u16 unk1)
{ {
if (!STWI_init(RFU_CP_START)) if (!STWI_init(RFU_CP_START))
{ {
gRfuState->txParams = 1; gSTWIStatus->txParams = 1;
gRfuState->txPacket->rfuPacket32.data[0] = unk1; gSTWIStatus->txPacket->rfuPacket32.data[0] = unk1;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -329,7 +329,7 @@ void STWI_send_CP_PollingREQ(void)
{ {
if (!STWI_init(RFU_CP_POLLING)) if (!STWI_init(RFU_CP_POLLING))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -338,7 +338,7 @@ void STWI_send_CP_EndREQ(void)
{ {
if (!STWI_init(RFU_CP_END)) if (!STWI_init(RFU_CP_END))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -351,8 +351,8 @@ void STWI_send_DataTxREQ(void *in, u8 size)
if (size & (sizeof(u32) - 1)) if (size & (sizeof(u32) - 1))
txParams += 1; txParams += 1;
gRfuState->txParams = txParams; gSTWIStatus->txParams = txParams;
CpuCopy32(in, gRfuState->txPacket->rfuPacket32.data, gRfuState->txParams * sizeof(u32)); CpuCopy32(in, gSTWIStatus->txPacket->rfuPacket32.data, gSTWIStatus->txParams * sizeof(u32));
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -365,8 +365,8 @@ void STWI_send_DataTxAndChangeREQ(void *in, u8 size)
if (size & (sizeof(u32) - 1)) if (size & (sizeof(u32) - 1))
txParams += 1; txParams += 1;
gRfuState->txParams = txParams; gSTWIStatus->txParams = txParams;
CpuCopy32(in, gRfuState->txPacket->rfuPacket32.data, gRfuState->txParams * sizeof(u32)); CpuCopy32(in, gSTWIStatus->txPacket->rfuPacket32.data, gSTWIStatus->txParams * sizeof(u32));
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -375,7 +375,7 @@ void STWI_send_DataRxREQ(void)
{ {
if (!STWI_init(RFU_DATA_RX)) if (!STWI_init(RFU_DATA_RX))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -384,7 +384,7 @@ void STWI_send_MS_ChangeREQ(void)
{ {
if (!STWI_init(RFU_MS_CHANGE)) if (!STWI_init(RFU_MS_CHANGE))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -395,15 +395,15 @@ void STWI_send_DataReadyAndChangeREQ(u8 unk)
{ {
if (!unk) if (!unk)
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
} }
else else
{ {
u8 *packetBytes; u8 *packetBytes;
gRfuState->txParams = 1; gSTWIStatus->txParams = 1;
packetBytes = gRfuState->txPacket->rfuPacket8.data; packetBytes = gSTWIStatus->txPacket->rfuPacket8.data;
packetBytes += sizeof(u32); packetBytes += sizeof(u32);
*packetBytes++ = unk; *packetBytes++ = unk;
@ -422,9 +422,9 @@ void STWI_send_DisconnectedAndChangeREQ(u8 unk0, u8 unk1)
{ {
u8 *packetBytes; u8 *packetBytes;
gRfuState->txParams = 1; gSTWIStatus->txParams = 1;
packetBytes = gRfuState->txPacket->rfuPacket8.data; packetBytes = gSTWIStatus->txPacket->rfuPacket8.data;
packetBytes += sizeof(u32); packetBytes += sizeof(u32);
*packetBytes++ = unk0; *packetBytes++ = unk0;
@ -440,7 +440,7 @@ void STWI_send_ResumeRetransmitAndChangeREQ(void)
{ {
if (!STWI_init(RFU_RESUME_RETRANSMIT_AND_CHANGE)) if (!STWI_init(RFU_RESUME_RETRANSMIT_AND_CHANGE))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -449,8 +449,8 @@ void STWI_send_DisconnectREQ(u8 unk)
{ {
if (!STWI_init(RFU_DISCONNECT)) if (!STWI_init(RFU_DISCONNECT))
{ {
gRfuState->txParams = 1; gSTWIStatus->txParams = 1;
gRfuState->txPacket->rfuPacket32.data[0] = unk; gSTWIStatus->txPacket->rfuPacket32.data[0] = unk;
STWI_start_Command(); STWI_start_Command();
} }
@ -460,8 +460,8 @@ void STWI_send_TestModeREQ(u8 unk0, u8 unk1)
{ {
if (!STWI_init(RFU_TEST_MODE)) if (!STWI_init(RFU_TEST_MODE))
{ {
gRfuState->txParams = 1; gSTWIStatus->txParams = 1;
gRfuState->txPacket->rfuPacket32.data[0] = unk0 | (unk1 << 8); gSTWIStatus->txPacket->rfuPacket32.data[0] = unk0 | (unk1 << 8);
STWI_start_Command(); STWI_start_Command();
} }
@ -474,10 +474,10 @@ void STWI_send_CPR_StartREQ(u16 unk0, u16 unk1, u8 unk2)
if (!STWI_init(RFU_CPR_START)) if (!STWI_init(RFU_CPR_START))
{ {
gRfuState->txParams = 2; gSTWIStatus->txParams = 2;
arg1 = unk1 | (unk0 << 16); arg1 = unk1 | (unk0 << 16);
packetData = gRfuState->txPacket->rfuPacket32.data; packetData = gSTWIStatus->txPacket->rfuPacket32.data;
packetData[0] = arg1; packetData[0] = arg1;
packetData[1] = unk2; packetData[1] = unk2;
@ -489,7 +489,7 @@ void STWI_send_CPR_PollingREQ(void)
{ {
if (!STWI_init(RFU_CPR_POLLING)) if (!STWI_init(RFU_CPR_POLLING))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -498,7 +498,7 @@ void STWI_send_CPR_EndREQ(void)
{ {
if (!STWI_init(RFU_CPR_END)) if (!STWI_init(RFU_CPR_END))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
@ -507,18 +507,18 @@ void STWI_send_StopModeREQ(void)
{ {
if (!STWI_init(RFU_STOP_MODE)) if (!STWI_init(RFU_STOP_MODE))
{ {
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
STWI_start_Command(); STWI_start_Command();
} }
} }
void STWI_intr_timer(void) void STWI_intr_timer(void)
{ {
switch (gRfuState->timerState) switch (gSTWIStatus->timerState)
{ {
//TODO: Make an enum for these //TODO: Make an enum for these
case 2: case 2:
gRfuState->timerActive = 1; gSTWIStatus->timerActive = 1;
STWI_set_timer(50); STWI_set_timer(50);
break; break;
case 1: case 1:
@ -527,11 +527,11 @@ void STWI_intr_timer(void)
STWI_restart_Command(); STWI_restart_Command();
break; break;
case 3: case 3:
gRfuState->timerActive = 1; gSTWIStatus->timerActive = 1;
STWI_stop_timer(); STWI_stop_timer();
STWI_reset_ClockCounter(); STWI_reset_ClockCounter();
if (gRfuState->callbackM) if (gSTWIStatus->callbackM)
gRfuState->callbackM(255, 0); gSTWIStatus->callbackM(255, 0);
break; break;
} }
} }
@ -541,79 +541,79 @@ void STWI_set_timer(u8 unk)
vu16 *timerL; vu16 *timerL;
vu16 *timerH; vu16 *timerH;
timerL = &REG_TMCNT_L(gRfuState->timerSelect); timerL = &REG_TMCNT_L(gSTWIStatus->timerSelect);
timerH = &REG_TMCNT_H(gRfuState->timerSelect); timerH = &REG_TMCNT_H(gSTWIStatus->timerSelect);
REG_IME = 0; REG_IME = 0;
switch (unk) switch (unk)
{ {
case 50: case 50:
*timerL = 0xFCCB; *timerL = 0xFCCB;
gRfuState->timerState = 1; gSTWIStatus->timerState = 1;
break; break;
case 80: case 80:
*timerL = 0xFAE0; *timerL = 0xFAE0;
gRfuState->timerState = 2; gSTWIStatus->timerState = 2;
break; break;
case 100: case 100:
*timerL = 0xF996; *timerL = 0xF996;
gRfuState->timerState = 3; gSTWIStatus->timerState = 3;
break; break;
case 130: case 130:
*timerL = 0xF7AD; *timerL = 0xF7AD;
gRfuState->timerState = 4; gSTWIStatus->timerState = 4;
break; break;
} }
*timerH = TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_1024CLK; *timerH = TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_1024CLK;
REG_IF = INTR_FLAG_TIMER0 << gRfuState->timerSelect; REG_IF = INTR_FLAG_TIMER0 << gSTWIStatus->timerSelect;
REG_IME = 1; REG_IME = 1;
} }
void STWI_stop_timer(void) void STWI_stop_timer(void)
{ {
gRfuState->timerState = 0; gSTWIStatus->timerState = 0;
REG_TMCNT_L(gRfuState->timerSelect) = 0; REG_TMCNT_L(gSTWIStatus->timerSelect) = 0;
REG_TMCNT_H(gRfuState->timerSelect) = 0; REG_TMCNT_H(gSTWIStatus->timerSelect) = 0;
} }
u16 STWI_init(u8 request) u16 STWI_init(u8 request)
{ {
if (!REG_IME) if (!REG_IME)
{ {
gRfuState->unk_12 = 6; gSTWIStatus->unk_12 = 6;
if (gRfuState->callbackM) if (gSTWIStatus->callbackM)
gRfuState->callbackM(request, gRfuState->unk_12); gSTWIStatus->callbackM(request, gSTWIStatus->unk_12);
return TRUE; return TRUE;
} }
else if (gRfuState->unk_2c == TRUE) else if (gSTWIStatus->unk_2c == TRUE)
{ {
gRfuState->unk_12 = 2; gSTWIStatus->unk_12 = 2;
gRfuState->unk_2c = FALSE; gSTWIStatus->unk_2c = FALSE;
if (gRfuState->callbackM) if (gSTWIStatus->callbackM)
gRfuState->callbackM(request, gRfuState->unk_12); gSTWIStatus->callbackM(request, gSTWIStatus->unk_12);
return TRUE; return TRUE;
} }
else if(!gRfuState->msMode) else if(!gSTWIStatus->msMode)
{ {
gRfuState->unk_12 = 4; gSTWIStatus->unk_12 = 4;
if (gRfuState->callbackM) if (gSTWIStatus->callbackM)
gRfuState->callbackM(request, gRfuState->unk_12, gRfuState); gSTWIStatus->callbackM(request, gSTWIStatus->unk_12, gSTWIStatus);
return TRUE; return TRUE;
} }
else else
{ {
gRfuState->unk_2c = TRUE; gSTWIStatus->unk_2c = TRUE;
gRfuState->activeCommand = request; gSTWIStatus->activeCommand = request;
gRfuState->unk_0 = 0; gSTWIStatus->unk_0 = 0;
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
gRfuState->unk_5 = 0; gSTWIStatus->unk_5 = 0;
gRfuState->unk_7 = 0; gSTWIStatus->unk_7 = 0;
gRfuState->unk_8 = 0; gSTWIStatus->unk_8 = 0;
gRfuState->unk_9 = 0; gSTWIStatus->unk_9 = 0;
gRfuState->timerState = 0; gSTWIStatus->timerState = 0;
gRfuState->timerActive = 0; gSTWIStatus->timerActive = 0;
gRfuState->unk_12 = 0; gSTWIStatus->unk_12 = 0;
gRfuState->unk_15 = 0; gSTWIStatus->unk_15 = 0;
REG_RCNT = 0x100; REG_RCNT = 0x100;
REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS; REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS;
@ -626,15 +626,15 @@ int STWI_start_Command()
u16 imeTemp; u16 imeTemp;
// Yes, it matters that it's casted to a u32... // Yes, it matters that it's casted to a u32...
*(u32*)gRfuState->txPacket->rfuPacket8.data = 0x99660000 | (gRfuState->txParams << 8) | gRfuState->activeCommand; *(u32*)gSTWIStatus->txPacket->rfuPacket8.data = 0x99660000 | (gSTWIStatus->txParams << 8) | gSTWIStatus->activeCommand;
REG_SIODATA32 = gRfuState->txPacket->rfuPacket32.command; REG_SIODATA32 = gSTWIStatus->txPacket->rfuPacket32.command;
gRfuState->unk_0 = 0; gSTWIStatus->unk_0 = 0;
gRfuState->unk_5 = 1; gSTWIStatus->unk_5 = 1;
imeTemp = REG_IME; imeTemp = REG_IME;
REG_IME = 0; REG_IME = 0;
REG_IE |= (INTR_FLAG_TIMER0 << gRfuState->timerSelect); REG_IE |= (INTR_FLAG_TIMER0 << gSTWIStatus->timerSelect);
REG_IE |= INTR_FLAG_SERIAL; REG_IE |= INTR_FLAG_SERIAL;
REG_IME = imeTemp; REG_IME = imeTemp;
@ -645,30 +645,30 @@ int STWI_start_Command()
int STWI_restart_Command(void) int STWI_restart_Command(void)
{ {
if (gRfuState->unk_15 <= 1) if (gSTWIStatus->unk_15 <= 1)
{ {
gRfuState->unk_15++; gSTWIStatus->unk_15++;
STWI_start_Command(); STWI_start_Command();
} }
else else
{ {
if (gRfuState->activeCommand == RFU_MS_CHANGE || gRfuState->activeCommand == RFU_DATA_TX_AND_CHANGE || gRfuState->activeCommand == RFU_UNK35 || gRfuState->activeCommand == RFU_RESUME_RETRANSMIT_AND_CHANGE) if (gSTWIStatus->activeCommand == RFU_MS_CHANGE || gSTWIStatus->activeCommand == RFU_DATA_TX_AND_CHANGE || gSTWIStatus->activeCommand == RFU_UNK35 || gSTWIStatus->activeCommand == RFU_RESUME_RETRANSMIT_AND_CHANGE)
{ {
gRfuState->unk_12 = 1; gSTWIStatus->unk_12 = 1;
gRfuState->unk_2c = 0; gSTWIStatus->unk_2c = 0;
if (gRfuState->callbackM) if (gSTWIStatus->callbackM)
gRfuState->callbackM(gRfuState->activeCommand, gRfuState->unk_12); gSTWIStatus->callbackM(gSTWIStatus->activeCommand, gSTWIStatus->unk_12);
} }
else else
{ {
gRfuState->unk_12 = 1; gSTWIStatus->unk_12 = 1;
gRfuState->unk_2c = 0; gSTWIStatus->unk_2c = 0;
if (gRfuState->callbackM) if (gSTWIStatus->callbackM)
gRfuState->callbackM(gRfuState->activeCommand, gRfuState->unk_12); gSTWIStatus->callbackM(gSTWIStatus->activeCommand, gSTWIStatus->unk_12);
gRfuState->unk_0 = 4; //TODO: what's 4 gSTWIStatus->unk_0 = 4; //TODO: what's 4
} }
} }
@ -677,9 +677,9 @@ int STWI_restart_Command(void)
int STWI_reset_ClockCounter(void) int STWI_reset_ClockCounter(void)
{ {
gRfuState->unk_0 = 5; //TODO: what is 5 gSTWIStatus->unk_0 = 5; //TODO: what is 5
gRfuState->txParams = 0; gSTWIStatus->txParams = 0;
gRfuState->unk_5 = 0; gSTWIStatus->unk_5 = 0;
REG_SIODATA32 = (1 << 31); REG_SIODATA32 = (1 << 31);
REG_SIOCNT = 0; REG_SIOCNT = 0;
REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS; REG_SIOCNT = SIO_INTR_ENABLE | SIO_32BIT_MODE | SIO_115200_BPS;

View File

@ -364,7 +364,7 @@ u32 sub_800BEC0(void)
void rfu_REQ_sendData_wrapper(u8 r2) void rfu_REQ_sendData_wrapper(u8 r2)
{ {
u8 val; u8 val;
if (!gUnknown_03007890->unk_00) if (!gRfuLinkStatus->unk_00)
{ {
val = gUnknown_03004140.unk_02; val = gUnknown_03004140.unk_02;
r2 = 0; r2 = 0;
@ -515,14 +515,14 @@ u8 sub_800C12C(u16 r6, u16 r8)
sub_800D30C(0xF3, 0x01); sub_800D30C(0xF3, 0x01);
return 2; return 2;
} }
for (i = 0; i < gUnknown_03007890->unk_08; i++) for (i = 0; i < gRfuLinkStatus->unk_08; i++)
{ {
if (gUnknown_03007890->unk_14[i].unk_00 == r6) if (gRfuLinkStatus->unk_14[i].unk_00 == r6)
{ {
break; break;
} }
} }
if (gUnknown_03007890->unk_08 == 0 || i == gUnknown_03007890->unk_08) if (gRfuLinkStatus->unk_08 == 0 || i == gRfuLinkStatus->unk_08)
{ {
gUnknown_03004140.unk_14 = 3; gUnknown_03004140.unk_14 = 3;
sub_800D30C(0xF3, 0x01); sub_800D30C(0xF3, 0x01);
@ -561,7 +561,7 @@ void sub_800C210(u8 a0)
gUnknown_03004140.unk_34[i] = 0; gUnknown_03004140.unk_34[i] = 0;
} }
} }
i = gUnknown_03007890->unk_03 & a0; i = gRfuLinkStatus->unk_03 & a0;
if (i) if (i)
{ {
sub_800D334(i); sub_800D334(i);
@ -630,8 +630,8 @@ void sub_800C27C(bool8 a0)
case 16: case 16:
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_11; gUnknown_03004140.unk_04 = gUnknown_03004140.unk_11;
gUnknown_03004140.unk_05 = gUnknown_03004140.unk_12; gUnknown_03004140.unk_05 = gUnknown_03004140.unk_12;
sub_800D334(gUnknown_03007890->unk_03); sub_800D334(gRfuLinkStatus->unk_03);
gUnknown_03004140.unk_14 = gUnknown_03007890->unk_03; gUnknown_03004140.unk_14 = gRfuLinkStatus->unk_03;
sub_800D30C(0x33, 0x01); sub_800D30C(0x33, 0x01);
return; return;
case 17: case 17:
@ -703,7 +703,7 @@ bool8 sub_800C36C(u16 a0)
} }
sub_800D610(); sub_800D610();
} }
if (gUnknown_03007890->unk_00 == 1) if (gRfuLinkStatus->unk_00 == 1)
{ {
if (sp2) if (sp2)
{ {
@ -800,7 +800,7 @@ void sub_800C54C(u32 a0)
rfu_REQ_configSystem(gUnknown_03004140.unk_3c->unk_02, gUnknown_03004140.unk_3c->unk_00, gUnknown_03004140.unk_3c->unk_01); rfu_REQ_configSystem(gUnknown_03004140.unk_3c->unk_02, gUnknown_03004140.unk_3c->unk_00, gUnknown_03004140.unk_3c->unk_01);
break; break;
case 4: case 4:
rfu_REQ_configGameData(gUnknown_03004140.unk_3c->unk_04, gUnknown_03004140.unk_3c->unk_06, gUnknown_03004140.unk_3c->unk_08, gUnknown_03004140.unk_3c->unk_0c); rfu_REQ_configGameData(gUnknown_03004140.unk_3c->unk_04, gUnknown_03004140.unk_3c->unk_06, (const u8 *)gUnknown_03004140.unk_3c->unk_08, gUnknown_03004140.unk_3c->unk_0c);
break; break;
case 5: case 5:
rfu_REQ_startSearchChild(); rfu_REQ_startSearchChild();
@ -834,7 +834,7 @@ void sub_800C54C(u32 a0)
case 15: case 15:
break; break;
case 16: case 16:
rfu_REQ_CHILD_startConnectRecovery(gUnknown_03007890->unk_03); rfu_REQ_CHILD_startConnectRecovery(gRfuLinkStatus->unk_03);
break; break;
case 17: case 17:
rfu_REQ_CHILD_pollConnectRecovery(); rfu_REQ_CHILD_pollConnectRecovery();
@ -857,7 +857,7 @@ void sub_800C54C(u32 a0)
gUnknown_03004140.unk_0e = 0; gUnknown_03004140.unk_0e = 0;
} }
} while (gUnknown_03004140.unk_04 == 18 || gUnknown_03004140.unk_04 == 19); } while (gUnknown_03004140.unk_04 == 18 || gUnknown_03004140.unk_04 == 19);
if (gUnknown_03007890->unk_00 != 1 || !sub_800C36C(0)) if (gRfuLinkStatus->unk_00 != 1 || !sub_800C36C(0))
{ {
sub_800CF34(); sub_800CF34();
sub_800D158(); sub_800D158();
@ -983,7 +983,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
{ {
sub_800D30C(0x20, 0x01); sub_800D30C(0x20, 0x01);
} }
if (gUnknown_03004140.unk_0b && gUnknown_03004140.unk_1a != 1 && gUnknown_03007890->unk_08 == 4) if (gUnknown_03004140.unk_0b && gUnknown_03004140.unk_1a != 1 && gRfuLinkStatus->unk_08 == 4)
{ {
rfu_REQ_endSearchParent(); rfu_REQ_endSearchParent();
rfu_waitREQComplete(); rfu_waitREQComplete();
@ -1059,11 +1059,11 @@ static void sub_800C7B4(u16 r8, u16 r6)
case 50: case 50:
if (r6 == 0) if (r6 == 0)
{ {
gUnknown_03004140.unk_14 = gUnknown_03007890->unk_03; gUnknown_03004140.unk_14 = gRfuLinkStatus->unk_03;
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 17; gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 17;
for (gUnknown_03004140.unk_10 = 0; gUnknown_03004140.unk_10 < 4; gUnknown_03004140.unk_10 ++) for (gUnknown_03004140.unk_10 = 0; gUnknown_03004140.unk_10 < 4; gUnknown_03004140.unk_10 ++)
{ {
if ((gUnknown_03007890->unk_03 >> gUnknown_03004140.unk_10) & 1) if ((gRfuLinkStatus->unk_03 >> gUnknown_03004140.unk_10) & 1)
{ {
break; break;
} }
@ -1092,7 +1092,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
else else
{ {
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0; gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0;
sub_800D334(gUnknown_03007890->unk_03); sub_800D334(gRfuLinkStatus->unk_03);
gUnknown_03004140.unk_1e = 0x33; gUnknown_03004140.unk_1e = 0x33;
} }
gUnknown_03004140.unk_34[gUnknown_03004140.unk_10] = 0; gUnknown_03004140.unk_34[gUnknown_03004140.unk_10] = 0;
@ -1126,7 +1126,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
{ {
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0; gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0;
sub_800D610(); sub_800D610();
sub_800D334(gUnknown_03007890->unk_02 | gUnknown_03007890->unk_03); sub_800D334(gRfuLinkStatus->unk_02 | gRfuLinkStatus->unk_03);
gUnknown_03004140.unk_14 = sp0; gUnknown_03004140.unk_14 = sp0;
sub_800D30C(0x25, 0x01); sub_800D30C(0x25, 0x01);
} }
@ -1148,10 +1148,10 @@ static void sub_800C7B4(u16 r8, u16 r6)
rfu_REQ_RFUStatus(); rfu_REQ_RFUStatus();
rfu_waitREQComplete(); rfu_waitREQComplete();
rfu_getRFUStatus(&sp0); rfu_getRFUStatus(&sp0);
if (sp0 == 0 && gUnknown_03007890->unk_00 == 0) if (sp0 == 0 && gRfuLinkStatus->unk_00 == 0)
{ {
stwiRecvBuffer = rfu_getSTWIRecvBuffer(); stwiRecvBuffer = rfu_getSTWIRecvBuffer();
stwiRecvBuffer[4] = gUnknown_03007890->unk_02; stwiRecvBuffer[4] = gRfuLinkStatus->unk_02;
stwiRecvBuffer[5] = 1; stwiRecvBuffer[5] = 1;
sub_800C36C(0x29); sub_800C36C(0x29);
r6 = 0; r6 = 0;
@ -1191,7 +1191,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
gUnknown_03004140.unk_00 &= ~gUnknown_03004140.unk_14; gUnknown_03004140.unk_00 &= ~gUnknown_03004140.unk_14;
if (gUnknown_03004140.unk_07) if (gUnknown_03004140.unk_07)
{ {
if (gUnknown_03007890->unk_00 == 0xFF) if (gRfuLinkStatus->unk_00 == 0xFF)
{ {
if (gUnknown_03004140.unk_07 == 8) if (gUnknown_03004140.unk_07 == 8)
{ {
@ -1206,7 +1206,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
} }
} }
} }
if (gUnknown_03007890->unk_00 == 0xFF) if (gRfuLinkStatus->unk_00 == 0xFF)
{ {
if (gUnknown_03004140.unk_04 == 0) if (gUnknown_03004140.unk_04 == 0)
{ {
@ -1221,7 +1221,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
break; break;
case 38: case 38:
sub_800D20C(); sub_800D20C();
if (gUnknown_03007890->unk_00 != 0xFF) if (gRfuLinkStatus->unk_00 != 0xFF)
{ {
sub_800D30C(0x50, 0x00); sub_800D30C(0x50, 0x00);
} }
@ -1246,8 +1246,8 @@ static void sub_800C7B4(u16 r8, u16 r6)
{ {
if (r8 == 28 && r6 != 0 && gUnknown_03004140.unk_07 == 4) if (r8 == 28 && r6 != 0 && gUnknown_03004140.unk_07 == 4)
{ {
gUnknown_03007890->unk_00 = 1; gRfuLinkStatus->unk_00 = 1;
gUnknown_03007890->unk_02 = 15; gRfuLinkStatus->unk_02 = 15;
sub_800D334(15); sub_800D334(15);
rfu_waitREQComplete(); rfu_waitREQComplete();
return; return;
@ -1279,7 +1279,7 @@ static void sub_800CEB0(u16 r6)
r7 = gUnknown_03004140.unk_0e; r7 = gUnknown_03004140.unk_0e;
gUnknown_03004140.unk_0e = 0; gUnknown_03004140.unk_0e = 0;
gUnknown_03004140.unk_0f = 1; gUnknown_03004140.unk_0f = 1;
if (gUnknown_03007890->unk_00 == 0) if (gRfuLinkStatus->unk_00 == 0)
{ {
sub_800C36C(r6); sub_800C36C(r6);
if (gUnknown_03004140.unk_02 != 1) if (gUnknown_03004140.unk_02 != 1)
@ -1321,8 +1321,8 @@ static void sub_800CF34(void)
if (gUnknown_03004140.unk_04 == 5 || gUnknown_03004140.unk_04 == 6 || gUnknown_03004140.unk_04 == 7 || gUnknown_03004140.unk_04 == 8) if (gUnknown_03004140.unk_04 == 5 || gUnknown_03004140.unk_04 == 6 || gUnknown_03004140.unk_04 == 7 || gUnknown_03004140.unk_04 == 8)
{ {
flags = ((gUnknown_03007890->unk_02 ^ gUnknown_03004140.unk_0c) & gUnknown_03007890->unk_02) & ~gUnknown_03007890->unk_07; flags = ((gRfuLinkStatus->unk_02 ^ gUnknown_03004140.unk_0c) & gRfuLinkStatus->unk_02) & ~gRfuLinkStatus->unk_07;
gUnknown_03004140.unk_0c = gUnknown_03007890->unk_02; gUnknown_03004140.unk_0c = gRfuLinkStatus->unk_02;
if (flags) if (flags)
{ {
gUnknown_03004140.unk_14 = flags; gUnknown_03004140.unk_14 = flags;
@ -1340,14 +1340,14 @@ static void sub_800CF34(void)
} }
else if (gUnknown_03004140.unk_24 & r4) else if (gUnknown_03004140.unk_24 & r4)
{ {
if (gUnknown_03007880[i]->unk_34 == 0x46) if (gRfuSlotStatusNI[i]->unk_34 == 0x46)
{ {
if (gUnknown_03007880[i]->unk_61 == 1) if (gRfuSlotStatusNI[i]->unk_61 == 1)
{ {
r5 = 0x02; r5 = 0x02;
for (ptr = gUnknown_03004140.unk_20; *ptr != 0xFFFF; ptr++) for (ptr = gUnknown_03004140.unk_20; *ptr != 0xFFFF; ptr++)
{ {
if (gUnknown_03007890->unk_14[i].unk_04 == *ptr) if (gRfuLinkStatus->unk_14[i].unk_04 == *ptr)
{ {
gUnknown_03004140.unk_00 |= r4; gUnknown_03004140.unk_00 |= r4;
gUnknown_03004140.unk_01++; gUnknown_03004140.unk_01++;
@ -1386,7 +1386,7 @@ static void sub_800CF34(void)
if (gUnknown_03004140.unk_0d) if (gUnknown_03004140.unk_0d)
{ {
r5 = 0x01; r5 = 0x01;
if (gUnknown_03007890->unk_06 && ((gUnknown_03004140.unk_03 & gUnknown_03004140.unk_00) != gUnknown_03004140.unk_00)) if (gRfuLinkStatus->unk_06 && ((gUnknown_03004140.unk_03 & gUnknown_03004140.unk_00) != gUnknown_03004140.unk_00))
{ {
r5 = 0x00; r5 = 0x00;
} }
@ -1434,7 +1434,7 @@ static void sub_800D158(void)
REG_IME = 0; REG_IME = 0;
if (gUnknown_03004140.unk_04 == 15) if (gUnknown_03004140.unk_04 == 15)
{ {
if (--gUnknown_03004140.unk_28[gUnknown_03004140.unk_10] == 0 || gUnknown_03007880[gUnknown_03004140.unk_10]->unk_0 == 0x27) if (--gUnknown_03004140.unk_28[gUnknown_03004140.unk_10] == 0 || gRfuSlotStatusNI[gUnknown_03004140.unk_10]->unk_0 == 0x27)
{ {
sub_800D630(); sub_800D630();
gUnknown_03004140.unk_04 = 24; gUnknown_03004140.unk_04 = 24;
@ -1453,7 +1453,7 @@ static void sub_800D158(void)
if (gUnknown_03004140.unk_02 == 0) if (gUnknown_03004140.unk_02 == 0)
{ {
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0; gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0;
sub_800D334(gUnknown_03007890->unk_02 | gUnknown_03007890->unk_03); sub_800D334(gRfuLinkStatus->unk_02 | gRfuLinkStatus->unk_03);
gUnknown_03004140.unk_14 = 0; gUnknown_03004140.unk_14 = 0;
sub_800D30C(0x25, 0x01); sub_800D30C(0x25, 0x01);
} }
@ -1462,7 +1462,7 @@ static void sub_800D158(void)
static void sub_800D20C(void) static void sub_800D20C(void)
{ {
if (gUnknown_03004140.unk_04 == 15 && gUnknown_03007880[gUnknown_03004140.unk_10]->unk_0 == 0x26) if (gUnknown_03004140.unk_04 == 15 && gRfuSlotStatusNI[gUnknown_03004140.unk_10]->unk_0 == 0x26)
{ {
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0; gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0;
rfu_clearSlot(4, gUnknown_03004140.unk_10); rfu_clearSlot(4, gUnknown_03004140.unk_10);
@ -1490,11 +1490,11 @@ static u8 sub_800D294(void)
const u16 *ptr; const u16 *ptr;
u8 flags = 0x00; u8 flags = 0x00;
for (i = 0; i < gUnknown_03007890->unk_08; i++) for (i = 0; i < gRfuLinkStatus->unk_08; i++)
{ {
for (ptr = gUnknown_03004140.unk_20; *ptr != 0xFFFF; ptr++) for (ptr = gUnknown_03004140.unk_20; *ptr != 0xFFFF; ptr++)
{ {
if (gUnknown_03007890->unk_14[i].unk_04 == *ptr) if (gRfuLinkStatus->unk_14[i].unk_04 == *ptr)
{ {
flags |= (1 << i); flags |= (1 << i);
} }
@ -1525,34 +1525,34 @@ static void sub_800D358(u8 a0)
{ {
u8 i; u8 i;
if (gUnknown_03007890->unk_04) if (gRfuLinkStatus->unk_04)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007880[i]->unk_0 & 0x8000 && gUnknown_03007880[i]->unk_1a & a0) if (gRfuSlotStatusNI[i]->unk_0 & 0x8000 && gRfuSlotStatusNI[i]->unk_1a & a0)
{ {
rfu_changeSendTarget(0x20, i, gUnknown_03007880[i]->unk_1a & ~a0); rfu_changeSendTarget(0x20, i, gRfuSlotStatusNI[i]->unk_1a & ~a0);
} }
} }
} }
if (gUnknown_03007890->unk_05) if (gRfuLinkStatus->unk_05)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007880[i]->unk_34 & 0x8000 && gUnknown_03007880[i]->unk_4e & a0) if (gRfuSlotStatusNI[i]->unk_34 & 0x8000 && gRfuSlotStatusNI[i]->unk_4e & a0)
{ {
rfu_NI_stopReceivingData(i); rfu_NI_stopReceivingData(i);
} }
} }
} }
if (gUnknown_03007890->unk_06) if (gRfuLinkStatus->unk_06)
{ {
gUnknown_03007890->unk_06 &= ~a0; gRfuLinkStatus->unk_06 &= ~a0;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007870[i]->unk_0 == 0x8024 && a0 & gUnknown_03007870[i]->unk_3) if (gRfuSlotStatusUNI[i]->unk_0 == 0x8024 && a0 & gRfuSlotStatusUNI[i]->unk_3)
{ {
gUnknown_03007870[i]->unk_3 &= ~a0; gRfuSlotStatusUNI[i]->unk_3 &= ~a0;
} }
} }
} }
@ -1566,32 +1566,32 @@ static void sub_800D434(void)
if (gUnknown_03004140.unk_18) if (gUnknown_03004140.unk_18)
{ {
if (gUnknown_03007890->unk_04) if (gRfuLinkStatus->unk_04)
{ {
for (i = 0; i < 4; i ++) for (i = 0; i < 4; i ++)
{ {
if (gUnknown_03007880[i]->unk_0 & 0x8000) if (gRfuSlotStatusNI[i]->unk_0 & 0x8000)
{ {
flags = 0; flags = 0;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
if ((gUnknown_03007880[i]->unk_1a >> j) & 1 && gUnknown_03007880[j]->unk_2 > gUnknown_03004140.unk_18) if ((gRfuSlotStatusNI[i]->unk_1a >> j) & 1 && gRfuSlotStatusNI[j]->unk_2 > gUnknown_03004140.unk_18)
{ {
flags |= (1 << j); flags |= (1 << j);
} }
if (flags) if (flags)
{ {
rfu_changeSendTarget(0x20, i, flags ^ gUnknown_03007880[i]->unk_1a); rfu_changeSendTarget(0x20, i, flags ^ gRfuSlotStatusNI[i]->unk_1a);
} }
} }
} }
} }
} }
if (gUnknown_03007890->unk_05) if (gRfuLinkStatus->unk_05)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007880[i]->unk_34 & 0x8000 && gUnknown_03007880[i]->unk_36 > gUnknown_03004140.unk_18) if (gRfuSlotStatusNI[i]->unk_34 & 0x8000 && gRfuSlotStatusNI[i]->unk_36 > gUnknown_03004140.unk_18)
{ {
rfu_NI_stopReceivingData(i); rfu_NI_stopReceivingData(i);
} }
@ -1628,7 +1628,7 @@ u8 sub_800D550(u8 a0, u16 a1)
u8 sub_800D594(u16 a0) u8 sub_800D594(u16 a0)
{ {
if (gUnknown_03007890->unk_04 | gUnknown_03007890->unk_05) if (gRfuLinkStatus->unk_04 | gRfuLinkStatus->unk_05)
{ {
gUnknown_03004140.unk_14 = 6; gUnknown_03004140.unk_14 = 6;
sub_800D30C(0xf3, 0x01); sub_800D30C(0xf3, 0x01);
@ -2049,17 +2049,17 @@ void ASCIIToPkmnStr(u8 *q1, const u8 *q2)
u8 sub_800DD1C(u8 maxFlags) u8 sub_800DD1C(u8 maxFlags)
{ {
u8 flagCount = 0; u8 flagCount = 0;
u32 flags = gUnknown_03007890->unk_02; u32 flags = gRfuLinkStatus->unk_02;
u8 i; u8 i;
if (gUnknown_03007890->unk_00 == 1) if (gRfuLinkStatus->unk_00 == 1)
{ {
for (i = 0; i < 4; flags >>= 1, i++) for (i = 0; i < 4; flags >>= 1, i++)
{ {
if (flags & 1) if (flags & 1)
{ {
if (maxFlags == flagCount + 1) if (maxFlags == flagCount + 1)
return gUnknown_03007890->unk_0a[i]; return gRfuLinkStatus->unk_0a[i];
flagCount++; flagCount++;
} }
} }
@ -2069,7 +2069,7 @@ u8 sub_800DD1C(u8 maxFlags)
for (i = 0; i < 4; flags >>= 1, i++) for (i = 0; i < 4; flags >>= 1, i++)
{ {
if (flags & 1) if (flags & 1)
return gUnknown_03007890->unk_0a[i]; return gRfuLinkStatus->unk_0a[i];
} }
} }
return 0; return 0;
@ -2081,7 +2081,7 @@ NAKED u8 sub_800DD1C(u8 maxFlags)
"\tlsls r0, 24\n" "\tlsls r0, 24\n"
"\tlsrs r5, r0, 24\n" "\tlsrs r5, r0, 24\n"
"\tmovs r6, 0\n" "\tmovs r6, 0\n"
"\tldr r0, =gUnknown_03007890\n" "\tldr r0, =gRfuLinkStatus\n"
"\tldr r4, [r0]\n" "\tldr r4, [r0]\n"
"\tldrb r2, [r4, 0x2]\n" "\tldrb r2, [r4, 0x2]\n"
"\tldrb r1, [r4]\n" "\tldrb r1, [r4]\n"
@ -2177,24 +2177,24 @@ bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx)
if (gUnknown_03004140.unk_06 == 1) if (gUnknown_03004140.unk_06 == 1)
{ {
retVal = TRUE; retVal = TRUE;
if (sub_8010454(gUnknown_03007890->unk_14[idx].unk_04) && ((gUnknown_03007890->unk_07 >> idx) & 1)) if (sub_8010454(gRfuLinkStatus->unk_14[idx].unk_04) && ((gRfuLinkStatus->unk_07 >> idx) & 1))
{ {
memcpy(buff1, &gUnknown_03007890->unk_14[idx].unk_06, 0xD); memcpy(buff1, gRfuLinkStatus->unk_14[idx].gname, 0xD);
memcpy(buff2, gUnknown_03007890->unk_14[idx].playerName, PLAYER_NAME_LENGTH + 1); memcpy(buff2, gRfuLinkStatus->unk_14[idx].uname, PLAYER_NAME_LENGTH + 1);
} }
else else
{ {
memset(buff1, 0, 0xD); memset(buff1, 0, 0xD);
memset(buff2, 0, sizeof(gUnknown_03007890->unk_14[idx].playerName)); memset(buff2, 0, PLAYER_NAME_LENGTH + 1);
} }
} }
else else
{ {
retVal = FALSE; retVal = FALSE;
if (sub_8010454(gUnknown_03007890->unk_14[idx].unk_04)) if (sub_8010454(gRfuLinkStatus->unk_14[idx].unk_04))
{ {
memcpy(buff1, &gUnknown_03007890->unk_14[idx].unk_06, 0xD); memcpy(buff1, gRfuLinkStatus->unk_14[idx].gname, 0xD);
memcpy(buff2, gUnknown_03007890->unk_14[idx].playerName, PLAYER_NAME_LENGTH + 1); memcpy(buff2, gRfuLinkStatus->unk_14[idx].uname, PLAYER_NAME_LENGTH + 1);
} }
else else
{ {
@ -2208,10 +2208,10 @@ bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx)
bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx) bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx)
{ {
bool8 retVal = FALSE; bool8 retVal = FALSE;
if (gUnknown_03007890->unk_14[idx].unk_04 == 0x7F7D) if (gRfuLinkStatus->unk_14[idx].unk_04 == 0x7F7D)
{ {
memcpy(buff1, &gUnknown_03007890->unk_14[idx].unk_06, 0xD); memcpy(buff1, gRfuLinkStatus->unk_14[idx].gname, 0xD);
memcpy(buff2, gUnknown_03007890->unk_14[idx].playerName, 8); memcpy(buff2, gRfuLinkStatus->unk_14[idx].uname, 8);
retVal = TRUE; retVal = TRUE;
} }
else else
@ -2237,7 +2237,7 @@ void CreateWirelessStatusIndicatorSprite(u8 x, u8 y)
x = 0xE7; x = 0xE7;
y = 0x08; y = 0x08;
} }
if (gUnknown_03007890->unk_00 == 1) if (gRfuLinkStatus->unk_00 == 1)
{ {
sprId = CreateSprite(&sWirelessStatusIndicatorSpriteTemplate, x, y, 0); sprId = CreateSprite(&sWirelessStatusIndicatorSpriteTemplate, x, y, 0);
gSprites[sprId].data[7] = 0x1234; gSprites[sprId].data[7] = 0x1234;
@ -2278,12 +2278,12 @@ void LoadWirelessStatusIndicatorSpriteGfx(void)
u8 sub_800E124(void) u8 sub_800E124(void)
{ {
u8 i; u8 i;
u8 flags = gUnknown_03007890->unk_02; u8 flags = gRfuLinkStatus->unk_02;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (flags & 1) if (flags & 1)
{ {
return gUnknown_03007890->unk_0a[i]; return gRfuLinkStatus->unk_0a[i];
} }
flags >>= 1; flags >>= 1;
} }
@ -2307,7 +2307,7 @@ void sub_800E174(void)
struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId]; struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId];
u8 signalStrength = 255; u8 signalStrength = 255;
u8 i = 0; u8 i = 0;
if (gUnknown_03007890->unk_00 == 1) if (gRfuLinkStatus->unk_00 == 1)
{ {
for (i = 0; i < GetLinkPlayerCount() - 1; i++) for (i = 0; i < GetLinkPlayerCount() - 1; i++)
{ {
@ -2787,7 +2787,7 @@ void sub_800ED34(u16 unused)
} }
rfu_REQ_recvData(); rfu_REQ_recvData();
rfu_waitREQComplete(); rfu_waitREQComplete();
if (gUnknown_03007870[gUnknown_03005000.unk_c3e]->unk_12) if (gRfuSlotStatusUNI[gUnknown_03005000.unk_c3e]->unk_12)
{ {
gUnknown_03005000.unk_cd0++; gUnknown_03005000.unk_cd0++;
sub_800D7D8(&gUnknown_03005000.unk_124, gUnknown_03005000.unk_c3f); sub_800D7D8(&gUnknown_03005000.unk_124, gUnknown_03005000.unk_c3f);
@ -2858,7 +2858,7 @@ bool8 sub_800EE94(void)
bool32 sub_800EEBC(void) bool32 sub_800EEBC(void)
{ {
if (gUnknown_03005000.unk_04 == 7 && !sub_800C12C(gUnknown_03007890->unk_14[gUnknown_03005000.unk_c3d].unk_00, 240)) if (gUnknown_03005000.unk_04 == 7 && !sub_800C12C(gRfuLinkStatus->unk_14[gUnknown_03005000.unk_c3d].unk_00, 240))
{ {
gUnknown_03005000.unk_04 = 9; gUnknown_03005000.unk_04 = 9;
return TRUE; return TRUE;
@ -2971,7 +2971,7 @@ bool32 IsRfuRecvQueueEmpty(void)
s32 i; s32 i;
s32 j; s32 j;
if (gUnknown_03007890->unk_06 == 0) if (gRfuLinkStatus->unk_06 == 0)
{ {
return FALSE; return FALSE;
} }
@ -2999,7 +2999,7 @@ bool32 sub_800F0F8(void)
else else
{ {
gUnknown_03005000.unk_cdb = 0; gUnknown_03005000.unk_cdb = 0;
if ((gUnknown_03005000.unk_ce2 & gUnknown_03007890->unk_02) == gUnknown_03005000.unk_ce2 && (gUnknown_03005000.unk_ce2 & gUnknown_03007890->unk_02)) if ((gUnknown_03005000.unk_ce2 & gRfuLinkStatus->unk_02) == gUnknown_03005000.unk_ce2 && (gUnknown_03005000.unk_ce2 & gRfuLinkStatus->unk_02))
{ {
if (!gUnknown_03005000.unk_cdc) if (!gUnknown_03005000.unk_cdc)
{ {
@ -3119,7 +3119,7 @@ bool32 sub_800F1E0(void)
gUnknown_03005000.unk_0e = 0; gUnknown_03005000.unk_0e = 0;
} }
retval = gUnknown_03005000.unk_cdc; retval = gUnknown_03005000.unk_cdc;
return gUnknown_03007890->unk_06 ? retval & 1 : FALSE; return gRfuLinkStatus->unk_06 ? retval & 1 : FALSE;
} }
void sub_800F498(u16 *a0, u8 *a1) void sub_800F498(u16 *a0, u8 *a1)
@ -3162,7 +3162,7 @@ bool32 sub_800F4F0(void)
sub_800F86C(0); sub_800F86C(0);
if (gUnknown_03004140.unk_02 == 0 && gUnknown_03005000.unk_ce4) if (gUnknown_03004140.unk_02 == 0 && gUnknown_03005000.unk_ce4)
{ {
rfu_REQ_disconnect(gUnknown_03007890->unk_02 | gUnknown_03007890->unk_03); rfu_REQ_disconnect(gRfuLinkStatus->unk_02 | gRfuLinkStatus->unk_03);
rfu_waitREQComplete(); rfu_waitREQComplete();
switchval = sub_8011A74(); switchval = sub_8011A74();
if (switchval != 1 && switchval != 6 && switchval != 9) if (switchval != 1 && switchval != 6 && switchval != 9)
@ -3305,7 +3305,7 @@ static void sub_800F86C(u8 unused)
return; return;
// fallthrough // fallthrough
case 0x7700: case 0x7700:
if (gUnknown_03007890->unk_00 == 0) if (gRfuLinkStatus->unk_00 == 0)
{ {
gUnknown_03005000.playerCount = gRecvCmds[i][1]; gUnknown_03005000.playerCount = gRecvCmds[i][1];
gUnknown_03005000.unk_cce = sub_800F74C((u8 *)(gRecvCmds[i] + 2)); gUnknown_03005000.unk_cce = sub_800F74C((u8 *)(gRecvCmds[i] + 2));
@ -3353,7 +3353,7 @@ static void sub_800F86C(u8 unused)
{ {
if (gReceivedRemoteLinkPlayers != 0) if (gReceivedRemoteLinkPlayers != 0)
{ {
if (gRecvCmds[i][1] & gUnknown_03007890->unk_02) if (gRecvCmds[i][1] & gRfuLinkStatus->unk_02)
{ {
gReceivedRemoteLinkPlayers = 0; gReceivedRemoteLinkPlayers = 0;
sub_800D630(); sub_800D630();
@ -3611,7 +3611,7 @@ void sub_801011C(void)
void sub_8010148(void) void sub_8010148(void)
{ {
rfu_REQ_disconnect(gUnknown_03007890->unk_02 | gUnknown_03007890->unk_03); rfu_REQ_disconnect(gRfuLinkStatus->unk_02 | gRfuLinkStatus->unk_03);
rfu_waitREQComplete(); rfu_waitREQComplete();
sub_801011C(); sub_801011C();
} }
@ -3631,7 +3631,7 @@ void LinkRfu_FatalError(void)
{ {
sub_800D630(); sub_800D630();
gUnknown_03005000.unk_ce4 = 1; gUnknown_03005000.unk_ce4 = 1;
gUnknown_03005000.unk_ce3 = gUnknown_03007890->unk_02 | gUnknown_03007890->unk_03; gUnknown_03005000.unk_ce3 = gRfuLinkStatus->unk_02 | gRfuLinkStatus->unk_03;
} }
void sub_80101CC(void) void sub_80101CC(void)
@ -3821,7 +3821,7 @@ bool8 sub_8010540(void)
{ {
if (gUnknown_03005000.unk_cd1[i] < 5 || gUnknown_03005000.unk_cd1[i] > 6) if (gUnknown_03005000.unk_cd1[i] < 5 || gUnknown_03005000.unk_cd1[i] > 6)
{ {
if (gUnknown_03007880[i]->unk_34 == 0x46 || gUnknown_03007880[i]->unk_34 == 0x48) if (gRfuSlotStatusNI[i]->unk_34 == 0x46 || gRfuSlotStatusNI[i]->unk_34 == 0x48)
{ {
if (gUnknown_03005000.unk_cd5[i] == 8) if (gUnknown_03005000.unk_cd5[i] == 8)
{ {
@ -3833,7 +3833,7 @@ bool8 sub_8010540(void)
} }
} }
else if (gUnknown_03007880[gUnknown_03005000.unk_c3e]->unk_34 == 0x47) else if (gRfuSlotStatusNI[gUnknown_03005000.unk_c3e]->unk_34 == 0x47)
rfu_clearSlot(8, i); rfu_clearSlot(8, i);
{ {
@ -3898,7 +3898,7 @@ u32 sub_8010714(u16 a0, const u8 *a1)
u8 r0 = sub_8011CE4(a1, a0); u8 r0 = sub_8011CE4(a1, a0);
if (r0 == 0xFF) if (r0 == 0xFF)
return 2; return 2;
if (gUnknown_03007880[r0]->unk_0 == 0) if (gRfuSlotStatusNI[r0]->unk_0 == 0)
return 1; return 1;
return 0; return 0;
} }
@ -3910,7 +3910,7 @@ void sub_8010750(void)
sub_8010540(); sub_8010540();
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007880[i]->unk_0 == 0x26 || gUnknown_03007880[i]->unk_0 == 0x27) if (gRfuSlotStatusNI[i]->unk_0 == 0x26 || gRfuSlotStatusNI[i]->unk_0 == 0x27)
{ {
if (gUnknown_03005000.unk_cd5[i] == 10) if (gUnknown_03005000.unk_cd5[i] == 10)
gUnknown_03005000.unk_cd5[i] = 11; gUnknown_03005000.unk_cd5[i] = 11;
@ -3924,16 +3924,16 @@ s32 sub_80107A0(void)
s32 retval = 0; s32 retval = 0;
if (gUnknown_03005000.unk_c85 == 8) if (gUnknown_03005000.unk_c85 == 8)
{ {
if (gUnknown_03007880[gUnknown_03005000.unk_c3e]->unk_0 == 0x26 || gUnknown_03007880[gUnknown_03005000.unk_c3e]->unk_0 == 0x27) if (gRfuSlotStatusNI[gUnknown_03005000.unk_c3e]->unk_0 == 0x26 || gRfuSlotStatusNI[gUnknown_03005000.unk_c3e]->unk_0 == 0x27)
rfu_clearSlot(4, gUnknown_03005000.unk_c3e); rfu_clearSlot(4, gUnknown_03005000.unk_c3e);
} }
if (gUnknown_03007880[gUnknown_03005000.unk_c3e]->unk_34 == 0x46 || gUnknown_03007880[gUnknown_03005000.unk_c3e]->unk_34 == 0x48) if (gRfuSlotStatusNI[gUnknown_03005000.unk_c3e]->unk_34 == 0x46 || gRfuSlotStatusNI[gUnknown_03005000.unk_c3e]->unk_34 == 0x48)
{ {
rfu_clearSlot(8, gUnknown_03005000.unk_c3e); rfu_clearSlot(8, gUnknown_03005000.unk_c3e);
sub_8011A64(gUnknown_03005000.unk_c86, 0); sub_8011A64(gUnknown_03005000.unk_c86, 0);
retval = gUnknown_03005000.unk_c86; retval = gUnknown_03005000.unk_c86;
} }
else if (gUnknown_03007880[gUnknown_03005000.unk_c3e]->unk_34 == 0x47) else if (gRfuSlotStatusNI[gUnknown_03005000.unk_c3e]->unk_34 == 0x47)
{ {
rfu_clearSlot(8, gUnknown_03005000.unk_c3e); rfu_clearSlot(8, gUnknown_03005000.unk_c3e);
retval = 6; retval = 6;
@ -4282,14 +4282,14 @@ void sub_801103C(void)
void sub_8011068(u8 a0) void sub_8011068(u8 a0)
{ {
gUnknown_02022B14.unk_0a_7 = a0; gUnknown_02022B14.unk_0a_7 = a0;
rfu_REQ_configGameData(0, 2, &gUnknown_02022B14, gUnknown_02022B22); rfu_REQ_configGameData(0, 2, (const u8 *)&gUnknown_02022B14, gUnknown_02022B22);
} }
void sub_8011090(u8 a0, u32 a1, u32 a2) void sub_8011090(u8 a0, u32 a1, u32 a2)
{ {
if (a0) if (a0)
sub_8010F84(a0, a1, a2); sub_8010F84(a0, a1, a2);
rfu_REQ_configGameData(0, 2, &gUnknown_02022B14, gUnknown_02022B22); rfu_REQ_configGameData(0, 2, (const u8 *)&gUnknown_02022B14, gUnknown_02022B22);
} }
void sub_80110B8(u32 a0) void sub_80110B8(u32 a0)
@ -4370,7 +4370,7 @@ void sub_801120C(u8 a0, u8 unused1)
{ {
if ((gUnknown_03004140.unk_14 >> i) & 1) if ((gUnknown_03004140.unk_14 >> i) & 1)
{ {
struct UnkLinkRfuStruct_02022B14 *structPtr = &gUnknown_03007890->unk_14[i].unk_06; struct UnkLinkRfuStruct_02022B14 *structPtr = (void *)gRfuLinkStatus->unk_14[i].gname;
if (structPtr->unk_0a_0 == sub_800F7DC()->unk_0a_0) if (structPtr->unk_0a_0 == sub_800F7DC()->unk_0a_0)
{ {
gUnknown_03005000.unk_cd1[i] = 0; gUnknown_03005000.unk_cd1[i] = 0;
@ -4528,7 +4528,7 @@ u8 sub_8011628(s32 a0)
{ {
if ((a0 >> i) & 1) if ((a0 >> i) & 1)
{ {
struct UnkLinkRfuStruct_02022B14 *structPtr = &gUnknown_03007890->unk_14[i].unk_06; struct UnkLinkRfuStruct_02022B14 *structPtr = (void *)gRfuLinkStatus->unk_14[i].gname;
if (structPtr->unk_0a_0 == 0x45) if (structPtr->unk_0a_0 == 0x45)
ret |= (1 << i); ret |= (1 << i);
} }
@ -4629,7 +4629,7 @@ void sub_8011674(u8 a0, u8 unused1)
break; break;
case 0x32: case 0x32:
gUnknown_03005000.unk_f0 = 3; gUnknown_03005000.unk_f0 = 3;
if (gUnknown_03007890->unk_00 == 0) if (gRfuLinkStatus->unk_00 == 0)
gUnknown_03005000.unk_c3c = 1; gUnknown_03005000.unk_c3c = 1;
break; break;
case 0x30: case 0x30:
@ -4654,7 +4654,7 @@ void sub_8011674(u8 a0, u8 unused1)
sub_800C27C(0); sub_800C27C(0);
} }
if (gUnknown_03007890->unk_00 == 0xFF && gUnknown_03004140.unk_07 == 0 && FuncIsActiveTask(sub_800EB44) == TRUE) if (gRfuLinkStatus->unk_00 == 0xFF && gUnknown_03004140.unk_07 == 0 && FuncIsActiveTask(sub_800EB44) == TRUE)
gUnknown_03005000.unk_04 = 0x11; gUnknown_03005000.unk_04 = 0x11;
sub_8011A64(2, a0); sub_8011A64(2, a0);
@ -4825,13 +4825,13 @@ u8 sub_8011CE4(const u8 *a0, u16 a1)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
u16 trainerId = ReadU16(gUnknown_03007890->unk_14[i].unk_06.unk_00.playerTrainerId); u16 trainerId = ReadU16(gRfuLinkStatus->unk_14[i].gname + 2);
if (sub_8010454(gUnknown_03007890->unk_14[i].unk_04) if (sub_8010454(gRfuLinkStatus->unk_14[i].unk_04)
&& !StringCompare(a0, gUnknown_03007890->unk_14[i].playerName) && !StringCompare(a0, gRfuLinkStatus->unk_14[i].uname)
&& a1 == trainerId) && a1 == trainerId)
{ {
ret = i; ret = i;
if (gUnknown_03007890->unk_14[i].unk_02 != 0xFF) if (gRfuLinkStatus->unk_14[i].unk_02 != 0xFF)
break; break;
} }
} }
@ -4911,7 +4911,7 @@ void sub_8011EF4(u8 taskId)
u8 id = sub_8011CE4((u8*)data, ReadU16(&data[8])); u8 id = sub_8011CE4((u8*)data, ReadU16(&data[8]));
if (id != 0xFF) if (id != 0xFF)
{ {
if (gUnknown_03007890->unk_14[id].unk_02 != 0xFF) if (gRfuLinkStatus->unk_14[id].unk_02 != 0xFF)
{ {
gUnknown_03005000.unk_c3d = id; gUnknown_03005000.unk_c3d = id;
if (sub_800EEBC()) if (sub_800EEBC())
@ -5006,9 +5006,9 @@ void sub_801209C(u8 taskId)
u8 id = sub_8011CE4(gUnknown_03005000.playerName, trainerId); u8 id = sub_8011CE4(gUnknown_03005000.playerName, trainerId);
if (id != 0xFF) if (id != 0xFF)
{ {
if (!sub_801200C(gTasks[taskId].data[1], &gUnknown_03007890->unk_14[id].unk_06)) if (!sub_801200C(gTasks[taskId].data[1], (void *)gRfuLinkStatus->unk_14[id].gname))
{ {
if (gUnknown_03007890->unk_14[id].unk_02 != 0xFF && !sub_800C12C(gUnknown_03007890->unk_14[id].unk_00, 0x5A)) if (gRfuLinkStatus->unk_14[id].unk_02 != 0xFF && !sub_800C12C(gRfuLinkStatus->unk_14[id].unk_00, 0x5A))
{ {
gUnknown_03005000.unk_04 = 0xA; gUnknown_03005000.unk_04 = 0xA;
DestroyTask(taskId); DestroyTask(taskId);
@ -5081,17 +5081,17 @@ void sub_801229C(void)
s32 i, j; s32 i, j;
nullsub_13(GetBlockReceivedStatus(), 0x1C, 0x13, 2); nullsub_13(GetBlockReceivedStatus(), 0x1C, 0x13, 2);
nullsub_13(gUnknown_03007890->unk_02, 0x14, 1, 1); nullsub_13(gRfuLinkStatus->unk_02, 0x14, 1, 1);
nullsub_13(gUnknown_03007890->unk_03, 0x17, 1, 1); nullsub_13(gRfuLinkStatus->unk_03, 0x17, 1, 1);
if (gUnknown_03005000.unk_0c == 1) if (gUnknown_03005000.unk_0c == 1)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if ((gUnknown_03007890->unk_07 >> i) & 1) if ((gRfuLinkStatus->unk_07 >> i) & 1)
{ {
nullsub_13(gUnknown_03007890->unk_14[i].unk_04, 1, i + 3, 4); nullsub_13(gRfuLinkStatus->unk_14[i].unk_04, 1, i + 3, 4);
nullsub_5((void*) &gUnknown_03007890->unk_14[i].unk_06, 6, i + 3); nullsub_5((void*)gRfuLinkStatus->unk_14[i].gname, 6, i + 3);
nullsub_5(gUnknown_03007890->unk_14[i].playerName, 0x16, i + 3); nullsub_5(gRfuLinkStatus->unk_14[i].uname, 0x16, i + 3);
} }
} }
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
@ -5103,7 +5103,7 @@ void sub_801229C(void)
} }
nullsub_5(gUnknown_082ED868, 1, 0xF); nullsub_5(gUnknown_082ED868, 1, 0xF);
} }
else if (gUnknown_03007890->unk_02 != 0 && gUnknown_03007890->unk_07 != 0) else if (gRfuLinkStatus->unk_02 != 0 && gRfuLinkStatus->unk_07 != 0)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
@ -5111,19 +5111,19 @@ void sub_801229C(void)
nullsub_5(gUnknown_082ED84B, 6, i + 3); nullsub_5(gUnknown_082ED84B, 6, i + 3);
nullsub_5(gUnknown_082ED85B, 0x16, i + 3); nullsub_5(gUnknown_082ED85B, 0x16, i + 3);
} }
nullsub_13(gUnknown_03007890->unk_14[gUnknown_03005000.unk_c3e].unk_04, 1, 3, 4); nullsub_13(gRfuLinkStatus->unk_14[gUnknown_03005000.unk_c3e].unk_04, 1, 3, 4);
nullsub_5((void*) &gUnknown_03007890->unk_14[gUnknown_03005000.unk_c3e].unk_06, 6, 3); nullsub_5((void*)gRfuLinkStatus->unk_14[gUnknown_03005000.unk_c3e].gname, 6, 3);
nullsub_5(gUnknown_03007890->unk_14[gUnknown_03005000.unk_c3e].playerName, 0x16, 3); nullsub_5(gRfuLinkStatus->unk_14[gUnknown_03005000.unk_c3e].uname, 0x16, 3);
} }
else else
{ {
for (i = 0; i < gUnknown_03007890->unk_08; i++) for (i = 0; i < gRfuLinkStatus->unk_08; i++)
{ {
if (gUnknown_03007890->unk_14[i].unk_02 != 0xFF) if (gRfuLinkStatus->unk_14[i].unk_02 != 0xFF)
{ {
nullsub_13(gUnknown_03007890->unk_14[i].unk_04, 1, i + 3, 4); nullsub_13(gRfuLinkStatus->unk_14[i].unk_04, 1, i + 3, 4);
nullsub_13(gUnknown_03007890->unk_14[i].unk_00, 6, i + 3, 4); nullsub_13(gRfuLinkStatus->unk_14[i].unk_00, 6, i + 3, 4);
nullsub_5(gUnknown_03007890->unk_14[i].playerName, 0x16, i + 3); nullsub_5(gRfuLinkStatus->unk_14[i].uname, 0x16, i + 3);
} }
} }
for (; i < 4; i++) for (; i < 4; i++)

View File

@ -254,7 +254,7 @@ static bool32 sub_80771BC(void)
{ {
if (gUnknown_02022C2C == 29) if (gUnknown_02022C2C == 29)
{ {
if (gUnknown_03007880[sub_800E87C(gUnknown_03004140.unk_00)]->unk_0 == 0) if (gRfuSlotStatusNI[sub_800E87C(gUnknown_03004140.unk_00)]->unk_0 == 0)
return TRUE; return TRUE;
else else
return FALSE; return FALSE;

View File

@ -4077,7 +4077,7 @@ s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3)
StringCopy(arg3->field_58 + 0x10, gSpeciesNames[sUnionRoomTrade.playerSpecies]); StringCopy(arg3->field_58 + 0x10, gSpeciesNames[sUnionRoomTrade.playerSpecies]);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007890->unk_14[i].unk_04 == 2) if (gRfuLinkStatus->unk_14[i].unk_04 == 2)
{ {
ConvertIntToDecimalStringN(arg3->field_58 + 0x20, arg2[2], STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(arg3->field_58 + 0x20, arg2[2], STR_CONV_MODE_LEFT_ALIGN, 3);
StringCopy(arg3->field_58 + 0x30, gSpeciesNames[arg2[1]]); StringCopy(arg3->field_58 + 0x30, gSpeciesNames[arg2[1]]);