unused sub_80086C8

This commit is contained in:
DizzyEggg 2024-09-25 14:39:08 +02:00
parent 6bd9c31ee9
commit 7d137ea3f8
2 changed files with 75 additions and 189 deletions

View File

@ -5,195 +5,6 @@
.text
thumb_func_start nullsub_165
nullsub_165:
bx lr
thumb_func_end nullsub_165
thumb_func_start nullsub_166
nullsub_166:
bx lr
thumb_func_end nullsub_166
thumb_func_start nullsub_167
nullsub_167:
bx lr
thumb_func_end nullsub_167
thumb_func_start nullsub_168
nullsub_168:
bx lr
thumb_func_end nullsub_168
thumb_func_start sub_80086C8
sub_80086C8:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0xC
mov r9, r2
ldr r7, [sp, 0x30]
lsls r2, r1, 3
adds r2, r1
lsls r2, 3
adds r0, r2
mov r12, r0
mov r0, r9
cmp r0, 0
bge _080086F2
ldr r1, [sp, 0x2C]
add r1, r9
str r1, [sp, 0x2C]
movs r2, 0
mov r9, r2
_080086F2:
cmp r3, 0
bge _080086FA
adds r7, r3
movs r3, 0
_080086FA:
ldr r0, [sp, 0x2C]
add r0, r9
mov r4, r12
movs r5, 0x4
ldrsh r2, [r4, r5]
lsls r1, r2, 3
cmp r0, r1
ble _08008710
mov r0, r9
subs r0, r1, r0
str r0, [sp, 0x2C]
_08008710:
adds r1, r3, r7
mov r4, r12
movs r5, 0x8
ldrsh r0, [r4, r5]
lsls r0, 3
cmp r1, r0
ble _08008720
subs r7, r0, r3
_08008720:
adds r1, r3, 0
cmp r3, 0
bge _08008728
adds r1, r3, 0x7
_08008728:
asrs r1, 3
muls r2, r1
mov r0, r9
cmp r0, 0
bge _08008734
adds r0, 0x7
_08008734:
asrs r0, 3
adds r0, r2, r0
lsls r0, 3
lsls r1, 3
subs r1, r3, r1
adds r0, r1
lsls r0, 2
mov r2, r12
ldr r1, [r2, 0x18]
b _080087D6
_08008748:
adds r2, r5, 0
ldr r4, [sp, 0x2C]
mov r6, r9
mov r1, r12
ldr r0, [r1, 0x3C]
cmp r0, r5
bls _08008758
str r5, [r1, 0x3C]
_08008758:
subs r0, r7, 0x1
str r0, [sp, 0x4]
adds r3, 0x1
str r3, [sp, 0x8]
mov r1, r12
ldr r1, [r1, 0x40]
str r1, [sp]
adds r0, r5, 0x4
mov r10, r0
cmp r4, 0
ble _080087B6
ldr r1, _0800878C
mov r8, r1
movs r7, 0x7
_08008774:
cmp r4, 0x7
bgt _08008790
adds r3, r4, 0
adds r0, r4, 0
ands r0, r7
adds r0, 0x8
lsls r0, 2
add r0, r8
ldr r1, [r2]
ldr r0, [r0]
ands r1, r0
b _080087AA
.align 2, 0
_0800878C: .4byte gUnknown_80B8868
_08008790:
adds r1, r6, 0
ands r1, r7
cmp r1, 0
beq _080087A8
movs r0, 0x8
subs r3, r0, r1
lsls r0, r1, 2
add r0, r8
ldr r1, [r2]
ldr r0, [r0]
ands r1, r0
b _080087AA
_080087A8:
movs r3, 0x8
_080087AA:
str r1, [r2]
adds r2, 0x20
subs r4, r3
adds r6, r3
cmp r4, 0
bgt _08008774
_080087B6:
ldr r7, [sp, 0x4]
ldr r3, [sp, 0x8]
ldr r2, [sp]
cmp r2, r5
bcs _080087C4
mov r4, r12
str r5, [r4, 0x40]
_080087C4:
mov r5, r10
movs r0, 0x7
ands r0, r3
cmp r0, 0
bne _080087D8
mov r5, r12
ldr r0, [r5, 0x20]
lsls r0, 2
mov r1, r10
_080087D6:
adds r5, r1, r0
_080087D8:
cmp r7, 0
bgt _08008748
add sp, 0xC
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80086C8
thumb_func_start sub_80087EC
sub_80087EC:
push {r4-r6,lr}

View File

@ -2862,3 +2862,78 @@ u8 *xxx_get_next_char_from_string(u8 *a1, u32 *a0)
return a1 + 1;
}
}
UNUSED void nullsub_165(void) {}
UNUSED void nullsub_166(void) {}
UNUSED void nullsub_167(void) {}
UNUSED void nullsub_168(void) {}
extern const u32 gUnknown_80B8868[];
UNUSED void sub_80086C8(UnkTextStruct1 *a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5)
{
u32 *r5;
s32 r2, r0, r1;
UnkTextStruct1 *strPtr = &a0[a1];
if (a2 < 0) {
a4 += a2;
a2 = 0;
}
if (a3 < 0) {
a5 += a3;
a3 = 0;
}
if (a4 + a2 > strPtr->unk4 * 8) {
a4 = (strPtr->unk4 * 8) - a2;
}
if (a3 + a5 > strPtr->unk8 * 8) {
a5 = (strPtr->unk8 * 8) - a3;
}
r2 = strPtr->unk4 * (a3 / 8);
r0 = 8 * (r2 + (a2 / 8));
r1 = a3 - ((a3 / 8) * 8);
r5 = &strPtr->unk18[r0 + r1];
while (a5 > 0) {
u32 *loopPtr;
s32 r4, r6;
loopPtr = r5;
r4 = a4;
r6 = a2;
if (strPtr->unk3C > r5) {
strPtr->unk3C = r5;
}
while (r4 > 0) {
s32 r3;
if (r4 < 8) {
r3 = r4;
*loopPtr &= gUnknown_80B8868[(r4 & 7) + 8];
}
else if ((r6 & 7) != 0) {
r3 = 8 - (r6 & 7);
*loopPtr &= gUnknown_80B8868[r6 & 7];
}
else {
r3 = 8;
*loopPtr = r6 & 7;
}
loopPtr += 8;
r4 -= r3;
r6 += r3;
}
a5--;
a3++;
if (strPtr->unk40 < r5) {
strPtr->unk40 = r5;
}
r5++;
if (!(a3 & 7)) {
r5 = &r5[strPtr->unk20];
}
}
}