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 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 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