summaryrefslogtreecommitdiff
path: root/include/battle.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/battle.h')
-rw-r--r--include/battle.h110
1 files changed, 90 insertions, 20 deletions
diff --git a/include/battle.h b/include/battle.h
index 4520c97ca..255813ca3 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -34,13 +34,6 @@
// needed to match the hack that is get_item, thanks cam, someone else clean this up later.
extern u8 unk_2000000[];
-// to do: maybe try to reduce the defines needed to match?
-#define BATTLE_STRUCT ((struct BattleStruct *)(unk_2000000))
-#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(unk_2000000 + 0x16800))
-#define UNK_2016A00_STRUCT ((struct UnknownStruct1B *)(unk_2000000 + 0x16A00))
-#define AI_STACK ((struct AI_Stack *)(unk_2000000 + 0x16C00))
-#define AI_ARRAY_160CC ((struct SmallItemStruct *)(unk_2000000 + 0x160CC))
-
enum
{
WEATHER_SUN,
@@ -63,7 +56,7 @@ struct Trainer
/*0x24*/ void *party;
};
-struct UnknownStruct1B // AI_Opponent_Info?
+struct UnkBattleStruct1 // AI_Opponent_Info?
{
/*0x00*/ u16 movesUsed[2][8]; // 0xFFFF means move not used (confuse self hit, etc)
/*0x20*/ u8 unk20[2];
@@ -109,9 +102,9 @@ struct SmallItemStruct
struct BattleStruct /* 0x2000000 */
{
u8 filler0[0x15DDE];
- /*0x15DDE*/ u8 unk15DDE;
- /*0x15DDF*/ u8 unk15DDF;
- /*0x15DE0*/ u8 filler15DE0[0x23C]; // 0xAF off?
+ /*0x15DDE*/ u8 unk15DDE;
+ /*0x15DDF*/ u8 unk15DDF;
+ /*0x15DE0*/ u8 filler15DE0[0x23C]; // 0xAF off?
struct SmallBattleStruct1 unk;
u8 filler1[0x68];
/* 0x16089 */ u8 safariFleeRate;
@@ -121,10 +114,10 @@ struct BattleStruct /* 0x2000000 */
u8 filler2[0x72E];
/* 0x16800 */ struct AI_ThinkingStruct ai; /* 0x2016800 */
u8 filler1681C[0x1E4];
- /* 0x16A00 */ struct UnknownStruct1B unk_2016A00_2;
+ /* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2;
};
-struct UnknownStruct4
+struct UnkBattleStruct4
{
/*0x00*/ u8 filler0[0x3];
/*0x04*/ u16 unk4;
@@ -144,10 +137,87 @@ struct UnknownStruct4
/*0x17*/ u8 filler17[0x4];
};
-extern struct UnknownStruct1B unk_2016A00;
-extern struct UnknownStruct4 gUnknown_02024CA8[];
+struct Struct30042E0
+{
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ u8 unk4;
+ u8 unk5_0:1;
+ u8 unk5_1:1;
+ u16 unk6;
+ u8 unk8[10];
+ u8 unk12;
+ u8 unk13;
+ u8 unk14[10];
+ u8 filler1E[2];
+ u16 unk20;
+ u16 unk22;
+ u16 unk24;
+ u16 unk26;
+ u16 unk28;
+ u8 unk2A[10];
+ u8 filler34[2];
+ u8 unk36[10];
+};
+
+struct Struct2017800
+{
+ u8 unk0_0:1;
+ u8 unk0_1:1;
+ u8 unk0_2:1;
+ u8 unk0_3:1;
+ u8 unk0_4:1;
+ u16 unk2;
+};
+
+struct Struct2017810
+{
+ u8 unk0_0:1;
+ u8 unk0_1:1;
+ u8 unk0_2:1;
+ u8 unk0_3:1;
+ u8 unk0_4:1;
+ u8 unk0_5:1;
+ u8 unk0_6:1;
+ u8 unk0_7:1;
+ u8 unk1_0:1;
+ u8 unk2;
+ u8 unk3;
+ //u8 filler2[2];
+ u8 unk4;
+ u8 unk5;
+ u8 unk6;
+ u8 unk7;
+ u8 unk8;
+ u8 unk9;
+ u8 fillerA[2];
+};
+
+struct Struct2017840
+{
+ u16 unk0;
+ u8 filler2[7];
+ u8 unk9_0:1;
+};
+
+extern struct UnkBattleStruct1 unk_2016A00;
+extern struct UnkBattleStruct4 gUnknown_02024CA8[];
extern struct AI_ThinkingStruct gAIThinkingSpace;
+// TODO: move ewram to global.h
+extern u8 ewram[];
+
+#define BATTLE_STRUCT ((struct BattleStruct *) (ewram + 0x00000))
+#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(ewram + 0x16800))
+#define UNK_2016A00_STRUCT ((struct UnkBattleStruct1 *) (ewram + 0x16A00))
+#define AI_STACK ((struct AI_Stack *) (ewram + 0x16C00))
+#define AI_ARRAY_160CC ((struct SmallItemStruct *) (ewram + 0x160CC))
+#define ewram17800 ((struct Struct2017800 *) (ewram + 0x17800))
+#define ewram17810 ((struct Struct2017810 *) (ewram + 0x17810))
+#define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840))
+
// asm/battle_1.o
void sub_800D6D4();
void sub_800D74C();
@@ -233,15 +303,15 @@ void nullsub_8(u8);
void sub_802E414(void);
// asm/battle_7.o
-void move_anim_start_t4();
+void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d);
void nullsub_9(u16);
-void nullsub_10();
+void nullsub_10(int);
void load_gfxc_health_bar();
u8 battle_load_something();
-void sub_8031F88();
-void sub_80324F8();
+void sub_8031F88(u8);
+void sub_80324F8(struct Pokemon *, u8);
void sub_8032638();
-void sub_8032AA8(u8 index, int i);
+void sub_8032AA8(u8, u8);
void sub_8032AE0(void);
// asm/battle_9.o