sub_80EAAF4

This commit is contained in:
PikalaxALT 2017-10-27 20:39:02 -04:00
parent aa134d42fb
commit 5ac53054a8
2 changed files with 22 additions and 92 deletions

View file

@ -5,98 +5,6 @@
.text
thumb_func_start sub_80EAAF4
sub_80EAAF4: @ 80EAAF4
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
sub sp, 0xA0
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x00001a9c
adds r7, r0, r1
movs r2, 0x1
_080EAB08:
adds r1, r2, 0x1
lsls r0, r1, 24
lsrs r5, r0, 24
mov r9, r1
cmp r5, 0x13
bhi _080EAB84
lsls r0, r2, 2
adds r0, r2
lsls r0, 5
adds r6, r0, r7
movs r0, 0xC0
mov r8, r0
_080EAB20:
ldrb r0, [r6, 0x1]
mov r3, r8
ands r3, r0
cmp r3, 0
bne _080EAB3E
lsls r2, r5, 2
adds r0, r2, r5
lsls r0, 5
adds r0, r7
ldrb r1, [r0, 0x1]
mov r0, r8
ands r0, r1
adds r4, r2, 0
cmp r0, 0x40
beq _080EAB56
_080EAB3E:
cmp r3, 0x80
bne _080EAB7A
lsls r2, r5, 2
adds r0, r2, r5
lsls r0, 5
adds r0, r7
ldrb r1, [r0, 0x1]
mov r0, r8
ands r0, r1
adds r4, r2, 0
cmp r0, 0x80
beq _080EAB7A
_080EAB56:
mov r0, sp
adds r1, r6, 0
movs r2, 0xA0
bl memcpy
adds r4, r5
lsls r4, 5
adds r4, r7
adds r0, r6, 0
adds r1, r4, 0
movs r2, 0xA0
bl memcpy
adds r0, r4, 0
mov r1, sp
movs r2, 0xA0
bl memcpy
_080EAB7A:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x13
bls _080EAB20
_080EAB84:
mov r1, r9
lsls r0, r1, 24
lsrs r2, r0, 24
cmp r2, 0x12
bls _080EAB08
add sp, 0xA0
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_80EAAF4
thumb_func_start sub_80EABA4
sub_80EABA4: @ 80EABA4
push {r4-r6,lr}

View file

@ -1577,3 +1577,25 @@ u8 sub_80EAA64(struct SecretBaseRecord *base, u32 version, u32 language)
}
return 0;
}
void sub_80EAAF4(void)
{
u8 i;
u8 j;
struct SecretBaseRecord base;
struct SecretBaseRecord *secretBases;
secretBases = gSaveBlock1Ptr->secretBases;
for (i = 1; i < 19; i ++)
{
for (j = i + 1; j < 20; j ++)
{
if ((secretBases[i].sbr_field_1_6 == 0 && secretBases[j].sbr_field_1_6 == 1) || (secretBases[i].sbr_field_1_6 == 2 && secretBases[j].sbr_field_1_6 != 2))
{
base = secretBases[i];
secretBases[i] = secretBases[j];
secretBases[j] = base;
}
}
}
}