Synchronize with pokefirered pokedex.c.

This commit is contained in:
ultima-soul 2019-08-24 11:17:11 -07:00
parent 8e7abad720
commit d3ea25ee7f
3 changed files with 30 additions and 29 deletions

View file

@ -4,6 +4,7 @@
extern u8 gUnusedPokedexU8; extern u8 gUnusedPokedexU8;
extern void (*gUnknown_030060B4)(void); extern void (*gUnknown_030060B4)(void);
#define KANTO_DEX_COUNT 151
#define HOENN_DEX_COUNT 202 #define HOENN_DEX_COUNT 202
#define NATIONAL_DEX_COUNT 386 #define NATIONAL_DEX_COUNT 386
@ -43,7 +44,7 @@ s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16); u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
bool16 HasAllHoennMons(void); bool16 HasAllHoennMons(void);
void ResetPokedexScrollPositions(void); void ResetPokedexScrollPositions(void);
u16 sub_80C0944(void); bool16 HasAllMons(void);
void CB2_Pokedex(void); void CB2_Pokedex(void);
#endif // GUARD_POKEDEX_H #endif // GUARD_POKEDEX_H

View file

@ -127,7 +127,7 @@ static void Task_DiplomaFadeOut(u8 taskId)
static void DisplayDiplomaText(void) static void DisplayDiplomaText(void)
{ {
if (sub_80C0944()) if (HasAllMons())
{ {
SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_BG0_ON); SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_BG0_ON);
StringCopy(gStringVar1, gText_DexNational); StringCopy(gStringVar1, gText_DexNational);

View file

@ -4360,12 +4360,12 @@ u16 GetHoennPokedexCount(u8 caseID)
return count; return count;
} }
u16 sub_80C089C(u8 caseID) u16 GetKantoPokedexCount(u8 caseID)
{ {
u16 count = 0; u16 count = 0;
u16 i; u16 i;
for (i = 0; i < 151; i++) for (i = 0; i < KANTO_DEX_COUNT; i++)
{ {
switch (caseID) switch (caseID)
{ {
@ -4386,7 +4386,7 @@ bool16 HasAllHoennMons(void)
{ {
u16 i; 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)) if (!GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT))
return FALSE; return FALSE;
@ -4394,11 +4394,11 @@ bool16 HasAllHoennMons(void)
return TRUE; return TRUE;
} }
bool8 sub_80C0918(void) bool8 HasAllKantoMons(void)
{ {
u16 i; u16 i;
for (i = 0; i < 150; i++) for (i = 0; i < KANTO_DEX_COUNT - 1; i++)
{ {
if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
return FALSE; return FALSE;
@ -4406,26 +4406,26 @@ bool8 sub_80C0918(void)
return TRUE; return TRUE;
} }
u16 sub_80C0944(void) bool16 HasAllMons(void)
{ {
u16 i; u16 i;
for (i = 0; i < 150; i++) for (i = 0; i < NATIONAL_DEX_MEWTWO; i++)
{ {
if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) 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)) 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)) if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
return 0; return FALSE;
} }
return 1; return TRUE;
} }
void sub_80C09B0(u16 a) void sub_80C09B0(u16 a)