Merge pull request #788 from ultima-soul/documentation

Synchronize with pokefirered pokedex.c.
This commit is contained in:
Diegoisawesome 2019-08-25 23:56:09 -05:00 committed by GitHub
commit ad941680d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 29 deletions

View File

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

View File

@ -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);

View File

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