summaryrefslogtreecommitdiff
path: root/src/code_80983D8.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-10-22 10:01:07 -0700
committerGitHub <noreply@github.com>2021-10-22 10:01:07 -0700
commit3e5dd1d047bada52ab0dce2fe58b04e39bcaa1cc (patch)
tree0e40067d711c783ef97667f4a8256f38ab0d4b0a /src/code_80983D8.c
parent3f7ee3a806d965fae70fd98f2cd1af13a2e4cf0b (diff)
Death by 74 files (#65)
* death by 74 files * 20% reached * doc move stuff in pokemon * fix undef reference * doc more and plumb a few more constanst for num party members and num moves * that struct is def PokemonMove.. clean up all code with it
Diffstat (limited to 'src/code_80983D8.c')
-rw-r--r--src/code_80983D8.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/code_80983D8.c b/src/code_80983D8.c
index ef1e59d..c6acf93 100644
--- a/src/code_80983D8.c
+++ b/src/code_80983D8.c
@@ -1,5 +1,36 @@
#include "global.h"
+extern u32 gUnknown_8115E94[5][3]; // NOTE: Factor of two difference in array sizes
+
+s32 sub_80983D8(short *param_1,short *param_2)
+{
+ s32 uVar1;
+ s32 uVar2;
+ s32 uVar3;
+
+ uVar3 = param_2[0] - param_1[0];
+ uVar2 = param_2[1] - param_1[1];
+ if ((uVar3 == 0) && (uVar2 == 0)) {
+ uVar1 = 0;
+ }
+ else {
+ if (0 < uVar3) {
+ uVar3 = 1;
+ }
+ if (0 < uVar2) {
+ uVar2 = 1;
+ }
+ if (-1 >= uVar3) {
+ uVar3 = -1;
+ }
+ if (-1 >= uVar2) {
+ uVar2 = -1;
+ }
+ uVar1 = gUnknown_8115E94[(uVar2 + 1)][(uVar3 + 1)];
+ }
+ return uVar1;
+}
+
s32 sub_8098434(short param_1[],short param_2[])
{
s32 diff_index1;
@@ -18,3 +49,4 @@ s32 sub_8098434(short param_1[],short param_2[])
}
return diff_index1;
}
+