summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/pokedex.h3
-rw-r--r--src/diploma.c2
-rw-r--r--src/pokedex.c54
3 files changed, 30 insertions, 29 deletions
diff --git a/include/pokedex.h b/include/pokedex.h
index a1b7378bf..532c823ee 100644
--- a/include/pokedex.h
+++ b/include/pokedex.h
@@ -4,6 +4,7 @@
extern u8 gUnusedPokedexU8;
extern void (*gUnknown_030060B4)(void);
+#define KANTO_DEX_COUNT 151
#define HOENN_DEX_COUNT 202
#define NATIONAL_DEX_COUNT 386
@@ -43,7 +44,7 @@ s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
bool16 HasAllHoennMons(void);
void ResetPokedexScrollPositions(void);
-u16 sub_80C0944(void);
+bool16 HasAllMons(void);
void CB2_Pokedex(void);
#endif // GUARD_POKEDEX_H
diff --git a/src/diploma.c b/src/diploma.c
index 92c7df703..8e0901fa8 100644
--- a/src/diploma.c
+++ b/src/diploma.c
@@ -127,7 +127,7 @@ static void Task_DiplomaFadeOut(u8 taskId)
static void DisplayDiplomaText(void)
{
- if (sub_80C0944())
+ if (HasAllMons())
{
SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_BG0_ON);
StringCopy(gStringVar1, gText_DexNational);
diff --git a/src/pokedex.c b/src/pokedex.c
index 0e532ed92..c1787ef6a 100644
--- a/src/pokedex.c
+++ b/src/pokedex.c
@@ -4249,12 +4249,12 @@ u16 GetPokedexHeightWeight(u16 dexNum, u8 data)
{
switch (data)
{
- case 0: // height
- return gPokedexEntries[dexNum].height;
- case 1: // weight
- return gPokedexEntries[dexNum].weight;
- default:
- return 1;
+ case 0: // height
+ return gPokedexEntries[dexNum].height;
+ case 1: // weight
+ return gPokedexEntries[dexNum].weight;
+ default:
+ return 1;
}
}
@@ -4360,23 +4360,23 @@ u16 GetHoennPokedexCount(u8 caseID)
return count;
}
-u16 sub_80C089C(u8 caseID)
+u16 GetKantoPokedexCount(u8 caseID)
{
u16 count = 0;
u16 i;
- for (i = 0; i < 151; i++)
+ for (i = 0; i < KANTO_DEX_COUNT; i++)
{
switch (caseID)
{
- case FLAG_GET_SEEN:
- if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN))
- count++;
- break;
- case FLAG_GET_CAUGHT:
- if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
- count++;
- break;
+ case FLAG_GET_SEEN:
+ if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN))
+ count++;
+ break;
+ case FLAG_GET_CAUGHT:
+ if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
+ count++;
+ break;
}
}
return count;
@@ -4386,7 +4386,7 @@ bool16 HasAllHoennMons(void)
{
u16 i;
- for (i = 0; i < 200; i++)
+ for (i = 0; i < HOENN_DEX_COUNT - 2; i++)
{
if (!GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT))
return FALSE;
@@ -4394,11 +4394,11 @@ bool16 HasAllHoennMons(void)
return TRUE;
}
-bool8 sub_80C0918(void)
+bool8 HasAllKantoMons(void)
{
u16 i;
- for (i = 0; i < 150; i++)
+ for (i = 0; i < KANTO_DEX_COUNT - 1; i++)
{
if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
return FALSE;
@@ -4406,26 +4406,26 @@ bool8 sub_80C0918(void)
return TRUE;
}
-u16 sub_80C0944(void)
+bool16 HasAllMons(void)
{
u16 i;
- for (i = 0; i < 150; i++)
+ for (i = 0; i < NATIONAL_DEX_MEWTWO; i++)
{
if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
- return 0;
+ return FALSE;
}
- for (i = 151; i < 248; i++)
+ for (i = NATIONAL_DEX_MEW; i < NATIONAL_DEX_TYRANITAR; i++)
{
if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
- return 0;
+ return FALSE;
}
- for (i = 251; i < 384; i++)
+ for (i = NATIONAL_DEX_CELEBI; i < NATIONAL_DEX_RAYQUAZA; i++)
{
if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
- return 0;
+ return FALSE;
}
- return 1;
+ return TRUE;
}
void sub_80C09B0(u16 a)