summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcamthesaxman <cameronghall@cox.net>2017-06-10 22:06:58 -0500
committercamthesaxman <cameronghall@cox.net>2017-06-10 22:06:58 -0500
commitf44934f8f79c7b361b85721134a0a1eaa2065ca1 (patch)
treeab010789b79877864214a22060d50434e10fe6b3 /src
parentb741c626e72a2c52351fddbbfc536f66183d009f (diff)
decompile sub_8094B6C
Diffstat (limited to 'src')
-rw-r--r--src/rom_8094928.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/rom_8094928.c b/src/rom_8094928.c
index 794fc78f6..761a49d27 100644
--- a/src/rom_8094928.c
+++ b/src/rom_8094928.c
@@ -1,9 +1,9 @@
#include "global.h"
#include "pokemon.h"
-#define UNK_201606C_ARRAY (unk_2000000 + 0x1606C) // lazy define but whatever.
+extern u8 ewram[];
-extern u8 unk_2000000[];
+#define UNK_201606C_ARRAY (ewram + 0x1606C) // lazy define but whatever.
extern struct PokemonStorage gPokemonStorage;
extern u8 IsLinkDoubleBattle(void);
@@ -133,3 +133,41 @@ void sub_8094A74(u8 arg[3], u8 player_number, u32 arg3)
arg[i] = (temp[i << 1] << 4) | temp[(i << 1) + 1];
}
}
+
+void sub_8094B6C(u8 a, u8 b, u8 c)
+{
+ s32 i;
+ s32 j;
+ u8 temp[6];
+ u8 r3;
+ u8 r7 = 0;
+
+ if (IsLinkDoubleBattle())
+ {
+ u8 *arr = ewram + 0x1606C + a * 3;
+
+ for (i = 0, j = 0; i < 3; i++)
+ {
+ temp[j++] = arr[i] >> 4;
+ temp[j++] = arr[i] & 0xF;
+ }
+ r3 = temp[c];
+ for (i = 0; i < 6; i++)
+ {
+ if (temp[i] == b)
+ {
+ r7 = temp[i];
+ temp[i] = r3;
+ break;
+ }
+ }
+ if (i != 6)
+ {
+ temp[c] = r7;
+
+ arr[0] = (temp[0] << 4) | temp[1];
+ arr[1] = (temp[2] << 4) | temp[3];
+ arr[2] = (temp[4] << 4) | temp[5];
+ }
+ }
+}