summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2018-07-03 02:57:00 -0400
committeryenatch <yenatch@gmail.com>2018-07-03 02:57:05 -0400
commite04593b6aa311b5fa274e2361f2c6d006e21192e (patch)
tree71efce725b52bd40fb3c0288153a2955dc4c640a
parentca9cdc306e13a5aff6885aec83b8e23131260d45 (diff)
label pp up masks
-rw-r--r--src/battle/calculate_base_damage.c6
-rw-r--r--src/pokemon_2.c10
-rw-r--r--src/pokemon_item_effect.c18
-rw-r--r--src/pokemon_summary_screen.c10
-rw-r--r--src/script_pokemon_util_80F99CC.c10
5 files changed, 27 insertions, 27 deletions
diff --git a/src/battle/calculate_base_damage.c b/src/battle/calculate_base_damage.c
index d983e47a4..0022cf9fe 100644
--- a/src/battle/calculate_base_damage.c
+++ b/src/battle/calculate_base_damage.c
@@ -23,13 +23,13 @@ extern u16 gBattleMovePower;
extern u16 gTrainerBattleOpponent;
// Masks for getting PP Up count, also PP Max values
-const u8 gUnknown_08208238[] = {0x03, 0x0c, 0x30, 0xc0};
+const u8 gPPUpReadMasks[] = {0x03, 0x0c, 0x30, 0xc0};
// Masks for setting PP Up count
-const u8 gUnknown_0820823C[] = {0xFC, 0xF3, 0xCF, 0x3F};
+const u8 gPPUpWriteMasks[] = {0xFC, 0xF3, 0xCF, 0x3F};
// Values added to PP Up count
-const u8 gUnknown_08208240[] = {0x01, 0x04, 0x10, 0x40};
+const u8 gPPUpValues[] = {0x01, 0x04, 0x10, 0x40};
const u8 gStatStageRatios[][2] =
{
diff --git a/src/pokemon_2.c b/src/pokemon_2.c
index 9c60ea108..1720159a2 100644
--- a/src/pokemon_2.c
+++ b/src/pokemon_2.c
@@ -44,8 +44,8 @@ extern const struct SpriteTemplate gSpriteTemplate_8208288[];
extern u8 gTrainerClassToPicIndex[];
extern u8 gTrainerClassToNameIndex[];
-extern const u8 gUnknown_08208238[];
-extern const u8 gUnknown_0820823C[];
+extern const u8 gPPUpReadMasks[];
+extern const u8 gPPUpWriteMasks[];
extern void sub_80105A0(struct Sprite *);
extern void oac_poke_opponent(struct Sprite *);
@@ -1169,19 +1169,19 @@ void GetSpeciesName(u8 *name, u16 species)
u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex)
{
u8 basePP = gBattleMoves[move].pp;
- return basePP + ((basePP * 20 * ((gUnknown_08208238[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100);
+ return basePP + ((basePP * 20 * ((gPPUpReadMasks[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100);
}
void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex)
{
u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
- ppBonuses &= gUnknown_0820823C[moveIndex];
+ ppBonuses &= gPPUpWriteMasks[moveIndex];
SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses);
}
void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex)
{
- mon->ppBonuses &= gUnknown_0820823C[moveIndex];
+ mon->ppBonuses &= gPPUpWriteMasks[moveIndex];
}
void CopyPlayerPartyMonToBattleData(u8 battleIndex, u8 partyIndex)
diff --git a/src/pokemon_item_effect.c b/src/pokemon_item_effect.c
index d26546f02..59b216af0 100644
--- a/src/pokemon_item_effect.c
+++ b/src/pokemon_item_effect.c
@@ -35,9 +35,9 @@ static const u8 sGetMonDataEVConstants[] =
MON_DATA_SPATK_EV
};
-extern u8 gUnknown_08208238[];
-extern u8 gUnknown_0820823C[];
-extern u8 gUnknown_08208240[];
+extern u8 gPPUpReadMasks[];
+extern u8 gPPUpWriteMasks[];
+extern u8 gPPUpValues[];
bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e);
@@ -221,11 +221,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 mo
if (r10 & 0x20)
{
r10 &= ~0x20;
- data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_08208238[moveIndex]) >> (moveIndex * 2);
+ data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gPPUpReadMasks[moveIndex]) >> (moveIndex * 2);
sp28 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
- if (data <= 2 && sp28 > 4)
+ if (data < 3 && sp28 > 4)
{
- data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) + gUnknown_08208240[moveIndex];
+ data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) + gPPUpValues[moveIndex];
SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - sp28;
@@ -450,13 +450,13 @@ bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 mo
}
break;
case 4:
- data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_08208238[moveIndex]) >> (moveIndex * 2);
+ data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gPPUpReadMasks[moveIndex]) >> (moveIndex * 2);
if (data < 3)
{
r4 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL);
- data &= gUnknown_0820823C[moveIndex];
- data += gUnknown_08208240[moveIndex] * 3;
+ data &= gPPUpWriteMasks[moveIndex];
+ data += gPPUpValues[moveIndex] * 3;
SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - r4;
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index 4c8b3b34b..7ddd20277 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -123,7 +123,7 @@ extern u8 ball_number_to_ball_processing_index(u16);
extern u8 StorageSystemGetNextMonIndex(struct BoxPokemon *, u8, u8, u8);
extern struct MusicPlayerInfo gMPlay_BGM;
-extern u8 gUnknown_08208238[];
+extern u8 gPPUpReadMasks[];
extern TaskFunc gUnknown_03005CF0;
extern struct SpriteTemplate gUnknown_02024E8C;
@@ -1140,9 +1140,9 @@ static void SummaryScreen_SwapMoves_Party(void)
u8 ppBonuses = GetMonData(pkmn, MON_DATA_PP_BONUSES);
// Swap PP bonuses
- u8 r9 = gUnknown_08208238[moveIndex1];
+ u8 r9 = gPPUpReadMasks[moveIndex1];
u8 r2 = (ppBonuses & r9) >> (moveIndex1 * 2);
- u8 r3 = gUnknown_08208238[moveIndex2];
+ u8 r3 = gPPUpReadMasks[moveIndex2];
u8 r1 = (ppBonuses & r3) >> (moveIndex2 * 2);
ppBonuses &= ~r9;
ppBonuses &= ~r3;
@@ -1170,9 +1170,9 @@ static void SummaryScreen_SwapMoves_Box(void)
u8 ppBonuses = GetBoxMonData(pkmn, MON_DATA_PP_BONUSES);
// Swap PP bonuses
- u8 r9 = gUnknown_08208238[moveIndex1];
+ u8 r9 = gPPUpReadMasks[moveIndex1];
u8 r2 = (ppBonuses & r9) >> (moveIndex1 * 2);
- u8 r3 = gUnknown_08208238[moveIndex2];
+ u8 r3 = gPPUpReadMasks[moveIndex2];
u8 r1 = (ppBonuses & r3) >> (moveIndex2 * 2);
ppBonuses &= ~r9;
ppBonuses &= ~r3;
diff --git a/src/script_pokemon_util_80F99CC.c b/src/script_pokemon_util_80F99CC.c
index b292265a6..87ef2517b 100644
--- a/src/script_pokemon_util_80F99CC.c
+++ b/src/script_pokemon_util_80F99CC.c
@@ -19,7 +19,7 @@
#include "text.h"
#include "ewram.h"
-extern const u8 gUnknown_08208238[];
+extern const u8 gPPUpReadMasks[];
extern u8 gPlayerPartyCount;
extern u16 gSpecialVar_0x8004;
@@ -307,11 +307,11 @@ void sub_80F9FDC(struct Pokemon *pkmn, u8 moveIndex1, u8 moveIndex2)
u8 pp2 = GetMonData(pkmn, MON_DATA_PP1 + moveIndex2);
u8 bonuses = GetMonData(pkmn, MON_DATA_PP_BONUSES);
- u8 r2 = (bonuses & gUnknown_08208238[moveIndex1]) >> (moveIndex1 * 2);
- u8 r1 = (bonuses & gUnknown_08208238[moveIndex2]) >> (moveIndex2 * 2);
+ u8 r2 = (bonuses & gPPUpReadMasks[moveIndex1]) >> (moveIndex1 * 2);
+ u8 r1 = (bonuses & gPPUpReadMasks[moveIndex2]) >> (moveIndex2 * 2);
- bonuses &= ~gUnknown_08208238[moveIndex1];
- bonuses &= ~gUnknown_08208238[moveIndex2];
+ bonuses &= ~gPPUpReadMasks[moveIndex1];
+ bonuses &= ~gPPUpReadMasks[moveIndex2];
bonuses |= (r2 << (moveIndex2 * 2)) + (r1 << (moveIndex1 * 2));
SetMonData(pkmn, MON_DATA_MOVE1 + moveIndex1, &move2);