sub_810CE10

This commit is contained in:
PikalaxALT
2018-10-08 21:04:59 -04:00
parent 2e0259fceb
commit 9e51b18b9f
3 changed files with 25 additions and 51 deletions
-49
View File
@@ -5,55 +5,6 @@
.text
thumb_func_start sub_810CE10
sub_810CE10: @ 810CE10
push {r4-r7,lr}
mov r12, r0
lsls r1, 16
lsrs r6, r1, 16
movs r1, 0
mov r4, r12
movs r7, 0
_0810CE1E:
movs r3, 0
ldrh r0, [r4]
cmp r0, 0
beq _0810CE4E
ldr r5, _0810CE3C @ =0x0000ffff
mov r0, r12
adds r2, r7, r0
_0810CE2C:
ldrh r0, [r2]
cmp r0, r5
beq _0810CE40
cmp r0, r6
bne _0810CE40
adds r0, r1, 0
b _0810CE5C
.align 2, 0
_0810CE3C: .4byte 0x0000ffff
_0810CE40:
adds r2, 0x2
adds r3, 0x1
cmp r3, 0x5
bgt _0810CE4E
ldrh r0, [r2]
cmp r0, 0
bne _0810CE2C
_0810CE4E:
adds r4, 0x10
adds r7, 0x10
adds r1, 0x1
cmp r1, 0xDC
bls _0810CE1E
movs r0, 0x1
negs r0, r0
_0810CE5C:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_810CE10
thumb_func_start sub_810CE64
sub_810CE64: @ 810CE64
push {r4,r5,lr}
+2 -2
View File
@@ -89,12 +89,12 @@ void sub_8146C88(void)
r5->unk_0_2 = 0;
r5->unk_0_5 = 0;
r5->unk_1 = 0;
VarSet(0x4028, 0);
VarSet(VAR_0x4028, 0);
}
void sub_8146CA4(void)
{
u16 *r4 = sub_806E454(0x4028);
u16 *r4 = sub_806E454(VAR_0x4028);
struct MysteryEventStruct *r2 = sub_8143D94();
struct MysteryEventStruct r0 = *r2;
+23
View File
@@ -826,3 +826,26 @@ void sub_810CDE8(void)
gSaveBlock1Ptr->trainerRematches[gUnknown_20370D2] = 0;
sub_80803FC();
}
int sub_810CE10(const struct UnkStruct_845318C * a0, u16 a1)
{
u32 r1;
s32 r3;
for (r1 = 0; r1 < 0xdd; r1++)
{
for (r3 = 0; r3 < 6; r3++)
{
u16 r0;
if (a0[r1].unk_0[r3] == 0)
break;
r0 = a0[r1].unk_0[r3];
if (r0 == 0xFFFF)
continue;
if (r0 == a1)
return r1;
}
}
return -1;
}