sub_800EB44

This commit is contained in:
PikalaxALT 2017-12-07 20:04:07 -05:00
parent c9f43116aa
commit 6441ba7832
4 changed files with 69 additions and 172 deletions

View File

@ -5,176 +5,6 @@
.text .text
thumb_func_start sub_800EB44
sub_800EB44: @ 800EB44
push {r4-r6,lr}
lsls r0, 24
lsrs r5, r0, 24
bl sub_800F7DC
ldrb r1, [r0, 0xA]
movs r0, 0x7F
ands r0, r1
cmp r0, 0x54
bne _0800EB78
bl sub_8011A74
lsls r0, 24
lsrs r0, 24
cmp r0, 0x4
bne _0800EB78
ldr r0, =gUnknown_03004140
ldrb r0, [r0]
bl rfu_REQ_disconnect
bl rfu_waitREQComplete
movs r0, 0
movs r1, 0
bl sub_8011A64
_0800EB78:
ldr r0, =gUnknown_03005000
ldrh r2, [r0, 0x4]
adds r6, r0, 0
cmp r2, 0x12
bls _0800EB84
b _0800ECF4
_0800EB84:
lsls r0, r2, 2
ldr r1, =_0800EB9C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_0800EB9C:
.4byte _0800EBE8
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800ECF4
.4byte _0800EC38
.4byte _0800EC98
.4byte _0800ECF4
.4byte _0800ECAC
.4byte _0800EC10
.4byte _0800ECF4
_0800EBE8:
ldr r0, =gUnknown_02022B2C
bl sub_800BFCC
ldr r0, =gUnknown_03005000
movs r2, 0x1
strh r2, [r0, 0x4]
ldr r1, =gTasks
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
adds r0, r1
strh r2, [r0, 0xA]
b _0800ECF4
.pool
_0800EC10:
ldr r3, =gUnknown_082ED6E0
movs r0, 0x2
movs r1, 0
movs r2, 0xF0
bl sub_800C054
ldr r0, =sub_800ED34
bl sub_800D52C
ldr r1, =gUnknown_03005000
movs r0, 0x12
strh r0, [r1, 0x4]
b _0800ECF4
.pool
_0800EC38:
ldr r1, =0x00000c3e
adds r0, r6, r1
ldrb r1, [r0]
movs r0, 0x80
lsls r0, 17
lsls r0, r1
lsrs r0, 24
adds r1, r6, 0
adds r1, 0x4C
movs r2, 0xE
bl rfu_UNI_setSendData
lsls r0, 16
lsrs r0, 16
cmp r0, 0
bne _0800ECF4
strb r0, [r6, 0xC]
adds r0, r5, 0
bl DestroyTask
ldr r0, =gTasks
lsls r1, r5, 2
adds r1, r5
lsls r1, 3
adds r1, r0
movs r2, 0x16
ldrsh r0, [r1, r2]
cmp r0, 0
beq _0800EC88
ldr r0, =sub_8010D0C
movs r1, 0x1
bl CreateTask
b _0800ECF4
.pool
_0800EC88:
ldr r0, =sub_801084C
movs r1, 0x5
bl CreateTask
b _0800ECF4
.pool
_0800EC98:
movs r0, 0
bl sub_800C27C
ldr r1, =gUnknown_03005000
movs r0, 0xF
strh r0, [r1, 0x4]
b _0800ECF4
.pool
_0800ECAC:
ldr r0, =0x00000cdb
adds r1, r6, r0
ldrb r0, [r1]
movs r0, 0
strb r0, [r1]
ldr r0, =sub_800EDBC
bl sub_800D52C
movs r0, 0x1
bl sub_8011068
bl sub_800EAB4
bl sub_800EAFC
movs r0, 0x14
strh r0, [r6, 0x4]
ldr r1, =gTasks
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
adds r0, r1
movs r1, 0x8
strh r1, [r0, 0xA]
movs r4, 0x1
strb r4, [r6, 0xC]
ldr r0, =sub_801084C
movs r1, 0x5
bl CreateTask
ldr r1, =0x00000ce8
adds r0, r6, r1
strb r4, [r0]
adds r0, r5, 0
bl DestroyTask
_0800ECF4:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_800EB44
thumb_func_start sub_800ED10 thumb_func_start sub_800ED10
sub_800ED10: @ 800ED10 sub_800ED10: @ 800ED10
push {lr} push {lr}

View File

