From 4adfd8ba02e692e56c68c3e0dc3cd28fb04e9341 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 3 Aug 2020 12:54:10 -0400 Subject: Decompile unk_02015CC0.s --- arm9/src/unk_02015CC0.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 arm9/src/unk_02015CC0.c (limited to 'arm9/src') 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]; +} -- cgit v1.2.3