diff options
author | red031000 <rubenru09@aol.com> | 2020-08-05 01:54:56 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-08-05 01:54:56 +0100 |
commit | c35e7faa7079a4ec6c095c6533591a4fca6c748d (patch) | |
tree | b15d69a86e7901e603ab5d69b8c203bfe7924079 /arm9/src | |
parent | 4f23a1710f9c6cbf0c3cfe5d2a75c320ce681bba (diff) | |
parent | 098ffd02f95c46c18f925d0d6866b6d4a51aa86e (diff) |
Merge branch 'master' of https://github.com/pret/pokediamond
Diffstat (limited to 'arm9/src')
-rw-r--r-- | arm9/src/unk_02015CC0.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arm9/src/unk_02015CC0.c b/arm9/src/unk_02015CC0.c new file mode 100644 index 00000000..5da221d0 --- /dev/null +++ b/arm9/src/unk_02015CC0.c @@ -0,0 +1,31 @@ +#include "global.h" +#include "unk_02015CC0.h" + +#pragma thumb on + +const u16 UNK_020ED72C[] = { + 0, + 2000, + 3000 +}; + +int FUN_02015CC0(u16 a0) +{ + int i; + for (i = 0; i < (int)NELEMS(UNK_020ED72C) - 1; i++) { + if (a0 < UNK_020ED72C[i + 1]) + return i; + } + return i; +} + +int FUN_02015CE0(u16 a0) +{ + return a0 - UNK_020ED72C[FUN_02015CC0(a0)]; +} + +int FUN_02015CF8(int a0, int a1) +{ + GF_ASSERT(a0 < (int)NELEMS(UNK_020ED72C)); + return a1 + UNK_020ED72C[a0]; +} |