summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-01-12 12:13:35 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2018-01-12 12:13:35 -0500
commitf37add5cfb4bb369ec096d91f62915ee4f88a1d7 (patch)
tree9976f0b35cc5cf66c451c78e784ca96ec2c52018 /src
parentcce4c9e92bfe7e10be3a0cf4940299e84701dba0 (diff)
through sub_8099D90
Diffstat (limited to 'src')
-rw-r--r--src/pokemon/pokemon_storage_system_4.c71
-rw-r--r--src/pokemon/pokemon_storage_system_6.c14
2 files changed, 85 insertions, 0 deletions
diff --git a/src/pokemon/pokemon_storage_system_4.c b/src/pokemon/pokemon_storage_system_4.c
index f7a008db2..697292d5c 100644
--- a/src/pokemon/pokemon_storage_system_4.c
+++ b/src/pokemon/pokemon_storage_system_4.c
@@ -18,6 +18,77 @@ EWRAM_DATA u16 gUnknown_020384EA = 0;
// Static ROM declarations
+void sub_809900C(u8 boxId, s8 a1);
+s8 sub_8099D90(u8 boxId);
+void sub_8099EB0(u8 boxId, s8 a1);
+void sub_809A23C(u8 boxId);
+void sub_809A3D0(u8 boxId, s8 a1);
+void sub_809A598(void);
+void sub_809A6DC(void);
+void sub_809A774(s8 a0);
+void sub_809A810(void);
+
// .rodata
// .text
+
+void sub_8099BF8(u8 boxId)
+{
+ gPokemonStorageSystemPtr->unk_08ba = 0;
+ gPokemonStorageSystemPtr->unk_08b4 = 0;
+ DmaFill32(3, 0, BG_SCREEN_ADDR(26), 0x1000);
+ sub_8099EB0(boxId, 0);
+ sub_809A23C(boxId);
+ sub_809A6DC();
+ SpawnBoxIconSprites(boxId);
+ REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(26) | BGCNT_TXT512x256;
+}
+
+void sub_8099C70(u8 whichBox)
+{
+ s8 r4 = sub_8099D90(whichBox);
+ sub_8099EB0(whichBox, r4);
+ gPokemonStorageSystemPtr->unk_08b6 = r4 * 6;
+ gPokemonStorageSystemPtr->unk_08b8 = 0x20;
+ gPokemonStorageSystemPtr->unk_08bb = whichBox;
+ gPokemonStorageSystemPtr->unk_08bc = r4 > 0 ? 0 : 5;
+ gPokemonStorageSystemPtr->unk_08be = r4;
+ gPokemonStorageSystemPtr->unk_08c0 = r4 > 0 ? 0x108 : 0x38;
+ gPokemonStorageSystemPtr->unk_08c2 = r4 > 0 ? 0 : 5;
+ gPokemonStorageSystemPtr->unk_08c4 = r4;
+ gPokemonStorageSystemPtr->unk_08c6 = 0;
+ gPokemonStorageSystemPtr->unk_08c8 = 2;
+ sub_809900C(whichBox, r4);
+ sub_809A3D0(whichBox, r4);
+ sub_809A774(r4);
+}
+
+bool8 sub_8099D34(void)
+{
+ bool8 retVal = sub_80990AC();
+ if (gPokemonStorageSystemPtr->unk_08b8 != 0)
+ {
+ gPokemonStorageSystemPtr->unk_08b4 += gPokemonStorageSystemPtr->unk_08b6;
+ gPokemonStorageSystemPtr->unk_08b4 &= 0x1ff;
+ if (--gPokemonStorageSystemPtr->unk_08b8 == 0)
+ {
+ sub_809A598();
+ sub_809A810();
+ }
+ return TRUE;
+ }
+ return retVal;
+}
+
+s8 sub_8099D90(u8 boxId)
+{
+ u8 curBox = get_preferred_box();
+ u8 i;
+
+ for (i = 0; curBox != boxId; i++)
+ {
+ if (++curBox >= 14)
+ curBox = 0;
+ }
+ return i <= 6 ? 1 : -1;
+}
diff --git a/src/pokemon/pokemon_storage_system_6.c b/src/pokemon/pokemon_storage_system_6.c
new file mode 100644
index 000000000..a781c1ed2
--- /dev/null
+++ b/src/pokemon/pokemon_storage_system_6.c
@@ -0,0 +1,14 @@
+
+// Includes
+#include "global.h"
+#include "pokemon_storage_system.h"
+
+// Static type declarations
+
+// Static RAM declarations
+
+// Static ROM declarations
+
+// .rodata
+
+// .text