From 90eec979c948c480772549f6ec05a76b4f4cb605 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 12 Dec 2017 20:07:09 -0600 Subject: fail at decompiling sub_80ABCDC --- include/contest.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 983f9bc6a..06c356c2f 100644 --- a/include/contest.h +++ b/include/contest.h @@ -1,6 +1,21 @@ #ifndef GUARD_CONTEST_H #define GUARD_CONTEST_H +struct ContestMove +{ + u8 effect; + u8 contestCategory:3; + u8 comboStarterId; + u8 comboMoves[4]; +}; + +struct ContestEffect +{ + u8 effectType; + u8 appeal; + u8 jam; +}; + struct ContestPokemon { /* 0x00 */ u16 species; -- cgit v1.2.3 From 35f79afbf39df0bbec528de97c7752f6757f5755 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 16 Dec 2017 21:15:44 -0600 Subject: decompile sub_80AD8DC - sub_80AE098 --- include/contest.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 06c356c2f..0203f7dd0 100644 --- a/include/contest.h +++ b/include/contest.h @@ -18,22 +18,25 @@ struct ContestEffect struct ContestPokemon { - /* 0x00 */ u16 species; - /* 0x02 */ u8 nickname[POKEMON_NAME_LENGTH]; - /* 0x0D */ u8 trainerName[8]; - /* 0x15 */ u8 unk15; - /* 0x16 */ u8 unk16; - /* 0x17 */ u8 filler17[7]; - /* 0x1E */ u16 moves[4]; // moves - /* 0x26 */ u8 cool; // cool - /* 0x27 */ u8 beauty; // beauty - /* 0x28 */ u8 cute; // cute - /* 0x29 */ u8 smart; // smart - /* 0x2A */ u8 tough; // tough - /* 0x2B */ u8 sheen; // sheen - /* 0x2C */ u8 filler2C[12]; - /* 0x38 */ u32 unk38; - /* 0x3C */ u32 unk3C; + /*0x00*/ u16 species; + /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; + /*0x0D*/ u8 trainerName[8]; + /*0x15*/ u8 unk15; + /*0x16*/ u8 unk16; + /*0x17*/ u8 filler17; + /*0x18*/ u32 unk18; + /*0x1C*/ u8 filler1C[2]; + /*0x1E*/ u16 moves[4]; // moves + /*0x26*/ u8 cool; // cool + /*0x27*/ u8 beauty; // beauty + /*0x28*/ u8 cute; // cute + /*0x29*/ u8 smart; // smart + /*0x2A*/ u8 tough; // tough + /*0x2B*/ u8 sheen; // sheen + /*0x2C*/ u8 unk2C; + /*0x2D*/ u8 unk2D[11]; + /*0x38*/ u32 personality; // personality + /*0x3C*/ u32 otId; // otId }; // wow extern struct ContestPokemon gContestMons[]; -- cgit v1.2.3 From 688ae64548d743a0f7bbed29511903c1695cb8b6 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 17 Dec 2017 16:15:30 -0600 Subject: decompile sub_80AE398 - sub_80AE9FC --- include/contest.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 0203f7dd0..414723391 100644 --- a/include/contest.h +++ b/include/contest.h @@ -21,11 +21,18 @@ struct ContestPokemon /*0x00*/ u16 species; /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; /*0x0D*/ u8 trainerName[8]; - /*0x15*/ u8 unk15; + /*0x15*/ u8 trainerGfxId; /*0x16*/ u8 unk16; /*0x17*/ u8 filler17; - /*0x18*/ u32 unk18; - /*0x1C*/ u8 filler1C[2]; + /*0x18*/ u32 flags; + /*0x1C*/ u8 unk1C_0:2; + u8 unk1C_2:1; + u8 unk1C_3:1; + u8 unk1C_4:1; + u8 unk1C_5:1; + u8 unk1C_6:1; + u8 unk1C_7:1; + u8 filler1D; /*0x1E*/ u16 moves[4]; // moves /*0x26*/ u8 cool; // cool /*0x27*/ u8 beauty; // beauty @@ -46,9 +53,9 @@ void sub_80AB47C(void); void sub_80AE098(u8); void sub_80AE398(u8, u8); u8 sub_80AE47C(struct Pokemon *party); -u32 sub_80AE770(u8, u8); +u16 sub_80AE770(u8, u8); void sub_80AE82C(u8); -u8 sub_80AEB1C(); +u8 sub_80AEB1C(u16); void sub_80AF668(void); void sub_80B0F28(u8); int sub_80B2A7C(u8); //Don't know return type size -- cgit v1.2.3 From 6415654584a586f48ede7e9e6f6de39b8c6ac9f0 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 17 Dec 2017 18:25:16 -0600 Subject: decompile sub_80AEB1C - sub_80AEFE8 --- include/contest.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 414723391..13786e006 100644 --- a/include/contest.h +++ b/include/contest.h @@ -47,6 +47,8 @@ struct ContestPokemon }; // wow extern struct ContestPokemon gContestMons[]; +extern struct ContestEffect gContestEffects[]; + void ResetLinkContestBoolean(void); void sub_80AB2AC(void); void sub_80AB47C(void); -- cgit v1.2.3 From 967cb5899f0d2f0b11569c2a19a694652628e438 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 17 Dec 2017 21:30:59 -0600 Subject: fix build --- include/contest.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 13786e006..fe161bac4 100644 --- a/include/contest.h +++ b/include/contest.h @@ -47,7 +47,9 @@ struct ContestPokemon }; // wow extern struct ContestPokemon gContestMons[]; -extern struct ContestEffect gContestEffects[]; +extern const struct ContestMove gContestMoves[]; +extern const struct ContestEffect gContestEffects[]; +extern const u8 *const gContestEffectStrings[]; void ResetLinkContestBoolean(void); void sub_80AB2AC(void); -- cgit v1.2.3 From cb4bb3fbd53b92efebaa27a0cdf4f763d58a9488 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 21 Dec 2017 18:32:44 -0600 Subject: decompile sub_80B1118 - sub_80B1EA8 --- include/contest.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index fe161bac4..9f8c263a4 100644 --- a/include/contest.h +++ b/include/contest.h @@ -1,6 +1,15 @@ #ifndef GUARD_CONTEST_H #define GUARD_CONTEST_H +enum +{ + CONTEST_CATEGORY_COOL, + CONTEST_CATEGORY_BEAUTY, + CONTEST_CATEGORY_CUTE, + CONTEST_CATEGORY_SMART, + CONTEST_CATEGORY_TOUGH, +}; + struct ContestMove { u8 effect; -- cgit v1.2.3 From 71d3e605290b2069d3571478a3736b04d658decb Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 00:22:48 -0600 Subject: save work --- include/contest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 9f8c263a4..55f39d002 100644 --- a/include/contest.h +++ b/include/contest.h @@ -71,7 +71,7 @@ void sub_80AE82C(u8); u8 sub_80AEB1C(u16); void sub_80AF668(void); void sub_80B0F28(u8); -int sub_80B2A7C(u8); //Don't know return type size +bool8 sub_80B2A7C(u8); u8 sub_80B2C4C(u8, u8); void sub_80B2D1C(void); -- cgit v1.2.3 From ce74d72c31a3ebda26adc6ae888700213f64b113 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 14:19:09 -0600 Subject: label and clean up some things in contest.c --- include/contest.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 55f39d002..e2b16ff1d 100644 --- a/include/contest.h +++ b/include/contest.h @@ -3,11 +3,23 @@ enum { - CONTEST_CATEGORY_COOL, - CONTEST_CATEGORY_BEAUTY, - CONTEST_CATEGORY_CUTE, - CONTEST_CATEGORY_SMART, - CONTEST_CATEGORY_TOUGH, + CONTEST_CATEGORY_COOL, + CONTEST_CATEGORY_BEAUTY, + CONTEST_CATEGORY_CUTE, + CONTEST_CATEGORY_SMART, + CONTEST_CATEGORY_TOUGH, +}; + +enum +{ + CONTEST_EFFECT_HIGHLY_APPEALING, + CONTEST_EFFECT_USER_MORE_STARTLED, + CONTEST_EFFECT_APPEAL_ONLY_ONCE, + CONTEST_EFFECT_REPEATABLE, + CONTEST_EFFECT_AVOID_STARTLE_ONCE, + CONTEST_EFFECT_AVOID_STARTLE, + CONTEST_EFFECT_AVOID_STARTLE_LITTLE, + //... }; struct ContestMove @@ -62,8 +74,8 @@ extern const u8 *const gContestEffectStrings[]; void ResetLinkContestBoolean(void); void sub_80AB2AC(void); -void sub_80AB47C(void); -void sub_80AE098(u8); +void CB2_StartContest(void); +void CreatePlayerContestMon(u8); void sub_80AE398(u8, u8); u8 sub_80AE47C(struct Pokemon *party); u16 sub_80AE770(u8, u8); @@ -73,6 +85,6 @@ void sub_80AF668(void); void sub_80B0F28(u8); bool8 sub_80B2A7C(u8); u8 sub_80B2C4C(u8, u8); -void sub_80B2D1C(void); +void Contest_ResetWinners(void); #endif // GUARD_CONTEST_H -- cgit v1.2.3 From 255f0d4ee4327c2eac59d55d5e50dccbb353370d Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 22 Dec 2017 17:42:05 -0600 Subject: clean up and label more of contest.c --- include/contest.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index e2b16ff1d..ae2767aef 100644 --- a/include/contest.h +++ b/include/contest.h @@ -39,13 +39,13 @@ struct ContestEffect struct ContestPokemon { - /*0x00*/ u16 species; - /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; - /*0x0D*/ u8 trainerName[8]; - /*0x15*/ u8 trainerGfxId; - /*0x16*/ u8 unk16; - /*0x17*/ u8 filler17; - /*0x18*/ u32 flags; + /*0x00*/ u16 species; + /*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; + /*0x0D*/ u8 trainerName[8]; + /*0x15*/ u8 trainerGfxId; + /*0x16*/ u8 unk16; + /*0x17*/ u8 filler17; + /*0x18*/ u32 flags; /*0x1C*/ u8 unk1C_0:2; u8 unk1C_2:1; u8 unk1C_3:1; @@ -54,17 +54,17 @@ struct ContestPokemon u8 unk1C_6:1; u8 unk1C_7:1; u8 filler1D; - /*0x1E*/ u16 moves[4]; // moves - /*0x26*/ u8 cool; // cool - /*0x27*/ u8 beauty; // beauty - /*0x28*/ u8 cute; // cute - /*0x29*/ u8 smart; // smart - /*0x2A*/ u8 tough; // tough - /*0x2B*/ u8 sheen; // sheen - /*0x2C*/ u8 unk2C; - /*0x2D*/ u8 unk2D[11]; - /*0x38*/ u32 personality; // personality - /*0x3C*/ u32 otId; // otId + /*0x1E*/ u16 moves[4]; // moves + /*0x26*/ u8 cool; // cool + /*0x27*/ u8 beauty; // beauty + /*0x28*/ u8 cute; // cute + /*0x29*/ u8 smart; // smart + /*0x2A*/ u8 tough; // tough + /*0x2B*/ u8 sheen; // sheen + /*0x2C*/ u8 unk2C; + /*0x2D*/ u8 unk2D[11]; + /*0x38*/ u32 personality; // personality + /*0x3C*/ u32 otId; // otId }; // wow extern struct ContestPokemon gContestMons[]; @@ -75,15 +75,15 @@ extern const u8 *const gContestEffectStrings[]; void ResetLinkContestBoolean(void); void sub_80AB2AC(void); void CB2_StartContest(void); -void CreatePlayerContestMon(u8); -void sub_80AE398(u8, u8); +void Contest_CreatePlayerMon(u8); +void Contest_InitAllPokemon(u8, u8); u8 sub_80AE47C(struct Pokemon *party); u16 sub_80AE770(u8, u8); void sub_80AE82C(u8); u8 sub_80AEB1C(u16); void sub_80AF668(void); void sub_80B0F28(u8); -bool8 sub_80B2A7C(u8); +bool8 Contest_SaveWinner(u8); u8 sub_80B2C4C(u8, u8); void Contest_ResetWinners(void); -- cgit v1.2.3 From 16e0d8089194a8d098da47c7a7b07fbc4dcc0292 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Wed, 27 Dec 2017 13:15:01 -0600 Subject: Port battle_anim changes from pokeemerald --- include/contest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index ae2767aef..10392c00e 100644 --- a/include/contest.h +++ b/include/contest.h @@ -73,14 +73,14 @@ extern const struct ContestEffect gContestEffects[]; extern const u8 *const gContestEffectStrings[]; void ResetLinkContestBoolean(void); -void sub_80AB2AC(void); +void LoadContestBgAfterMoveAnim(void); void CB2_StartContest(void); void Contest_CreatePlayerMon(u8); void Contest_InitAllPokemon(u8, u8); u8 sub_80AE47C(struct Pokemon *party); u16 sub_80AE770(u8, u8); void sub_80AE82C(u8); -u8 sub_80AEB1C(u16); +u8 IsSpeciesNotUnown(u16); void sub_80AF668(void); void sub_80B0F28(u8); bool8 Contest_SaveWinner(u8); -- cgit v1.2.3 From b3551bc2f328c286c6ecc45ea288665d46b44260 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 6 Jan 2018 12:27:27 -0600 Subject: fix some code and formatting anomalies --- include/contest.h | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 10392c00e..6e71358a2 100644 --- a/include/contest.h +++ b/include/contest.h @@ -87,4 +87,171 @@ bool8 Contest_SaveWinner(u8); u8 sub_80B2C4C(u8, u8); void Contest_ResetWinners(void); +// Contest Shared EWRAM + +struct Shared18000 +{ + /*0x18000*/ u8 unk18000; + /*0x18001*/ u8 filler18001[3]; + /*0x18004*/ u16 unk18004[16][16]; + /*0x18204*/ u16 unk18204[0x200]; + /*0x18604*/ u16 unk18604[0x200]; + /*0x18A04*/ u8 unk18A04[0x800]; +}; + +struct Contest +{ + /*0x19204*/ u8 playerMoveChoice; + /*0x19205*/ u8 turnNumber; + /*0x19206*/ u8 unk19206[4]; // seems to only be used by an unref function + /*0x1920A*/ u16 unk1920A_0:1; // Task active flags? + u16 unk1920A_1:1; + u16 unk1920A_2:1; + u16 unk1920A_3:1; + u16 unk1920A_4:1; + u16 unk1920A_5:1; + u16 unk1920A_6:1; + u16 unk1920A_7:1; + /*0x1920B*/ u16 unk1920B_0:1; + u16 unk1920B_1:1; + u16 unk1920B_2:1; + /*0x1920C*/ u8 mainTaskId; + /*0x1920D*/ u8 unk1920D[4]; + /*0x19211*/ u8 unk19211; + /*0x19212*/ u8 unk19212; + /*0x19213*/ u8 filler19213; + /*0x19214*/ u8 unk19214; + /*0x19215*/ u8 unk19215; + /*0x19216*/ u8 unk19216; // sprite ID + /*0x19217*/ s8 applauseLevel; + /*0x19218*/ u8 unk19218[4]; + /*0x1921C*/ u32 unk1921C; // saved RNG value? + u16 unk19220[5][4]; // move history? + u8 unk19248[5][4]; // excitement history + u8 applauseMeterSpriteId; // sprite ID + /*0x1925D*/ u8 unk1925D; + /*0x1925E*/ u8 unk1925E; +}; + +struct ContestantStatus +{ + s16 appeal1; // move appeal? + s16 appeal2; // final appeal after end of turn, maybe? + s16 unk4; + u16 currMove; + u16 prevMove; + u8 moveCategory; + u8 unkB_0:2; + u8 unkB_2:2; + u8 moveRepeatCount:3; + u8 unkB_7:1; // used a one-time move? + u8 unkC_0:1; + u8 unkC_1:2; + s8 unkD; + u8 unkE; + u8 unkF; + u8 unk10_0:1; + u8 unk10_1:1; + u8 unk10_2:1; + u8 unk10_3:1; + u8 unk10_4:2; + u8 unk10_6:2; + u8 unk11_0:2; + u8 unk11_2:1; + u8 unk11_3:1; + u8 unk11_4:1; + u8 unk11_5:1; + u8 unk12; + u8 unk13; // status action? + u8 unk14; + u8 disappointedRepeat:1; + u8 unk15_1:1; + u8 unk15_2:1; + u8 unk15_3:1; + u8 unk15_4:1; + u8 unk15_5:1; + u8 unk15_6:1; + u8 unk16; + u8 unk17; + u8 unk18; + u8 unk19; // turn position + u8 attentionLevel; // How much the Pokemon "stood out" + u8 unk1B; +}; + +struct UnknownContestStruct3 +{ + u8 unk0; + u8 unk1; + //u8 unk2_0:1; + //u8 unk2_1:1; + u8 unk2; // maybe a bitfield + u8 filler3; +}; + +// possibly the same as UnknownContestStruct3? +struct UnknownContestStruct4 +{ + u8 unk0; // sprite ID + u8 unk1; // sprite ID + u8 unk2_0:1; + u8 unk2_1:1; + u8 unk2_2:1; + u8 filler3; +}; + +struct UnknownContestStruct5 +{ + s8 bits_0; // current move excitement? + u8 bits_8:1; + u8 bits_9:3; + u8 bits_C:4; + s8 unk2; + u8 filler3; +}; + +struct UnknownContestStruct7 +{ + u8 unk0[4]; + u16 unk4; + u16 unk6; + u8 filler8[0xD-8]; + u8 unkD[4]; + u8 unk11; + u8 filler12[2]; +}; + +struct UnknownContestStruct8 +{ + u16 unk0; + u16 unk2; + u8 unk4_0:1; + u8 unk5; + u8 filler6[2]; + u32 unk8; + u32 unkC; + u32 unk10; +}; + +struct UnknownContestStruct6 +{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +}; + +#define shared15800 (gSharedMem + 0x15800) +#define shared15DE0 (*(struct ContestWinner *)(gSharedMem + 0x15DE0)) +#define shared16800 (gSharedMem + 0x16800) +#define shared18000 (*(struct Shared18000 *)(gSharedMem + 0x18000)) +#define shared18004 ((u16 *)(gSharedMem + 0x18004)) +#define sContest (*(struct Contest *)(gSharedMem + 0x19204)) +#define sContestantStatus ((struct ContestantStatus *)(gSharedMem + 0x19260)) +#define shared192D0 (*(struct UnknownContestStruct7 *)(gSharedMem + 0x192D0)) +#define shared192E4 (gSharedMem + 0x192E4) +#define shared19328 (*(struct UnknownContestStruct5 *)(gSharedMem + 0x19328)) +#define shared19338 ((struct UnknownContestStruct4 *)(gSharedMem + 0x19338)) +#define shared19348 (*(struct UnknownContestStruct8 *)(gSharedMem + 0x19348)) + #endif // GUARD_CONTEST_H -- cgit v1.2.3