sub_800E94C

This commit is contained in:
PikalaxALT 2017-12-07 00:28:12 -05:00
parent 4f342198c2
commit 94da6de903
5 changed files with 78 additions and 157 deletions

View File

@ -5,154 +5,6 @@
.text
thumb_func_start sub_800E94C
sub_800E94C: @ 800E94C
push {r4-r7,lr}
lsls r0, 24
lsrs r6, r0, 24
ldr r0, =gUnknown_03005000
ldrh r3, [r0, 0x4]
adds r7, r0, 0
cmp r3, 0xC
bls _0800E95E
b _0800EA9A
_0800E95E:
lsls r0, r3, 2
ldr r1, =_0800E970
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_0800E970:
.4byte _0800E9A4
.4byte _0800EA9A
.4byte _0800EA9A
.4byte _0800EA9A
.4byte _0800EA9A
.4byte _0800EA9A
.4byte _0800E9BC
.4byte _0800EA9A
.4byte _0800EA9A
.4byte _0800E9E4
.4byte _0800EA9A
.4byte _0800E9F8
.4byte _0800EA3C
_0800E9A4:
ldr r0, =gUnknown_082ED608
bl sub_800BFCC
ldr r0, =gUnknown_03005000
movs r2, 0x1
strh r2, [r0, 0x4]
b _0800E9CC
.pool
_0800E9BC:
ldrb r0, [r7, 0xC]
ldr r3, =gUnknown_082ED6E0
movs r1, 0
movs r2, 0xF0
bl sub_800C054
movs r2, 0x7
strh r2, [r7, 0x4]
_0800E9CC:
ldr r1, =gTasks
lsls r0, r6, 2
adds r0, r6
lsls r0, 3
adds r0, r1
strh r2, [r0, 0xA]
b _0800EA9A
.pool
_0800E9E4:
ldr r0, =gTasks
lsls r1, r6, 2
adds r1, r6
lsls r1, 3
adds r1, r0
movs r0, 0xA
strh r0, [r1, 0xA]
b _0800EA9A
.pool
_0800E9F8:
bl sub_80107A0
cmp r0, 0x6
beq _0800EA1C
cmp r0, 0x6
bgt _0800EA0A
cmp r0, 0x5
beq _0800EA10
b _0800EA9A
_0800EA0A:
cmp r0, 0x9
beq _0800EA1C
b _0800EA9A
_0800EA10:
ldr r1, =gUnknown_03005000
movs r0, 0xC
strh r0, [r1, 0x4]
b _0800EA9A
.pool
_0800EA1C:
bl sub_800D630
ldr r0, =gUnknown_03005000
ldr r1, =0x00000ce4
adds r0, r1
movs r1, 0x2
strb r1, [r0]
adds r0, r6, 0
bl DestroyTask
b _0800EA9A
.pool
_0800EA3C:
ldr r0, =0x00000c3e
adds r4, r7, r0
ldrb r0, [r4]
movs r5, 0x80
lsls r5, 17
lsls r5, r0
lsrs r5, 24
ldrb r1, [r4]
movs r0, 0xC
bl rfu_clearSlot
ldrb r1, [r4]
ldr r0, =0x00000c3f
adds r2, r7, r0
movs r0, 0x10
movs r3, 0x46
bl rfu_setRecvBuffer
adds r1, r7, 0
adds r1, 0x4C
adds r0, r5, 0
movs r2, 0xE
bl rfu_UNI_setSendData
ldr r1, =gTasks
lsls r0, r6, 2
adds r0, r6
lsls r0, 3
adds r0, r1
movs r1, 0x8
strh r1, [r0, 0xA]
adds r0, r6, 0
bl DestroyTask
ldr r4, =gUnknown_02022B44
ldrb r0, [r4, 0xF]
cmp r0, 0
bne _0800EA92
bl sub_801227C
ldrb r0, [r4, 0xF]
adds r0, 0x1
strb r0, [r4, 0xF]
_0800EA92:
ldr r0, =sub_801084C
movs r1, 0x5
bl CreateTask
_0800EA9A:
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_800E94C
thumb_func_start sub_800EAB4
sub_800EAB4: @ 800EAB4
push {r4,r5,lr}

View File

@ -128,8 +128,8 @@ struct RfuUnk2
u8 fill_4f[0x12];
u8 unk_61;
u8 fill_62[6];
u32 unk_68;
u32 unk_6c;
void *unk_68;
void *unk_6c;
u8 unk_70[0x70];
};
@ -215,3 +215,5 @@ 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);
void rfu_setRecvBuffer(u8 a0, u8 a1, void *a2, size_t a3);
void rfu_UNI_setSendData(u8 flag, void *ptr, u8 size);

View File

