Skip to content

Commit

Permalink
match sub_8015F44 and add decomp.me link
Browse files Browse the repository at this point in the history
  • Loading branch information
SethBarberee committed Oct 20, 2024
1 parent a6474ba commit ac1547f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 37 deletions.
37 changes: 0 additions & 37 deletions asm/code_8015080.s
Original file line number Diff line number Diff line change
Expand Up @@ -1725,41 +1725,4 @@ _08015F34:
_08015F40: .4byte gUnknown_80DB098
thumb_func_end sub_8015EB4

thumb_func_start sub_8015F44
sub_8015F44:
push {r4,lr}
movs r2, 0
ldr r0, _08015F78
ldr r0, [r0]
ldrb r4, [r0, 0x1B]
cmp r2, r4
bge _08015F7C
adds r3, r0, 0
adds r3, 0xF8
ldr r0, [r3]
ldrb r0, [r0]
cmp r0, 0
beq _08015F7C
movs r2, 0x1
movs r1, 0x1
_08015F62:
cmp r1, r4
bge _08015F7C
ldr r0, [r3]
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
beq _08015F7C
adds r2, r1, 0x1
adds r1, r2, 0
b _08015F62
.align 2, 0
_08015F78: .4byte gUnknown_203B1FC
_08015F7C:
adds r0, r2, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8015F44

.align 2,0
31 changes: 31 additions & 0 deletions src/code_8012A18_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,37 @@ struct unkStruct_203B1FC

extern struct unkStruct_203B1FC *gUnknown_203B1FC;

// https://decomp.me/scratch/6BUMI - Seth
s32 sub_8015F44(void)
{

#ifndef NONMATCHING
register s32 index asm("r2");
#else
s32 index;
#endif
s32 counter;
index = 0;

if(index < gUnknown_203B1FC->unk1B)
{
if(gUnknown_203B1FC->unkF8[0] == '\0')
return index;
index = 1;
counter = 1;
while (1) {

if(counter >= gUnknown_203B1FC->unk1B)
return index;
if(gUnknown_203B1FC->unkF8[counter] == '\0')
return index;
index = counter + 1;
counter = index;
}
}
return index;
}

void sub_8015F84(void)
{
u32 uVar2;
Expand Down

0 comments on commit ac1547f

Please sign in to comment.