sub_81449E0

This commit is contained in:
PikalaxALT
2018-11-30 10:52:54 -05:00
parent 80dbdacace
commit 5a80a339cd
3 changed files with 80 additions and 143 deletions
-133
View File
@@ -5,139 +5,6 @@
.text
thumb_func_start sub_81449E0
sub_81449E0: @ 81449E0
push {r4,r5,lr}
sub sp, 0x8
adds r4, r0, 0
ldr r5, [r4]
cmp r5, 0x1
beq _08144A4C
cmp r5, 0x1
bgt _081449F6
cmp r5, 0
beq _08144A00
b _08144AE2
_081449F6:
cmp r5, 0x2
beq _08144AA0
cmp r5, 0x3
beq _08144ACA
b _08144AE2
_08144A00:
bl sub_800A4BC
lsls r0, 24
cmp r0, 0
beq _08144AE2
ldrh r1, [r4, 0xE]
ldr r2, _08144A44 @ =0xffff0000
ldr r0, [sp]
ands r0, r2
orrs r0, r1
str r0, [sp]
ldrh r1, [r4, 0x14]
ldr r0, [sp, 0x4]
ands r0, r2
orrs r0, r1
str r0, [sp, 0x4]
ldr r0, [r4, 0x1C]
bl CalcCRC16WithTable
lsls r0, 16
ldr r2, _08144A48 @ =0x0000ffff
ldr r1, [sp]
ands r1, r2
orrs r1, r0
str r1, [sp]
lsrs r1, 16
strh r1, [r4, 0x12]
strh r5, [r4, 0x10]
movs r0, 0
mov r1, sp
movs r2, 0x8
bl SendBlock
b _08144AC2
.align 2, 0
_08144A44: .4byte 0xffff0000
_08144A48: .4byte 0x0000ffff
_08144A4C:
bl sub_800A4BC
lsls r0, 24
cmp r0, 0
beq _08144AE2
ldrb r0, [r4, 0x4]
bl sub_81448D8
cmp r0, 0
beq _08144AE2
ldrb r0, [r4, 0x4]
bl sub_81448FC
ldrh r1, [r4, 0x10]
lsls r0, r1, 6
subs r0, r1
lsls r3, r0, 2
ldrh r0, [r4, 0x14]
subs r0, r3
cmp r0, 0xFC
bhi _08144A8C
ldr r1, [r4, 0x1C]
adds r1, r3
lsls r2, r0, 16
lsrs r2, 16
movs r0, 0
bl SendBlock
ldrh r0, [r4, 0x10]
adds r0, 0x1
strh r0, [r4, 0x10]
b _08144AC2
_08144A8C:
ldr r1, [r4, 0x1C]
adds r1, r3
movs r0, 0
movs r2, 0xFC
bl SendBlock
ldrh r0, [r4, 0x10]
adds r0, 0x1
strh r0, [r4, 0x10]
b _08144AE2
_08144AA0:
bl sub_800A4BC
lsls r0, 24
cmp r0, 0
beq _08144AE2
ldr r0, [r4, 0x1C]
ldrh r1, [r4, 0x14]
bl CalcCRC16WithTable
lsls r0, 16
lsrs r0, 16
ldrh r1, [r4, 0x12]
cmp r0, r1
beq _08144AC2
bl sub_80FA190
b _08144AE2
_08144AC2:
ldr r0, [r4]
adds r0, 0x1
str r0, [r4]
b _08144AE2
_08144ACA:
ldrb r0, [r4, 0x4]
bl sub_81448D8
cmp r0, 0
beq _08144AE2
ldrb r0, [r4, 0x4]
bl sub_81448FC
movs r0, 0
str r0, [r4]
movs r0, 0x1
b _08144AE4
_08144AE2:
movs r0, 0
_08144AE4:
add sp, 0x8
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_81449E0
thumb_func_start sub_8144AEC
sub_8144AEC: @ 8144AEC
push {r4,lr}