sub_800C27C

This commit is contained in:
PikalaxALT 2017-11-18 23:30:23 -05:00
parent 155bb03f46
commit bf06edfcd3
3 changed files with 85 additions and 116 deletions

View File

@ -5,121 +5,6 @@
.text
thumb_func_start sub_800C27C
sub_800C27C: @ 800C27C
push {r4,r5,lr}
lsls r0, 24
movs r2, 0
ldr r1, =gUnknown_03004140
strb r2, [r1, 0x7]
adds r5, r1, 0
cmp r0, 0
beq _0800C29C
bl sub_800C000
movs r0, 0x17
strb r0, [r5, 0x4]
b _0800C366
.pool
_0800C29C:
ldrb r0, [r5, 0x4]
subs r0, 0x5
cmp r0, 0xD
bhi _0800C352
lsls r0, 2
ldr r1, =_0800C2B4
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_0800C2B4:
.4byte _0800C2EC
.4byte _0800C2F8
.4byte _0800C2F8
.4byte _0800C358
.4byte _0800C302
.4byte _0800C30C
.4byte _0800C30C
.4byte _0800C316
.4byte _0800C320
.4byte _0800C320
.4byte _0800C358
.4byte _0800C326
.4byte _0800C34C
.4byte _0800C34C
_0800C2EC:
movs r1, 0
movs r0, 0x8
strb r0, [r5, 0x4]
strb r1, [r5, 0x5]
movs r2, 0x13
b _0800C358
_0800C2F8:
movs r0, 0x7
strb r0, [r5, 0x4]
movs r0, 0x8
strb r0, [r5, 0x5]
b _0800C358
_0800C302:
movs r0, 0
strb r0, [r5, 0x5]
strb r0, [r5, 0x4]
movs r2, 0x21
b _0800C358
_0800C30C:
movs r1, 0
movs r0, 0xB
strb r0, [r5, 0x4]
strb r1, [r5, 0x5]
b _0800C358
_0800C316:
movs r0, 0
strb r0, [r5, 0x5]
strb r0, [r5, 0x4]
movs r2, 0x23
b _0800C358
_0800C320:
movs r0, 0xE
strb r0, [r5, 0x4]
b _0800C358
_0800C326:
ldrb r0, [r5, 0x11]
strb r0, [r5, 0x4]
ldrb r0, [r5, 0x12]
strb r0, [r5, 0x5]
ldr r4, =gUnknown_03007890
ldr r0, [r4]
ldrb r0, [r0, 0x3]
bl sub_800D334
ldr r0, [r4]
ldrb r0, [r0, 0x3]
strh r0, [r5, 0x14]
movs r0, 0x33
movs r1, 0x1
bl sub_800D30C
b _0800C366
.pool
_0800C34C:
movs r0, 0x12
strb r0, [r5, 0x4]
b _0800C358
_0800C352:
strb r2, [r5, 0x5]
strb r2, [r5, 0x4]
movs r2, 0x43
_0800C358:
ldrb r0, [r5, 0x4]
cmp r0, 0
bne _0800C366
adds r0, r2, 0
movs r1, 0
bl sub_800D30C
_0800C366:
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_800C27C
thumb_func_start sub_800C36C
sub_800C36C: @ 800C36C
push {r4-r7,lr}

View File

@ -48,7 +48,9 @@ struct UnkRfuStruct_1 {
u8 unk_0d;
u8 filler_0e[2];
u8 unk_10;
u8 filler_11[3];
u8 unk_11;
u8 unk_12;
// aligned
u16 unk_14;
u8 filler_16[2];
u16 unk_18;

View File

@ -266,3 +266,85 @@ void sub_800C210(u8 a0)
sub_800D30C(0x33, i);
}
}
void sub_800C27C(bool8 a0)
{
u8 r2;
r2 = 0;
gUnknown_03004140.unk_07 = 0;
if (a0)
{
sub_800C000();
gUnknown_03004140.unk_04 = 23;
}
else
{
switch (gUnknown_03004140.unk_04)
{
case 5:
gUnknown_03004140.unk_04 = 8;
gUnknown_03004140.unk_05 = 0;
r2 = 0x13;
break;
case 6:
gUnknown_03004140.unk_04 = 7;
gUnknown_03004140.unk_05 = 8;
break;
case 7:
gUnknown_03004140.unk_04 = 7;
gUnknown_03004140.unk_05 = 8;
break;
case 8:
break;
case 9:
gUnknown_03004140.unk_05 = 0;
gUnknown_03004140.unk_04 = 0;
r2 = 0x21;
break;
case 10:
gUnknown_03004140.unk_04 = 11;
gUnknown_03004140.unk_05 = 0;
break;
case 11:
gUnknown_03004140.unk_04 = 11;
gUnknown_03004140.unk_05 = 0;
break;
case 12:
gUnknown_03004140.unk_05 = 0;
gUnknown_03004140.unk_04 = 0;
r2 = 0x23;
break;
case 13:
gUnknown_03004140.unk_04 = 14;
break;
case 14:
gUnknown_03004140.unk_04 = 14;
break;
case 15:
break;
case 16:
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_11;
gUnknown_03004140.unk_05 = gUnknown_03004140.unk_12;
sub_800D334(gUnknown_03007890->unk_03);
gUnknown_03004140.unk_14 = gUnknown_03007890->unk_03;
sub_800D30C(0x33, 0x01);
return;
case 17:
gUnknown_03004140.unk_04 = 18;
break;
case 18:
gUnknown_03004140.unk_04 = 18;
break;
default:
gUnknown_03004140.unk_05 = 0;
gUnknown_03004140.unk_04 = 0;
r2 = 0x43;
break;
}
if (gUnknown_03004140.unk_04 == 0)
{
sub_800D30C(r2, 0);
}
}
}