@ -216,4 +216,4 @@ void rfu_NI_stopReceivingData(u8 who);
u16 rfu_initializeAPI(u32 *unk0, u16 unk1, IntrFunc *interrupt, bool8 copyInterruptToRam); u16 rfu_initializeAPI(u32 *unk0, u16 unk1, IntrFunc *interrupt, bool8 copyInterruptToRam);
void rfu_setTimerInterrupt(u8 which, IntrFunc *intr); void rfu_setTimerInterrupt(u8 which, IntrFunc *intr);
void rfu_setRecvBuffer(u8 a0, u8 a1, void *a2, size_t a3); void rfu_setRecvBuffer(u8 a0, u8 a1, void *a2, size_t a3);
void rfu_UNI_setSendData(u8 flag, void *ptr, u8 size); bool16 rfu_UNI_setSendData(u8 flag, void *ptr, u8 size);

View File

@ -163,7 +163,9 @@ struct UnkRfuStruct_2 {
/* 0xce2 */ u8 unk_ce2; /* 0xce2 */ u8 unk_ce2;
/* 0xce2 */ u8 unk_ce3; /* 0xce2 */ u8 unk_ce3;
/* 0xce4 */ u8 unk_ce4; /* 0xce4 */ u8 unk_ce4;
/* 0xce5 */ u8 filler_ce5[15]; /* 0xce5 */ u8 filler_ce5[3];
/* 0xce8 */ u8 unk_ce8;
/* 0xce9 */ u8 filler_ce9[11];
}; // size = 0xcf4 }; // size = 0xcf4
// Exported RAM declarations // Exported RAM declarations

View File

@ -51,6 +51,8 @@ bool8 sub_800DAC8(struct UnkRfuStruct_2_Sub_c1c *q1, u8 *q2);
void sub_800EDBC(u16 a0); void sub_800EDBC(u16 a0);
void sub_800EAB4(void); void sub_800EAB4(void);
void sub_800EAFC(void); void sub_800EAFC(void);
void sub_800ED34(u16 a0);
struct UnkLinkRfuStruct_02022B14 *sub_800F7DC(void);
void sub_800FCC4(struct UnkRfuStruct_2_Sub_6c *data); void sub_800FCC4(struct UnkRfuStruct_2_Sub_6c *data);
bool32 sub_8010454(u16 a0); bool32 sub_8010454(u16 a0);
void sub_8010750(void); void sub_8010750(void);
@ -58,6 +60,8 @@ int sub_80107A0(void);
void sub_801084C(u8 taskId); void sub_801084C(u8 taskId);
void sub_8010AAC(u8 taskId); void sub_8010AAC(u8 taskId);
void sub_8010D0C(u8 taskId); void sub_8010D0C(u8 taskId);
void sub_8011068(u8 a0);
void sub_8011A64(u8 a0, u8 a1);
u8 sub_8012224(void); u8 sub_8012224(void);
void sub_801227C(void); void sub_801227C(void);
@ -2649,3 +2653,64 @@ void sub_800EAFC(void)
sub_800E88C(r5, -1); sub_800E88C(r5, -1);
gUnknown_03005000.unk_0c = 1; gUnknown_03005000.unk_0c = 1;
} }
void sub_800EB44(u8 taskId)
{
if (sub_800F7DC()->unk_0a_0 == 0x54 && sub_8011A74() == 4)
{
rfu_REQ_disconnect(gUnknown_03004140.unk_00);
rfu_waitREQComplete();
sub_8011A64(0, 0);
}
switch (gUnknown_03005000.unk_04)
{
case 0:
sub_800BFCC(&gUnknown_02022B2C);
gUnknown_03005000.unk_04 = 1;
gTasks[taskId].data[1] = 1;
break;
case 1:
break;
case 17:
sub_800C054(2, 0, 240, gUnknown_082ED6E0);
sub_800D52C(sub_800ED34);
gUnknown_03005000.unk_04 = 18;
break;
case 18:
break;
case 13:
if (rfu_UNI_setSendData(1 << gUnknown_03005000.unk_c3e, gUnknown_03005000.unk_4c, 14) == 0)
{
gUnknown_03005000.unk_0c = 0;
DestroyTask(taskId);
if (gTasks[taskId].data[7])
{
CreateTask(sub_8010D0C, 1);
}
else
{
CreateTask(sub_801084C, 5);
}
}
break;
case 14:
sub_800C27C(0);
gUnknown_03005000.unk_04 = 15;
break;
case 15:
break;
case 16:
gUnknown_03005000.unk_cdb = 0;
sub_800D52C(sub_800EDBC);
sub_8011068(1);
sub_800EAB4();
sub_800EAFC();
gUnknown_03005000.unk_04 = 20;
gTasks[taskId].data[1] = 8;
gUnknown_03005000.unk_0c = 1;
CreateTask(sub_801084C, 5);
gUnknown_03005000.unk_ce8 = 1;
DestroyTask(taskId);
break;
}
}