summaryrefslogtreecommitdiff
path: root/arm9/src
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2020-08-04 09:24:58 -0400
committerGitHub <noreply@github.com>2020-08-04 09:24:58 -0400
commita253a0513906c02326afdafefe6feddc3de7a3a1 (patch)
tree2bb45658a16f11846b995e0f05e362661f418f0f /arm9/src
parentae5720bd68f9d1910ade441017190c41e175b643 (diff)
parent1f219b2e2fc933d8fa562afdb91fe06ffa175d71 (diff)
Merge pull request #257 from PikalaxALT/pikalax_work
unk_02015CC0; fix knarc and msgenc compiling with older g++
Diffstat (limited to 'arm9/src')
-rw-r--r--arm9/src/unk_02015CC0.c31
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];
+}