summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDiegoisawesome <Diegoisawesome@users.noreply.github.com>2018-06-30 11:25:19 -0700
committerGitHub <noreply@github.com>2018-06-30 11:25:19 -0700
commitefebc51972b23ddffa2700b1dd6895d4728646a3 (patch)
tree5dfa68e92aa9d1a267af8dde9ca8040294952e3f /include
parent91ee3221b3a4885d155ad2cca16b7678062ad18a (diff)
parent97712ec931febe390861f2234e26a66f15c9c295 (diff)
Merge pull request #268 from DizzyEggg/decompile_battle_tent
Decompile a bit of battle tent
Diffstat (limited to 'include')
-rw-r--r--include/battle_frontier_2.h3
-rw-r--r--include/battle_tower.h15
-rw-r--r--include/global.h112
-rw-r--r--include/new_game.h5
4 files changed, 78 insertions, 57 deletions
diff --git a/include/battle_frontier_2.h b/include/battle_frontier_2.h
index 3f8f8049d..d410749b9 100644
--- a/include/battle_frontier_2.h
+++ b/include/battle_frontier_2.h
@@ -8,5 +8,8 @@ void sub_81A8AF8(void);
bool8 InBattlePike(void);
void sub_819FA50(void);
void sub_81AA078(u16*, u8);
+void sub_81A4C30(void);
+void sub_819A4F8(void);
+void sub_819DC00(void);
#endif // GUARD_BATTLE_FRONTIER_2_H
diff --git a/include/battle_tower.h b/include/battle_tower.h
index 9d4553132..d8a3dc9a8 100644
--- a/include/battle_tower.h
+++ b/include/battle_tower.h
@@ -22,10 +22,25 @@ union BattleTowerRecord
struct EmeraldBattleTowerRecord emerald;
};
+struct BattleFrontierTrainer
+{
+ u32 trainerClass;
+ u8 trainerName[8];
+ u16 speechBefore[6];
+ u16 speechWin[6];
+ u16 speechLose[6];
+ u16 *btMonPool;
+};
+
+extern struct BattleFrontierTrainer *gUnknown_0203BC88;
+
u16 sub_8164FCC(u8, u8);
void sub_81659DC(struct RSBattleTowerRecord *a0, struct RSBattleTowerRecord *a1);
bool32 sub_816587C(union BattleTowerRecord *, union BattleTowerRecord *);
void CalcEmeraldBattleTowerChecksum(struct EmeraldBattleTowerRecord *);
void sub_81628A0(union BattleTowerRecord *);
+void sub_8162614(u16 trainerId, u8);
+void ConvertBattleFrontierTrainerSpeechToString(u16 *words);
+void GetFrontierTrainerName(u8 *dest, u16 trainerIdx);
#endif //GUARD_BATTLE_TOWER_H
diff --git a/include/global.h b/include/global.h
index d27dae2ba..49d0370f1 100644
--- a/include/global.h
+++ b/include/global.h
@@ -314,62 +314,30 @@ struct EmeraldBattleTowerRecord
/*0xE8*/ u32 checksum;
};
-struct SaveBlock2
+struct BattleFrontier
{
- /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH];
- /*0x08*/ u8 playerGender; // MALE, FEMALE
- /*0x09*/ u8 specialSaveWarp;
- /*0x0A*/ u8 playerTrainerId[4];
- /*0x0E*/ u16 playTimeHours;
- /*0x10*/ u8 playTimeMinutes;
- /*0x11*/ u8 playTimeSeconds;
- /*0x12*/ u8 playTimeVBlanks;
- /*0x13*/ u8 optionsButtonMode; // OPTIONS_BUTTON_MODE_[NORMAL/LR/L_EQUALS_A]
- /*0x14*/ u16 optionsTextSpeed:3; // OPTIONS_TEXT_SPEED_[SLOW/MID/FAST]
- u16 optionsWindowFrameType:5; // Specifies one of the 20 decorative borders for text boxes
- u16 optionsSound:1; // OPTIONS_SOUND_[MONO/STEREO]
- u16 optionsBattleStyle:1; // OPTIONS_BATTLE_STYLE_[SHIFT/SET]
- u16 optionsBattleSceneOff:1; // whether battle animations are disabled
- u16 regionMapZoom:1; // whether the map is zoomed in
- /*0x18*/ struct Pokedex pokedex;
- /*0x90*/ u8 filler_90[0x8];
- /*0x98*/ struct Time localTimeOffset;
- /*0xA0*/ struct Time lastBerryTreeUpdate;
- /*0xA8*/ u32 field_A8;
- /*0xAC*/ u32 encryptionKey;
-
- // TODO: fix and verify labels
- /*0xB0*/ u8 field_B0;
- /*0xB1*/ u8 field_B1;
- /*0xB2*/ u8 field_B2_0:3;
- /*0xB2*/ u8 field_B2_1:2;
- /*0xB3*/ u8 field_B3[0x29];
- /*0xDC*/ struct UnkRecordMixingStruct field_DC[4];
- /*0x1EC*/ struct BerryCrush berryCrush;
- /*0x1FC*/ struct PokemonJumpResults pokeJump;
- /*0x20C*/ struct BerryPickingResults berryPick;
- /*0x21C*/ u8 field_21C[1032];
- /*0x624*/ u16 contestLinkResults[20]; // 4 positions for 5 categories, possibly a struct or a 2d array
-
- // All below could be a one giant struct
-
/*0x64C*/ struct EmeraldBattleTowerRecord battleTower;
/*0x738*/ struct UnknownSaveBlock2Struct field_738[5]; // No idea here, it's probably wrong, no clue.
/*0xBD4*/ u16 field_BD4;
/*0xBD6*/ u16 field_BD6;
/*0xBD8*/ u8 field_BD8[11];
- /*0xBE3*/ u8 filler_BE3[8];
+ /*0xBE3*/ u8 field_BE3[8];
/*0xBEB*/ u8 field_BEB;
- /*0xBE3*/ u8 filler_BEC[189];
- /*0xCA9*/ u8 frontierChosenLvl : 2; // 0x1, 0x2 -> 0x3
- /*0xCA9*/ u8 field_CA9_a : 1; // 0x4
- /*0xCA9*/ u8 field_CA9_b : 1; // 0x8
- /*0xCA9*/ u8 field_CA9_c : 1; // 0x10
- /*0xCA9*/ u8 field_CA9_d : 1; // 0x20
- /*0xCA9*/ u8 field_CA9_e : 1; // 0x40
- /*0xCA9*/ u8 field_CA9_f : 1; // 0x80
+ /*0xBEC*/ u8 filler_BEC[16];
+ /*0xBFC*/ u16 ecwords_BFC[6];
+ /*0xC08*/ u16 ecwords_C08[6];
+ /*0xC14*/ u16 ecwords_C14[6];
+ /*0xC20*/ u8 filler_C20[0x88];
+ /*0xCA8*/ u8 field_CA8;
+ /*0xCA9*/ u8 chosenLvl:2; // 0x1, 0x2 -> 0x3
+ /*0xCA9*/ u8 field_CA9_a:1; // 0x4
+ /*0xCA9*/ u8 field_CA9_b:1; // 0x8
+ /*0xCA9*/ u8 field_CA9_c:1; // 0x10
+ /*0xCA9*/ u8 field_CA9_d:1; // 0x20
+ /*0xCA9*/ u8 field_CA9_e:1; // 0x40
+ /*0xCA9*/ u8 field_CA9_f:1; // 0x80
/*0xCAA*/ u16 field_CAA[4];
- /*0xCB2*/ u16 battlePyramidWildHeaderId;
+ /*0xCB2*/ u16 field_CB2;
/*0xCB4*/ u16 field_CB4[30];
/*0xCF0*/ u16 field_CF0[2];
/*0xCF4*/ u16 field_CF4[2];
@@ -416,21 +384,61 @@ struct SaveBlock2
/*0xE04*/ u16 field_E04;
/*0xE06*/ u16 field_E06;
/*0xE08*/ u16 field_E08[9];
- /*0xE1A*/ u16 battlePyramidFloor; // possibly?
+ /*0xE1A*/ u16 field_E1A;
/*0xE1C*/ u16 field_E1C;
/*0xE1E*/ u16 field_E1E[7];
/*0xE2C*/ struct PyramidBag pyramidBag;
- /*0x???*/ u8 field_unkown[6];
- /*0xE6E*/ u16 battleTentWinStreak;
+ /*0xE58*/ u16 field_E58;
+ /*0xE6A*/ u16 field_E6A;
+ /*0xE6C*/ u16 field_E6C;
+ /*0xE6E*/ u16 field_E6E;
/*0xE70*/ u8 field_E70[72];
/*0xEB8*/ u16 frontierBattlePoints;
/*0xEBA*/ u8 field_EBA[39];
/*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH];
/*0xEF1*/ u8 field_EF1[2][4];
/*0xEF9*/ u8 field_EF9[51];
- // sizeof=0xF2C
};
+struct SaveBlock2
+{
+ /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH];
+ /*0x08*/ u8 playerGender; // MALE, FEMALE
+ /*0x09*/ u8 specialSaveWarp;
+ /*0x0A*/ u8 playerTrainerId[4];
+ /*0x0E*/ u16 playTimeHours;
+ /*0x10*/ u8 playTimeMinutes;
+ /*0x11*/ u8 playTimeSeconds;
+ /*0x12*/ u8 playTimeVBlanks;
+ /*0x13*/ u8 optionsButtonMode; // OPTIONS_BUTTON_MODE_[NORMAL/LR/L_EQUALS_A]
+ /*0x14*/ u16 optionsTextSpeed:3; // OPTIONS_TEXT_SPEED_[SLOW/MID/FAST]
+ u16 optionsWindowFrameType:5; // Specifies one of the 20 decorative borders for text boxes
+ u16 optionsSound:1; // OPTIONS_SOUND_[MONO/STEREO]
+ u16 optionsBattleStyle:1; // OPTIONS_BATTLE_STYLE_[SHIFT/SET]
+ u16 optionsBattleSceneOff:1; // whether battle animations are disabled
+ u16 regionMapZoom:1; // whether the map is zoomed in
+ /*0x18*/ struct Pokedex pokedex;
+ /*0x90*/ u8 filler_90[0x8];
+ /*0x98*/ struct Time localTimeOffset;
+ /*0xA0*/ struct Time lastBerryTreeUpdate;
+ /*0xA8*/ u32 field_A8;
+ /*0xAC*/ u32 encryptionKey;
+
+ // TODO: fix and verify labels
+ /*0xB0*/ u8 field_B0;
+ /*0xB1*/ u8 field_B1;
+ /*0xB2*/ u8 field_B2_0:3;
+ /*0xB2*/ u8 field_B2_1:2;
+ /*0xB3*/ u8 field_B3[0x29];
+ /*0xDC*/ struct UnkRecordMixingStruct field_DC[4];
+ /*0x1EC*/ struct BerryCrush berryCrush;
+ /*0x1FC*/ struct PokemonJumpResults pokeJump;
+ /*0x20C*/ struct BerryPickingResults berryPick;
+ /*0x21C*/ u8 field_21C[1032];
+ /*0x624*/ u16 contestLinkResults[20]; // 4 positions for 5 categories, possibly a struct or a 2d array
+ /*0x64C*/ struct BattleFrontier frontier;
+}; // sizeof=0xF2C
+
extern struct SaveBlock2 *gSaveBlock2Ptr;
struct SecretBaseParty
diff --git a/include/new_game.h b/include/new_game.h
index 2088d1826..7e1169ec3 100644
--- a/include/new_game.h
+++ b/include/new_game.h
@@ -4,12 +4,7 @@
void WriteUnalignedWord(u32 var, u8 *dataPtr);
u32 ReadUnalignedWord(u8* dataPtr);
void CopyUnalignedWord(u8 *copyTo, u8 *copyFrom);
-void InitPlayerTrainerId(void);
-void SetDefaultOptions(void);
-void ClearPokedexFlags(void);
-void WarpToTruck(void);
void NewGameInitData(void);
-void ResetMiniGamesResults(void);
void sub_808447C(void);
void Sav2_ClearSetDefault(void);