sub_80EAD94

This commit is contained in:
PikalaxALT 2017-10-27 21:03:27 -04:00
parent 3d01d999c6
commit 6341dbf61f
2 changed files with 48 additions and 133 deletions

View file

@ -5,137 +5,6 @@
.text
thumb_func_start sub_80EAD94
sub_80EAD94: @ 80EAD94
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
mov r9, r0
adds r7, r1, 0
mov r8, r2
adds r6, r3, 0
movs r5, 0x1
_080EADA6:
lsls r0, r5, 2
adds r0, r5
lsls r0, 5
mov r1, r9
adds r4, r0, r1
ldrb r0, [r4]
cmp r0, 0
beq _080EADF8
ldrb r1, [r4, 0x1]
movs r0, 0xC0
ands r0, r1
cmp r0, 0x40
bne _080EADCE
movs r2, 0x10
negs r2, r2
adds r0, r2, 0
ands r0, r1
movs r1, 0x1
orrs r0, r1
strb r0, [r4, 0x1]
_080EADCE:
adds r0, r4, 0
adds r1, r7, 0
adds r2, r5, 0
bl sub_80EAD14
lsls r0, 24
cmp r0, 0
bne _080EADF8
adds r0, r4, 0
mov r1, r8
adds r2, r5, 0
bl sub_80EAD14
lsls r0, 24
cmp r0, 0
bne _080EADF8
adds r0, r4, 0
adds r1, r6, 0
adds r2, r5, 0
bl sub_80EAD14
_080EADF8:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x13
bls _080EADA6
movs r5, 0
_080EAE04:
lsls r0, r5, 2
adds r0, r5
lsls r0, 5
adds r4, r0, r7
ldrb r0, [r4]
cmp r0, 0
beq _080EAE38
ldrb r0, [r4, 0x1]
movs r2, 0x21
negs r2, r2
adds r1, r2, 0
ands r0, r1
strb r0, [r4, 0x1]
adds r0, r4, 0
mov r1, r8
adds r2, r5, 0
bl sub_80EAD14
lsls r0, 24
cmp r0, 0
bne _080EAE38
adds r0, r4, 0
adds r1, r6, 0
adds r2, r5, 0
bl sub_80EAD14
_080EAE38:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x13
bls _080EAE04
movs r5, 0
movs r0, 0x21
negs r0, r0
adds r7, r0, 0
_080EAE4A:
lsls r0, r5, 2
adds r0, r5
lsls r4, r0, 5
mov r2, r8
adds r1, r4, r2
ldrb r0, [r1]
cmp r0, 0
beq _080EAE6A
ldrb r0, [r1, 0x1]
ands r0, r7
strb r0, [r1, 0x1]
adds r0, r1, 0
adds r1, r6, 0
adds r2, r5, 0
bl sub_80EAD14
_080EAE6A:
adds r1, r4, r6
ldrb r0, [r1]
cmp r0, 0
beq _080EAE78
ldrb r0, [r1, 0x1]
ands r0, r7
strb r0, [r1, 0x1]
_080EAE78:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x13
bls _080EAE4A
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80EAD94
thumb_func_start sub_80EAE90
sub_80EAE90: @ 80EAE90
push {r4,lr}

View file

@ -1644,7 +1644,7 @@ void DeleteFirstOldBaseFromPlayerInRecordMixingFriendsRecords(struct SecretBaseR
u8 i;
u8 sbFlags = 0x0;
for (i = 0; i < 20; i++)
for (i = 0; i < 20; i ++)
{
if (!(sbFlags & 0x1)) // 001
{
@ -1684,7 +1684,7 @@ bool8 sub_80EAD14(struct SecretBaseRecord *base, struct SecretBaseRecord *secret
{
u8 i;
for (i = 0; i < 20; i++)
for (i = 0; i < 20; i ++)
{
if (secretBases[i].secretBaseId != 0)
{
@ -1712,3 +1712,49 @@ bool8 sub_80EAD14(struct SecretBaseRecord *base, struct SecretBaseRecord *secret
return FALSE;
}
void sub_80EAD94(struct SecretBaseRecord *basesA, struct SecretBaseRecord *basesB, struct SecretBaseRecord *basesC, struct SecretBaseRecord *basesD)
{
u8 i;
for (i = 1; i < 20; i ++)
{
if (basesA[i].secretBaseId)
{
if (basesA[i].sbr_field_1_6 == 1)
{
basesA[i].sbr_field_1_0 = 1;
}
if (!sub_80EAD14(&basesA[i], basesB, i))
{
if (!sub_80EAD14(&basesA[i], basesC, i))
{
sub_80EAD14(&basesA[i], basesD, i);
}
}
}
}
for (i = 0; i < 20; i ++)
{
if (basesB[i].secretBaseId)
{
basesB[i].sbr_field_1_5 = 0;
if (!sub_80EAD14(&basesB[i], basesC, i))
{
sub_80EAD14(&basesB[i], basesD, i);
}
}
}
for (i = 0; i < 20; i ++)
{
if (basesC[i].secretBaseId)
{
basesC[i].sbr_field_1_5 = 0;
sub_80EAD14(&basesC[i], basesD, i);
}
if (basesD[i].secretBaseId)
{
basesD[i].sbr_field_1_5 = 0;
}
}
}