@ -40,6 +40,13 @@ struct UnkLinkRfuStruct_02022B2C
u16 unk_14;
};
struct UnkLinkRfuStruct_02022B44
{
u8 fill_00[15];
u8 unk_0f;
u8 fill_10[0xcc];
};
struct UnkRfuStruct_1 {
/* 0x000 */ u8 unk_00;
/* 0x001 */ u8 unk_01;
@ -131,7 +138,9 @@ struct UnkRfuStruct_2 {
/* 0x006 */ u8 filler_06[6];
/* 0x00c */ u8 unk_0c;
/* 0x00d */ u8 playerCount;
/* 0x00e */ u8 filler_0e[0x5e];
/* 0x00e */ u8 filler_0e[0x3e];
/* 0x04c */ u8 unk_4c[14 * 2];
/* 0x068 */ u8 filler_68[4];
/* 0x06c */ struct UnkRfuStruct_2_Sub_6c unk_6c;
/* 0x080 */ struct UnkRfuStruct_2_Sub_6c unk_80[5];
/* 0x0e4 */ u8 filler_e4[10];
@ -140,12 +149,16 @@ struct UnkRfuStruct_2 {
/* 0x124 */ struct UnkRfuStruct_2_Sub_124 unk_124;
/* 0x9e8 */ struct UnkRfuStruct_2_Sub_9e8 unk_9e8;
/* 0xc1c */ struct UnkRfuStruct_2_Sub_c1c unk_c1c;
/* 0xc3c */ u8 filler_c3c[3];
/* 0xc3f */ u8 filler_c3f[0x9c];
/* 0xc3c */ u8 filler_c3c[2];
/* 0xc3e */ vu8 unk_c3e;
/* 0xc3f */ u8 unk_c3f[70 * 2];
/* 0xccb */ u8 filler_ccb[16];
/* 0xcdb */ vu8 unk_cdb;
/* 0xcdc */ u8 filler_cdc[2];
/* 0xcde */ u8 unk_cde[4];
/* 0xce2 */ u8 filler_ce2[18];
/* 0xce2 */ u8 filler_ce2[2];
/* 0xce4 */ u8 unk_ce4;
/* 0xce5 */ u8 filler_ce5[15];
}; // size = 0xcf4
// Exported RAM declarations

View File

@ -28,6 +28,7 @@ EWRAM_DATA u8 gWirelessStatusIndicatorSpriteId = 0;
EWRAM_DATA ALIGNED(4) struct UnkLinkRfuStruct_02022B14 gUnknown_02022B14 = {};
EWRAM_DATA ALIGNED(2) u8 gUnknown_02022B22[8] = {};
EWRAM_DATA struct UnkLinkRfuStruct_02022B2C gUnknown_02022B2C = {};
EWRAM_DATA struct UnkLinkRfuStruct_02022B44 gUnknown_02022B44 = {};
// Static ROM declarations
@ -53,10 +54,12 @@ void sub_800EAFC(void);
void sub_800FCC4(struct UnkRfuStruct_2_Sub_6c *data);
bool32 sub_8010454(u16 a0);
void sub_8010750(void);
int sub_80107A0(void);
void sub_801084C(u8 taskId);
void sub_8010AAC(u8 taskId);
void sub_8010D0C(u8 taskId);
u8 sub_8012224(void);
void sub_801227C(void);
// .rodata
@ -2567,3 +2570,57 @@ void sub_800E88C(int r2, int r5)
}
}
}
void sub_800E94C(u8 taskId)
{
switch (gUnknown_03005000.unk_04)
{
case 0:
sub_800BFCC(&gUnknown_082ED608);
gUnknown_03005000.unk_04 = 1;
gTasks[taskId].data[1] = 1;
break;
case 1:
break;
case 6:
sub_800C054(gUnknown_03005000.unk_0c, 0, 0xf0, gUnknown_082ED6E0);
gUnknown_03005000.unk_04 = 7;
gTasks[taskId].data[1] = 7;
break;
case 7:
break;
case 9:
gTasks[taskId].data[1] = 10;
break;
case 11:
switch (sub_80107A0())
{
case 5:
gUnknown_03005000.unk_04 = 12;
break;
case 6:
case 9:
sub_800D630();
gUnknown_03005000.unk_ce4 = 2;
DestroyTask(taskId);
break;
}
break;
case 12:
{
u8 r5 = 1 << gUnknown_03005000.unk_c3e;
rfu_clearSlot(12, gUnknown_03005000.unk_c3e);
rfu_setRecvBuffer(16, gUnknown_03005000.unk_c3e, gUnknown_03005000.unk_c3f, 70);
rfu_UNI_setSendData(r5, gUnknown_03005000.unk_4c, 14);
gTasks[taskId].data[1] = 8;
DestroyTask(taskId);
if (gUnknown_02022B44.unk_0f == 0)
{
sub_801227C();
gUnknown_02022B44.unk_0f++;
}
CreateTask(sub_801084C, 5);
break;
}
}
}

View File

@ -21,9 +21,6 @@ gStringVar4: @ 2021FC4
.include "src/link.o"
.include "src/link_rfu.o"
gUnknown_02022B44: @ 2022B44
.space 0xDC
gUnknown_02022C20: @ 2022C20
.space 0xC