From f4e55999a5282dc1d2b94e0ca14081de6aae93ba Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 20 Oct 2018 00:33:51 +0200 Subject: begin porting and decomping battle tower --- include/global.h | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index b92f1097f..35e34e722 100644 --- a/include/global.h +++ b/include/global.h @@ -275,26 +275,6 @@ struct BerryCrush u32 unk; }; -struct UnknownSaveBlock2Struct -{ - u8 field_0; - u8 field_1; - u8 field_2[2]; - u8 field_4[8]; - u8 field_C[16]; - u16 field_1C[6]; - u16 field_28[6]; - u8 field_34[176]; - u8 field_E4; - u8 field_E5; - u8 field_E6; - u8 field_E7; - u8 field_E8; - u8 field_E9; - u8 field_EA; - u8 field_EB; -}; // sizeof = 0xEC - struct ApprenticeMon { u16 species; @@ -345,7 +325,7 @@ struct UnknownPokemonStruct struct EmeraldBattleTowerRecord { - /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 + /*0x00*/ u8 lvlMode; // 0 = level 50, 1 = level 100 /*0x01*/ u8 trainerClass; /*0x02*/ u16 winStreak; /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1]; @@ -387,7 +367,7 @@ struct BattleDomeTrainer struct BattleFrontier { /*0x64C*/ struct EmeraldBattleTowerRecord battleTower; - /*0x738*/ struct UnknownSaveBlock2Struct field_738[5]; // No idea here, it's probably wrong, no clue. + /*0x738*/ struct EmeraldBattleTowerRecord records[5]; // No idea here, it's probably wrong, no clue. /*0xBD4*/ u16 field_BD4; /*0xBD6*/ u16 field_BD6; /*0xBD8*/ u8 field_BD8[11]; @@ -415,7 +395,10 @@ struct BattleFrontier /*0xCF0*/ u16 field_CF0[2]; /*0xCF4*/ u16 field_CF4[2]; /*0xCF8*/ u16 field_CF8[2]; - /*0xCFC*/ u16 field_CFC[5]; + /*0xCFC*/ u16 field_CFC[2]; + /*0xD06*/ u16 field_D00; + /*0xD06*/ u16 field_D02; + /*0xD06*/ u16 field_D04; /*0xD06*/ u8 field_D06; /*0xD07*/ u8 field_D07; /*0xD08*/ u8 field_D08_0:1; -- cgit v1.2.3 From 16026fe91d5628f138be434841ae764534946b2c Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 21 Oct 2018 00:06:42 +0200 Subject: More battle tower. --- include/global.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 35e34e722..ef5a944d0 100644 --- a/include/global.h +++ b/include/global.h @@ -326,19 +326,31 @@ struct UnknownPokemonStruct struct EmeraldBattleTowerRecord { /*0x00*/ u8 lvlMode; // 0 = level 50, 1 = level 100 - /*0x01*/ u8 trainerClass; + /*0x01*/ u8 facilityClass; /*0x02*/ u16 winStreak; /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1]; /*0x0C*/ u8 trainerId[4]; - /*0x10*/ struct { - u16 easyChat[6]; - } greeting; + /*0x10*/ u16 greeting[6]; /*0x1C*/ u8 filler_1c[0x18]; /*0x34*/ struct UnknownPokemonStruct party[4]; /*0xE4*/ u8 language; /*0xE8*/ u32 checksum; }; +struct BattleTowerEReaderTrainer +{ + /*0x00*/ u8 unk0; + /*0x01*/ u8 facilityClass; + /*0x02*/ u16 winStreak; + /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1]; + /*0x0C*/ u8 trainerId[4]; + /*0x10*/ u16 greeting[6]; + /*0x1C*/ u16 farewellPlayerLost[6]; + /*0x28*/ u16 farewellPlayerWon[6]; + /*0x34*/ struct UnknownPokemonStruct party[3]; + /*0xB8*/ u32 checksum; +}; + struct FrontierMonData { u16 moves[4]; @@ -367,17 +379,13 @@ struct BattleDomeTrainer struct BattleFrontier { /*0x64C*/ struct EmeraldBattleTowerRecord battleTower; - /*0x738*/ struct EmeraldBattleTowerRecord records[5]; // No idea here, it's probably wrong, no clue. + /*0x738*/ struct EmeraldBattleTowerRecord records[5]; // From record mixing. /*0xBD4*/ u16 field_BD4; /*0xBD6*/ u16 field_BD6; /*0xBD8*/ u8 field_BD8[11]; /*0xBE3*/ u8 field_BE3[8]; /*0xBEB*/ u8 field_BEB; - /*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]; + /*0xBEC*/ struct BattleTowerEReaderTrainer ereaderTrainer; /*0xCA8*/ u8 field_CA8; /*0xCA9*/ u8 lvlMode:2; // 0x1, 0x2 -> 0x3 /*0xCA9*/ u8 field_CA9_a:1; // 0x4 @@ -388,8 +396,8 @@ struct BattleFrontier /*0xCA9*/ u8 field_CA9_f:1; // 0x80 /*0xCAA*/ u16 field_CAA[3]; /*0xCB0*/ u16 field_CB0; - /*0xCB2*/ u16 field_CB2; - /*0xCB4*/ u16 field_CB4[20]; + /*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor. + /*0xCB4*/ u16 battledTrainerIds[20]; /*0xCDC*/ u32 field_CDC; /*0xCE0*/ u16 field_CE0[4][2]; /*0xCF0*/ u16 field_CF0[2]; -- cgit v1.2.3 From 0ab27e44b14a0dc4523b5bac7fef18312ab4fdde Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 21 Oct 2018 20:13:12 +0200 Subject: more tower, fail --- include/global.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index ef5a944d0..6840d5fe2 100644 --- a/include/global.h +++ b/include/global.h @@ -331,7 +331,8 @@ struct EmeraldBattleTowerRecord /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1]; /*0x0C*/ u8 trainerId[4]; /*0x10*/ u16 greeting[6]; - /*0x1C*/ u8 filler_1c[0x18]; + /*0x1C*/ u16 unk1C[6]; + /*0x28*/ u16 unk28[6]; /*0x34*/ struct UnknownPokemonStruct party[4]; /*0xE4*/ u8 language; /*0xE8*/ u32 checksum; @@ -378,8 +379,8 @@ struct BattleDomeTrainer struct BattleFrontier { - /*0x64C*/ struct EmeraldBattleTowerRecord battleTower; - /*0x738*/ struct EmeraldBattleTowerRecord records[5]; // From record mixing. + /*0x64C*/ struct EmeraldBattleTowerRecord towerPlayer; + /*0x738*/ struct EmeraldBattleTowerRecord towerRecords[5]; // From record mixing. /*0xBD4*/ u16 field_BD4; /*0xBD6*/ u16 field_BD6; /*0xBD8*/ u8 field_BD8[11]; @@ -397,7 +398,10 @@ struct BattleFrontier /*0xCAA*/ u16 field_CAA[3]; /*0xCB0*/ u16 field_CB0; /*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor. - /*0xCB4*/ u16 battledTrainerIds[20]; + /*0xCB4*/ u16 battledTrainerIds[17]; + u16 field_CD6; + u16 field_CD8; + u16 field_CDA; /*0xCDC*/ u32 field_CDC; /*0xCE0*/ u16 field_CE0[4][2]; /*0xCF0*/ u16 field_CF0[2]; @@ -457,10 +461,7 @@ struct BattleFrontier /*0xEB8*/ u16 frontierBattlePoints; /*0xEBA*/ u8 field_EBA; /*0xEBB*/ u8 field_EBB; - /*0xEBC*/ u8 field_EBC; - /*0xEBD*/ u8 field_EBD; - /*0xEBE*/ u8 field_EBE; - /*0xEBF*/ u8 field_EBF; + /*0xEBC*/ u32 battlesCount; /*0xEC0*/ u16 field_EC0[16]; /*0xEE0*/ u8 field_EE0; /*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH + 1]; -- cgit v1.2.3 From b330bdba51b86959e702e904c4a5d8039e6395c7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 22 Oct 2018 19:22:57 +0200 Subject: More and more battle tower --- include/global.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 6840d5fe2..a7b50278c 100644 --- a/include/global.h +++ b/include/global.h @@ -288,7 +288,7 @@ struct Apprentice u8 lvlMode:2; // + 1 u8 field_1; u8 number; - struct ApprenticeMon monData[3]; + struct ApprenticeMon party[3]; u16 easyChatWords[6]; u8 playerId[4]; u8 playerName[PLAYER_NAME_LENGTH]; @@ -383,8 +383,8 @@ struct BattleFrontier /*0x738*/ struct EmeraldBattleTowerRecord towerRecords[5]; // From record mixing. /*0xBD4*/ u16 field_BD4; /*0xBD6*/ u16 field_BD6; - /*0xBD8*/ u8 field_BD8[11]; - /*0xBE3*/ u8 field_BE3[8]; + /*0xBD8*/ u8 field_BD8[PLAYER_NAME_LENGTH + 1]; + /*0xBE3*/ u8 field_BE0[POKEMON_NAME_LENGTH + 1]; /*0xBEB*/ u8 field_BEB; /*0xBEC*/ struct BattleTowerEReaderTrainer ereaderTrainer; /*0xCA8*/ u8 field_CA8; @@ -395,15 +395,12 @@ struct BattleFrontier /*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[3]; + /*0xCAA*/ u16 selectedPartyMons[3]; /*0xCB0*/ u16 field_CB0; /*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor. - /*0xCB4*/ u16 battledTrainerIds[17]; - u16 field_CD6; - u16 field_CD8; - u16 field_CDA; + /*0xCB4*/ u16 field_CB4[20]; /*0xCDC*/ u32 field_CDC; - /*0xCE0*/ u16 field_CE0[4][2]; + /*0xCE0*/ u16 winStreaks[4][2]; /*0xCF0*/ u16 field_CF0[2]; /*0xCF4*/ u16 field_CF4[2]; /*0xCF8*/ u16 field_CF8[2]; -- cgit v1.2.3 From 549b669f2aa397c9d784de2ff9b91459ab26c060 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 24 Oct 2018 23:14:45 +0200 Subject: battle tower, match sth and dumb loop instead of goto --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index a7b50278c..0cff281e7 100644 --- a/include/global.h +++ b/include/global.h @@ -293,7 +293,7 @@ struct Apprentice u8 playerId[4]; u8 playerName[PLAYER_NAME_LENGTH]; u8 language; - u32 unk40; + u32 checksum; }; struct UnknownPokemonStruct -- cgit v1.2.3 From 826d0ea2abe1ef505fb6b2b9b78e36c5c7a76c0e Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 27 Oct 2018 15:44:29 +0200 Subject: Begin frontier records --- include/global.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 0cff281e7..d23800139 100644 --- a/include/global.h +++ b/include/global.h @@ -401,10 +401,7 @@ struct BattleFrontier /*0xCB4*/ u16 field_CB4[20]; /*0xCDC*/ u32 field_CDC; /*0xCE0*/ u16 winStreaks[4][2]; - /*0xCF0*/ u16 field_CF0[2]; - /*0xCF4*/ u16 field_CF4[2]; - /*0xCF8*/ u16 field_CF8[2]; - /*0xCFC*/ u16 field_CFC[2]; + /*0xCF0*/ u16 field_CF0[4][2]; /*0xD06*/ u16 field_D00; /*0xD06*/ u16 field_D02; /*0xD06*/ u16 field_D04; -- cgit v1.2.3 From e85051712361063b04aa7a35ff5c25aed068cab9 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 27 Oct 2018 21:01:35 +0200 Subject: more battle frontier 2 --- include/global.h | 53 ++++++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index d23800139..7f5a025be 100644 --- a/include/global.h +++ b/include/global.h @@ -331,8 +331,8 @@ struct EmeraldBattleTowerRecord /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1]; /*0x0C*/ u8 trainerId[4]; /*0x10*/ u16 greeting[6]; - /*0x1C*/ u16 unk1C[6]; - /*0x28*/ u16 unk28[6]; + /*0x1C*/ u16 speechWon[6]; + /*0x28*/ u16 speechLost[6]; /*0x34*/ struct UnknownPokemonStruct party[4]; /*0xE4*/ u8 language; /*0xE8*/ u32 checksum; @@ -400,8 +400,8 @@ struct BattleFrontier /*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor. /*0xCB4*/ u16 field_CB4[20]; /*0xCDC*/ u32 field_CDC; - /*0xCE0*/ u16 winStreaks[4][2]; - /*0xCF0*/ u16 field_CF0[4][2]; + /*0xCE0*/ u16 towerWinStreaks[4][2]; + /*0xCF0*/ u16 towerRecordWinStreaks[4][2]; /*0xD06*/ u16 field_D00; /*0xD06*/ u16 field_D02; /*0xD06*/ u16 field_D04; @@ -418,34 +418,29 @@ struct BattleFrontier /*0xD09*/ u8 filler_D09; /*0xD0A*/ u8 field_D0A; /*0xD0B*/ u8 field_D0B; - /*0xD0C*/ u16 field_D0C[2][2]; - /*0xD14*/ u16 field_D14[2][2]; - /*0xD1C*/ u16 field_D1C[2][2]; + /*0xD0C*/ u16 domeWinStreaks[2][2]; + /*0xD14*/ u16 domeRecordWinStreaks[2][2]; + /*0xD1C*/ u16 domeTotalChampionships[2][2]; /*0xD24*/ struct BattleDomeTrainer domeTrainers[DOME_TOURNAMENT_TRAINERS_COUNT]; - /*0xD64*/ u16 domeMonId[DOME_TOURNAMENT_TRAINERS_COUNT][3]; + /*0xD64*/ u16 domeMonIds[DOME_TOURNAMENT_TRAINERS_COUNT][3]; /*0xD64*/ u16 field_DC4[2]; - /*0xDC8*/ u16 field_DC8[2][2]; - /*0xDD0*/ u16 field_DD0[2][2]; + /*0xDC8*/ u16 palaceWinStreaks[2][2]; + /*0xDD0*/ u16 palaceRecordWinStreaks[2][2]; /*0xDD8*/ u16 field_DD8; - /*0xDDA*/ u16 field_DDA[2]; - /*0xDDE*/ u16 field_DDE[2]; - /*0xDE2*/ u16 field_DE2[2][2]; - /*0xDEA*/ u16 field_DEA[2]; - /*0xDEE*/ u16 field_DEE; - /*0xDF0*/ u16 field_DF0; - /*0xDF2*/ u16 field_DF2; - /*0xDF4*/ u16 field_DF4; - /*0xDF6*/ u16 field_DF6; - /*0xDF8*/ u16 field_DF8; - /*0xDFA*/ u16 field_DFA; - /*0xDFC*/ u16 field_DFC; - /*0xDFE*/ u16 field_DFE; - /*0xE00*/ u16 field_E00; + /*0xDDA*/ u16 arenaWinStreaks[2]; + /*0xDDE*/ u16 arenaRecordStreaks[2]; + /*0xDE2*/ u16 factoryWinStreaks[2][2]; + /*0xDEA*/ u16 factoryRecordWinStreaks[2][2]; + /*0xDF6*/ u16 factoryRentsCount[2][2]; + /*0xDFA*/ u16 factoryRecordRentsCount[2][2]; /*0xE02*/ u16 field_E02; - /*0xE04*/ u16 field_E04[2]; - /*0xE08*/ u16 field_E08[9]; - /*0xE1A*/ u16 field_E1A[2]; - /*0xE1E*/ u16 field_E1E[7]; + /*0xE04*/ u16 pikeWinStreaks[2]; + /*0xE08*/ u16 pikeRecordStreaks[2]; + /*0xE0C*/ u16 pikeTotalStreaks[2]; + /*0xE10*/ u16 field_E10[5]; + /*0xE1A*/ u16 pyramidWinStreaks[2]; + /*0xE1E*/ u16 pyramidRecordStreaks[2]; + /*0xE1E*/ u16 field_E1F[5]; /*0xE2C*/ struct PyramidBag pyramidBag; /*0xE58*/ u16 field_E58; /*0xE6A*/ u16 field_E6A; @@ -517,7 +512,7 @@ struct SaveBlock2 /*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 + /*0x624*/ u16 contestLinkResults[5][4]; // 4 positions for 5 categories. /*0x64C*/ struct BattleFrontier frontier; }; // sizeof=0xF2C -- cgit v1.2.3 From 98d8dbfd8a2e6759a38d70573256c22fb386e07d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 28 Oct 2018 00:50:06 +0200 Subject: Up to sub_81a443c --- include/global.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 7f5a025be..9a03300b2 100644 --- a/include/global.h +++ b/include/global.h @@ -447,9 +447,8 @@ struct BattleFrontier /*0xE6C*/ u16 field_E6C; /*0xE6E*/ u16 field_E6E; /*0xE70*/ struct Struct_field_E70 field_E70[6]; - /*0xEB8*/ u16 frontierBattlePoints; - /*0xEBA*/ u8 field_EBA; - /*0xEBB*/ u8 field_EBB; + /*0xEB8*/ u16 battlePoints; + /*0xEBA*/ u16 field_EBA; /*0xEBC*/ u32 battlesCount; /*0xEC0*/ u16 field_EC0[16]; /*0xEE0*/ u8 field_EE0; -- cgit v1.2.3 From 3a9eeef84447c222a4638546d014e12b0098fe51 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 28 Oct 2018 21:11:53 +0100 Subject: Frontier, finish ranking hall --- include/global.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 9a03300b2..c2b139e7a 100644 --- a/include/global.h +++ b/include/global.h @@ -137,6 +137,7 @@ enum LanguageId #define BAG_BERRIES_COUNT 46 #define PYRAMID_BAG_ITEMS_COUNT 10 +#define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode. // string lengths #define ITEM_NAME_LENGTH 14 @@ -402,9 +403,9 @@ struct BattleFrontier /*0xCDC*/ u32 field_CDC; /*0xCE0*/ u16 towerWinStreaks[4][2]; /*0xCF0*/ u16 towerRecordWinStreaks[4][2]; - /*0xD06*/ u16 field_D00; - /*0xD06*/ u16 field_D02; - /*0xD06*/ u16 field_D04; + /*0xD00*/ u16 field_D00; + /*0xD02*/ u16 field_D02; + /*0xD04*/ u16 field_D04; /*0xD06*/ u8 field_D06; /*0xD07*/ u8 field_D07; /*0xD08*/ u8 field_D08_0:1; @@ -482,6 +483,24 @@ struct PlayersApprentice /*0xB8*/ struct Sav2_B8 field_B8[9]; }; +struct RankingHall1P +{ + u8 id[4]; + u16 winStreak; + u8 name[PLAYER_NAME_LENGTH + 1]; + u8 language; +}; + +struct RankingHall2P +{ + u8 id1[4]; + u8 id2[4]; + u16 winStreak; + u8 name1[PLAYER_NAME_LENGTH + 1]; + u8 name2[PLAYER_NAME_LENGTH + 1]; + u8 language; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; @@ -506,11 +525,12 @@ struct SaveBlock2 /*0xA8*/ u32 field_A8; /*0xAC*/ u32 encryptionKey; /*0xB0*/ struct PlayersApprentice playerApprentice; - /*0xDC*/ struct Apprentice apprentices[4]; + /*0xDC*/ struct Apprentice apprentices[4]; // From record mixing. /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; - /*0x21C*/ u8 field_21C[1032]; + /*0x21C*/ struct RankingHall1P hallRecords1P[HALL_FACILITIES_COUNT][2][3]; // From record mixing. + /*0x57C*/ struct RankingHall2P hallRecords2P[2][3]; // From record mixing. /*0x624*/ u16 contestLinkResults[5][4]; // 4 positions for 5 categories. /*0x64C*/ struct BattleFrontier frontier; }; // sizeof=0xF2C -- cgit v1.2.3