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