From e84da39d8ad7228e731a55b2d6eaf58aa8acc96f Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Tue, 8 Sep 2020 16:44:04 -0400 Subject: Match BattleIntroOpponent1SendsOutMonAnimation --- src/menu_specialized.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/menu_specialized.c') diff --git a/src/menu_specialized.c b/src/menu_specialized.c index d402ecb51..f9da20e11 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -250,7 +250,7 @@ void sub_81D1D04(u8 a0) sUnknown_0203CF48[a0] = 0xFF; } -static u8 sub_81D1D34(u8 a0) +static u8 sub_81D1D34(u8 a0) // unused { return sUnknown_0203CF48[a0]; } -- cgit v1.2.3 From 7dc95a0103af08c95c9093b6efa6c77af77a2538 Mon Sep 17 00:00:00 2001 From: aaaaaa123456789 Date: Sun, 13 Sep 2020 04:22:50 -0300 Subject: Undo PokeCodec's PRs This commit undoes most of PokeCodec's PRs after the debate in chat. Some harmless or completely superseded PRs have been left alone, as there is not much benefit in attempting to undo them. Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136, #1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179, #1180, #1181, #1182 and #1183. --- src/menu_specialized.c | 121 +++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 59 deletions(-) (limited to 'src/menu_specialized.c') diff --git a/src/menu_specialized.c b/src/menu_specialized.c index f9da20e11..a99c5c9d0 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -250,7 +250,7 @@ void sub_81D1D04(u8 a0) sUnknown_0203CF48[a0] = 0xFF; } -static u8 sub_81D1D34(u8 a0) // unused +static u8 sub_81D1D34(u8 a0) { return sUnknown_0203CF48[a0]; } @@ -894,73 +894,76 @@ static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) { return StringCopyPadded(dst, gText_EggNickname, 0, 12); } - GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, dst); - StringGetEnd10(dst); - species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); - if (boxId == TOTAL_BOXES_COUNT) // Party mon. - { - level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); - gender = GetMonGender(&gPlayerParty[monId]); - } else { - // Needed to match, feel free to remove. - boxId++, boxId--; - monId++, monId--; - - boxMon = GetBoxedMonPtr(boxId, monId); - gender = GetBoxMonGender(boxMon); - level = GetLevelFromBoxMonExp(boxMon); - } + GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, dst); + StringGetEnd10(dst); + species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); + if (boxId == TOTAL_BOXES_COUNT) // Party mon. + { + level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); + gender = GetMonGender(&gPlayerParty[monId]); + } + else + { + // Needed to match, feel free to remove. + boxId++;boxId--; + monId++;monId--; - if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(dst, gSpeciesNames[species])) - gender = MON_GENDERLESS; + boxMon = GetBoxedMonPtr(boxId, monId); + gender = GetBoxMonGender(boxMon); + level = GetLevelFromBoxMonExp(boxMon); + } - for (str = dst; *str != EOS; str++) - ; + if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(dst, gSpeciesNames[species])) + gender = MON_GENDERLESS; - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_SKIP; - *(str++) = 60; + for (str = dst; *str != EOS; str++) + ; - switch (gender) - { - default: - *(str++) = CHAR_SPACE; - break; - case MON_MALE: - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_COLOR; - *(str++) = TEXT_COLOR_RED; *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_SHADOW; - *(str++) = TEXT_COLOR_LIGHT_RED; - *(str++) = CHAR_MALE; - break; - case MON_FEMALE: - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_COLOR; - *(str++) = TEXT_COLOR_GREEN; + *(str++) = EXT_CTRL_CODE_SKIP; + *(str++) = 60; + + switch (gender) + { + default: + *(str++) = CHAR_SPACE; + break; + case MON_MALE: + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_COLOR; + *(str++) = TEXT_COLOR_RED; + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_SHADOW; + *(str++) = TEXT_COLOR_LIGHT_RED; + *(str++) = CHAR_MALE; + break; + case MON_FEMALE: + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_COLOR; + *(str++) = TEXT_COLOR_GREEN; + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_SHADOW; + *(str++) = TEXT_COLOR_LIGHT_GREEN; + *(str++) = CHAR_FEMALE; + break; + } + *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_SHADOW; - *(str++) = TEXT_COLOR_LIGHT_GREEN; - *(str++) = CHAR_FEMALE; - break; - } + *(str++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; + *(str++) = TEXT_COLOR_BLUE; + *(str++) = TEXT_COLOR_TRANSPARENT; + *(str++) = TEXT_COLOR_LIGHT_BLUE; + *(str++) = CHAR_SLASH; + *(str++) = CHAR_EXTRA_SYMBOL; + *(str++) = CHAR_LV_2; + str = ConvertIntToDecimalStringN(str, level, STR_CONV_MODE_LEFT_ALIGN, 3); + *(str++) = CHAR_SPACE; + *str = EOS; - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; - *(str++) = TEXT_COLOR_BLUE; - *(str++) = TEXT_COLOR_TRANSPARENT; - *(str++) = TEXT_COLOR_LIGHT_BLUE; - *(str++) = CHAR_SLASH; - *(str++) = CHAR_EXTRA_SYMBOL; - *(str++) = CHAR_LV_2; - str = ConvertIntToDecimalStringN(str, level, STR_CONV_MODE_LEFT_ALIGN, 3); - *(str++) = CHAR_SPACE; - *str = EOS; - - return str; + return str; + } } // Buffers the string in src to dest up to n chars. If src is less than n chars, fill with spaces -- cgit v1.2.3 From 94711208a2088ec739f04a6bd78a983a76e7ec2e Mon Sep 17 00:00:00 2001 From: Kaz Date: Sat, 19 Sep 2020 17:38:54 -0400 Subject: menu_specialized.c: Fix fakematches. --- src/menu_specialized.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'src/menu_specialized.c') diff --git a/src/menu_specialized.c b/src/menu_specialized.c index f9da20e11..495f9aa10 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -881,34 +881,31 @@ s32 GetBoxOrPartyMonData(u16 boxId, u16 monId, s32 request, u8 *dst) // Gets the name/gender/level string for the condition menu static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) { - u16 species, level, gender; + u16 box, mon, species, level, gender; struct BoxPokemon *boxMon; u8 *str; + box = boxId; + mon = monId; *(dst++) = EXT_CTRL_CODE_BEGIN; *(dst++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; *(dst++) = TEXT_COLOR_BLUE; *(dst++) = TEXT_COLOR_TRANSPARENT; *(dst++) = TEXT_COLOR_LIGHT_BLUE; - if (GetBoxOrPartyMonData(boxId, monId, MON_DATA_IS_EGG, NULL)) - { + if (GetBoxOrPartyMonData(box, mon, MON_DATA_IS_EGG, NULL)) return StringCopyPadded(dst, gText_EggNickname, 0, 12); - } - GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, dst); + GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst); StringGetEnd10(dst); - species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); - if (boxId == TOTAL_BOXES_COUNT) // Party mon. + species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL); + if (box == TOTAL_BOXES_COUNT) // Party mon. { - level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); - gender = GetMonGender(&gPlayerParty[monId]); + level = GetMonData(&gPlayerParty[mon], MON_DATA_LEVEL); + gender = GetMonGender(&gPlayerParty[mon]); } else { - // Needed to match, feel free to remove. - boxId++, boxId--; - monId++, monId--; + boxMon = GetBoxedMonPtr(box, mon); - boxMon = GetBoxedMonPtr(boxId, monId); gender = GetBoxMonGender(boxMon); level = GetLevelFromBoxMonExp(boxMon); } @@ -981,6 +978,8 @@ static u8 *BufferConditionMenuSpacedStringN(u8 *dst, const u8 *src, s16 n) void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId, u16 monId, u16 partyId, u16 numMons, bool8 excludesCancel) { u16 i; + u16 box = boxId; + u16 mon = monId; // In this and the below 2 functions, numMons is passed as the number of menu selections (which includes Cancel) // To indicate that the Cancel needs to be subtracted they pass an additional bool @@ -990,21 +989,16 @@ void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId if (partyId != numMons) { - GetConditionMenuMonString(nameDst, boxId, monId); + GetConditionMenuMonString(nameDst, box, mon); locationDst[0] = EXT_CTRL_CODE_BEGIN; locationDst[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; locationDst[2] = TEXT_COLOR_BLUE; locationDst[3] = TEXT_COLOR_TRANSPARENT; locationDst[4] = TEXT_COLOR_LIGHT_BLUE; - if (boxId == TOTAL_BOXES_COUNT) // Party mon. - { + if (box == TOTAL_BOXES_COUNT) // Party mon. BufferConditionMenuSpacedStringN(&locationDst[5], gText_InParty, 8); - } else - { - boxId++;boxId--; // Again...Someone fix this maybe? - BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(boxId), 8); - } + BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(box), 8); } else { -- cgit v1.2.3 From 52598983250fd8ad7b66ff2b9d77046859f169c8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 1 Oct 2020 17:20:38 -0400 Subject: Replace POKEMON_SLOTS_NUMBER --- src/menu_specialized.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/menu_specialized.c') diff --git a/src/menu_specialized.c b/src/menu_specialized.c index f9da20e11..327dcefc4 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -25,7 +25,6 @@ #include "window.h" #include "constants/berry.h" #include "constants/songs.h" -#include "constants/species.h" #include "gba/io_reg.h" extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -- cgit v1.2.3 From 2b2be90a5266e294342e1759dddfe8af4d6f39f2 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 10 Oct 2020 16:17:34 -0600 Subject: start pokenav documentation --- src/menu_specialized.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/menu_specialized.c') diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 327dcefc4..0745ac6d5 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -319,7 +319,7 @@ void sub_81D1EC0(void) Free(sUnknown_0203CF4C); } -void sub_81D1ED4(struct ConditionGraph *a0) +void InitConditionGraphData(struct ConditionGraph *graph) { u8 i, j; @@ -327,22 +327,22 @@ void sub_81D1ED4(struct ConditionGraph *a0) { for (i = 0; i < 10; i++) { - a0->unk64[i][j].unk0 = 0; - a0->unk64[i][j].unk2 = 0; + graph->unk64[i][j].unk0 = 0; + graph->unk64[i][j].unk2 = 0; } for (i = 0; i < 4; i++) { - a0->unk0[i][j] = 0; - a0->unk14[i][j].unk0 = 0x9B; - a0->unk14[i][j].unk2 = 0x5B; + graph->stat[i][j] = 0; + graph->unk14[i][j].unk0 = 155; + graph->unk14[i][j].unk2 = 91; } - a0->unk12C[j].unk0 = 0; - a0->unk12C[j].unk2 = 0; + graph->unk12C[j].unk0 = 0; + graph->unk12C[j].unk2 = 0; } - a0->unk354 = 0; - a0->unk352 = 0; + graph->unk354 = 0; + graph->unk352 = 0; } void sub_81D1F84(struct ConditionGraph *graph, struct UnknownSubStruct_81D1ED4 *arg1, struct UnknownSubStruct_81D1ED4 *arg2) @@ -350,7 +350,7 @@ void sub_81D1F84(struct ConditionGraph *graph, struct UnknownSubStruct_81D1ED4 * u16 i, j; s32 r5, r6; - for (i = 0; i < 5; i++) + for (i = 0; i < FLAVOR_COUNT; i++) { r5 = arg1[i].unk0 << 8; r6 = ((arg2[i].unk0 - arg1[i].unk0) << 8) / 10; @@ -387,25 +387,25 @@ bool32 TransitionConditionGraph(struct ConditionGraph *graph) } } -void sub_81D20AC(struct ConditionGraph *a0) +void InitConditionGraphState(struct ConditionGraph *graph) { - a0->unk355 = 0; + graph->state = 0; } -bool8 sub_81D20BC(struct ConditionGraph *graph) +bool8 SetupConditionGraphScanlineParams(struct ConditionGraph *graph) { struct ScanlineEffectParams params; - switch (graph->unk355) + switch (graph->state) { case 0: ScanlineEffect_Clear(); - graph->unk355++; + graph->state++; return TRUE; case 1: params = sConditionGraphScanline; ScanlineEffect_SetParams(params); - graph->unk355++; + graph->state++; return FALSE; default: return FALSE; @@ -431,7 +431,7 @@ void sub_81D2108(struct ConditionGraph *graph) graph->unk354 = 0; } -void sub_81D21DC(u8 bg) +void SetConditionGraphIOWindows(u8 bg) { u32 flags; @@ -1025,23 +1025,23 @@ void GetConditionMenuMonConditions(struct ConditionGraph *graph, u8 *sheen, u16 if (partyId != numMons) { - graph->unk0[id][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL); - graph->unk0[id][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL); - graph->unk0[id][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL); - graph->unk0[id][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL); - graph->unk0[id][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL); + graph->stat[id][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL); + graph->stat[id][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL); + graph->stat[id][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL); + graph->stat[id][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL); + graph->stat[id][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL); sheen[id] = (GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) != 0xFF) ? GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) / 29u : 9; - sub_81D2754(graph->unk0[id], graph->unk14[id]); + sub_81D2754(graph->stat[id], graph->unk14[id]); } else { for (i = 0; i < FLAVOR_COUNT; i++) { - graph->unk0[id][i] = 0; + graph->stat[id][i] = 0; graph->unk14[id][i].unk0 = 155; graph->unk14[id][i].unk2 = 91; } -- cgit v1.2.3 From 266a23b32712f6a81bc8ffeeb4dac145894747ad Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 14 Dec 2020 21:44:25 -0500 Subject: fix indentation --- src/menu_specialized.c | 87 +++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 44 deletions(-) (limited to 'src/menu_specialized.c') diff --git a/src/menu_specialized.c b/src/menu_specialized.c index c1088d9f7..7de963893 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -903,60 +903,59 @@ static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) } else { - boxMon = GetBoxedMonPtr(box, mon); gender = GetBoxMonGender(boxMon); level = GetLevelFromBoxMonExp(boxMon); } - if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(dst, gSpeciesNames[species])) - gender = MON_GENDERLESS; - - for (str = dst; *str != EOS; str++) - ; + if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(dst, gSpeciesNames[species])) + gender = MON_GENDERLESS; - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_SKIP; - *(str++) = 60; + for (str = dst; *str != EOS; str++) + ; - switch (gender) - { - default: - *(str++) = CHAR_SPACE; - break; - case MON_MALE: - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_COLOR; - *(str++) = TEXT_COLOR_RED; - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_SHADOW; - *(str++) = TEXT_COLOR_LIGHT_RED; - *(str++) = CHAR_MALE; - break; - case MON_FEMALE: - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_COLOR; - *(str++) = TEXT_COLOR_GREEN; - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_SHADOW; - *(str++) = TEXT_COLOR_LIGHT_GREEN; - *(str++) = CHAR_FEMALE; - break; - } + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_SKIP; + *(str++) = 60; - *(str++) = EXT_CTRL_CODE_BEGIN; - *(str++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; - *(str++) = TEXT_COLOR_BLUE; - *(str++) = TEXT_COLOR_TRANSPARENT; - *(str++) = TEXT_COLOR_LIGHT_BLUE; - *(str++) = CHAR_SLASH; - *(str++) = CHAR_EXTRA_SYMBOL; - *(str++) = CHAR_LV_2; - str = ConvertIntToDecimalStringN(str, level, STR_CONV_MODE_LEFT_ALIGN, 3); + switch (gender) + { + default: *(str++) = CHAR_SPACE; - *str = EOS; + break; + case MON_MALE: + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_COLOR; + *(str++) = TEXT_COLOR_RED; + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_SHADOW; + *(str++) = TEXT_COLOR_LIGHT_RED; + *(str++) = CHAR_MALE; + break; + case MON_FEMALE: + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_COLOR; + *(str++) = TEXT_COLOR_GREEN; + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_SHADOW; + *(str++) = TEXT_COLOR_LIGHT_GREEN; + *(str++) = CHAR_FEMALE; + break; + } - return str; + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; + *(str++) = TEXT_COLOR_BLUE; + *(str++) = TEXT_COLOR_TRANSPARENT; + *(str++) = TEXT_COLOR_LIGHT_BLUE; + *(str++) = CHAR_SLASH; + *(str++) = CHAR_EXTRA_SYMBOL; + *(str++) = CHAR_LV_2; + str = ConvertIntToDecimalStringN(str, level, STR_CONV_MODE_LEFT_ALIGN, 3); + *(str++) = CHAR_SPACE; + *str = EOS; + + return str; } // Buffers the string in src to dest up to n chars. If src is less than n chars, fill with spaces -- cgit v1.2.3