through sub_800E700

This commit is contained in:
PikalaxALT 2017-12-04 20:06:03 -05:00
parent 92fd61d6f2
commit 765ad80884
5 changed files with 32 additions and 52 deletions

View File

@ -5,57 +5,6 @@
.text
thumb_func_start sub_800E6D0
sub_800E6D0: @ 800E6D0
push {r4-r6,lr}
ldr r4, =gIntrTable
ldr r5, [r4, 0x4]
ldr r6, [r4, 0x8]
bl sub_800E700
bl rfu_REQ_stopMode
bl rfu_waitREQComplete
ldr r1, =0x04000208
movs r0, 0
strh r0, [r1]
str r5, [r4, 0x4]
str r6, [r4, 0x8]
movs r0, 0x1
strh r0, [r1]
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_800E6D0
thumb_func_start sub_800E700
sub_800E700: @ 800E700
push {r4,lr}
ldr r0, =gUnknown_03004140+0x50
ldr r1, =0x00000e64
ldr r4, =gIntrTable + 0x4
adds r2, r4, 0
movs r3, 0x1
bl rfu_initializeAPI
lsls r0, 16
lsrs r1, r0, 16
cmp r1, 0
bne _0800E732
ldr r0, =gLinkType
strh r1, [r0]
bl sub_800AAF4
movs r0, 0
bl sub_80111B0
bl sub_800E604
adds r1, r4, 0x4
movs r0, 0x3
bl rfu_setTimerInterrupt
_0800E732:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_800E700
thumb_func_start sub_800E748
sub_800E748: @ 800E748
push {r4,r5,lr}

View File

@ -211,3 +211,5 @@ bool16 rfu_UNI_PARENT_getDRAC_ACK(u8 *a0);
void rfu_REQ_disconnect(u8 who);
void rfu_changeSendTarget(u8 a0, u8 who, u8 a2);
void rfu_NI_stopReceivingData(u8 who);
u16 rfu_initializeAPI(u32 *unk0, u16 unk1, IntrFunc *interrupt, bool8 copyInterruptToRam);
void rfu_setTimerInterrupt(u8 which, IntrFunc *intr);

View File

@ -247,6 +247,7 @@ void sub_800A418(void);
void SetSuppressLinkErrorMessage(bool8 flag);
void sub_800B524(struct LinkPlayer *linkPlayer);
u8 GetSioMultiSI(void);
void sub_800AAF4(void);
extern u16 gLinkPartnersHeldKeys[6];
extern u32 gLinkDebugSeed;

View File

@ -78,7 +78,9 @@ struct UnkRfuStruct_1 {
/* 0x03c */ struct UnkLinkRfuStruct_02022B2C *unk_3c;
/* 0x040 */ void (*unk_40)(u8, u8);
/* 0x044 */ void (*unk_44)(u16);
/* 0x048 */ u8 filler_48[0xe78];
/* 0x048 */ u8 filler_48[8];
/* 0x050 */ u32 unk_50[0x399];
/* 0xeb4 */ u8 filler_e64[12];
};
struct UnkRfuStruct_2_Sub_6c {

View File

@ -48,6 +48,7 @@ void sub_800D630(void);
bool8 sub_800DAC8(struct UnkRfuStruct_2_Sub_c1c *q1, u8 *q2);
void sub_800FCC4(struct UnkRfuStruct_2_Sub_6c *data);
bool32 sub_8010454(u16 a0);
void sub_80111B0(bool32 a0);
u8 sub_8011A74(void);
u8 sub_8012224(void);
@ -2355,3 +2356,28 @@ void sub_800E604(void)
CpuFill16(0, gRecvCmds, sizeof gRecvCmds);
CpuFill16(0, gLinkPlayers, sizeof gLinkPlayers)
}
void sub_800E6D0(void)
{
IntrFunc serialIntr = gIntrTable[1];
IntrFunc timerIntr = gIntrTable[2];
sub_800E700();
rfu_REQ_stopMode();
rfu_waitREQComplete();
REG_IME = 0;
gIntrTable[1] = serialIntr;
gIntrTable[2] = timerIntr;
REG_IME = INTR_FLAG_VBLANK;
}
void sub_800E700(void)
{
if (!rfu_initializeAPI(gUnknown_03004140.unk_50, sizeof gUnknown_03004140.unk_50, gIntrTable + 1, TRUE))
{
gLinkType = 0;
sub_800AAF4();
sub_80111B0(0);
sub_800E604();
rfu_setTimerInterrupt(3, gIntrTable + 2);
}
}