From bfc4b338cbd3e78062c71ff6f72f821631277c1b Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 22 Aug 2017 17:34:42 -0500 Subject: rename some mauville man stuff --- include/global.h | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index f076274cc..bb501ac93 100644 --- a/include/global.h +++ b/include/global.h @@ -447,11 +447,19 @@ struct MailStruct /*0x20*/ u16 itemId; }; -struct UnkMauvilleOldManStruct + +// Mauville Pokemon Center men + +struct MauvilleManCommon +{ + u8 id; +}; + +struct MauvilleManBard { - u8 unk_2D94; + u8 id; u8 unk_2D95; - /*0x2D96*/ u16 mauvilleOldMan_ecArray[6]; + /*0x2D96*/ u16 songLyrics[6]; /*0x2DA2*/ u16 mauvilleOldMan_ecArray2[6]; /*0x2DAE*/ u8 playerName[8]; /*0x2DB6*/ u8 filler_2DB6[0x3]; @@ -459,29 +467,43 @@ struct UnkMauvilleOldManStruct u8 unk_2DBD; }; /*size = 0x2C*/ -struct UnkMauvilleOldManStruct2 +struct MauvilleManHipster { - u8 filler0; + u8 id; u8 unk1; - u8 unk2; - u16 mauvilleOldMan_ecArray[10]; - u8 mauvilleOldMan_ecArray2[12]; - u8 fillerF[0x2]; -}; /*size = 0x2C*/ +}; -struct MauvilleOldManTrader +struct MauvilleManTrader { - u8 unk0; + u8 id; u8 unk1[4]; u8 unk5[4][11]; u8 unk31; }; +struct MauvilleManStoryteller +{ + u8 id; +}; + +struct MauvilleManGiddy +{ + u8 id; + u8 unk1; + u8 unk2; + u16 mauvilleOldMan_ecArray[10]; + u8 mauvilleOldMan_ecArray2[12]; + u8 fillerF[0x2]; +}; /*size = 0x2C*/ + typedef union OldMan { - struct UnkMauvilleOldManStruct oldMan1; - struct UnkMauvilleOldManStruct2 oldMan2; - struct MauvilleOldManTrader trader; + struct MauvilleManCommon common; + struct MauvilleManBard bard; + struct MauvilleManHipster hipster; + struct MauvilleManTrader trader; + struct MauvilleManStoryteller storyteller; + struct MauvilleManGiddy giddy; u8 filler[0x40]; } OldMan; -- cgit v1.2.3 From 4f36e317f9d2489e7c192f2a70c44a087e7d1998 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 23 Aug 2017 15:55:01 +0200 Subject: name labels --- include/global.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index f076274cc..8f28c8c59 100644 --- a/include/global.h +++ b/include/global.h @@ -37,6 +37,7 @@ fndec\ #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) +#define POKEMON_SLOTS_NUMBER 412 #define POKEMON_NAME_LENGTH 10 #define OT_NAME_LENGTH 7 @@ -571,6 +572,11 @@ struct RecordMixingGift struct RecordMixingGiftData data; }; +// there should be enough flags for all 412 slots +// each slot takes up 8 flags +// if the value is not divisible by 8, we need to account for the reminder as well +#define DEX_FLAGS_NO ((POKEMON_SLOTS_NUMBER / 8) + ((POKEMON_SLOTS_NUMBER % 8) ? 1 : 0)) + struct SaveBlock1 /* 0x02025734 */ { /*0x00*/ struct Coords16 pos; @@ -597,7 +603,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x640*/ struct ItemSlot bagPocket_TMHM[64]; /*0x740*/ struct ItemSlot bagPocket_Berries[46]; /*0x7F8*/ struct Pokeblock pokeblocks[40]; - /*0x938*/ u8 unk938[52]; // pokedex related + /*0x938*/ u8 dexSeen2[DEX_FLAGS_NO]; /*0x96C*/ u16 berryBlenderRecords[3]; /*0x972*/ u8 filler_972[0x6]; /*0x978*/ u16 trainerRematchStepCounter; @@ -657,7 +663,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x3160*/ struct EnigmaBerry enigmaBerry; /*0x3690*/ struct RamScript ramScript; /*0x3A7C*/ struct RecordMixingGift recordMixingGift; - /*0x3A8C*/ u8 unk3A8C[52]; //pokedex related + /*0x3A8C*/ u8 dexSeen3[DEX_FLAGS_NO]; }; extern struct SaveBlock1 gSaveBlock1; @@ -679,8 +685,8 @@ struct Pokedex /*0x04*/ u32 unownPersonality; // set when you first see Unown /*0x08*/ u32 spindaPersonality; // set when you first see Spinda /*0x0C*/ u32 unknown3; - /*0x10*/ u8 owned[52]; - /*0x44*/ u8 seen[52]; + /*0x10*/ u8 owned[DEX_FLAGS_NO]; + /*0x44*/ u8 seen[DEX_FLAGS_NO]; }; struct SaveBlock2_Sub -- cgit v1.2.3 From 988f5a685a36d3591d07f71ca778d988fb26720a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 01:10:30 -0500 Subject: decompile up to sub_80F8598 --- include/global.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index bb501ac93..67039d50e 100644 --- a/include/global.h +++ b/include/global.h @@ -457,14 +457,14 @@ struct MauvilleManCommon struct MauvilleManBard { - u8 id; - u8 unk_2D95; - /*0x2D96*/ u16 songLyrics[6]; - /*0x2DA2*/ u16 mauvilleOldMan_ecArray2[6]; - /*0x2DAE*/ u8 playerName[8]; - /*0x2DB6*/ u8 filler_2DB6[0x3]; - /*0x2DB9*/ u8 playerTrainerId[4]; - u8 unk_2DBD; + /*0x00*/ u8 id; + /*0x01*/ u8 unk_2D95; + /*0x02*/ u16 songLyrics[6]; + /*0x0E*/ u16 mauvilleOldMan_ecArray2[6]; + /*0x1A*/ u8 playerName[8]; + /*0x22*/ u8 filler_2DB6[0x3]; + /*0x25*/ u8 playerTrainerId[4]; + /*0x29*/ u8 unk_2DBD; }; /*size = 0x2C*/ struct MauvilleManHipster @@ -484,18 +484,24 @@ struct MauvilleManTrader struct MauvilleManStoryteller { u8 id; + u8 unk1; + u8 filler2[2]; + u8 unk4[4]; + u8 unk8[4][7]; + u8 unk24[2][4]; // unknown length }; struct MauvilleManGiddy { - u8 id; - u8 unk1; - u8 unk2; - u16 mauvilleOldMan_ecArray[10]; - u8 mauvilleOldMan_ecArray2[12]; - u8 fillerF[0x2]; + /*0x00*/ u8 id; + /*0x01*/ u8 unk1; + /*0x02*/ u8 questionNum; + /*0x04*/ u16 mauvilleOldMan_ecArray[10]; + /*0x18*/ u8 questionList[12]; + /*0x24*/ u8 fillerF[0x2]; }; /*size = 0x2C*/ + typedef union OldMan { struct MauvilleManCommon common; -- cgit v1.2.3 From a277e60789d9ea78fe03a4bcded2edf7b91e548e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 13:40:03 -0500 Subject: finish decompiling mauville_old_man --- 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 67039d50e..f172c12a3 100644 --- a/include/global.h +++ b/include/global.h @@ -484,7 +484,7 @@ struct MauvilleManTrader struct MauvilleManStoryteller { u8 id; - u8 unk1; + bool8 unk1; u8 filler2[2]; u8 unk4[4]; u8 unk8[4][7]; -- cgit v1.2.3 From 1ae38be0a46d1d901a2d9e5bb22938a0cecf6b7f Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 15:19:55 -0500 Subject: do some renaming and reorganizing --- include/global.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index f172c12a3..32a6beb2b 100644 --- a/include/global.h +++ b/include/global.h @@ -464,7 +464,7 @@ struct MauvilleManBard /*0x1A*/ u8 playerName[8]; /*0x22*/ u8 filler_2DB6[0x3]; /*0x25*/ u8 playerTrainerId[4]; - /*0x29*/ u8 unk_2DBD; + /*0x29*/ bool8 hasChangedSong; }; /*size = 0x2C*/ struct MauvilleManHipster @@ -502,7 +502,7 @@ struct MauvilleManGiddy }; /*size = 0x2C*/ -typedef union OldMan +union MauvilleMan { struct MauvilleManCommon common; struct MauvilleManBard bard; @@ -511,7 +511,7 @@ typedef union OldMan struct MauvilleManStoryteller storyteller; struct MauvilleManGiddy giddy; u8 filler[0x40]; -} OldMan; +}; struct Unk_SB_Access_Struct1 { @@ -668,7 +668,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2B4C*/ struct MailStruct mail[16]; /*0x2D8C*/ u8 unk2D8C[4]; /*0x2D90*/ u8 filler_2D90[0x4]; - /*0x2D94*/ OldMan oldMan; + /*0x2D94*/ union MauvilleMan mauvilleMan; /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff /*0x2DFC*/ u8 filler_2DFC[0x8]; /*0x2E04*/ SB_Struct sbStruct; -- cgit v1.2.3 From 4a583141ba483dcd49f49760a29c403c5d259efb Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 15:33:07 -0500 Subject: more labeling and fix German build --- 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 32a6beb2b..6c0fc28ef 100644 --- a/include/global.h +++ b/include/global.h @@ -460,7 +460,7 @@ struct MauvilleManBard /*0x00*/ u8 id; /*0x01*/ u8 unk_2D95; /*0x02*/ u16 songLyrics[6]; - /*0x0E*/ u16 mauvilleOldMan_ecArray2[6]; + /*0x0E*/ u16 temporaryLyrics[6]; /*0x1A*/ u8 playerName[8]; /*0x22*/ u8 filler_2DB6[0x3]; /*0x25*/ u8 playerTrainerId[4]; -- cgit v1.2.3 From 1b715eb7ba38ff408acf5e5e0a9ea88642f912bb Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 16:52:49 -0500 Subject: more Mauville man labeling --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 6c0fc28ef..0e0c29045 100644 --- a/include/global.h +++ b/include/global.h @@ -478,7 +478,7 @@ struct MauvilleManTrader u8 id; u8 unk1[4]; u8 unk5[4][11]; - u8 unk31; + bool8 alreadyTraded; }; struct MauvilleManStoryteller @@ -487,7 +487,7 @@ struct MauvilleManStoryteller bool8 unk1; u8 filler2[2]; u8 unk4[4]; - u8 unk8[4][7]; + u8 playerNames[4][7]; u8 unk24[2][4]; // unknown length }; -- cgit v1.2.3 From 670255f950a98f8a5cc636a20682b9ed42a31b21 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 19:54:39 -0500 Subject: fix build for real this time --- include/global.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 0e0c29045..875ea7815 100644 --- a/include/global.h +++ b/include/global.h @@ -486,9 +486,9 @@ struct MauvilleManStoryteller u8 id; bool8 unk1; u8 filler2[2]; - u8 unk4[4]; - u8 playerNames[4][7]; - u8 unk24[2][4]; // unknown length + u8 gameStatIDs[4]; + u8 trainerNames[4][7]; + u8 unk24[4][4]; }; struct MauvilleManGiddy -- cgit v1.2.3 From 8c57ef0fad270bc795d0b64a75d96fafc0f63513 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 20:50:39 -0500 Subject: finish labeling script --- 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 875ea7815..7c673f13e 100644 --- a/include/global.h +++ b/include/global.h @@ -494,11 +494,10 @@ struct MauvilleManStoryteller struct MauvilleManGiddy { /*0x00*/ u8 id; - /*0x01*/ u8 unk1; + /*0x01*/ u8 taleCounter; /*0x02*/ u8 questionNum; - /*0x04*/ u16 mauvilleOldMan_ecArray[10]; + /*0x04*/ u16 randomWords[10]; /*0x18*/ u8 questionList[12]; - /*0x24*/ u8 fillerF[0x2]; }; /*size = 0x2C*/ -- cgit v1.2.3 From b6ea4d9a77cdb6b416d3dd94eef68ce8a56cd4eb Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 24 Aug 2017 21:18:07 -0500 Subject: label more stuff in mauville_old_man.c --- include/global.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 7c673f13e..ab7d43955 100644 --- a/include/global.h +++ b/include/global.h @@ -458,7 +458,6 @@ struct MauvilleManCommon struct MauvilleManBard { /*0x00*/ u8 id; - /*0x01*/ u8 unk_2D95; /*0x02*/ u16 songLyrics[6]; /*0x0E*/ u16 temporaryLyrics[6]; /*0x1A*/ u8 playerName[8]; @@ -470,7 +469,7 @@ struct MauvilleManBard struct MauvilleManHipster { u8 id; - u8 unk1; + bool8 alreadySpoken; }; struct MauvilleManTrader @@ -484,11 +483,11 @@ struct MauvilleManTrader struct MauvilleManStoryteller { u8 id; - bool8 unk1; + bool8 alreadyRecorded; u8 filler2[2]; u8 gameStatIDs[4]; u8 trainerNames[4][7]; - u8 unk24[4][4]; + u8 statValues[4][4]; }; struct MauvilleManGiddy @@ -509,7 +508,7 @@ union MauvilleMan struct MauvilleManTrader trader; struct MauvilleManStoryteller storyteller; struct MauvilleManGiddy giddy; - u8 filler[0x40]; + u8 filler[0x40]; // needed to pad out the struct }; struct Unk_SB_Access_Struct1 -- cgit v1.2.3 From f25a1e6106fef11318301666359ee5ec2d45677f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 29 Aug 2017 22:14:29 -0400 Subject: Daycare_SendPokemon --- include/global.h | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index f076274cc..d5535a9c7 100644 --- a/include/global.h +++ b/include/global.h @@ -534,18 +534,32 @@ struct GabbyAndTyData /*2b1b*/ u8 valB_5:3; }; -struct RecordMixing_UnknownStructSub +struct DayCareMail { - u32 unk0; - u8 data[0x34]; - //u8 data[0x38]; + /*0x00*/ struct MailStruct mail; + /*0x24*/ u8 names[19]; }; -struct RecordMixing_UnknownStruct -{ - struct RecordMixing_UnknownStructSub data[2]; +struct DayCareMailExtra { u32 unk70; - u16 unk74[0x2]; + u16 unk74[2]; +}; + +struct DayCareMailEtc +{ + struct DayCareMail data[2]; + union { + struct DayCareMailExtra rc; + u32 unk70[2]; + } extra; +}; + +struct DayCareData { + struct BoxPokemon mons[2]; + struct DayCareMailEtc mail; + u8 unk_118[2]; + u8 unk_11a; + u8 unk_11b; }; struct LinkBattleRecord @@ -644,11 +658,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff /*0x2DFC*/ u8 filler_2DFC[0x8]; /*0x2E04*/ SB_Struct sbStruct; - /*0x2F9C*/ struct BoxPokemon daycareData[2]; - /*0x303C*/ struct RecordMixing_UnknownStruct filler_303C; - /*0x30AC*/ u8 filler_30B4[0x2]; - /*0x30B6*/ u8 filler_30B6; - /*0x30B7*/ u8 filler_30B7[1]; + /*0x2F9C*/ struct DayCareData daycareData; /*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5]; /*0x3108*/ u8 filler_3108[8]; /*0x3110*/ u8 giftRibbons[7]; -- cgit v1.2.3 From 36bafa9f9fad1efd7baead651c7f357f6a832023 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 29 Aug 2017 22:41:26 -0400 Subject: sub_8041570 --- 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 d5535a9c7..3f30544a8 100644 --- a/include/global.h +++ b/include/global.h @@ -550,7 +550,7 @@ struct DayCareMailEtc struct DayCareMail data[2]; union { struct DayCareMailExtra rc; - u32 unk70[2]; + u32 steps[2]; } extra; }; -- cgit v1.2.3 From 885aa7d1b875de62569319f28a5d2836d5c366e6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 30 Aug 2017 08:15:03 -0400 Subject: unref_sub_8041824 --- 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 3f30544a8..ee54007b2 100644 --- a/include/global.h +++ b/include/global.h @@ -557,7 +557,7 @@ struct DayCareMailEtc struct DayCareData { struct BoxPokemon mons[2]; struct DayCareMailEtc mail; - u8 unk_118[2]; + u16 unk_118; u8 unk_11a; u8 unk_11b; }; -- cgit v1.2.3 From 97d9399be794f6a94137a1945af52ef1e26de4a7 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 30 Aug 2017 16:02:46 -0400 Subject: Restore previously-decompiled functions; make static what should be static --- 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 ee54007b2..82dcd1a53 100644 --- a/include/global.h +++ b/include/global.h @@ -557,7 +557,7 @@ struct DayCareMailEtc struct DayCareData { struct BoxPokemon mons[2]; struct DayCareMailEtc mail; - u16 unk_118; + u16 eggPersonalityLo; u8 unk_11a; u8 unk_11b; }; -- cgit v1.2.3 From a1c5f2e6bad52af49dbf7de48ac78d4015dd073f Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 30 Aug 2017 16:42:05 -0400 Subject: Nonmatching sub_80421B0 --- include/global.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 82dcd1a53..b2b4ffcc4 100644 --- a/include/global.h +++ b/include/global.h @@ -540,26 +540,30 @@ struct DayCareMail /*0x24*/ u8 names[19]; }; -struct DayCareMailExtra { +struct DayCareMailExtra_RecordMixing { u32 unk70; u16 unk74[2]; }; +struct DayCareMailExtra_EggData { + u32 steps[2]; + u16 personalityLo; + u8 unk_11a; +}; + struct DayCareMailEtc { struct DayCareMail data[2]; union { - struct DayCareMailExtra rc; - u32 steps[2]; + struct DayCareMailExtra_RecordMixing rc; + struct DayCareMailExtra_EggData egg; + u8 misc[12]; } extra; }; struct DayCareData { struct BoxPokemon mons[2]; struct DayCareMailEtc mail; - u16 eggPersonalityLo; - u8 unk_11a; - u8 unk_11b; }; struct LinkBattleRecord -- cgit v1.2.3 From b7f9479bdb37f12774f7e31a934a3dd5e8f821e0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 30 Aug 2017 19:04:07 -0400 Subject: Fix building --- include/global.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index b2b4ffcc4..0a415e3e6 100644 --- a/include/global.h +++ b/include/global.h @@ -551,14 +551,17 @@ struct DayCareMailExtra_EggData { u8 unk_11a; }; +struct RecordMixingDayCareMail +{ + struct DayCareMail data[2]; + u32 unk70; + u16 unk74[2]; +}; + struct DayCareMailEtc { struct DayCareMail data[2]; - union { - struct DayCareMailExtra_RecordMixing rc; - struct DayCareMailExtra_EggData egg; - u8 misc[12]; - } extra; + struct DayCareMailExtra_EggData egg; }; struct DayCareData { -- cgit v1.2.3 From 1b2096556ae0dcbc31723e782cfec354a4a94117 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 4 Sep 2017 23:05:24 -0400 Subject: sub_804AF10 and sub_804AF84 --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index f076274cc..07ea6a410 100644 --- a/include/global.h +++ b/include/global.h @@ -651,8 +651,8 @@ struct SaveBlock1 /* 0x02025734 */ /*0x30B7*/ u8 filler_30B7[1]; /*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5]; /*0x3108*/ u8 filler_3108[8]; - /*0x3110*/ u8 giftRibbons[7]; - /*0x3117*/ u8 filler_311B[0x2D]; + /*0x3110*/ u8 giftRibbons[11]; + /*0x3117*/ u8 filler_311B[0x29]; /*0x3144*/ struct Roamer roamer; /*0x3160*/ struct EnigmaBerry enigmaBerry; /*0x3690*/ struct RamScript ramScript; -- cgit v1.2.3 From a185f8a26dc5e5a04908c272ab54bede7af8a10c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 12 Sep 2017 16:53:04 -0500 Subject: lots more relabeling --- 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 ab7d43955..79269937f 100644 --- a/include/global.h +++ b/include/global.h @@ -608,7 +608,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2C*/ u16 battleMusic; /*0x2E*/ u8 weather; /*0x2F*/ u8 filler_2F; - /*0x30*/ u8 flashUsed; + /*0x30*/ u8 flashLevel; // flash level on current map, 0 being normal and 4 being the darkest /*0x32*/ u16 mapDataId; /*0x34*/ u16 mapView[0x100]; /*0x234*/ u8 playerPartyCount; -- cgit v1.2.3 From cdc5d1b683dd89e80d3daaf13965cae916ed9f6c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 23 Sep 2017 23:49:37 -0500 Subject: do some scrcmd/overworld labeling --- 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 79269937f..2d049a412 100644 --- a/include/global.h +++ b/include/global.h @@ -603,7 +603,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x04*/ struct WarpData location; /*0x0C*/ struct WarpData warp1; /*0x14*/ struct WarpData warp2; - /*0x1C*/ struct WarpData warp3; + /*0x1C*/ struct WarpData lastHealLocation; /*0x24*/ struct WarpData warp4; /*0x2C*/ u16 battleMusic; /*0x2E*/ u8 weather; -- cgit v1.2.3 From 0c234d0929a6f7bb41277275f06abae1b3d7e823 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 24 Sep 2017 12:12:53 -0500 Subject: more renaming --- 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 2d049a412..240f58ece 100644 --- a/include/global.h +++ b/include/global.h @@ -605,7 +605,7 @@ struct SaveBlock1 /* 0x02025734 */ /*0x14*/ struct WarpData warp2; /*0x1C*/ struct WarpData lastHealLocation; /*0x24*/ struct WarpData warp4; - /*0x2C*/ u16 battleMusic; + /*0x2C*/ u16 savedMusic; /*0x2E*/ u8 weather; /*0x2F*/ u8 filler_2F; /*0x30*/ u8 flashLevel; // flash level on current map, 0 being normal and 4 being the darkest -- cgit v1.2.3 From 9f736e58afff3e3e3be1398ceebac93614ec70e1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 29 Sep 2017 22:25:20 -0400 Subject: Rename daycare structs to be slightly less insensible --- include/global.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 43a105162..ac28507e8 100644 --- a/include/global.h +++ b/include/global.h @@ -562,16 +562,11 @@ struct GabbyAndTyData struct DayCareMail { - /*0x00*/ struct MailStruct mail; + /*0x00*/ struct MailStruct message; /*0x24*/ u8 names[19]; }; -struct DayCareMailExtra_RecordMixing { - u32 unk70; - u16 unk74[2]; -}; - -struct DayCareMailExtra_EggData { +struct DayCareStepCountersEtc { u32 steps[2]; u16 personalityLo; u8 unk_11a; @@ -579,20 +574,20 @@ struct DayCareMailExtra_EggData { struct RecordMixingDayCareMail { - struct DayCareMail data[2]; + struct DayCareMail mail[2]; u32 unk70; u16 unk74[2]; }; -struct DayCareMailEtc +struct DayCareMisc { - struct DayCareMail data[2]; - struct DayCareMailExtra_EggData egg; + struct DayCareMail mail[2]; + struct DayCareStepCountersEtc countersEtc; }; struct DayCareData { struct BoxPokemon mons[2]; - struct DayCareMailEtc mail; + struct DayCareMisc misc; }; struct LinkBattleRecord -- cgit v1.2.3 From fcd62bf39372bbb26e21f3dfb67ccf1782954834 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 15 Oct 2017 14:36:53 -0700 Subject: Start decomp on rest of secret_base --- 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 f0eb7401f..51c599a73 100644 --- a/include/global.h +++ b/include/global.h @@ -130,7 +130,7 @@ struct UCoords16 struct SecretBaseRecord { - /*ID?*/ /*0x1A08*/ u8 sbr_field_0; + /*ID?*/ /*0x1A08*/ u8 secretBaseId; /*0x1A09*/ u8 sbr_field_1_0:4; /*0x1A09*/ u8 gender:1; /*0x1A09*/ u8 sbr_field_1_5:1; -- cgit v1.2.3 From b29c65b176bc7441ac38002e2ea9e38f8e4e9ce6 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 15 Oct 2017 19:25:32 -0700 Subject: Continue decomp of secret_base --- 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 51c599a73..e6a073aa5 100644 --- a/include/global.h +++ b/include/global.h @@ -136,7 +136,7 @@ struct SecretBaseRecord /*0x1A09*/ u8 sbr_field_1_5:1; /*0x1A09*/ u8 sbr_field_1_6:2; /*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes? - /*0x1A12*/ u8 trainerId[4]; // byte 0 is used for determining trainer class + /*0x1A11*/ u8 trainerId[4]; // byte 0 is used for determining trainer class /*0x1A16*/ u16 sbr_field_e; /*0x1A18*/ u8 sbr_field_10; /*0x1A19*/ u8 sbr_field_11; -- cgit v1.2.3 From 687fee8891816c7d9b21670ba326edde8b15dce1 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 16 Oct 2017 14:38:52 -0700 Subject: Finish secret_base decomp --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index e6a073aa5..7c1ac9c68 100644 --- a/include/global.h +++ b/include/global.h @@ -130,12 +130,12 @@ struct UCoords16 struct SecretBaseRecord { - /*ID?*/ /*0x1A08*/ u8 secretBaseId; + /*0x1A08*/ u8 secretBaseId; /*0x1A09*/ u8 sbr_field_1_0:4; /*0x1A09*/ u8 gender:1; /*0x1A09*/ u8 sbr_field_1_5:1; /*0x1A09*/ u8 sbr_field_1_6:2; - /*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes? + /*0x1A0A*/ u8 playerName[OT_NAME_LENGTH]; /*0x1A11*/ u8 trainerId[4]; // byte 0 is used for determining trainer class /*0x1A16*/ u16 sbr_field_e; /*0x1A18*/ u8 sbr_field_10; -- cgit v1.2.3 From 13c196eda57ebbdb3c7e14bebd2985f1edceae34 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 21 Oct 2017 19:51:28 -0700 Subject: More battle_tower work --- include/global.h | 85 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 16 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 7c1ac9c68..6a7f6396c 100644 --- a/include/global.h +++ b/include/global.h @@ -727,26 +727,79 @@ struct Pokedex /*0x44*/ u8 seen[DEX_FLAGS_NO]; }; +// struct EReaderTrainerPokemon +// { +// /*0x00, 0x4CC*/u16 unk0; +// /*0x02, 0x4CE*/u16 unk2; +// /*0x04, 0x4D0*/u8 unk4[0x8]; +// /*0x0C, 0x4D8*/u8 level; +// /*0x0D, 0x4D9*/u8 unk9[0x1F]; +// }; + +// struct EReaderTrainer +// { +// /*0x00, 0x498*/u8 filler_0[2]; +// /*0x02, 0x49A*/u16 unk2; +// /*0x04, 0x49C*/u8 filler_4[0x30]; +// /*0x34, 0x4CC*/struct EReaderTrainerPokemon party[3]; +// /*0xB8, 0x550*/u32 unkB8; +// }; + +struct SaveBlock2_1 +{ + u32 filler_0[0x29]; +}; + +struct BattleTowerTrainer +{ + u8 trainerClass; + u8 name[8]; + u8 teamFlags; + u16 padding; + u16 easyChat[6]; +}; + +struct BattleTowerRecord // record mixing +{ + /*0x00*/u8 var_0; + /*0x01*/u8 trainerClass; + /*0x02*/u16 var_2; + /*0x04*/u8 name[8]; + /*0x0C*/u8 var_C[5]; + u8 filler[0x93]; +}; + +struct BattleTowerEReaderTrainer +{ + /*0x00*/u8 unk0; + /*0x01*/u8 trainerClass; + /*0x02*/u16 filler_2; + /*0x04*/u8 name[8]; + /*0x0B*/u8 ereaderTrainer[0xB0]; +}; + struct SaveBlock2_Sub { - /*0x0000, 0x00A8*/ u8 filler_000[0x3D8]; - /*0x03D8, 0x0480*/ u16 var_480; - /*0x03DA, 0x0482*/ u16 var_482; + /*0x0000, 0x00A8*/ struct BattleTowerRecord var_A8; + /*0x00A4, 0x014C*/ struct BattleTowerRecord var_14C[5]; + /*0x03D8, 0x0480*/ u16 firstMonSpecies; // species of the first pokemon in the player's battle tower party + /*0x03DA, 0x0482*/ u16 defeatedBySpecies; // species of the pokemon that defated the player in their battle tower streak. /*0x03DC, 0x0484*/ u8 filler_3DC[0x14]; - /*0x03F0, 0x0498*/ u8 ereaderTrainer[0xBC]; - /*0x04AC, 0x0554*/ u8 var_4AC; - /*0x04AD, 0x0555*/ u8 var_4AD; + /*0x03F0, 0x0498*/ struct BattleTowerEReaderTrainer ereaderTrainer; + /*0x04AC, 0x0554*/ u8 battleTowerLevelType:1; // 0 = level 50; 1 = level 100 + /*0x04AD, 0x0555*/ u8 var_4AD; // used by tv, but ultimately does nothing, since both code paths are identical /*0x04AE, 0x0556*/ u8 var_4AE[2]; - /*0x04B0, 0x0558*/ u16 var_4B0; - /*0x04B2, 0x055A*/ u16 var_4B2; - /*0x04B4, 0x055C*/ u16 var_4B4; - /*0x04B6, 0x055E*/ u16 var_4B6; - /*0x04B8, 0x0560*/ u16 recordWinStreak[2]; - /*0x04BC, 0x0564*/ u8 filler_4BC[0xC]; - /*0x04C8, 0x0570*/ u16 var_4C8; - /*0x04CA, 0x0572*/ u16 var_4CA; - /*0x04CC, 0x0574*/ u16 winStreak[2]; - /*0x04D0, 0x0578*/ u8 var_4D0; + /*0x04B0, 0x0558*/ u16 var_4B0[2]; + /*0x04B4, 0x055C*/ u16 var_4B4[2]; + /*0x04B8, 0x0560*/ u16 recordWinStreaks[2]; + /*0x04BC, 0x0564*/ u8 battleTowerTrainerId; // index for gBattleTowerTrainers table + /*0x04BD, 0x0565*/ u8 var_4BD[0x3]; + /*0x04C0, 0x0568*/ u8 var_4C0; + /*0x04C1, 0x0569*/ u8 var_4C1[0x7]; + /*0x04C8, 0x0570*/ u16 totalBattleTowerWins; + /*0x04CA, 0x0572*/ u16 bestBattleTowerWinStreak; + /*0x04CC, 0x0574*/ u16 currentWinStreaks[2]; + /*0x04D0, 0x0578*/ u8 lastStreakLevelType; // 0 = level 50, 1 = level 100. level type of the last streak. Used by tv to report the level mode. /*0x04D1, 0x0579*/ u8 filler_4D1[0x317]; }; -- cgit v1.2.3 From f90bc99a49a3d4fa60e96cd6fbcb546f8e3a1da0 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 23 Oct 2017 17:45:02 -0700 Subject: Move all battle_tower data into src/ --- include/global.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 6a7f6396c..11611dc41 100644 --- a/include/global.h +++ b/include/global.h @@ -755,8 +755,9 @@ struct BattleTowerTrainer u8 trainerClass; u8 name[8]; u8 teamFlags; - u16 padding; - u16 easyChat[6]; + struct { + u16 easyChat[6]; + } greeting; }; struct BattleTowerRecord // record mixing -- cgit v1.2.3 From e27be38588bc1d2d3e26e10c87d5de91a5cbab21 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 23 Oct 2017 19:32:10 -0700 Subject: More decomp of battle_tower --- include/global.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 11611dc41..1431bf772 100644 --- a/include/global.h +++ b/include/global.h @@ -766,8 +766,11 @@ struct BattleTowerRecord // record mixing /*0x01*/u8 trainerClass; /*0x02*/u16 var_2; /*0x04*/u8 name[8]; - /*0x0C*/u8 var_C[5]; - u8 filler[0x93]; + /*0x0C*/u8 var_C[4]; + /*0x10*/struct { + u16 easyChat[6]; + } greeting; + /*0x1C*/u8 filler[0x87]; }; struct BattleTowerEReaderTrainer @@ -775,8 +778,14 @@ struct BattleTowerEReaderTrainer /*0x00*/u8 unk0; /*0x01*/u8 trainerClass; /*0x02*/u16 filler_2; - /*0x04*/u8 name[8]; - /*0x0B*/u8 ereaderTrainer[0xB0]; + /*0x04*/u8 name[7]; + /*0x0B*/u8 filler_B[0x5]; + /*0x10*/struct { + u16 easyChat[6]; + } greeting; + /*0x1C*/u8 filler_1C[0x18]; + /*0x34*/struct UnknownPokemonStruct party[3]; + /*0xB8*/u32 unk_B0; }; struct SaveBlock2_Sub @@ -788,6 +797,7 @@ struct SaveBlock2_Sub /*0x03DC, 0x0484*/ u8 filler_3DC[0x14]; /*0x03F0, 0x0498*/ struct BattleTowerEReaderTrainer ereaderTrainer; /*0x04AC, 0x0554*/ u8 battleTowerLevelType:1; // 0 = level 50; 1 = level 100 + /*0x04AC, 0x0554*/ u8 unk_554:1; /*0x04AD, 0x0555*/ u8 var_4AD; // used by tv, but ultimately does nothing, since both code paths are identical /*0x04AE, 0x0556*/ u8 var_4AE[2]; /*0x04B0, 0x0558*/ u16 var_4B0[2]; -- cgit v1.2.3 From 978ca50dad8de72a3940b5423fd5c3b87c13eb46 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 28 Oct 2017 17:35:37 -0700 Subject: Even more battle tower decompilation --- include/global.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 1431bf772..4cc5f6bcc 100644 --- a/include/global.h +++ b/include/global.h @@ -681,10 +681,12 @@ struct SaveBlock1 /* 0x02025734 */ /*0x2B0D*/ u8 outbreakPokemonProbability; /*0x2B0E*/ u16 outbreakUnk5; /*0x2B10*/ struct GabbyAndTyData gabbyAndTyData; - /*0x2B1C*/ u16 unk2B1C[6]; - /*0x2B28*/ u16 unk2B28[6]; - /*0x2B34*/ u16 unk2B34[6]; - /*0x2B40*/ u16 unk2B40[6]; + /*0x2B1C*/ struct { + /*0x2B1C*/ u16 unk2B1C[6]; + /*0x2B28*/ u16 unk2B28[6]; + /*0x2B34*/ u16 unk2B34[6]; + /*0x2B40*/ u16 unk2B40[6]; + } easyChats; /*0x2B4C*/ struct MailStruct mail[16]; /*0x2D8C*/ u8 unk2D8C[4]; /*0x2D90*/ u8 filler_2D90[0x4]; @@ -766,11 +768,12 @@ struct BattleTowerRecord // record mixing /*0x01*/u8 trainerClass; /*0x02*/u16 var_2; /*0x04*/u8 name[8]; - /*0x0C*/u8 var_C[4]; + /*0x0C*/u8 trainerId[4]; /*0x10*/struct { u16 easyChat[6]; } greeting; - /*0x1C*/u8 filler[0x87]; + /*0x1C*/struct UnknownPokemonStruct party[3]; + /*0xA0*/u32 checksum; }; struct BattleTowerEReaderTrainer @@ -785,7 +788,7 @@ struct BattleTowerEReaderTrainer } greeting; /*0x1C*/u8 filler_1C[0x18]; /*0x34*/struct UnknownPokemonStruct party[3]; - /*0xB8*/u32 unk_B0; + /*0xB8*/u32 checksum; }; struct SaveBlock2_Sub @@ -793,8 +796,9 @@ struct SaveBlock2_Sub /*0x0000, 0x00A8*/ struct BattleTowerRecord var_A8; /*0x00A4, 0x014C*/ struct BattleTowerRecord var_14C[5]; /*0x03D8, 0x0480*/ u16 firstMonSpecies; // species of the first pokemon in the player's battle tower party - /*0x03DA, 0x0482*/ u16 defeatedBySpecies; // species of the pokemon that defated the player in their battle tower streak. - /*0x03DC, 0x0484*/ u8 filler_3DC[0x14]; + /*0x03DA, 0x0482*/ u16 defeatedBySpecies; // species of the pokemon that defated the player + /*0x03DC, 0x0484*/ u8 defeatedByTrainerName[8]; + /*0x03E4, 0x048C*/ u8 firstMonNickname[POKEMON_NAME_LENGTH]; // nickname of the first pokemon in the player's battle tower party /*0x03F0, 0x0498*/ struct BattleTowerEReaderTrainer ereaderTrainer; /*0x04AC, 0x0554*/ u8 battleTowerLevelType:1; // 0 = level 50; 1 = level 100 /*0x04AC, 0x0554*/ u8 unk_554:1; @@ -805,8 +809,8 @@ struct SaveBlock2_Sub /*0x04B8, 0x0560*/ u16 recordWinStreaks[2]; /*0x04BC, 0x0564*/ u8 battleTowerTrainerId; // index for gBattleTowerTrainers table /*0x04BD, 0x0565*/ u8 var_4BD[0x3]; - /*0x04C0, 0x0568*/ u8 var_4C0; - /*0x04C1, 0x0569*/ u8 var_4C1[0x7]; + /*0x04C0, 0x0568*/ u16 prizeItem; + /*0x04C2, 0x056A*/ u8 var_4C2[0x6]; /*0x04C8, 0x0570*/ u16 totalBattleTowerWins; /*0x04CA, 0x0572*/ u16 bestBattleTowerWinStreak; /*0x04CC, 0x0574*/ u16 currentWinStreaks[2]; -- cgit v1.2.3 From c677029e155aa5f0ef61de708588a36085fd36b4 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 28 Oct 2017 22:18:48 -0700 Subject: More battle_tower decomp --- include/global.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 4cc5f6bcc..41cffe3c2 100644 --- a/include/global.h +++ b/include/global.h @@ -786,7 +786,12 @@ struct BattleTowerEReaderTrainer /*0x10*/struct { u16 easyChat[6]; } greeting; - /*0x1C*/u8 filler_1C[0x18]; + /*0x1C*/struct { + u16 easyChat[6]; + } farewellPlayerLost; + /*0x28*/struct { + u16 easyChat[6]; + } farewellPlayerWon; /*0x34*/struct UnknownPokemonStruct party[3]; /*0xB8*/u32 checksum; }; -- cgit v1.2.3 From b9252e4f2803fe14bd7dd8385da595931b82c8d6 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 28 Oct 2017 22:59:19 -0700 Subject: Give more descriptive names for battle tower structs --- include/global.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 41cffe3c2..9b4320c81 100644 --- a/include/global.h +++ b/include/global.h @@ -780,7 +780,7 @@ struct BattleTowerEReaderTrainer { /*0x00*/u8 unk0; /*0x01*/u8 trainerClass; - /*0x02*/u16 filler_2; + /*0x02*/u16 filler_2; // TODO: this gets set in MEScrCmd_addtrainer /*0x04*/u8 name[7]; /*0x0B*/u8 filler_B[0x5]; /*0x10*/struct { @@ -796,10 +796,10 @@ struct BattleTowerEReaderTrainer /*0xB8*/u32 checksum; }; -struct SaveBlock2_Sub +struct BattleTowerData { - /*0x0000, 0x00A8*/ struct BattleTowerRecord var_A8; - /*0x00A4, 0x014C*/ struct BattleTowerRecord var_14C[5]; + /*0x0000, 0x00A8*/ struct BattleTowerRecord playerRecord; + /*0x00A4, 0x014C*/ struct BattleTowerRecord records[5]; // from record mixing /*0x03D8, 0x0480*/ u16 firstMonSpecies; // species of the first pokemon in the player's battle tower party /*0x03DA, 0x0482*/ u16 defeatedBySpecies; // species of the pokemon that defated the player /*0x03DC, 0x0484*/ u8 defeatedByTrainerName[8]; @@ -807,13 +807,13 @@ struct SaveBlock2_Sub /*0x03F0, 0x0498*/ struct BattleTowerEReaderTrainer ereaderTrainer; /*0x04AC, 0x0554*/ u8 battleTowerLevelType:1; // 0 = level 50; 1 = level 100 /*0x04AC, 0x0554*/ u8 unk_554:1; - /*0x04AD, 0x0555*/ u8 var_4AD; // used by tv, but ultimately does nothing, since both code paths are identical + /*0x04AD, 0x0555*/ u8 battleOutcome; /*0x04AE, 0x0556*/ u8 var_4AE[2]; - /*0x04B0, 0x0558*/ u16 var_4B0[2]; - /*0x04B4, 0x055C*/ u16 var_4B4[2]; + /*0x04B0, 0x0558*/ u16 curChallengeWins[2]; // number of wins in the current challenge. (challenges consist of 7 battles) + /*0x04B4, 0x055C*/ u16 curStreakChallengesCompleted[2]; // number of challenges completed in the current streak. /*0x04B8, 0x0560*/ u16 recordWinStreaks[2]; /*0x04BC, 0x0564*/ u8 battleTowerTrainerId; // index for gBattleTowerTrainers table - /*0x04BD, 0x0565*/ u8 var_4BD[0x3]; + /*0x04BD, 0x0565*/ u8 selectedPartyMons[0x3]; // indices of the 3 selected player party mons. /*0x04C0, 0x0568*/ u16 prizeItem; /*0x04C2, 0x056A*/ u8 var_4C2[0x6]; /*0x04C8, 0x0570*/ u16 totalBattleTowerWins; @@ -844,7 +844,7 @@ struct SaveBlock2 /* 0x02024EA4 */ /*0x90*/ u8 filler_90[0x8]; /*0x98*/ struct Time localTimeOffset; /*0xA0*/ struct Time lastBerryTreeUpdate; - /*0xA8*/ struct SaveBlock2_Sub filler_A8; + /*0xA8*/ struct BattleTowerData battleTower; }; struct MapPosition -- cgit v1.2.3 From fc786f80fd10732d23759e7c647f15406a5162d0 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 29 Oct 2017 16:51:25 -0700 Subject: Decompile a few nonmatchings in battle_tower --- 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 9b4320c81..43ffcae0c 100644 --- a/include/global.h +++ b/include/global.h @@ -780,7 +780,7 @@ struct BattleTowerEReaderTrainer { /*0x00*/u8 unk0; /*0x01*/u8 trainerClass; - /*0x02*/u16 filler_2; // TODO: this gets set in MEScrCmd_addtrainer + /*0x02*/u16 var_2; // TODO: this gets set in MEScrCmd_addtrainer /*0x04*/u8 name[7]; /*0x0B*/u8 filler_B[0x5]; /*0x10*/struct { -- cgit v1.2.3 From fea6c54f45a22493768d57c16fb9b916cfdeadde Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Wed, 1 Nov 2017 21:33:03 -0700 Subject: Decompile Debug_FillEReaderTrainerWithPlayerData --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 43ffcae0c..8461624cb 100644 --- a/include/global.h +++ b/include/global.h @@ -781,8 +781,8 @@ struct BattleTowerEReaderTrainer /*0x00*/u8 unk0; /*0x01*/u8 trainerClass; /*0x02*/u16 var_2; // TODO: this gets set in MEScrCmd_addtrainer - /*0x04*/u8 name[7]; - /*0x0B*/u8 filler_B[0x5]; + /*0x04*/u8 name[8]; + /*0x0C*/u8 trainerId[4]; /*0x10*/struct { u16 easyChat[6]; } greeting; -- cgit v1.2.3 From c5cda9f16442780794852af54635f6526c4c031a Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Wed, 1 Nov 2017 23:52:26 -0700 Subject: Use descriptive variable and function names for battle_tower code --- include/global.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 8461624cb..fcdd4109c 100644 --- a/include/global.h +++ b/include/global.h @@ -764,9 +764,9 @@ struct BattleTowerTrainer struct BattleTowerRecord // record mixing { - /*0x00*/u8 var_0; + /*0x00*/u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 /*0x01*/u8 trainerClass; - /*0x02*/u16 var_2; + /*0x02*/u16 winStreak; /*0x04*/u8 name[8]; /*0x0C*/u8 trainerId[4]; /*0x10*/struct { @@ -780,7 +780,7 @@ struct BattleTowerEReaderTrainer { /*0x00*/u8 unk0; /*0x01*/u8 trainerClass; - /*0x02*/u16 var_2; // TODO: this gets set in MEScrCmd_addtrainer + /*0x02*/u16 winStreak; /*0x04*/u8 name[8]; /*0x0C*/u8 trainerId[4]; /*0x10*/struct { @@ -809,8 +809,8 @@ struct BattleTowerData /*0x04AC, 0x0554*/ u8 unk_554:1; /*0x04AD, 0x0555*/ u8 battleOutcome; /*0x04AE, 0x0556*/ u8 var_4AE[2]; - /*0x04B0, 0x0558*/ u16 curChallengeWins[2]; // number of wins in the current challenge. (challenges consist of 7 battles) - /*0x04B4, 0x055C*/ u16 curStreakChallengesCompleted[2]; // number of challenges completed in the current streak. + /*0x04B0, 0x0558*/ u16 curChallengeBattleNum[2]; // 1-based index of battle in the current challenge. (challenges consist of 7 battles) + /*0x04B4, 0x055C*/ u16 curStreakChallengesNum[2]; // 1-based index of the current challenge in the current streak. /*0x04B8, 0x0560*/ u16 recordWinStreaks[2]; /*0x04BC, 0x0564*/ u8 battleTowerTrainerId; // index for gBattleTowerTrainers table /*0x04BD, 0x0565*/ u8 selectedPartyMons[0x3]; // indices of the 3 selected player party mons. -- cgit v1.2.3 From 2a682aec81c9de708d19e0ade1efef0a4f9db245 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 2 Nov 2017 17:55:40 -0700 Subject: Define constants for special battle_tower trainer ids --- 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 fcdd4109c..d73cd5fdf 100644 --- a/include/global.h +++ b/include/global.h @@ -815,7 +815,7 @@ struct BattleTowerData /*0x04BC, 0x0564*/ u8 battleTowerTrainerId; // index for gBattleTowerTrainers table /*0x04BD, 0x0565*/ u8 selectedPartyMons[0x3]; // indices of the 3 selected player party mons. /*0x04C0, 0x0568*/ u16 prizeItem; - /*0x04C2, 0x056A*/ u8 var_4C2[0x6]; + /*0x04C2, 0x056A*/ u8 filler_4C2[0x6]; /*0x04C8, 0x0570*/ u16 totalBattleTowerWins; /*0x04CA, 0x0572*/ u16 bestBattleTowerWinStreak; /*0x04CC, 0x0574*/ u16 currentWinStreaks[2]; -- cgit v1.2.3 From 0a95d8d97fde65213b31ed2e0412dde218b61590 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 2 Nov 2017 17:57:33 -0700 Subject: Cleanup unused structs --- include/global.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index d73cd5fdf..29804a5a9 100644 --- a/include/global.h +++ b/include/global.h @@ -729,29 +729,6 @@ struct Pokedex /*0x44*/ u8 seen[DEX_FLAGS_NO]; }; -// struct EReaderTrainerPokemon -// { -// /*0x00, 0x4CC*/u16 unk0; -// /*0x02, 0x4CE*/u16 unk2; -// /*0x04, 0x4D0*/u8 unk4[0x8]; -// /*0x0C, 0x4D8*/u8 level; -// /*0x0D, 0x4D9*/u8 unk9[0x1F]; -// }; - -// struct EReaderTrainer -// { -// /*0x00, 0x498*/u8 filler_0[2]; -// /*0x02, 0x49A*/u16 unk2; -// /*0x04, 0x49C*/u8 filler_4[0x30]; -// /*0x34, 0x4CC*/struct EReaderTrainerPokemon party[3]; -// /*0xB8, 0x550*/u32 unkB8; -// }; - -struct SaveBlock2_1 -{ - u32 filler_0[0x29]; -}; - struct BattleTowerTrainer { u8 trainerClass; -- cgit v1.2.3 From 67ea254871134d850e013ee72bd4275b40e8091b Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 3 Nov 2017 19:09:40 -0400 Subject: BG_CHAR_ADDR and BG_SCREEN_ADDR recast fixes --- include/global.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 29804a5a9..e0a1c6452 100644 --- a/include/global.h +++ b/include/global.h @@ -55,6 +55,24 @@ enum B_32 = 4 }; +// There are many quirks in the source code which have overarching behavioral differences from +// a number of other files. For example, diploma.c seems to declare rodata before each use while +// other files declare out of order and must be at the beginning. There are also a number of +// macros which differ from one file to the next due to the method of obtaining the result, such +// as these below. Because of this, there is a theory (Two Team Theory) that states that these +// programming projects had more than 1 "programming team" which utilized different macros for +// each of the files that were worked on. +#define T1_READ_8(ptr) ((ptr)[0]) +#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) // why do you use OR here but not for READ_32? +#define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24)) +#define T1_READ_PTR(ptr) (u8*) T1_READ_32(ptr) + +// T2_READ_8 is a duplicate to remain consistent with each group. +#define T2_READ_8(ptr) ((ptr)[0]) +#define T2_READ_16(ptr) ((ptr)[0] + ((ptr)[1] << 8)) // why do you use OR here but not for READ_32? +#define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) +#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) + enum { VERSION_SAPPHIRE = 1, -- cgit v1.2.3 From b4c6e0560a7b1310cc08b93ea04935d4fbb7c3de Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 4 Nov 2017 22:42:28 -0400 Subject: BAD_MEM macros to MEM_ALT --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index e0a1c6452..647f66bc8 100644 --- a/include/global.h +++ b/include/global.h @@ -63,13 +63,13 @@ enum // programming projects had more than 1 "programming team" which utilized different macros for // each of the files that were worked on. #define T1_READ_8(ptr) ((ptr)[0]) -#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) // why do you use OR here but not for READ_32? +#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) #define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24)) #define T1_READ_PTR(ptr) (u8*) T1_READ_32(ptr) // T2_READ_8 is a duplicate to remain consistent with each group. #define T2_READ_8(ptr) ((ptr)[0]) -#define T2_READ_16(ptr) ((ptr)[0] + ((ptr)[1] << 8)) // why do you use OR here but not for READ_32? +#define T2_READ_16(ptr) ((ptr)[0] + ((ptr)[1] << 8)) #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) -- cgit v1.2.3