From e7e1938094081ba2e20232caca0239cb2290251f Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 16:17:23 -0400 Subject: Start decompilation of lilycove_lady --- include/global.h | 35 ++++++++++++++++++++++++++++++++++- include/vars.h | 2 ++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index e694a5974..764eff563 100644 --- a/include/global.h +++ b/include/global.h @@ -655,6 +655,39 @@ struct DaycareData #define FLAGS_COUNT 300 #define VARS_COUNT 256 +enum { + LILYCOVE_LADY_QUIZ, + LILYCOVE_LADY_FAVOUR, + LILYCOVE_LADY_CONTEST +}; + +typedef union // TODO +{ + struct + { + /*0x000*/ u8 id; + /*0x001*/ u8 language; + } quiz; + + struct + { + /*0x000*/ u8 id; + } flavor; + + struct + { + /*0x000*/ u8 id; + /*0x001*/ u8 filler_001[12]; + /*0x00d*/ u8 category; // maybe? + } contest; + + struct + { + /*0x000*/ u8 id; + /*0x001*/ u8 filler_001[535]; + } common; +} LilycoveLady; + struct SaveBlock1 { /*0x00*/ struct Coords16 pos; @@ -738,7 +771,7 @@ struct SaveBlock1 /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; - /*0x3B58*/ u8 lilycoveLady[536]; // TODO: convert to a union + /*0x3B58*/ LilycoveLady lilycoveLady; // TODO: convert to a union /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; diff --git a/include/vars.h b/include/vars.h index 5da960640..7c0edeb77 100644 --- a/include/vars.h +++ b/include/vars.h @@ -12,6 +12,8 @@ #define VAR_0x4008 0x4008 #define VAR_0x4009 0x4009 #define VAR_0x400A 0x400A +#define VAR_0x4010 0x4010 +#define VAR_0x4011 0x4011 #define VAR_0x401F 0x401F #define VAR_RECYCLE_GOODS 0x4020 #define VAR_REPEL_STEP_COUNT 0x4021 -- cgit v1.2.3 From b26eb6713bb866f1173b4c7192ce231d894d19ea Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 16:32:33 -0400 Subject: sub_818DB20 --- include/global.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 764eff563..92435ce28 100644 --- a/include/global.h +++ b/include/global.h @@ -672,7 +672,11 @@ typedef union // TODO struct { /*0x000*/ u8 id; - } flavor; + /*0x001*/ u8 filler_001[11]; + /*0x00c*/ u8 unk_00c; + /*0x00d*/ u8 filler_00d[3]; + /*0x010*/ u16 unk_010; + } favour; struct { -- cgit v1.2.3 From 4e8a2c6934c4f8a44ed8d350fe96996beda21d0e Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 16:55:53 -0400 Subject: SetLilycoveFavourLady --- include/global.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 92435ce28..0fc860e68 100644 --- a/include/global.h +++ b/include/global.h @@ -672,10 +672,16 @@ typedef union // TODO struct { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[11]; + /*0x001*/ u8 unk_001; + /*0x002*/ u8 unk_002; + /*0x003*/ u8 unk_003; + /*0x004*/ u8 unk_004; + /*0x005*/ u8 filler_005[7]; /*0x00c*/ u8 unk_00c; - /*0x00d*/ u8 filler_00d[3]; + /*0x00d*/ u8 filler_00d; + /*0x00e*/ u16 unk_00e; /*0x010*/ u16 unk_010; + /*0x012*/ u8 language; } favour; struct -- cgit v1.2.3 From 3b3423d1a751134ff7941b41bad72e0e75314647 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 17:07:36 -0400 Subject: sub_818DC60 --- include/global.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 0fc860e68..42629cf48 100644 --- a/include/global.h +++ b/include/global.h @@ -675,8 +675,7 @@ typedef union // TODO /*0x001*/ u8 unk_001; /*0x002*/ u8 unk_002; /*0x003*/ u8 unk_003; - /*0x004*/ u8 unk_004; - /*0x005*/ u8 filler_005[7]; + /*0x004*/ u8 unk_004[8]; /*0x00c*/ u8 unk_00c; /*0x00d*/ u8 filler_00d; /*0x00e*/ u16 unk_00e; -- cgit v1.2.3 From 316f9f4d83d118437c266526cc0e6da1dfc90461 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 21:28:01 -0400 Subject: through sub_818DD14 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 64ed869ef..8c2122b39 100644 --- a/include/global.h +++ b/include/global.h @@ -684,7 +684,7 @@ typedef union // TODO /*0x004*/ u8 unk_004[8]; /*0x00c*/ u8 unk_00c; /*0x00d*/ u8 filler_00d; - /*0x00e*/ u16 unk_00e; + /*0x00e*/ u16 itemId; /*0x010*/ u16 unk_010; /*0x012*/ u8 language; } favour; -- cgit v1.2.3 From 534dd2c4b0259f87657b2e8795d96217e8bf12cc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 21:47:15 -0400 Subject: sub_818DD84 --- include/item_menu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 include/item_menu.h (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h new file mode 100644 index 000000000..f402f5cdd --- /dev/null +++ b/include/item_menu.h @@ -0,0 +1,11 @@ +#ifndef GUARD_item_menu_H +#define GUARD_item_menu_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void sub_81AAC50(void); + +#endif //GUARD_item_menu_H -- cgit v1.2.3 From 73ee165ef6b05417dc42be721e625712c6538ed6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 22:25:31 -0400 Subject: sub_818DF00 --- include/global.h | 66 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 8c2122b39..42fe0cfbb 100644 --- a/include/global.h +++ b/include/global.h @@ -667,39 +667,51 @@ enum { LILYCOVE_LADY_CONTEST }; -typedef union // TODO +struct LilycoveLadyQuiz { - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 language; - } quiz; + /*0x000*/ u8 id; + /*0x001*/ u8 language; + /*0x002*/ u16 unk_002[9]; + /*0x014*/ u16 unk_014; + /*0x016*/ u8 filler_016[2]; + /*0x018*/ u8 unk_018; + /*0x019*/ u8 filler_019[15]; + /*0x028*/ u16 unk_028; + /*0x02a*/ u8 filler_02a; + /*0x02b*/ u8 unk_02b; +}; - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 unk_001; - /*0x002*/ u8 unk_002; - /*0x003*/ u8 unk_003; - /*0x004*/ u8 unk_004[8]; - /*0x00c*/ u8 unk_00c; - /*0x00d*/ u8 filler_00d; - /*0x00e*/ u16 itemId; - /*0x010*/ u16 unk_010; - /*0x012*/ u8 language; - } favour; +struct LilycoveLadyFavour +{ + /*0x000*/ u8 id; + /*0x001*/ u8 unk_001; + /*0x002*/ u8 unk_002; + /*0x003*/ u8 unk_003; + /*0x004*/ u8 unk_004[8]; + /*0x00c*/ u8 unk_00c; + /*0x00d*/ u8 filler_00d; + /*0x00e*/ u16 itemId; + /*0x010*/ u16 unk_010; + /*0x012*/ u8 language; +}; - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[12]; - /*0x00d*/ u8 category; // maybe? - } contest; +struct LilycoveLadyContest +{ + /*0x000*/ u8 id; + /*0x001*/ u8 filler_001[12]; + /*0x00d*/ u8 category; // maybe? +}; + +typedef union // TODO +{ + struct LilycoveLadyQuiz quiz; + struct LilycoveLadyFavour favour; + struct LilycoveLadyContest contest; struct { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[535]; + /*0x001*/ u8 filler_001[0x207]; } common; } LilycoveLady; @@ -786,7 +798,7 @@ struct SaveBlock1 /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; - /*0x3B58*/ LilycoveLady lilycoveLady; // TODO: convert to a union + /*0x3B58*/ LilycoveLady lilycoveLady; /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; -- cgit v1.2.3 From 28d0fa33fef825dcb22d45db966ef814c461dd08 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 22:35:40 -0400 Subject: SetLilicoveQuizLady --- include/global.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 42fe0cfbb..84c70a16e 100644 --- a/include/global.h +++ b/include/global.h @@ -670,15 +670,18 @@ enum { struct LilycoveLadyQuiz { /*0x000*/ u8 id; - /*0x001*/ u8 language; + /*0x001*/ u8 unk_001; /*0x002*/ u16 unk_002[9]; /*0x014*/ u16 unk_014; - /*0x016*/ u8 filler_016[2]; + /*0x016*/ u16 unk_016; /*0x018*/ u8 unk_018; - /*0x019*/ u8 filler_019[15]; + /*0x019*/ u8 filler_019[7]; + /*0x020*/ u16 unk_020[4]; /*0x028*/ u16 unk_028; - /*0x02a*/ u8 filler_02a; + /*0x02a*/ u8 unk_02a; /*0x02b*/ u8 unk_02b; + /*0x02c*/ u8 unk_02c; + /*0x02d*/ u8 language; }; struct LilycoveLadyFavour -- cgit v1.2.3 From 0b81c2920aa87aae3403efdf60e40b58445efbbf Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 10:45:00 -0400 Subject: sub_818E1F4 --- include/global.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 84c70a16e..569345355 100644 --- a/include/global.h +++ b/include/global.h @@ -674,9 +674,8 @@ struct LilycoveLadyQuiz /*0x002*/ u16 unk_002[9]; /*0x014*/ u16 unk_014; /*0x016*/ u16 unk_016; - /*0x018*/ u8 unk_018; - /*0x019*/ u8 filler_019[7]; - /*0x020*/ u16 unk_020[4]; + /*0x018*/ u8 playerName[8]; + /*0x020*/ u16 playerTrainerId[4]; /*0x028*/ u16 unk_028; /*0x02a*/ u8 unk_02a; /*0x02b*/ u8 unk_02b; @@ -690,9 +689,8 @@ struct LilycoveLadyFavour /*0x001*/ u8 unk_001; /*0x002*/ u8 unk_002; /*0x003*/ u8 unk_003; - /*0x004*/ u8 unk_004[8]; + /*0x004*/ u8 playerName[8]; /*0x00c*/ u8 unk_00c; - /*0x00d*/ u8 filler_00d; /*0x00e*/ u16 itemId; /*0x010*/ u16 unk_010; /*0x012*/ u8 language; -- cgit v1.2.3 From 8a31e58689af6e62c8c272c24397310c2a44f6f5 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 11:30:09 -0400 Subject: sub_818E298 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 569345355..09dabf822 100644 --- a/include/global.h +++ b/include/global.h @@ -676,7 +676,7 @@ struct LilycoveLadyQuiz /*0x016*/ u16 unk_016; /*0x018*/ u8 playerName[8]; /*0x020*/ u16 playerTrainerId[4]; - /*0x028*/ u16 unk_028; + /*0x028*/ u16 itemId; /*0x02a*/ u8 unk_02a; /*0x02b*/ u8 unk_02b; /*0x02c*/ u8 unk_02c; -- cgit v1.2.3 From 213fef604247d31f6981bd83c703bb1d3e1bbd31 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 11:44:20 -0400 Subject: through sub_818E308 --- include/easy_chat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/easy_chat.h b/include/easy_chat.h index 5143aa39c..d7dc72410 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -29,5 +29,7 @@ enum }; void InitEasyChatPhrases(void); +void easy_chat_input_maybe(void); +void CopyEasyChatWord(u8 *, u16); #endif // GUARD_EASYCHAT_H -- cgit v1.2.3 From fdea92edffb4360db50cb0e7dcc044dc7242defe Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 11:48:11 -0400 Subject: through sub_818E3E0 --- include/item_menu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h index f402f5cdd..85655e9d5 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -7,5 +7,6 @@ // Exported ROM declarations void sub_81AAC50(void); +void sub_81AAC70(void); #endif //GUARD_item_menu_H -- cgit v1.2.3 From d22a9acc63b9f7c72e0d7ec81396b799af94e270 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 16:12:18 -0400 Subject: through sub_818E490 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 09dabf822..6fa8cb92d 100644 --- a/include/global.h +++ b/include/global.h @@ -712,7 +712,7 @@ typedef union // TODO struct { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[0x207]; + /*0x001*/ u8 filler_001[0x217]; } common; } LilycoveLady; -- cgit v1.2.3 From 7c8cbc6b88d745da215fc45730f84b598869438f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 16:49:22 -0400 Subject: SetLilycoveContestLady --- include/global.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 6fa8cb92d..fa7856786 100644 --- a/include/global.h +++ b/include/global.h @@ -670,7 +670,7 @@ enum { struct LilycoveLadyQuiz { /*0x000*/ u8 id; - /*0x001*/ u8 unk_001; + /*0x001*/ u8 phase; /*0x002*/ u16 unk_002[9]; /*0x014*/ u16 unk_014; /*0x016*/ u16 unk_016; @@ -686,7 +686,7 @@ struct LilycoveLadyQuiz struct LilycoveLadyFavour { /*0x000*/ u8 id; - /*0x001*/ u8 unk_001; + /*0x001*/ u8 phase; /*0x002*/ u8 unk_002; /*0x003*/ u8 unk_003; /*0x004*/ u8 playerName[8]; @@ -699,8 +699,13 @@ struct LilycoveLadyFavour struct LilycoveLadyContest { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[12]; - /*0x00d*/ u8 category; // maybe? + /*0x001*/ u8 phase; + /*0x002*/ u8 fave_pkblk; + /*0x003*/ u8 other_pkblk; + /*0x004*/ u8 playerName[8]; + /*0x00c*/ u8 max_sheen; + /*0x00d*/ u8 category; + /*0x00e*/ u8 language; }; typedef union // TODO @@ -708,12 +713,7 @@ typedef union // TODO struct LilycoveLadyQuiz quiz; struct LilycoveLadyFavour favour; struct LilycoveLadyContest contest; - - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[0x217]; - } common; + u8 id; } LilycoveLady; struct SaveBlock1 @@ -800,6 +800,7 @@ struct SaveBlock1 /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; /*0x3B58*/ LilycoveLady lilycoveLady; + /*0x3B88*/ u8 filler_3B88[0x1E8]; /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; -- cgit v1.2.3 From d263750f1903a89fc61b2496453ff1c5b4b9a58b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 20:48:32 -0400 Subject: remaining lilycove lady functions --- include/rom4.h | 1 + include/rom6.h | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 include/rom6.h (limited to 'include') diff --git a/include/rom4.h b/include/rom4.h index a1c4281e9..e19d277a6 100644 --- a/include/rom4.h +++ b/include/rom4.h @@ -28,5 +28,6 @@ void strange_npc_table_clear(void); const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8); void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *); void sub_8086230(void); +void c2_exit_to_overworld_2_switch(void); #endif //GUARD_ROM4_H diff --git a/include/rom6.h b/include/rom6.h new file mode 100644 index 000000000..15070616d --- /dev/null +++ b/include/rom6.h @@ -0,0 +1,6 @@ +#ifndef GUARD_ROM6_H +#define GUARD_ROM6_H + +void sub_81357FC(u8, void(void)); + +#endif //GUARD_ROM6_H -- cgit v1.2.3 From 942fbe87d42ed1208217deac3cfa4f21908d446a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 21:03:57 -0400 Subject: Populate header, label as static whatever won't break things --- include/easy_chat.h | 1 + include/lilycove_lady.h | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/easy_chat.h b/include/easy_chat.h index d7dc72410..fc44b6a8a 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -31,5 +31,6 @@ enum void InitEasyChatPhrases(void); void easy_chat_input_maybe(void); void CopyEasyChatWord(u8 *, u16); +bool32 sub_811F8D8(u16); #endif // GUARD_EASYCHAT_H diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h index 81825d8ac..c7776131b 100644 --- a/include/lilycove_lady.h +++ b/include/lilycove_lady.h @@ -1,6 +1,17 @@ #ifndef GUARD_LILYCOVE_LADY_H #define GUARD_LILYCOVE_LADY_H +u8 GetLilycoveLadyId(void); void SetLilycoveLady(void); +void sub_818DA78(void); +void sub_818DEF4(void); +void sub_818E564(void); +void sub_818E570(const struct LilycoveLadyQuiz *quiz); +bool8 sub_818E704(struct Pokeblock *pokeblock); +void sub_818E7E0(u8 *dest1, u8 *dest2); +void sub_818E81C(u8 *dest); +void sub_818E848(u8 *dest); +void sub_818E868(u8 *dest, u8 category); +u8 sub_818E880(void); #endif //GUARD_LILYCOVE_LADY_H -- cgit v1.2.3