summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle_interface.c4
-rw-r--r--src/birch_pc.c105
-rw-r--r--src/credits.c2
-rw-r--r--src/easy_chat.c2
-rw-r--r--src/pokedex.c22
-rw-r--r--src/script_pokemon_util_80C4BF0.c4
6 files changed, 70 insertions, 69 deletions
diff --git a/src/battle_interface.c b/src/battle_interface.c
index 9938c4b54..a9175ac10 100644
--- a/src/battle_interface.c
+++ b/src/battle_interface.c
@@ -8,6 +8,7 @@
#include "songs.h"
#include "battle.h"
#include "palette.h"
+#include "pokedex.h"
struct UnknownStruct5
{
@@ -104,7 +105,6 @@ extern const u16 gBattleInterfaceStatusIcons_DynPal[];
#define MACRO1(n) ((n) - (n) / 8 * 8) + 64 * ((n) / 8)
extern int sub_8040D3C();
-extern u8 sub_8090D90();
extern void load_gfxc_health_bar();
static void sub_8043D5C(struct Sprite *);
@@ -2534,7 +2534,7 @@ static void sub_8045458(u8 a, u8 b)
if (battle_side_get_owner(r4) != 0)
{
u16 species = GetMonData(&gEnemyParty[gUnknown_02024A6A[r4]], MON_DATA_SPECIES);
- if (sub_8090D90(SpeciesToNationalPokedexNum(species), 1) != 0)
+ if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(species), 1) != 0)
{
r4 = gSprites[a].data5;
if (b != 0)
diff --git a/src/birch_pc.c b/src/birch_pc.c
index 89eafc0ce..79070b5a8 100644
--- a/src/birch_pc.c
+++ b/src/birch_pc.c
@@ -9,31 +9,31 @@ extern u16 gSpecialVar_0x8004;
extern u16 gSpecialVar_0x8005;
extern u16 gSpecialVar_0x8006;
-extern const u8 gUnknown_081C4520[];
-extern const u8 gUnknown_081C456A[];
-extern const u8 gUnknown_081C45B0[];
-extern const u8 gUnknown_081C45F9[];
-extern const u8 gUnknown_081C4648[];
-extern const u8 gUnknown_081C467E[];
-extern const u8 gUnknown_081C46B9[];
-extern const u8 gUnknown_081C46FE[];
-extern const u8 gUnknown_081C4747[];
-extern const u8 gUnknown_081C4780[];
-extern const u8 gUnknown_081C47DF[];
-extern const u8 gUnknown_081C4828[];
-extern const u8 gUnknown_081C4863[];
-extern const u8 gUnknown_081C489C[];
-extern const u8 gUnknown_081C48EB[];
-extern const u8 gUnknown_081C4936[];
-extern const u8 gUnknown_081C49A2[];
-extern const u8 gUnknown_081C4A06[];
-extern const u8 gUnknown_081C4A4F[];
-extern const u8 gUnknown_081C4A91[];
-extern const u8 gUnknown_081C4ADA[];
+extern const u8 gBirchDexRatingText_LessThan10[];
+extern const u8 gBirchDexRatingText_LessThan20[];
+extern const u8 gBirchDexRatingText_LessThan30[];
+extern const u8 gBirchDexRatingText_LessThan40[];
+extern const u8 gBirchDexRatingText_LessThan50[];
+extern const u8 gBirchDexRatingText_LessThan60[];
+extern const u8 gBirchDexRatingText_LessThan70[];
+extern const u8 gBirchDexRatingText_LessThan80[];
+extern const u8 gBirchDexRatingText_LessThan90[];
+extern const u8 gBirchDexRatingText_LessThan100[];
+extern const u8 gBirchDexRatingText_LessThan110[];
+extern const u8 gBirchDexRatingText_LessThan120[];
+extern const u8 gBirchDexRatingText_LessThan130[];
+extern const u8 gBirchDexRatingText_LessThan140[];
+extern const u8 gBirchDexRatingText_LessThan150[];
+extern const u8 gBirchDexRatingText_LessThan160[];
+extern const u8 gBirchDexRatingText_LessThan170[];
+extern const u8 gBirchDexRatingText_LessThan180[];
+extern const u8 gBirchDexRatingText_LessThan190[];
+extern const u8 gBirchDexRatingText_LessThan200[];
+extern const u8 gBirchDexRatingText_DexCompleted[];
bool16 ScriptGetPokedexInfo(void)
{
- if (!gSpecialVar_0x8004)
+ if (gSpecialVar_0x8004 == 0) // is national dex not present?
{
gSpecialVar_0x8005 = GetHoennPokedexCount(0);
gSpecialVar_0x8006 = GetHoennPokedexCount(1);
@@ -47,65 +47,66 @@ bool16 ScriptGetPokedexInfo(void)
return IsNationalPokedexEnabled();
}
+// This shows your Hoenn Pokedex rating and NOT your National Dex.
const u8 *GetPokedexRatingText(u16 count)
{
if (count < 10)
- return gUnknown_081C4520;
+ return gBirchDexRatingText_LessThan10;
if (count < 20)
- return gUnknown_081C456A;
+ return gBirchDexRatingText_LessThan20;
if (count < 30)
- return gUnknown_081C45B0;
+ return gBirchDexRatingText_LessThan30;
if (count < 40)
- return gUnknown_081C45F9;
+ return gBirchDexRatingText_LessThan40;
if (count < 50)
- return gUnknown_081C4648;
+ return gBirchDexRatingText_LessThan50;
if (count < 60)
- return gUnknown_081C467E;
+ return gBirchDexRatingText_LessThan60;
if (count < 70)
- return gUnknown_081C46B9;
+ return gBirchDexRatingText_LessThan70;
if (count < 80)
- return gUnknown_081C46FE;
+ return gBirchDexRatingText_LessThan80;
if (count < 90)
- return gUnknown_081C4747;
+ return gBirchDexRatingText_LessThan90;
if (count < 100)
- return gUnknown_081C4780;
+ return gBirchDexRatingText_LessThan100;
if (count < 110)
- return gUnknown_081C47DF;
+ return gBirchDexRatingText_LessThan110;
if (count < 120)
- return gUnknown_081C4828;
+ return gBirchDexRatingText_LessThan120;
if (count < 130)
- return gUnknown_081C4863;
+ return gBirchDexRatingText_LessThan130;
if (count < 140)
- return gUnknown_081C489C;
+ return gBirchDexRatingText_LessThan140;
if (count < 150)
- return gUnknown_081C48EB;
+ return gBirchDexRatingText_LessThan150;
if (count < 160)
- return gUnknown_081C4936;
+ return gBirchDexRatingText_LessThan160;
if (count < 170)
- return gUnknown_081C49A2;
+ return gBirchDexRatingText_LessThan170;
if (count < 180)
- return gUnknown_081C4A06;
+ return gBirchDexRatingText_LessThan180;
if (count < 190)
- return gUnknown_081C4A4F;
+ return gBirchDexRatingText_LessThan190;
if (count < 200)
- return gUnknown_081C4A91;
+ return gBirchDexRatingText_LessThan200;
if (count == 200)
{
- if (sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1)
- || sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1))
- return gUnknown_081C4A91;
- return gUnknown_081C4ADA;
+ if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1)
+ || GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // Jirachi or Deoxys is not counted towards the dex completion.
+ return gBirchDexRatingText_LessThan200;
+ return gBirchDexRatingText_DexCompleted;
}
if (count == 201)
{
- if (sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1)
- && sub_8090D90(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1))
- return gUnknown_081C4A91;
- return gUnknown_081C4ADA;
+ if (GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1)
+ && GetNationalPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1))
+ return gBirchDexRatingText_LessThan200;
+ return gBirchDexRatingText_DexCompleted;
}
if (count == 202)
- return gUnknown_081C4ADA;
- return gUnknown_081C4520;
+ return gBirchDexRatingText_DexCompleted;
+ return gBirchDexRatingText_LessThan10;
}
void ShowPokedexRatingMessage(void)
diff --git a/src/credits.c b/src/credits.c
index 01af78bce..ffb7554ba 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -2044,7 +2044,7 @@ void sub_81458DC(void)
_0814590E:\n\
adds r0, r4, 0\n\
movs r1, 0x1\n\
- bl sub_8090D90\n\
+ bl GetNationalPokedexFlag\n\
lsls r0, 24\n\
adds r6, r7, 0\n\
adds r6, 0x90\n\
diff --git a/src/easy_chat.c b/src/easy_chat.c
index 380fe6e4d..33d7678bb 100644
--- a/src/easy_chat.c
+++ b/src/easy_chat.c
@@ -243,7 +243,7 @@ static u16 sub_80EB9D8(void) {
{
const u16 dexNum = SpeciesToNationalPokedexNum(*speciesList);
- const u8 local2 = sub_8090D90(dexNum, 0);
+ const u8 local2 = GetNationalPokedexFlag(dexNum, 0);
if (local2)
{
diff --git a/src/pokedex.c b/src/pokedex.c
index 5ea1f9938..83b87906d 100644
--- a/src/pokedex.c
+++ b/src/pokedex.c
@@ -855,8 +855,8 @@ void SortPokedex(u8 dexMode, u8 sortMode)
{
vars[2] = HoennToNationalOrder(i + 1);
gPokedexView->unk0[i].dexNum = vars[2];
- gPokedexView->unk0[i].seen = sub_8090D90(vars[2], 0);
- gPokedexView->unk0[i].owned = sub_8090D90(vars[2], 1);
+ gPokedexView->unk0[i].seen = GetNationalPokedexFlag(vars[2], 0);
+ gPokedexView->unk0[i].owned = GetNationalPokedexFlag(vars[2], 1);
if (gPokedexView->unk0[i].seen)
gPokedexView->unk60C = i + 1;
}
@@ -870,14 +870,14 @@ void SortPokedex(u8 dexMode, u8 sortMode)
for (i = 0; i < vars[0]; i++)
{
vars[2] = i + 1;
- if (sub_8090D90(vars[2], 0))
+ if (GetNationalPokedexFlag(vars[2], 0))
r10 = 1;
if (r10)
{
asm(""); //Needed to match for some reason
gPokedexView->unk0[r5].dexNum = vars[2];
- gPokedexView->unk0[r5].seen = sub_8090D90(vars[2], 0);
- gPokedexView->unk0[r5].owned = sub_8090D90(vars[2], 1);
+ gPokedexView->unk0[r5].seen = GetNationalPokedexFlag(vars[2], 0);
+ gPokedexView->unk0[r5].owned = GetNationalPokedexFlag(vars[2], 1);
if (gPokedexView->unk0[r5].seen)
gPokedexView->unk60C = r5 + 1;
r5++;
@@ -891,11 +891,11 @@ void SortPokedex(u8 dexMode, u8 sortMode)
{
vars[2] = gPokedexOrder_Alphabetical[i];
- if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 0))
+ if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 0))
{
gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2];
gPokedexView->unk0[gPokedexView->unk60C].seen = 1;
- gPokedexView->unk0[gPokedexView->unk60C].owned = sub_8090D90(vars[2], 1);
+ gPokedexView->unk0[gPokedexView->unk60C].owned = GetNationalPokedexFlag(vars[2], 1);
gPokedexView->unk60C++;
}
}
@@ -905,7 +905,7 @@ void SortPokedex(u8 dexMode, u8 sortMode)
{
vars[2] = gPokedexOrder_Weight[i];
- if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1))
+ if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1))
{
gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2];
gPokedexView->unk0[gPokedexView->unk60C].seen = 1;
@@ -919,7 +919,7 @@ void SortPokedex(u8 dexMode, u8 sortMode)
{
vars[2] = gPokedexOrder_Weight[i];
- if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1))
+ if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1))
{
gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2];
gPokedexView->unk0[gPokedexView->unk60C].seen = 1;
@@ -933,7 +933,7 @@ void SortPokedex(u8 dexMode, u8 sortMode)
{
vars[2] = gPokedexOrder_Height[i];
- if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1))
+ if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1))
{
gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2];
gPokedexView->unk0[gPokedexView->unk60C].seen = 1;
@@ -947,7 +947,7 @@ void SortPokedex(u8 dexMode, u8 sortMode)
{
vars[2] = gPokedexOrder_Height[i];
- if (NationalToHoennOrder(vars[2]) <= vars[0] && sub_8090D90(vars[2], 1))
+ if (NationalToHoennOrder(vars[2]) <= vars[0] && GetNationalPokedexFlag(vars[2], 1))
{
gPokedexView->unk0[gPokedexView->unk60C].dexNum = vars[2];
gPokedexView->unk0[gPokedexView->unk60C].seen = 1;
diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c
index 912458655..d1e401e18 100644
--- a/src/script_pokemon_util_80C4BF0.c
+++ b/src/script_pokemon_util_80C4BF0.c
@@ -568,8 +568,8 @@ u8 ScriptGiveMon(u16 species, u8 var, u16 item, u32 var3, u32 var4, u8 var5)
if(sentToPc >= 0)
{
// set both the seen and caught flags
- sub_8090D90(nationalSpecies, 2);
- sub_8090D90(nationalSpecies, 3);
+ GetNationalPokedexFlag(nationalSpecies, 2);
+ GetNationalPokedexFlag(nationalSpecies, 3);
}
}
return sentToPc;