summaryrefslogtreecommitdiff
path: root/src/code_808EAB0.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-02-21 11:13:55 -0800
committerGitHub <noreply@github.com>2021-02-21 13:13:55 -0600
commit7fa4f1a92bdc4cefb094f9e3f1144ad3e3a588d9 (patch)
tree4d5149a98d71e691fb89dca3dfa082eb11ae6a49 /src/code_808EAB0.c
parentc754c2a0466d8394c7ffcb3a515199d5703e47be (diff)
Fully decomp save.s (#28)
* some work on decomping more save stuff * code cleanup and decomp another save func * fully decomp save and combine split save c files * fix two nonmatchings
Diffstat (limited to 'src/code_808EAB0.c')
-rw-r--r--src/code_808EAB0.c47
1 files changed, 4 insertions, 43 deletions
diff --git a/src/code_808EAB0.c b/src/code_808EAB0.c
index 44be84e..9fea853 100644
--- a/src/code_808EAB0.c
+++ b/src/code_808EAB0.c
@@ -61,60 +61,21 @@ void sub_808EB0C(u8 *r0, s32 r1)
}
}
-#ifndef NONMATCHING
-NAKED
-#endif
void sub_808EB48(u8 *r0, s32 r1)
{
-#ifdef NONMATCHING
- // TODO array access and counter are mixed up in the regs.. so close
s32 counter;
- u32 index;
- index = 0;
- counter = 0xB;
- while(counter >= 0)
+ for(counter = 0; counter <= 0xB; counter++)
{
- if(gUnknown_810A378[index] <= r1)
+ if(gUnknown_810A378[counter] <= r1)
{
- r0[index] = TRUE;
+ r0[counter] = TRUE;
}
else
{
- r0[index] = FALSE;
+ r0[counter] = FALSE;
}
- index++;
- counter--;
}
-#else
- asm_unified("\tpush {r4-r7,lr}\n"
- "\tadds r4, r1, 0\n"
- "\tmovs r6, 0x1\n"
- "\tmovs r5, 0\n"
- "\tadds r2, r0, 0\n"
- "\tldr r1, _0808EB64\n"
- "\tmovs r3, 0xB\n"
-"_0808EB56:\n"
- "\tmovs r7, 0\n"
- "\tldrsh r0, [r1, r7]\n"
- "\tcmp r0, r4\n"
- "\tbgt _0808EB68\n"
- "\tstrb r6, [r2]\n"
- "\tb _0808EB6A\n"
- "\t.align 2, 0\n"
-"_0808EB64: .4byte gUnknown_810A378\n"
-"_0808EB68:\n"
- "\tstrb r5, [r2]\n"
-"_0808EB6A:\n"
- "\tadds r2, 0x1\n"
- "\tadds r1, 0x2\n"
- "\tsubs r3, 0x1\n"
- "\tcmp r3, 0\n"
- "\tbge _0808EB56\n"
- "\tpop {r4-r7}\n"
- "\tpop {r0}\n"
- "\tbx r0");
-#endif
}
bool8 sub_808EB7C(s32 r0, u8 r1)