From 74b81bf229ded3212ab77701aebd4e16799731ec Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 13 Oct 2018 00:48:26 +0200 Subject: start apprentice --- include/global.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 9ae892b5c..9b66f7da6 100644 --- a/include/global.h +++ b/include/global.h @@ -297,9 +297,16 @@ struct UnknownSaveBlock2Struct struct UnkRecordMixingStruct { - u8 field_0[0x34]; + u8 field_0_0:5; + u8 field_0_1:2; + u8 field_1; + u8 field_2; + u8 field_3[37]; + u16 unk28[6]; u8 playerId[4]; - u8 field_38[10]; + u8 playerName[PLAYER_NAME_LENGTH]; + u8 language; + u32 unk40; }; struct UnknownPokemonStruct @@ -492,10 +499,12 @@ struct SaveBlock2 // TODO: fix and verify labels /*0xB0*/ u8 field_B0; - /*0xB1*/ u8 field_B1; + /*0xB1*/ u8 field_B1_0:2; + /*0xB1*/ u8 field_B1_1:6; /*0xB2*/ u8 field_B2_0:3; /*0xB2*/ u8 field_B2_1:2; - /*0xB3*/ u8 field_B3[0x29]; + /*0xB3*/ u8 field_B3; + /*0xB4*/ u8 field_B4[0x28]; /*0xDC*/ struct UnkRecordMixingStruct field_DC[4]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; -- cgit v1.2.3 From a496a763ca54871e19e2482b550127e2aa709b05 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 13 Oct 2018 20:38:46 +0200 Subject: Merge record mixing, pokemon and global with apprentice --- include/global.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 9b66f7da6..ec9fc99bf 100644 --- a/include/global.h +++ b/include/global.h @@ -295,13 +295,21 @@ struct UnknownSaveBlock2Struct u8 field_EB; }; // sizeof = 0xEC -struct UnkRecordMixingStruct +struct ApprenticeMon +{ + u16 species; + u16 moves[4]; + u16 item; +}; + +struct Apprentice { u8 field_0_0:5; u8 field_0_1:2; u8 field_1; u8 field_2; - u8 field_3[37]; + u8 field_3; + struct ApprenticeMon monData[3]; u16 unk28[6]; u8 playerId[4]; u8 playerName[PLAYER_NAME_LENGTH]; @@ -473,6 +481,15 @@ struct BattleFrontier /*0xEFC*/ struct FrontierMonData field_EFC[3]; }; +struct Sav2_B8 +{ + u8 unk0_0:2; + u8 unk0_1:2; + u8 unk0_2:2; + u8 unk0_3:2; + u16 unk2; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; @@ -500,12 +517,14 @@ struct SaveBlock2 // TODO: fix and verify labels /*0xB0*/ u8 field_B0; /*0xB1*/ u8 field_B1_0:2; - /*0xB1*/ u8 field_B1_1:6; + /*0xB1*/ u8 field_B1_1:4; + /*0xB1*/ u8 field_B1_2:2; /*0xB2*/ u8 field_B2_0:3; /*0xB2*/ u8 field_B2_1:2; /*0xB3*/ u8 field_B3; - /*0xB4*/ u8 field_B4[0x28]; - /*0xDC*/ struct UnkRecordMixingStruct field_DC[4]; + /*0xB4*/ u8 field_B4[3]; + /*0xB8*/ struct Sav2_B8 field_B8[9]; + /*0xDC*/ struct Apprentice field_DC[4]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; -- cgit v1.2.3 From 36b8a6a9a2ad5aca2e5d59a1293222819d987aa6 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 13 Oct 2018 23:23:33 +0200 Subject: More apprentice work --- 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 ec9fc99bf..0100d04db 100644 --- a/include/global.h +++ b/include/global.h @@ -310,7 +310,7 @@ struct Apprentice u8 field_2; u8 field_3; struct ApprenticeMon monData[3]; - u16 unk28[6]; + u16 easyChatWords[6]; u8 playerId[4]; u8 playerName[PLAYER_NAME_LENGTH]; u8 language; -- cgit v1.2.3 From 145df4906326488874b3f75ef96f99e85b18f2a0 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 14 Oct 2018 14:35:51 +0200 Subject: Document more of apprentice --- include/global.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 0100d04db..43e829dcf 100644 --- a/include/global.h +++ b/include/global.h @@ -304,11 +304,10 @@ struct ApprenticeMon struct Apprentice { - u8 field_0_0:5; - u8 field_0_1:2; + u8 id:5; + u8 lvlMode:2; // + 1 u8 field_1; - u8 field_2; - u8 field_3; + u8 number; struct ApprenticeMon monData[3]; u16 easyChatWords[6]; u8 playerId[4]; @@ -514,7 +513,7 @@ struct SaveBlock2 /*0xA8*/ u32 field_A8; /*0xAC*/ u32 encryptionKey; - // TODO: fix and verify labels + // Possibly player's apprentice, will document once battle tower is decompiled. /*0xB0*/ u8 field_B0; /*0xB1*/ u8 field_B1_0:2; /*0xB1*/ u8 field_B1_1:4; @@ -524,7 +523,7 @@ struct SaveBlock2 /*0xB3*/ u8 field_B3; /*0xB4*/ u8 field_B4[3]; /*0xB8*/ struct Sav2_B8 field_B8[9]; - /*0xDC*/ struct Apprentice field_DC[4]; + /*0xDC*/ struct Apprentice apprentices[4]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; -- cgit v1.2.3 From 7952cfeba5c9eaed2cd58a7f49dea8d676a56840 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 14 Oct 2018 16:27:48 +0200 Subject: document more of apprentice --- include/global.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 43e829dcf..2c5ce3777 100644 --- a/include/global.h +++ b/include/global.h @@ -178,12 +178,14 @@ enum OPTIONS_BATTLE_STYLE_SET }; -struct Coords8 { +struct Coords8 +{ s8 x; s8 y; }; -struct UCoords8 { +struct UCoords8 +{ u8 x; u8 y; }; @@ -489,6 +491,19 @@ struct Sav2_B8 u16 unk2; }; +struct PlayersApprentice +{ + /*0xB0*/ u8 id; + /*0xB1*/ u8 activeLvlMode:2; // +1, 0 means not active + /*0xB1*/ u8 field_B1_1:4; + /*0xB1*/ u8 field_B1_2:2; + /*0xB2*/ u8 field_B2_0:3; + /*0xB2*/ u8 field_B2_1:2; + /*0xB3*/ u8 field_B3; + /*0xB4*/ u8 monIds[3]; + /*0xB8*/ struct Sav2_B8 field_B8[9]; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; @@ -512,17 +527,7 @@ struct SaveBlock2 /*0xA0*/ struct Time lastBerryTreeUpdate; /*0xA8*/ u32 field_A8; /*0xAC*/ u32 encryptionKey; - - // Possibly player's apprentice, will document once battle tower is decompiled. - /*0xB0*/ u8 field_B0; - /*0xB1*/ u8 field_B1_0:2; - /*0xB1*/ u8 field_B1_1:4; - /*0xB1*/ u8 field_B1_2:2; - /*0xB2*/ u8 field_B2_0:3; - /*0xB2*/ u8 field_B2_1:2; - /*0xB3*/ u8 field_B3; - /*0xB4*/ u8 field_B4[3]; - /*0xB8*/ struct Sav2_B8 field_B8[9]; + /*0xB0*/ struct PlayersApprentice playerApprentice; /*0xDC*/ struct Apprentice apprentices[4]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; -- cgit v1.2.3