From f597469988d5d1e58fccb203c0e9de351b0c278e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 8 Jun 2017 01:25:53 -0500 Subject: decompile sub_80318FC - unref_sub_8031BA0 --- include/data2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/data2.h b/include/data2.h index 987c7cb2e..759efe3d3 100644 --- a/include/data2.h +++ b/include/data2.h @@ -29,7 +29,7 @@ extern const union AnimCmd *const *const gUnknown_081EC2A4[]; extern const union AnimCmd *const *const gUnknown_081ECACC[]; extern struct MonCoords gTrainerBackPicCoords[]; extern struct SpriteSheet gTrainerBackPicTable[]; -extern struct SpritePalette gTrainerBackPicPaletteTable[]; +extern const struct SpritePalette gTrainerBackPicPaletteTable[]; extern u8 gEnemyMonElevation[]; extern const u8 gTrainerClassNames[][13]; extern const struct Trainer gTrainers[]; @@ -40,7 +40,7 @@ extern const u8 gUnknown_081F96C8[]; extern struct SpriteSheet gUnknown_081FAEA4; extern struct SpritePalette gUnknown_081FAEAC; extern const struct SpriteTemplate gSpriteTemplate_81FAF0C; -extern void *gUnknown_081FAF4C[]; +extern void *const gUnknown_081FAF4C[]; extern struct BattleMove gBattleMoves[]; #endif // GUARD_DATA2_H -- cgit v1.2.3 From 16db220259f321860e503282db86837124f3c66a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 12:56:59 -0500 Subject: move some common battle struct definitions to battle.h --- include/battle.h | 61 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 3b4771869..e3ec0780e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -29,16 +29,6 @@ #define MAX_TRAINER_ITEMS 4 #define MAX_MON_MOVES 4 -// 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 UnkBattleStruct1 *)(unk_2000000 + 0x16A00)) -#define AI_STACK ((struct AI_Stack *)(unk_2000000 + 0x16C00)) -#define AI_ARRAY_160CC ((struct SmallItemStruct *)(unk_2000000 + 0x160CC)) - enum { WEATHER_SUN, @@ -142,8 +132,59 @@ struct UnkBattleStruct4 /*0x17*/ u8 filler17[0x4]; }; +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 filler6[2]; + u8 unk8; + u8 unk9; + u8 fillerA[2]; +}; + +struct Struct2017840 +{ + u16 unk0; + u8 filler2[7]; + u8 unk9; +}; + extern struct UnknownStruct1 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)) + #endif // GUARD_BATTLE_H -- cgit v1.2.3 From 974e4da9c9d325491df07d842da5eb6b45b50b2e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 16:50:56 -0500 Subject: decompile sub_8032350 - sub_80326EC --- include/battle.h | 3 ++- include/battle_interface.h | 2 +- include/songs.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index e3ec0780e..5a054acc7 100644 --- a/include/battle.h +++ b/include/battle.h @@ -158,7 +158,8 @@ struct Struct2017810 //u8 filler2[2]; u8 unk4; u8 unk5; - u8 filler6[2]; + u8 unk6; + u8 unk7; u8 unk8; u8 unk9; u8 fillerA[2]; diff --git a/include/battle_interface.h b/include/battle_interface.h index e85f87a30..70434f9a9 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -31,6 +31,6 @@ void sub_8045A5C(u8, struct Pokemon *, u8); s32 sub_8045C78(u8, u8, u8, u8); s16 sub_80460C8(struct BattleInterfaceStruct1 *, int *, void *, int); u8 GetScaledHPFraction(s16, s16, u8); -int GetHPBarLevel(s16, s16); +u8 GetHPBarLevel(s16, s16); #endif // GUARD_BATTLE_INTERFACE_H diff --git a/include/songs.h b/include/songs.h index d7829479f..51948fba8 100644 --- a/include/songs.h +++ b/include/songs.h @@ -93,7 +93,7 @@ enum SE_T_KAMI, SE_T_KAMI2, SE_ELEBETA, - SE_HINSI, + /*0x5A*/ SE_HINSI, SE_EXPMAX, SE_TAMAKORO, SE_TAMAKORO_E, -- cgit v1.2.3 From 1a5bcd59134f062ade7070b8e62f0d2f3c218537 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 18:21:48 -0500 Subject: decompile sub_80327CC - sub_8032C4C --- include/asm.inc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm.inc.h b/include/asm.inc.h index dbd3f0820..a63cf5635 100755 --- a/include/asm.inc.h +++ b/include/asm.inc.h @@ -24,7 +24,7 @@ void sub_802E3E4(u8, int); void nullsub_8(u8); // asm/battle_7.o -void sub_8032AA8(u8 index, int i); +void sub_8032AA8(u8, u8); // src/pokemon_3.o u16 SpeciesToNationalPokedexNum(u16); -- cgit v1.2.3 From f14f219929ec0390e385cb9eee9f10fda4baf73a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 10 Jun 2017 20:53:06 -0500 Subject: finish decompiling battle_7 --- include/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 5a054acc7..ec406d2e6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -169,7 +169,7 @@ struct Struct2017840 { u16 unk0; u8 filler2[7]; - u8 unk9; + u8 unk9_0:1; }; extern struct UnknownStruct1 unk_2016A00; -- cgit v1.2.3 From 2f437b0a94dd88cd78d0f6b4d92b9f5169531376 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 19:34:01 -0500 Subject: Struct30042E0 --- include/battle.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index ec406d2e6..cfac2b44b 100644 --- a/include/battle.h +++ b/include/battle.h @@ -132,6 +132,31 @@ struct UnkBattleStruct4 /*0x17*/ u8 filler17[0x4]; }; +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; -- cgit v1.2.3