From 0330656868d9795bb260b047f2ee78d5295cf907 Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 14 May 2022 17:09:42 +0300 Subject: [PATCH 01/47] Change triple kick power calculation --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index d0ff7c5beb..1a096e170c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8052,7 +8052,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower = gBattleStruct->presentBasePower; break; case EFFECT_TRIPLE_KICK: - basePower += gBattleScripting.tripleKickPower; + basePower *= (4 - gMultiHitCounter); break; case EFFECT_SPIT_UP: basePower = 100 * gDisableStructs[battlerAtk].stockpileCounter; From 922bbacd7192a98db2b2422041fcd0d5623b6111 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 26 Aug 2022 17:47:07 -0300 Subject: [PATCH 02/47] Updated GetMonFriendshipScore -Moved it to src/pokemon.c -Made a battle specific variant called GetBattlerFriendshipScore. -Made that variant return 0 for Mega Evolved 'mons and if called on link battles. --- include/battle.h | 1 + include/battle_util.h | 2 +- include/pokemon.h | 1 + src/battle_script_commands.c | 9 +++++---- src/battle_util.c | 31 +++++++++++++++---------------- src/pokemon.c | 20 ++++++++++++++++++++ 6 files changed, 43 insertions(+), 21 deletions(-) diff --git a/include/battle.h b/include/battle.h index 36ffdb6da0..82993b73e2 100644 --- a/include/battle.h +++ b/include/battle.h @@ -456,6 +456,7 @@ struct MegaEvolutionData bool8 playerSelect; u8 triggerSpriteId; bool8 isWishMegaEvo; + bool32 didMegaEvo[PARTY_SIZE][2]; // For each party member and side. }; struct Illusion diff --git a/include/battle_util.h b/include/battle_util.h index 5dbefd7e7e..9b8109c398 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -201,6 +201,6 @@ bool32 CanBeParalyzed(u8 battlerId); bool32 CanBeFrozen(u8 battlerId); bool32 CanBeConfused(u8 battlerId); bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag); -u32 GetMonFriendshipScore(struct Pokemon *pokemon); +u32 GetBattlerFriendshipScore(u8 battlerId); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/pokemon.h b/include/pokemon.h index c05628a598..7a38508274 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -559,5 +559,6 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg); u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg); u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove); bool32 ShouldShowFemaleDifferences(u16 species, u32 personality); +u32 GetMonFriendshipScore(struct Pokemon *pokemon); #endif // GUARD_POKEMON_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a5a822546c..361abe2419 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1734,7 +1734,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u #if B_AFFECTION_MECHANICS == TRUE // With high affection/friendship there's a chance to evade a move by substracting 10% of its accuracy. // I can't find exact information about that chance, so I'm just gonna write it as a 20% chance for now. - if (GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[battlerDef]]) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20) + if (GetMonFriendshipScore(battlerDef) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20) calc = (calc * 90) / 100; #endif @@ -1907,7 +1907,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi + 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY) + 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk) #if B_AFFECTION_MECHANICS == TRUE - + 2 * (GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]) >= FRIENDSHIP_200_TO_254) + + 2 * (GetMonFriendshipScore(gBattlerAttacker) >= FRIENDSHIP_200_TO_254) #endif + (abilityAtk == ABILITY_SUPER_LUCK); @@ -1977,7 +1977,7 @@ static void Cmd_adjustdamage(void) { u8 holdEffect, param; u32 moveType; - u32 friendshipScore = GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[gBattlerTarget]]); + u32 friendshipScore = GetBattlerFriendshipScore(gBattlerTarget); u32 rand = Random() % 100; GET_MOVE_TYPE(gCurrentMove, moveType); @@ -4063,7 +4063,7 @@ static void Cmd_getexp(void) } #endif #if B_AFFECTION_MECHANICS == TRUE - if (GetMonFriendshipScore(&gPlayerParty[gBattleStruct->expGetterMonId]) >= FRIENDSHIP_50_TO_99) + if (GetMonFriendshipScore(gBattleStruct->expGetterMonId) >= FRIENDSHIP_50_TO_99) gBattleMoveDamage = (gBattleMoveDamage * 120) / 100; #endif @@ -8652,6 +8652,7 @@ static void Cmd_various(void) gBattleMons[gActiveBattler].species = megaSpecies; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); + gBattleStruct->mega.didMegaEvo[gActiveBattler][GetBattlerSide(gActiveBattler)] = TRUE; BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], sizeof(gBattleMons[gActiveBattler].species), &gBattleMons[gActiveBattler].species); MarkBattlerForControllerExec(gActiveBattler); diff --git a/src/battle_util.c b/src/battle_util.c index f38d80a69c..5cb2badb0e 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2104,24 +2104,23 @@ void TryToRevertMimicry(void) } } -u32 GetMonFriendshipScore(struct Pokemon *pokemon) +u32 GetBattlerFriendshipScore(u8 battlerId) { - u32 friendshipScore = GetMonData(pokemon, MON_DATA_FRIENDSHIP); + struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct *)(&gBattleResources->bufferA[battlerId][4]))->mega); + u8 side = GetBattlerSide(battlerId); + struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; - if (friendshipScore == MAX_FRIENDSHIP) - return FRIENDSHIP_MAX; - if (friendshipScore >= 200) - return FRIENDSHIP_200_TO_254; - if (friendshipScore >= 150) - return FRIENDSHIP_150_TO_199; - if (friendshipScore >= 100) - return FRIENDSHIP_100_TO_149; - if (friendshipScore >= 50) - return FRIENDSHIP_50_TO_99; - if (friendshipScore >= 1) - return FRIENDSHIP_1_TO_49; + if (side != B_SIDE_PLAYER) + return FRIENDSHIP_NONE; + else if (gBattleStruct->mega.didMegaEvo[battlerId][side] + || (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_FRONTIER + | BATTLE_TYPE_LINK + | BATTLE_TYPE_RECORDED_LINK + | BATTLE_TYPE_SECRET_BASE))) + return FRIENDSHIP_NONE; - return FRIENDSHIP_NONE; + return GetMonFriendshipScore(&party[gBattlerPartyIndexes[battlerId]]); } enum @@ -2605,7 +2604,7 @@ u8 DoFieldEndTurnEffects(void) { #if B_AFFECTION_MECHANICS == TRUE if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER - && GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]) >= FRIENDSHIP_150_TO_199 + && GetBattlerFriendshipScore(gBattlerAttacker) >= FRIENDSHIP_150_TO_199 && (Random() % 100 < 20)) { gBattleCommunication[MULTISTRING_CHOOSER] = 1; diff --git a/src/pokemon.c b/src/pokemon.c index 92bd923f08..61c72c363e 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8384,3 +8384,23 @@ bool32 ShouldShowFemaleDifferences(u16 species, u32 personality) { return (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; } + +u32 GetMonFriendshipScore(struct Pokemon *pokemon) +{ + u32 friendshipScore = GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL); + + if (friendshipScore == MAX_FRIENDSHIP) + return FRIENDSHIP_MAX; + if (friendshipScore >= 200) + return FRIENDSHIP_200_TO_254; + if (friendshipScore >= 150) + return FRIENDSHIP_150_TO_199; + if (friendshipScore >= 100) + return FRIENDSHIP_100_TO_149; + if (friendshipScore >= 50) + return FRIENDSHIP_50_TO_99; + if (friendshipScore >= 1) + return FRIENDSHIP_1_TO_49; + + return FRIENDSHIP_NONE; +} From 452b135c7f15bd7a0354f97bc51335da90090c32 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 31 Aug 2022 17:48:22 -0300 Subject: [PATCH 03/47] I forgot to replace the function calls where appropriate :P --- src/battle_anim_new.c | 3 ++- src/battle_script_commands.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 35c1244670..a120b69a78 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -19,6 +19,7 @@ #include "constants/hold_effects.h" #include "constants/items.h" #include "constants/pokemon.h" +#include "battle_util.h" // function declarations static void SpriteCB_SpriteToCentreOfSide(struct Sprite *sprite); @@ -7899,6 +7900,6 @@ void AnimTask_AffectionHangedOn(u8 taskId) int side = GetBattlerSide(gBattleAnimTarget); struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; - gBattleAnimArgs[0] = GetMonFriendshipScore(&party[gBattlerPartyIndexes[gBattleAnimTarget]]); + gBattleAnimArgs[0] = GetBattlerFriendshipScore(gBattleAnimTarget); DestroyAnimVisualTask(taskId); } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 361abe2419..52818dc38e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1734,7 +1734,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u #if B_AFFECTION_MECHANICS == TRUE // With high affection/friendship there's a chance to evade a move by substracting 10% of its accuracy. // I can't find exact information about that chance, so I'm just gonna write it as a 20% chance for now. - if (GetMonFriendshipScore(battlerDef) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20) + if (GetBattlerFriendshipScore(battlerDef) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20) calc = (calc * 90) / 100; #endif @@ -1907,7 +1907,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi + 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY) + 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk) #if B_AFFECTION_MECHANICS == TRUE - + 2 * (GetMonFriendshipScore(gBattlerAttacker) >= FRIENDSHIP_200_TO_254) + + 2 * (GetBattlerFriendshipScore(gBattlerAttacker) >= FRIENDSHIP_200_TO_254) #endif + (abilityAtk == ABILITY_SUPER_LUCK); @@ -4063,7 +4063,7 @@ static void Cmd_getexp(void) } #endif #if B_AFFECTION_MECHANICS == TRUE - if (GetMonFriendshipScore(gBattleStruct->expGetterMonId) >= FRIENDSHIP_50_TO_99) + if (GetBattlerFriendshipScore(gBattleStruct->expGetterMonId) >= FRIENDSHIP_50_TO_99) gBattleMoveDamage = (gBattleMoveDamage * 120) / 100; #endif From 74c3fdfba79f0b18cbc94805f496295004f339e2 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 4 Sep 2022 19:41:01 -0300 Subject: [PATCH 04/47] Flag to allow certain species to always have perfect IVs (like Partner Pikachu and Eevee) --- include/constants/pokemon.h | 1 + include/pokemon.h | 2 +- src/pokemon.c | 87 ++++++++++++++++++++----------------- 3 files changed, 50 insertions(+), 40 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index f5d0e9509e..dd813e5094 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -350,6 +350,7 @@ #define FLAG_GALARIAN_FORM (1 << 4) #define FLAG_HISUIAN_FORM (1 << 5) #define FLAG_GENDER_DIFFERENCE (1 << 6) +#define FLAG_ALL_PERFECT_IVS (1 << 7) #define LEGENDARY_PERFECT_IV_COUNT 3 diff --git a/include/pokemon.h b/include/pokemon.h index 94fdff91d2..648a1f5bb2 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -323,7 +323,7 @@ struct BaseStats u8 safariZoneFleeRate; u8 bodyColor : 7; u8 noFlip : 1; - u8 flags; + u16 flags; }; #include "constants/battle_config.h" diff --git a/src/pokemon.c b/src/pokemon.c index 350aebf0b8..9b760dbb90 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3370,50 +3370,59 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, iv = (value & (MAX_IV_MASK << 10)) >> 10; SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); - #if P_LEGENDARY_PERFECT_IVS >= GEN_6 - if (gBaseStats[species].flags & (FLAG_LEGENDARY | FLAG_MYTHICAL | FLAG_ULTRA_BEAST)) + if (gBaseStats[species].flags & FLAG_ALL_PERFECT_IVS) + { + iv = MAX_PER_STAT_IVS; + SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); + } + #if P_LEGENDARY_PERFECT_IVS >= GEN_6 + else if (gBaseStats[species].flags & (FLAG_LEGENDARY | FLAG_MYTHICAL | FLAG_ULTRA_BEAST)) + { + iv = MAX_PER_STAT_IVS; + // Initialize a list of IV indices. + for (i = 0; i < NUM_STATS; i++) { - iv = MAX_PER_STAT_IVS; - // Initialize a list of IV indices. - for (i = 0; i < NUM_STATS; i++) - { - availableIVs[i] = i; - } + availableIVs[i] = i; + } - // Select the 3 IVs that will be perfected. - for (i = 0; i < LEGENDARY_PERFECT_IV_COUNT; i++) + // Select the 3 IVs that will be perfected. + for (i = 0; i < LEGENDARY_PERFECT_IV_COUNT; i++) + { + u8 index = Random() % (NUM_STATS - i); + selectedIvs[i] = availableIVs[index]; + RemoveIVIndexFromList(availableIVs, index); + } + for (i = 0; i < LEGENDARY_PERFECT_IV_COUNT; i++) + { + switch (selectedIvs[i]) { - u8 index = Random() % (NUM_STATS - i); - selectedIvs[i] = availableIVs[index]; - RemoveIVIndexFromList(availableIVs, index); - } - for (i = 0; i < LEGENDARY_PERFECT_IV_COUNT; i++) - { - switch (selectedIvs[i]) - { - case STAT_HP: - SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); - break; - case STAT_ATK: - SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); - break; - case STAT_DEF: - SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); - break; - case STAT_SPEED: - SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); - break; - case STAT_SPATK: - SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); - break; - case STAT_SPDEF: - SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); - break; - } + case STAT_HP: + SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); + break; + case STAT_ATK: + SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); + break; + case STAT_DEF: + SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); + break; + case STAT_SPEED: + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); + break; + case STAT_SPATK: + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); + break; + case STAT_SPDEF: + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); + break; } } - #endif - + } + #endif } if (gBaseStats[species].abilities[1]) From a4c242f2f89f2a4fa1f4efc2ff9a68c18298dcf0 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 4 Sep 2022 21:55:59 -0300 Subject: [PATCH 05/47] Implemented Shiny Lock functionality --- include/constants/pokemon.h | 1 + src/pokemon.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index dd813e5094..5898eba5ca 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -351,6 +351,7 @@ #define FLAG_HISUIAN_FORM (1 << 5) #define FLAG_GENDER_DIFFERENCE (1 << 6) #define FLAG_ALL_PERFECT_IVS (1 << 7) +#define FLAG_SHINY_LOCKED (1 << 8) #define LEGENDARY_PERFECT_IV_COUNT 3 diff --git a/src/pokemon.c b/src/pokemon.c index 9b760dbb90..30e22bd6ab 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3301,14 +3301,23 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, } else // Player is the OT { + u32 shinyValue; value = gSaveBlock2Ptr->playerTrainerId[0] | (gSaveBlock2Ptr->playerTrainerId[1] << 8) | (gSaveBlock2Ptr->playerTrainerId[2] << 16) | (gSaveBlock2Ptr->playerTrainerId[3] << 24); - if (CheckBagHasItem(ITEM_SHINY_CHARM, 1)) + if (gBaseStats[species].flags & FLAG_SHINY_LOCKED) + { + do + { + // Choose random personalities until one that results in a non-shiny Pokémon + personality = Random32(); + shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality); + } while (shinyValue < SHINY_ODDS); + } + else if (CheckBagHasItem(ITEM_SHINY_CHARM, 1)) { - u32 shinyValue; u32 rolls = 0; do { From d0d4c52d84623bfd70bed8dc19778b95aba63183 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 4 Sep 2022 22:03:17 -0300 Subject: [PATCH 06/47] Update src/pokemon.c Co-authored-by: LOuroboros --- src/pokemon.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 30e22bd6ab..61d16e56ce 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3410,24 +3410,24 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, { switch (selectedIvs[i]) { - case STAT_HP: - SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); - break; - case STAT_ATK: - SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); - break; - case STAT_DEF: - SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); - break; - case STAT_SPEED: - SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); - break; - case STAT_SPATK: - SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); - break; - case STAT_SPDEF: - SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); - break; + case STAT_HP: + SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); + break; + case STAT_ATK: + SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv); + break; + case STAT_DEF: + SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv); + break; + case STAT_SPEED: + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); + break; + case STAT_SPATK: + SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); + break; + case STAT_SPDEF: + SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); + break; } } } From 2ee843c70d14848e19f715081fd85715755d7835 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 4 Sep 2022 22:10:31 -0300 Subject: [PATCH 07/47] Proper label for species flags --- include/constants/pokemon.h | 18 +- src/battle_script_commands.c | 2 +- src/data/pokemon/base_stats.h | 382 +++++++++++++++++----------------- src/pokemon.c | 8 +- src/pokemon_debug.c | 18 +- 5 files changed, 214 insertions(+), 214 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 5898eba5ca..60bca5a838 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -343,15 +343,15 @@ #define NUM_HIDDEN_ABILITY_SLOTS 1 // Species Flags -#define FLAG_LEGENDARY (1 << 0) -#define FLAG_MYTHICAL (1 << 1) -#define FLAG_ULTRA_BEAST (1 << 2) -#define FLAG_ALOLAN_FORM (1 << 3) -#define FLAG_GALARIAN_FORM (1 << 4) -#define FLAG_HISUIAN_FORM (1 << 5) -#define FLAG_GENDER_DIFFERENCE (1 << 6) -#define FLAG_ALL_PERFECT_IVS (1 << 7) -#define FLAG_SHINY_LOCKED (1 << 8) +#define SPECIES_FLAG_LEGENDARY (1 << 0) +#define SPECIES_FLAG_MYTHICAL (1 << 1) +#define SPECIES_FLAG_ULTRA_BEAST (1 << 2) +#define SPECIES_FLAG_ALOLAN_FORM (1 << 3) +#define SPECIES_FLAG_GALARIAN_FORM (1 << 4) +#define SPECIES_FLAG_HISUIAN_FORM (1 << 5) +#define SPECIES_FLAG_GENDER_DIFFERENCE (1 << 6) +#define SPECIES_FLAG_ALL_PERFECT_IVS (1 << 7) +#define SPECIES_FLAG_SHINY_LOCKED (1 << 8) #define LEGENDARY_PERFECT_IV_COUNT 3 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 18fa5bbdff..b99b9adddb 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -13708,7 +13708,7 @@ static void Cmd_handleballthrow(void) else catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate; - if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & FLAG_ULTRA_BEAST) + if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & SPECIES_FLAG_ULTRA_BEAST) { if (gLastUsedItem == ITEM_BEAST_BALL) ballMultiplier = 50; diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 41b5143cf1..12c11fca63 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -262,7 +262,7 @@ .abilities = {ABILITY_MULTITYPE, ABILITY_NONE},\ .bodyColor = BODY_COLOR_WHITE, \ .noFlip = FALSE, \ - .flags = FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } #define DEERLING_BASE_STATS(color) \ @@ -337,7 +337,7 @@ .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE},\ .bodyColor = BODY_COLOR_PURPLE, \ .noFlip = FALSE, \ - .flags = FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } #define VIVILLON_BASE_STATS(color) \ @@ -516,7 +516,7 @@ .abilities = {ABILITY_FAIRY_AURA, ABILITY_NONE},\ .bodyColor = BODY_COLOR_BLUE, \ .noFlip = FALSE, \ - .flags = FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define ZYGARDE_50_BASE_STATS(ability) \ @@ -541,7 +541,7 @@ .abilities = {ability, ABILITY_NONE},\ .bodyColor = BODY_COLOR_GREEN, \ .noFlip = TRUE, \ - .flags = FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define ZYGARDE_10_BASE_STATS(ability) \ @@ -566,7 +566,7 @@ .abilities = {ability, ABILITY_NONE},\ .bodyColor = BODY_COLOR_BLACK, \ .noFlip = TRUE, \ - .flags = FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define ORICORIO_BASE_STATS(type, color) \ @@ -640,7 +640,7 @@ .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE},\ .bodyColor = BODY_COLOR_GRAY, \ .noFlip = FALSE, \ - .flags = FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define MINIOR_METEOR_ATTRIBUTES\ @@ -737,7 +737,7 @@ .abilities = {ABILITY_SOUL_HEART, ABILITY_NONE},\ .bodyColor = color, \ .noFlip = FALSE, \ - .flags = FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } #define CRAMORANT_BASE_STATS \ @@ -906,7 +906,7 @@ .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE},\ .bodyColor = BODY_COLOR_GREEN, \ .noFlip = FALSE, \ - .flags = FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } const struct BaseStats gBaseStats[] = @@ -4269,7 +4269,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_ADAPTABILITY, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_VAPOREON] = @@ -4536,7 +4536,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_SNOW_CLOAK}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZAPDOS] = @@ -4565,7 +4565,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_MOLTRES] = @@ -4590,7 +4590,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FLAME_BODY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_DRATINI] = @@ -4690,7 +4690,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_MEW] = @@ -4717,7 +4717,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SYNCHRONIZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_CHIKORITA] = @@ -7003,7 +7003,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ENTEI] = @@ -7033,7 +7033,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_SUICUNE] = @@ -7063,7 +7063,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LARVITAR] = @@ -7160,7 +7160,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_MULTISCALE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_HO_OH] = @@ -7187,7 +7187,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_CELEBI] = @@ -7214,7 +7214,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_TREECKO] = @@ -10403,7 +10403,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_REGICE] = @@ -10428,7 +10428,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_REGISTEEL] = @@ -10454,7 +10454,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LATIAS] = @@ -10479,7 +10479,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LATIOS] = @@ -10504,7 +10504,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KYOGRE] = @@ -10529,7 +10529,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DRIZZLE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_GROUDON] = @@ -10554,7 +10554,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DROUGHT, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_RAYQUAZA] = @@ -10580,7 +10580,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AIR_LOCK, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_JIRACHI] = @@ -10607,7 +10607,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_DEOXYS] = @@ -10634,7 +10634,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, #if P_NEW_POKEMON == TRUE @@ -10881,7 +10881,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_STARAVIA] = @@ -10906,7 +10906,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_STARAPTOR] = @@ -10959,7 +10959,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SIMPLE, ABILITY_UNAWARE, ABILITY_MOODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_BIBAREL] = @@ -11009,7 +11009,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_RUN_AWAY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_KRICKETUNE] = @@ -11035,7 +11035,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SHINX] = @@ -11060,7 +11060,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_LUXIO] = @@ -11337,7 +11337,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HONEY_GATHER, ABILITY_NONE, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_VESPIQUEN] = @@ -12107,7 +12107,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_HIPPOWDON] = @@ -12132,7 +12132,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SKORUPI] = @@ -12883,7 +12883,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_MESPRIT] = @@ -12910,7 +12910,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_AZELF] = @@ -12936,7 +12936,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_DIALGA] = @@ -12961,7 +12961,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_PALKIA] = @@ -12986,7 +12986,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_HEATRAN] = @@ -13011,7 +13011,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FLASH_FIRE, ABILITY_NONE, ABILITY_FLAME_BODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_REGIGIGAS] = @@ -13036,7 +13036,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SLOW_START, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_GIRATINA] = @@ -13061,7 +13061,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_CRESSELIA] = @@ -13086,7 +13086,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_PHIONE] = @@ -13111,7 +13111,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HYDRATION, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_MANAPHY] = @@ -13136,7 +13136,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HYDRATION, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_DARKRAI] = @@ -13162,7 +13162,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BAD_DREAMS, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_SHAYMIN] = @@ -13189,7 +13189,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_ARCEUS] = @@ -13214,7 +13214,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_VICTINI] = @@ -13239,7 +13239,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VICTORY_STAR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_SNIVY] = @@ -13896,7 +13896,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_BLITZLE] = @@ -15650,7 +15650,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_JELLICENT] = @@ -15675,7 +15675,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ALOMOMOLA] = @@ -16786,7 +16786,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_TERRAKION] = @@ -16811,7 +16811,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_VIRIZION] = @@ -16836,7 +16836,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_TORNADUS] = @@ -16861,7 +16861,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_THUNDURUS] = @@ -16886,7 +16886,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_RESHIRAM] = @@ -16911,7 +16911,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZEKROM] = @@ -16936,7 +16936,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LANDORUS] = @@ -16961,7 +16961,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_FORCE, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KYUREM] = @@ -16988,7 +16988,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KELDEO] = @@ -17013,7 +17013,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_MELOETTA] = @@ -17042,7 +17042,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_GENESECT] = GENESECT_BASE_STATS, @@ -17479,7 +17479,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_RIVALRY, ABILITY_UNNERVE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_FLABEBE] = FLABEBE_BASE_STATS, @@ -18553,7 +18553,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DARK_AURA, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZYGARDE] = ZYGARDE_50_BASE_STATS(ABILITY_AURA_BREAK), @@ -18581,7 +18581,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_HOOPA] = @@ -18606,7 +18606,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGICIAN, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_VOLCANION] = @@ -18631,7 +18631,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_ROWLET] = @@ -19842,7 +19842,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_SILVALLY] = SILVALLY_BASE_STATS(TYPE_NORMAL), @@ -20096,7 +20096,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_ELECTRIC_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_TAPU_LELE] = @@ -20121,7 +20121,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PSYCHIC_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_TAPU_BULU] = @@ -20146,7 +20146,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GRASSY_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_TAPU_FINI] = @@ -20171,7 +20171,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MISTY_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_COSMOG] = @@ -20196,7 +20196,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_UNAWARE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_COSMOEM] = @@ -20222,7 +20222,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STURDY, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_SOLGALEO] = @@ -20247,7 +20247,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FULL_METAL_BODY, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LUNALA] = @@ -20272,7 +20272,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SHADOW_SHIELD, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_NIHILEGO] = @@ -20297,7 +20297,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_BUZZWOLE] = @@ -20323,7 +20323,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_PHEROMOSA] = @@ -20348,7 +20348,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_XURKITREE] = @@ -20373,7 +20373,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_CELESTEELA] = @@ -20400,7 +20400,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_KARTANA] = @@ -20425,7 +20425,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_GUZZLORD] = @@ -20450,7 +20450,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_NECROZMA] = @@ -20476,7 +20476,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_MAGEARNA] = MAGEARNA_BASE_STATS(BODY_COLOR_GRAY), @@ -20504,7 +20504,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TECHNICIAN, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_POIPOLE] = @@ -20529,7 +20529,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_NAGANADEL] = @@ -20554,7 +20554,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_STAKATAKA] = @@ -20579,7 +20579,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_BLACEPHALON] = @@ -20604,7 +20604,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, - .flags = FLAG_ULTRA_BEAST, + .flags = SPECIES_FLAG_ULTRA_BEAST, }, [SPECIES_ZERAORA] = @@ -20629,7 +20629,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VOLT_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_MELTAN] = @@ -20654,7 +20654,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGNET_PULL, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_MELMETAL] = @@ -20679,7 +20679,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_IRON_FIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_GROOKEY] = @@ -22454,7 +22454,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTREPID_SWORD, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZAMAZENTA] = @@ -22479,7 +22479,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DAUNTLESS_SHIELD, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ETERNATUS] = @@ -22504,7 +22504,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KUBFU] = @@ -22529,7 +22529,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_URSHIFU] = @@ -22554,7 +22554,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_UNSEEN_FIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZARUDE] = ZARUDE_BASE_STATS, @@ -22581,7 +22581,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TRANSISTOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_REGIDRAGO] = @@ -22606,7 +22606,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DRAGONS_MAW, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_GLASTRIER] = @@ -22631,7 +22631,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CHILLING_NEIGH, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_SPECTRIER] = @@ -22656,7 +22656,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GRIM_NEIGH, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_CALYREX] = @@ -22681,7 +22681,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_UNNERVE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_WYRDEER] = @@ -22778,7 +22778,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_RATTLED, ABILITY_ADAPTABILITY, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SNEASLER] = @@ -22852,7 +22852,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HEALER, ABILITY_NONE, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_VENUSAUR_MEGA] = @@ -23198,7 +23198,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STEADFAST, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_MEWTWO_MEGA_Y] = @@ -23223,7 +23223,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INSOMNIA, ABILITY_INSOMNIA}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_AMPHAROS_MEGA] = @@ -23809,7 +23809,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LATIOS_MEGA] = @@ -23834,7 +23834,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LOPUNNY_MEGA] = @@ -24009,7 +24009,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_RAYQUAZA_MEGA] = @@ -24035,7 +24035,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DELTA_STREAM, ABILITY_DELTA_STREAM}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KYOGRE_PRIMAL] = @@ -24060,7 +24060,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRIMORDIAL_SEA, ABILITY_PRIMORDIAL_SEA}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_GROUDON_PRIMAL] = @@ -24085,7 +24085,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DESOLATE_LAND, ABILITY_DESOLATE_LAND}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_RATTATA_ALOLAN] = @@ -24111,7 +24111,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GLUTTONY, ABILITY_HUSTLE, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_RATICATE_ALOLAN] = @@ -24137,7 +24137,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GLUTTONY, ABILITY_HUSTLE, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_RAICHU_ALOLAN] = @@ -24162,7 +24162,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SURGE_SURFER, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_SANDSHREW_ALOLAN] = @@ -24188,7 +24188,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SLUSH_RUSH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_SANDSLASH_ALOLAN] = @@ -24213,7 +24213,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SLUSH_RUSH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_VULPIX_ALOLAN] = @@ -24239,7 +24239,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_NINETALES_ALOLAN] = @@ -24265,7 +24265,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_DIGLETT_ALOLAN] = @@ -24291,7 +24291,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_VEIL, ABILITY_TANGLING_HAIR, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_DUGTRIO_ALOLAN] = @@ -24317,7 +24317,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_VEIL, ABILITY_TANGLING_HAIR, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_MEOWTH_ALOLAN] = @@ -24343,7 +24343,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PICKUP, ABILITY_TECHNICIAN, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_PERSIAN_ALOLAN] = @@ -24369,7 +24369,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FUR_COAT, ABILITY_TECHNICIAN, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_GEODUDE_ALOLAN] = @@ -24395,7 +24395,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_GRAVELER_ALOLAN] = @@ -24421,7 +24421,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_GOLEM_ALOLAN] = @@ -24446,7 +24446,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_GRIMER_ALOLAN] = @@ -24472,7 +24472,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_POISON_TOUCH, ABILITY_GLUTTONY, ABILITY_POWER_OF_ALCHEMY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_MUK_ALOLAN] = @@ -24498,7 +24498,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_POISON_TOUCH, ABILITY_GLUTTONY, ABILITY_POWER_OF_ALCHEMY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_EXEGGUTOR_ALOLAN] = @@ -24523,7 +24523,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FRISK, ABILITY_NONE, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_MAROWAK_ALOLAN] = @@ -24548,7 +24548,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CURSED_BODY, ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_ALOLAN_FORM, + .flags = SPECIES_FLAG_ALOLAN_FORM, }, [SPECIES_MEOWTH_GALARIAN] = @@ -24573,7 +24573,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PICKUP, ABILITY_TOUGH_CLAWS, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_PONYTA_GALARIAN] = @@ -24598,7 +24598,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_PASTEL_VEIL, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_RAPIDASH_GALARIAN] = @@ -24623,7 +24623,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_PASTEL_VEIL, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_SLOWPOKE_GALARIAN] = @@ -24648,7 +24648,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GLUTTONY, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_SLOWBRO_GALARIAN] = @@ -24673,7 +24673,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_QUICK_DRAW, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_FARFETCHD_GALARIAN] = @@ -24699,7 +24699,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_WEEZING_GALARIAN] = @@ -24725,7 +24725,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_MISTY_SURGE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_MR_MIME_GALARIAN] = @@ -24750,7 +24750,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_SCREEN_CLEANER, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_ARTICUNO_GALARIAN] = @@ -24775,7 +24775,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_COMPETITIVE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_ZAPDOS_GALARIAN] = @@ -24800,7 +24800,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DEFIANT, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_MOLTRES_GALARIAN] = @@ -24825,7 +24825,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BERSERK, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_SLOWKING_GALARIAN] = @@ -24850,7 +24850,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CURIOUS_MEDICINE, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_CORSOLA_GALARIAN] = @@ -24875,7 +24875,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_ZIGZAGOON_GALARIAN] = @@ -24900,7 +24900,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_LINOONE_GALARIAN] = @@ -24925,7 +24925,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_DARUMAKA_GALARIAN] = @@ -24950,7 +24950,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HUSTLE, ABILITY_NONE, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_DARMANITAN_GALARIAN] = @@ -24975,7 +24975,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GORILLA_TACTICS, ABILITY_NONE, ABILITY_ZEN_MODE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_YAMASK_GALARIAN] = @@ -25000,7 +25000,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WANDERING_SPIRIT, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_STUNFISK_GALARIAN] = @@ -25025,7 +25025,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MIMICRY, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_GROWLITHE_HISUIAN] = @@ -25050,7 +25050,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_ARCANINE_HISUIAN] = @@ -25075,7 +25075,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_VOLTORB_HISUIAN] = @@ -25100,7 +25100,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_ELECTRODE_HISUIAN] = @@ -25125,7 +25125,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_TYPHLOSION_HISUIAN] = @@ -25150,7 +25150,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_FLASH_FIRE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_QWILFISH_HISUIAN] = @@ -25176,7 +25176,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_POISON_POINT, ABILITY_SWIFT_SWIM, ABILITY_INTIMIDATE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_SNEASEL_HISUIAN] = @@ -25202,7 +25202,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_POISON_TOUCH}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_SAMUROTT_HISUIAN] = @@ -25227,7 +25227,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHELL_ARMOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_LILLIGANT_HISUIAN] = @@ -25255,7 +25255,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CHLOROPHYLL, ABILITY_HUSTLE, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_ZORUA_HISUIAN] = @@ -25280,7 +25280,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_ILLUSION, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_ZOROARK_HISUIAN] = @@ -25305,7 +25305,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_ILLUSION, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_BRAVIARY_HISUIAN] = @@ -25330,7 +25330,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_KEEN_EYE, ABILITY_SHEER_FORCE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_SLIGGOO_HISUIAN] = @@ -25358,7 +25358,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAP_SIPPER, ABILITY_OVERCOAT, ABILITY_GOOEY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_GOODRA_HISUIAN] = @@ -25383,7 +25383,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAP_SIPPER, ABILITY_OVERCOAT, ABILITY_GOOEY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_AVALUGG_HISUIAN] = @@ -25408,7 +25408,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STRONG_JAW, ABILITY_ICE_BODY, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_DECIDUEYE_HISUIAN] = @@ -25433,7 +25433,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_HISUIAN_FORM, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, [SPECIES_PIKACHU_COSPLAY] = COSPLAY_PIKACHU_BASE_STATS(FLIP), @@ -25649,7 +25649,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_PALKIA_ORIGIN] = @@ -25674,7 +25674,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_GIRATINA_ORIGIN] = @@ -25841,7 +25841,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_GORILLA_TACTICS, ABILITY_NONE, ABILITY_ZEN_MODE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = SPECIES_FLAG_GALARIAN_FORM, }, [SPECIES_DEERLING_SUMMER] = DEERLING_BASE_STATS(BODY_COLOR_GREEN), @@ -25874,7 +25874,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_REGENERATOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_THUNDURUS_THERIAN] = @@ -25899,7 +25899,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VOLT_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_LANDORUS_THERIAN] = @@ -25924,7 +25924,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ENAMORUS_THERIAN] = @@ -25949,7 +25949,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_OVERCOAT, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KYUREM_WHITE] = @@ -25974,7 +25974,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KYUREM_BLACK] = @@ -25999,7 +25999,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_KELDEO_RESOLUTE] = @@ -26024,7 +26024,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_MELOETTA_PIROUETTE] = @@ -26053,7 +26053,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_GENESECT_DOUSE_DRIVE] = GENESECT_BASE_STATS, @@ -26326,7 +26326,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_POWER_CONSTRUCT, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_HOOPA_UNBOUND] = @@ -26351,7 +26351,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGICIAN, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL, }, [SPECIES_ORICORIO_POM_POM] = ORICORIO_BASE_STATS(TYPE_ELECTRIC, BODY_COLOR_YELLOW), @@ -26489,7 +26489,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_NECROZMA_DAWN_WINGS] = @@ -26514,7 +26514,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_NECROZMA_ULTRA] = @@ -26541,7 +26541,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NEUROFORCE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_MAGEARNA_ORIGINAL_COLOR] = MAGEARNA_BASE_STATS(BODY_COLOR_RED), @@ -26636,7 +26636,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTREPID_SWORD, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZAMAZENTA_CROWNED_SHIELD] = @@ -26661,7 +26661,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DAUNTLESS_SHIELD, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ETERNATUS_ETERNAMAX] = @@ -26686,7 +26686,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_URSHIFU_RAPID_STRIKE_STYLE] = @@ -26711,7 +26711,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_UNSEEN_FIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY, }, [SPECIES_ZARUDE_DADA] = ZARUDE_BASE_STATS, diff --git a/src/pokemon.c b/src/pokemon.c index 61d16e56ce..65ac046ff6 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3307,7 +3307,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, | (gSaveBlock2Ptr->playerTrainerId[2] << 16) | (gSaveBlock2Ptr->playerTrainerId[3] << 24); - if (gBaseStats[species].flags & FLAG_SHINY_LOCKED) + if (gBaseStats[species].flags & SPECIES_FLAG_SHINY_LOCKED) { do { @@ -3379,7 +3379,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, iv = (value & (MAX_IV_MASK << 10)) >> 10; SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); - if (gBaseStats[species].flags & FLAG_ALL_PERFECT_IVS) + if (gBaseStats[species].flags & SPECIES_FLAG_ALL_PERFECT_IVS) { iv = MAX_PER_STAT_IVS; SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv); @@ -3390,7 +3390,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); } #if P_LEGENDARY_PERFECT_IVS >= GEN_6 - else if (gBaseStats[species].flags & (FLAG_LEGENDARY | FLAG_MYTHICAL | FLAG_ULTRA_BEAST)) + else if (gBaseStats[species].flags & (SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_MYTHICAL | SPECIES_FLAG_ULTRA_BEAST)) { iv = MAX_PER_STAT_IVS; // Initialize a list of IV indices. @@ -8418,5 +8418,5 @@ void TrySpecialOverworldEvo(void) bool32 ShouldShowFemaleDifferences(u16 species, u32 personality) { - return (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; + return (gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; } diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 8775889fdf..a8190e4d80 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -417,21 +417,21 @@ static void PrintInstructionsOnWindow(struct PokemonDebugMenu *data) FillWindowPixelBuffer(WIN_INSTRUCTIONS, 0x11); if (data->currentSubmenu == 0) { - if (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) + if (gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsGender, x, 0, 0, NULL); else AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructions, x, 0, 0, NULL); } else if (data->currentSubmenu == 1) { - if (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) + if (gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuOneGender, x, 0, 0, NULL); else AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuOne, x, 0, 0, NULL); } else if (data->currentSubmenu == 2) { - if (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) + if (gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuTwoGender, x, 0, 0, NULL); else AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuTwo, x, 0, 0, NULL); @@ -485,7 +485,7 @@ static void PrintDigitChars(struct PokemonDebugMenu *data) text[i++] = CHAR_SPACE; text[i++] = CHAR_HYPHEN; - if (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) + if (gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) { if (data->isFemale) text[i++] = CHAR_FEMALE; @@ -688,14 +688,14 @@ static const struct CompressedSpritePalette *GetMonSpritePalStructCustom(u16 spe { if (isShiny) { - if ((gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && isFemale) + if ((gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) return &gMonShinyPaletteTableFemale[species]; else return &gMonShinyPaletteTable[species]; } else { - if ((gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && isFemale) + if ((gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) return &gMonPaletteTableFemale[species]; else return &gMonPaletteTable[species]; @@ -714,14 +714,14 @@ static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bo if (isShiny) { - if ((gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && isFemale) + if ((gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) lzPaletteData = gMonShinyPaletteTableFemale[species].data; else lzPaletteData = gMonShinyPaletteTable[species].data; } else { - if ((gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && isFemale) + if ((gBaseStats[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) lzPaletteData = gMonPaletteTableFemale[species].data; else lzPaletteData = gMonPaletteTable[species].data; @@ -1493,7 +1493,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) ReloadPokemonSprites(data); ApplyOffsetSpriteValues(data); } - if (JOY_NEW(SELECT_BUTTON) && (gBaseStats[data->currentmonId].flags & FLAG_GENDER_DIFFERENCE)) + if (JOY_NEW(SELECT_BUTTON) && (gBaseStats[data->currentmonId].flags & SPECIES_FLAG_GENDER_DIFFERENCE)) { data->isFemale = !data->isFemale; PrintDigitChars(data); From d699ea3334d544a7fef6c758a8e7f21c2c3b286b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 5 Sep 2022 08:38:35 -0400 Subject: [PATCH 08/47] Fixed macro alignments --- src/data/pokemon/base_stats.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 12c11fca63..bb85f2840f 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -262,7 +262,7 @@ .abilities = {ABILITY_MULTITYPE, ABILITY_NONE},\ .bodyColor = BODY_COLOR_WHITE, \ .noFlip = FALSE, \ - .flags = SPECIES_FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } #define DEERLING_BASE_STATS(color) \ @@ -337,7 +337,7 @@ .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE},\ .bodyColor = BODY_COLOR_PURPLE, \ .noFlip = FALSE, \ - .flags = SPECIES_FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } #define VIVILLON_BASE_STATS(color) \ @@ -516,7 +516,7 @@ .abilities = {ABILITY_FAIRY_AURA, ABILITY_NONE},\ .bodyColor = BODY_COLOR_BLUE, \ .noFlip = FALSE, \ - .flags = SPECIES_FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define ZYGARDE_50_BASE_STATS(ability) \ @@ -541,7 +541,7 @@ .abilities = {ability, ABILITY_NONE},\ .bodyColor = BODY_COLOR_GREEN, \ .noFlip = TRUE, \ - .flags = SPECIES_FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define ZYGARDE_10_BASE_STATS(ability) \ @@ -566,7 +566,7 @@ .abilities = {ability, ABILITY_NONE},\ .bodyColor = BODY_COLOR_BLACK, \ .noFlip = TRUE, \ - .flags = SPECIES_FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define ORICORIO_BASE_STATS(type, color) \ @@ -640,7 +640,7 @@ .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE},\ .bodyColor = BODY_COLOR_GRAY, \ .noFlip = FALSE, \ - .flags = SPECIES_FLAG_LEGENDARY, \ + .flags = SPECIES_FLAG_LEGENDARY, \ } #define MINIOR_METEOR_ATTRIBUTES\ @@ -737,7 +737,7 @@ .abilities = {ABILITY_SOUL_HEART, ABILITY_NONE},\ .bodyColor = color, \ .noFlip = FALSE, \ - .flags = SPECIES_FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } #define CRAMORANT_BASE_STATS \ @@ -906,7 +906,7 @@ .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE},\ .bodyColor = BODY_COLOR_GREEN, \ .noFlip = FALSE, \ - .flags = SPECIES_FLAG_MYTHICAL, \ + .flags = SPECIES_FLAG_MYTHICAL, \ } const struct BaseStats gBaseStats[] = From c8afeea1824f01e8435e5bf1115b366bec65ff82 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Sep 2022 16:09:45 -0400 Subject: [PATCH 09/47] Generate trainer pic palettes from image --- .../{brendan_back_pic.png => brendan.png} | Bin ...re_brendan_back_pic.png => brendan_rs.png} | Bin .../back_pics/{leaf_back_pic.png => leaf.png} | Bin .../back_pics/{may_back_pic.png => may.png} | Bin ...y_sapphire_may_back_pic.png => may_rs.png} | Bin .../back_pics/{red_back_pic.png => red.png} | Bin .../{steven_back_pic.png => steven.png} | Bin .../{wally_back_pic.png => wally.png} | Bin ...admin_f_front_pic.png => aqua_admin_f.png} | Bin ...admin_m_front_pic.png => aqua_admin_m.png} | Bin ...grunt_f_front_pic.png => aqua_grunt_f.png} | Bin ...grunt_m_front_pic.png => aqua_grunt_m.png} | Bin ...e_front_pic.png => aqua_leader_archie.png} | Bin ...a_front_pic.png => arena_tycoon_greta.png} | Bin ...roma_lady_front_pic.png => aroma_lady.png} | Bin ...tle_girl_front_pic.png => battle_girl.png} | Bin .../{beauty_front_pic.png => beauty.png} | Bin ...d_keeper_front_pic.png => bird_keeper.png} | Bin ...lack_belt_front_pic.png => black_belt.png} | Bin .../{brendan_front_pic.png => brendan.png} | Bin ...e_brendan_front_pic.png => brendan_rs.png} | Bin ..._catcher_front_pic.png => bug_catcher.png} | Bin ...ug_maniac_front_pic.png => bug_maniac.png} | Bin .../{camper_front_pic.png => camper.png} | Bin ...ace_front_pic.png => champion_wallace.png} | Bin ...{collector_front_pic.png => collector.png} | Bin ...iner_f_front_pic.png => cooltrainer_f.png} | Bin ...iner_m_front_pic.png => cooltrainer_m.png} | Bin ...front_pic.png => cycling_triathlete_f.png} | Bin ...front_pic.png => cycling_triathlete_m.png} | Bin ...cker_front_pic.png => dome_ace_tucker.png} | Bin ...n_tamer_front_pic.png => dragon_tamer.png} | Bin ...ake_front_pic.png => elite_four_drake.png} | Bin ...ia_front_pic.png => elite_four_glacia.png} | Bin ...be_front_pic.png => elite_four_phoebe.png} | Bin ...ey_front_pic.png => elite_four_sidney.png} | Bin .../{expert_f_front_pic.png => expert_f.png} | Bin .../{expert_m_front_pic.png => expert_m.png} | Bin ..._front_pic.png => factory_head_noland.png} | Bin ...{fisherman_front_pic.png => fisherman.png} | Bin ...{gentleman_front_pic.png => gentleman.png} | Bin ...{guitarist_front_pic.png => guitarist.png} | Bin ...ex_maniac_front_pic.png => hex_maniac.png} | Bin .../{hiker_front_pic.png => hiker.png} | Bin ...erviewer_front_pic.png => interviewer.png} | Bin .../{kindler_front_pic.png => kindler.png} | Bin .../{lady_front_pic.png => lady.png} | Bin .../{lass_front_pic.png => lass.png} | Bin ...brawly_front_pic.png => leader_brawly.png} | Bin ...nery_front_pic.png => leader_flannery.png} | Bin ...der_juan_front_pic.png => leader_juan.png} | Bin ...norman_front_pic.png => leader_norman.png} | Bin ...xanne_front_pic.png => leader_roxanne.png} | Bin ...front_pic.png => leader_tate_and_liza.png} | Bin ...ttson_front_pic.png => leader_wattson.png} | Bin ...winona_front_pic.png => leader_winona.png} | Bin .../{leaf_front_pic.png => leaf.png} | Bin ...ma_admin_front_pic.png => magma_admin.png} | Bin ...runt_f_front_pic.png => magma_grunt_f.png} | Bin ...runt_m_front_pic.png => magma_grunt_m.png} | Bin ...e_front_pic.png => magma_leader_maxie.png} | Bin .../front_pics/{may_front_pic.png => may.png} | Bin ..._sapphire_may_front_pic.png => may_rs.png} | Bin ...{ninja_boy_front_pic.png => ninja_boy.png} | Bin ...ld_couple_front_pic.png => old_couple.png} | Bin ...front_pic.png => palace_maven_spenser.png} | Bin ...ol_lady_front_pic.png => parasol_lady.png} | Bin ...{picnicker_front_pic.png => picnicker.png} | Bin ...lucy_front_pic.png => pike_queen_lucy.png} | Bin ...{pokefan_f_front_pic.png => pokefan_f.png} | Bin ...{pokefan_m_front_pic.png => pokefan_m.png} | Bin ...okemaniac_front_pic.png => pokemaniac.png} | Bin ..._f_front_pic.png => pokemon_breeder_f.png} | Bin ..._m_front_pic.png => pokemon_breeder_m.png} | Bin ...r_f_front_pic.png => pokemon_ranger_f.png} | Bin ...r_m_front_pic.png => pokemon_ranger_m.png} | Bin ...{psychic_f_front_pic.png => psychic_f.png} | Bin ...{psychic_m_front_pic.png => psychic_m.png} | Bin ...front_pic.png => pyramid_king_brandon.png} | Bin .../front_pics/{red_front_pic.png => red.png} | Bin .../{rich_boy_front_pic.png => rich_boy.png} | Bin ...n_maniac_front_pic.png => ruin_maniac.png} | Bin ...front_pic.png => running_triathlete_f.png} | Bin ...front_pic.png => running_triathlete_m.png} | Bin .../{sailor_front_pic.png => sailor.png} | Bin ..._front_pic.png => salon_maiden_anabel.png} | Bin ...l_kid_f_front_pic.png => school_kid_f.png} | Bin ...l_kid_m_front_pic.png => school_kid_m.png} | Bin ..._and_bro_front_pic.png => sis_and_bro.png} | Bin ...{sr_and_jr_front_pic.png => sr_and_jr.png} | Bin .../{steven_front_pic.png => steven.png} | Bin ...{swimmer_f_front_pic.png => swimmer_f.png} | Bin ...{swimmer_m_front_pic.png => swimmer_m.png} | Bin ...ront_pic.png => swimming_triathlete_f.png} | Bin ...ront_pic.png => swimming_triathlete_m.png} | Bin .../{tuber_f_front_pic.png => tuber_f.png} | Bin .../{tuber_m_front_pic.png => tuber_m.png} | Bin .../{twins_front_pic.png => twins.png} | Bin .../{wally_front_pic.png => wally.png} | Bin ..._couple_front_pic.png => young_couple.png} | Bin ...{youngster_front_pic.png => youngster.png} | Bin graphics/trainers/palettes/aqua_admin_f.pal | 19 - graphics/trainers/palettes/aqua_admin_m.pal | 19 - graphics/trainers/palettes/aqua_grunt_f.pal | 19 - graphics/trainers/palettes/aqua_grunt_m.pal | 19 - .../trainers/palettes/aqua_leader_archie.pal | 19 - .../trainers/palettes/arena_tycoon_greta.pal | 19 - graphics/trainers/palettes/aroma_lady.pal | 19 - graphics/trainers/palettes/battle_girl.pal | 19 - graphics/trainers/palettes/beauty.pal | 19 - graphics/trainers/palettes/bird_keeper.pal | 19 - graphics/trainers/palettes/black_belt.pal | 19 - ...by_sapphire_brendan.pal => brendan_rs.pal} | 0 graphics/trainers/palettes/bug_catcher.pal | 19 - graphics/trainers/palettes/bug_maniac.pal | 19 - graphics/trainers/palettes/camper.pal | 19 - .../trainers/palettes/champion_wallace.pal | 19 - graphics/trainers/palettes/collector.pal | 19 - graphics/trainers/palettes/cooltrainer_f.pal | 19 - graphics/trainers/palettes/cooltrainer_m.pal | 19 - .../palettes/cycling_triathlete_f.pal | 19 - .../palettes/cycling_triathlete_m.pal | 19 - .../trainers/palettes/dome_ace_tucker.pal | 19 - graphics/trainers/palettes/dragon_tamer.pal | 19 - .../trainers/palettes/elite_four_drake.pal | 19 - .../trainers/palettes/elite_four_glacia.pal | 19 - .../trainers/palettes/elite_four_phoebe.pal | 19 - .../trainers/palettes/elite_four_sidney.pal | 19 - graphics/trainers/palettes/expert_f.pal | 19 - graphics/trainers/palettes/expert_m.pal | 19 - .../trainers/palettes/factory_head_noland.pal | 19 - graphics/trainers/palettes/fisherman.pal | 19 - graphics/trainers/palettes/gentleman.pal | 19 - graphics/trainers/palettes/guitarist.pal | 19 - graphics/trainers/palettes/hex_maniac.pal | 19 - graphics/trainers/palettes/hiker.pal | 19 - graphics/trainers/palettes/interviewer.pal | 19 - graphics/trainers/palettes/kindler.pal | 19 - graphics/trainers/palettes/lady.pal | 19 - graphics/trainers/palettes/lass.pal | 19 - graphics/trainers/palettes/leader_brawly.pal | 19 - .../trainers/palettes/leader_flannery.pal | 19 - graphics/trainers/palettes/leader_juan.pal | 19 - graphics/trainers/palettes/leader_norman.pal | 19 - graphics/trainers/palettes/leader_roxanne.pal | 19 - .../palettes/leader_tate_and_liza.pal | 19 - graphics/trainers/palettes/leader_wattson.pal | 19 - graphics/trainers/palettes/leader_winona.pal | 19 - graphics/trainers/palettes/leaf.pal | 19 - graphics/trainers/palettes/leaf_back_pic.pal | 19 - graphics/trainers/palettes/magma_admin.pal | 19 - graphics/trainers/palettes/magma_grunt_f.pal | 19 - graphics/trainers/palettes/magma_grunt_m.pal | 19 - .../trainers/palettes/magma_leader_maxie.pal | 19 - .../{ruby_sapphire_may.pal => may_rs.pal} | 0 graphics/trainers/palettes/ninja_boy.pal | 19 - graphics/trainers/palettes/old_couple.pal | 19 - .../palettes/palace_maven_spenser.pal | 19 - graphics/trainers/palettes/parasol_lady.pal | 19 - graphics/trainers/palettes/picnicker.pal | 19 - .../trainers/palettes/pike_queen_lucy.pal | 19 - graphics/trainers/palettes/pokefan_f.pal | 19 - graphics/trainers/palettes/pokefan_m.pal | 19 - graphics/trainers/palettes/pokemaniac.pal | 19 - .../trainers/palettes/pokemon_breeder_f.pal | 19 - .../trainers/palettes/pokemon_breeder_m.pal | 19 - .../trainers/palettes/pokemon_ranger_f.pal | 19 - .../trainers/palettes/pokemon_ranger_m.pal | 19 - graphics/trainers/palettes/psychic_f.pal | 19 - graphics/trainers/palettes/psychic_m.pal | 19 - .../palettes/pyramid_king_brandon.pal | 19 - graphics/trainers/palettes/red.pal | 19 - graphics/trainers/palettes/red_back_pic.pal | 19 - graphics/trainers/palettes/rich_boy.pal | 19 - graphics/trainers/palettes/ruin_maniac.pal | 19 - .../palettes/running_triathlete_f.pal | 19 - .../palettes/running_triathlete_m.pal | 19 - graphics/trainers/palettes/sailor.pal | 19 - .../trainers/palettes/salon_maiden_anabel.pal | 19 - graphics/trainers/palettes/school_kid_f.pal | 19 - graphics/trainers/palettes/school_kid_m.pal | 19 - graphics/trainers/palettes/sis_and_bro.pal | 19 - graphics/trainers/palettes/sr_and_jr.pal | 19 - graphics/trainers/palettes/swimmer_f.pal | 19 - graphics/trainers/palettes/swimmer_m.pal | 19 - .../palettes/swimming_triathlete_f.pal | 19 - .../palettes/swimming_triathlete_m.pal | 19 - graphics/trainers/palettes/tuber_f.pal | 19 - graphics/trainers/palettes/tuber_m.pal | 19 - graphics/trainers/palettes/twins.pal | 19 - graphics/trainers/palettes/young_couple.pal | 19 - graphics/trainers/palettes/youngster.pal | 19 - src/data/graphics/trainers.h | 386 +++++++++--------- 193 files changed, 193 insertions(+), 1884 deletions(-) rename graphics/trainers/back_pics/{brendan_back_pic.png => brendan.png} (100%) rename graphics/trainers/back_pics/{ruby_sapphire_brendan_back_pic.png => brendan_rs.png} (100%) rename graphics/trainers/back_pics/{leaf_back_pic.png => leaf.png} (100%) rename graphics/trainers/back_pics/{may_back_pic.png => may.png} (100%) rename graphics/trainers/back_pics/{ruby_sapphire_may_back_pic.png => may_rs.png} (100%) rename graphics/trainers/back_pics/{red_back_pic.png => red.png} (100%) rename graphics/trainers/back_pics/{steven_back_pic.png => steven.png} (100%) rename graphics/trainers/back_pics/{wally_back_pic.png => wally.png} (100%) rename graphics/trainers/front_pics/{aqua_admin_f_front_pic.png => aqua_admin_f.png} (100%) rename graphics/trainers/front_pics/{aqua_admin_m_front_pic.png => aqua_admin_m.png} (100%) rename graphics/trainers/front_pics/{aqua_grunt_f_front_pic.png => aqua_grunt_f.png} (100%) rename graphics/trainers/front_pics/{aqua_grunt_m_front_pic.png => aqua_grunt_m.png} (100%) rename graphics/trainers/front_pics/{aqua_leader_archie_front_pic.png => aqua_leader_archie.png} (100%) rename graphics/trainers/front_pics/{arena_tycoon_greta_front_pic.png => arena_tycoon_greta.png} (100%) rename graphics/trainers/front_pics/{aroma_lady_front_pic.png => aroma_lady.png} (100%) rename graphics/trainers/front_pics/{battle_girl_front_pic.png => battle_girl.png} (100%) rename graphics/trainers/front_pics/{beauty_front_pic.png => beauty.png} (100%) rename graphics/trainers/front_pics/{bird_keeper_front_pic.png => bird_keeper.png} (100%) rename graphics/trainers/front_pics/{black_belt_front_pic.png => black_belt.png} (100%) rename graphics/trainers/front_pics/{brendan_front_pic.png => brendan.png} (100%) rename graphics/trainers/front_pics/{ruby_sapphire_brendan_front_pic.png => brendan_rs.png} (100%) rename graphics/trainers/front_pics/{bug_catcher_front_pic.png => bug_catcher.png} (100%) rename graphics/trainers/front_pics/{bug_maniac_front_pic.png => bug_maniac.png} (100%) rename graphics/trainers/front_pics/{camper_front_pic.png => camper.png} (100%) rename graphics/trainers/front_pics/{champion_wallace_front_pic.png => champion_wallace.png} (100%) rename graphics/trainers/front_pics/{collector_front_pic.png => collector.png} (100%) rename graphics/trainers/front_pics/{cooltrainer_f_front_pic.png => cooltrainer_f.png} (100%) rename graphics/trainers/front_pics/{cooltrainer_m_front_pic.png => cooltrainer_m.png} (100%) rename graphics/trainers/front_pics/{cycling_triathlete_f_front_pic.png => cycling_triathlete_f.png} (100%) rename graphics/trainers/front_pics/{cycling_triathlete_m_front_pic.png => cycling_triathlete_m.png} (100%) rename graphics/trainers/front_pics/{dome_ace_tucker_front_pic.png => dome_ace_tucker.png} (100%) rename graphics/trainers/front_pics/{dragon_tamer_front_pic.png => dragon_tamer.png} (100%) rename graphics/trainers/front_pics/{elite_four_drake_front_pic.png => elite_four_drake.png} (100%) rename graphics/trainers/front_pics/{elite_four_glacia_front_pic.png => elite_four_glacia.png} (100%) rename graphics/trainers/front_pics/{elite_four_phoebe_front_pic.png => elite_four_phoebe.png} (100%) rename graphics/trainers/front_pics/{elite_four_sidney_front_pic.png => elite_four_sidney.png} (100%) rename graphics/trainers/front_pics/{expert_f_front_pic.png => expert_f.png} (100%) rename graphics/trainers/front_pics/{expert_m_front_pic.png => expert_m.png} (100%) rename graphics/trainers/front_pics/{factory_head_noland_front_pic.png => factory_head_noland.png} (100%) rename graphics/trainers/front_pics/{fisherman_front_pic.png => fisherman.png} (100%) rename graphics/trainers/front_pics/{gentleman_front_pic.png => gentleman.png} (100%) rename graphics/trainers/front_pics/{guitarist_front_pic.png => guitarist.png} (100%) rename graphics/trainers/front_pics/{hex_maniac_front_pic.png => hex_maniac.png} (100%) rename graphics/trainers/front_pics/{hiker_front_pic.png => hiker.png} (100%) rename graphics/trainers/front_pics/{interviewer_front_pic.png => interviewer.png} (100%) rename graphics/trainers/front_pics/{kindler_front_pic.png => kindler.png} (100%) rename graphics/trainers/front_pics/{lady_front_pic.png => lady.png} (100%) rename graphics/trainers/front_pics/{lass_front_pic.png => lass.png} (100%) rename graphics/trainers/front_pics/{leader_brawly_front_pic.png => leader_brawly.png} (100%) rename graphics/trainers/front_pics/{leader_flannery_front_pic.png => leader_flannery.png} (100%) rename graphics/trainers/front_pics/{leader_juan_front_pic.png => leader_juan.png} (100%) rename graphics/trainers/front_pics/{leader_norman_front_pic.png => leader_norman.png} (100%) rename graphics/trainers/front_pics/{leader_roxanne_front_pic.png => leader_roxanne.png} (100%) rename graphics/trainers/front_pics/{leader_tate_and_liza_front_pic.png => leader_tate_and_liza.png} (100%) rename graphics/trainers/front_pics/{leader_wattson_front_pic.png => leader_wattson.png} (100%) rename graphics/trainers/front_pics/{leader_winona_front_pic.png => leader_winona.png} (100%) rename graphics/trainers/front_pics/{leaf_front_pic.png => leaf.png} (100%) rename graphics/trainers/front_pics/{magma_admin_front_pic.png => magma_admin.png} (100%) rename graphics/trainers/front_pics/{magma_grunt_f_front_pic.png => magma_grunt_f.png} (100%) rename graphics/trainers/front_pics/{magma_grunt_m_front_pic.png => magma_grunt_m.png} (100%) rename graphics/trainers/front_pics/{magma_leader_maxie_front_pic.png => magma_leader_maxie.png} (100%) rename graphics/trainers/front_pics/{may_front_pic.png => may.png} (100%) rename graphics/trainers/front_pics/{ruby_sapphire_may_front_pic.png => may_rs.png} (100%) rename graphics/trainers/front_pics/{ninja_boy_front_pic.png => ninja_boy.png} (100%) rename graphics/trainers/front_pics/{old_couple_front_pic.png => old_couple.png} (100%) rename graphics/trainers/front_pics/{palace_maven_spenser_front_pic.png => palace_maven_spenser.png} (100%) rename graphics/trainers/front_pics/{parasol_lady_front_pic.png => parasol_lady.png} (100%) rename graphics/trainers/front_pics/{picnicker_front_pic.png => picnicker.png} (100%) rename graphics/trainers/front_pics/{pike_queen_lucy_front_pic.png => pike_queen_lucy.png} (100%) rename graphics/trainers/front_pics/{pokefan_f_front_pic.png => pokefan_f.png} (100%) rename graphics/trainers/front_pics/{pokefan_m_front_pic.png => pokefan_m.png} (100%) rename graphics/trainers/front_pics/{pokemaniac_front_pic.png => pokemaniac.png} (100%) rename graphics/trainers/front_pics/{pokemon_breeder_f_front_pic.png => pokemon_breeder_f.png} (100%) rename graphics/trainers/front_pics/{pokemon_breeder_m_front_pic.png => pokemon_breeder_m.png} (100%) rename graphics/trainers/front_pics/{pokemon_ranger_f_front_pic.png => pokemon_ranger_f.png} (100%) rename graphics/trainers/front_pics/{pokemon_ranger_m_front_pic.png => pokemon_ranger_m.png} (100%) rename graphics/trainers/front_pics/{psychic_f_front_pic.png => psychic_f.png} (100%) rename graphics/trainers/front_pics/{psychic_m_front_pic.png => psychic_m.png} (100%) rename graphics/trainers/front_pics/{pyramid_king_brandon_front_pic.png => pyramid_king_brandon.png} (100%) rename graphics/trainers/front_pics/{red_front_pic.png => red.png} (100%) rename graphics/trainers/front_pics/{rich_boy_front_pic.png => rich_boy.png} (100%) rename graphics/trainers/front_pics/{ruin_maniac_front_pic.png => ruin_maniac.png} (100%) rename graphics/trainers/front_pics/{running_triathlete_f_front_pic.png => running_triathlete_f.png} (100%) rename graphics/trainers/front_pics/{running_triathlete_m_front_pic.png => running_triathlete_m.png} (100%) rename graphics/trainers/front_pics/{sailor_front_pic.png => sailor.png} (100%) rename graphics/trainers/front_pics/{salon_maiden_anabel_front_pic.png => salon_maiden_anabel.png} (100%) rename graphics/trainers/front_pics/{school_kid_f_front_pic.png => school_kid_f.png} (100%) rename graphics/trainers/front_pics/{school_kid_m_front_pic.png => school_kid_m.png} (100%) rename graphics/trainers/front_pics/{sis_and_bro_front_pic.png => sis_and_bro.png} (100%) rename graphics/trainers/front_pics/{sr_and_jr_front_pic.png => sr_and_jr.png} (100%) rename graphics/trainers/front_pics/{steven_front_pic.png => steven.png} (100%) rename graphics/trainers/front_pics/{swimmer_f_front_pic.png => swimmer_f.png} (100%) rename graphics/trainers/front_pics/{swimmer_m_front_pic.png => swimmer_m.png} (100%) rename graphics/trainers/front_pics/{swimming_triathlete_f_front_pic.png => swimming_triathlete_f.png} (100%) rename graphics/trainers/front_pics/{swimming_triathlete_m_front_pic.png => swimming_triathlete_m.png} (100%) rename graphics/trainers/front_pics/{tuber_f_front_pic.png => tuber_f.png} (100%) rename graphics/trainers/front_pics/{tuber_m_front_pic.png => tuber_m.png} (100%) rename graphics/trainers/front_pics/{twins_front_pic.png => twins.png} (100%) rename graphics/trainers/front_pics/{wally_front_pic.png => wally.png} (100%) rename graphics/trainers/front_pics/{young_couple_front_pic.png => young_couple.png} (100%) rename graphics/trainers/front_pics/{youngster_front_pic.png => youngster.png} (100%) delete mode 100644 graphics/trainers/palettes/aqua_admin_f.pal delete mode 100644 graphics/trainers/palettes/aqua_admin_m.pal delete mode 100644 graphics/trainers/palettes/aqua_grunt_f.pal delete mode 100644 graphics/trainers/palettes/aqua_grunt_m.pal delete mode 100644 graphics/trainers/palettes/aqua_leader_archie.pal delete mode 100644 graphics/trainers/palettes/arena_tycoon_greta.pal delete mode 100644 graphics/trainers/palettes/aroma_lady.pal delete mode 100644 graphics/trainers/palettes/battle_girl.pal delete mode 100644 graphics/trainers/palettes/beauty.pal delete mode 100644 graphics/trainers/palettes/bird_keeper.pal delete mode 100644 graphics/trainers/palettes/black_belt.pal rename graphics/trainers/palettes/{ruby_sapphire_brendan.pal => brendan_rs.pal} (100%) delete mode 100644 graphics/trainers/palettes/bug_catcher.pal delete mode 100644 graphics/trainers/palettes/bug_maniac.pal delete mode 100644 graphics/trainers/palettes/camper.pal delete mode 100644 graphics/trainers/palettes/champion_wallace.pal delete mode 100644 graphics/trainers/palettes/collector.pal delete mode 100644 graphics/trainers/palettes/cooltrainer_f.pal delete mode 100644 graphics/trainers/palettes/cooltrainer_m.pal delete mode 100644 graphics/trainers/palettes/cycling_triathlete_f.pal delete mode 100644 graphics/trainers/palettes/cycling_triathlete_m.pal delete mode 100644 graphics/trainers/palettes/dome_ace_tucker.pal delete mode 100644 graphics/trainers/palettes/dragon_tamer.pal delete mode 100644 graphics/trainers/palettes/elite_four_drake.pal delete mode 100644 graphics/trainers/palettes/elite_four_glacia.pal delete mode 100644 graphics/trainers/palettes/elite_four_phoebe.pal delete mode 100644 graphics/trainers/palettes/elite_four_sidney.pal delete mode 100644 graphics/trainers/palettes/expert_f.pal delete mode 100644 graphics/trainers/palettes/expert_m.pal delete mode 100644 graphics/trainers/palettes/factory_head_noland.pal delete mode 100644 graphics/trainers/palettes/fisherman.pal delete mode 100644 graphics/trainers/palettes/gentleman.pal delete mode 100644 graphics/trainers/palettes/guitarist.pal delete mode 100644 graphics/trainers/palettes/hex_maniac.pal delete mode 100644 graphics/trainers/palettes/hiker.pal delete mode 100644 graphics/trainers/palettes/interviewer.pal delete mode 100644 graphics/trainers/palettes/kindler.pal delete mode 100644 graphics/trainers/palettes/lady.pal delete mode 100644 graphics/trainers/palettes/lass.pal delete mode 100644 graphics/trainers/palettes/leader_brawly.pal delete mode 100644 graphics/trainers/palettes/leader_flannery.pal delete mode 100644 graphics/trainers/palettes/leader_juan.pal delete mode 100644 graphics/trainers/palettes/leader_norman.pal delete mode 100644 graphics/trainers/palettes/leader_roxanne.pal delete mode 100644 graphics/trainers/palettes/leader_tate_and_liza.pal delete mode 100644 graphics/trainers/palettes/leader_wattson.pal delete mode 100644 graphics/trainers/palettes/leader_winona.pal delete mode 100644 graphics/trainers/palettes/leaf.pal delete mode 100644 graphics/trainers/palettes/leaf_back_pic.pal delete mode 100644 graphics/trainers/palettes/magma_admin.pal delete mode 100644 graphics/trainers/palettes/magma_grunt_f.pal delete mode 100644 graphics/trainers/palettes/magma_grunt_m.pal delete mode 100644 graphics/trainers/palettes/magma_leader_maxie.pal rename graphics/trainers/palettes/{ruby_sapphire_may.pal => may_rs.pal} (100%) delete mode 100644 graphics/trainers/palettes/ninja_boy.pal delete mode 100644 graphics/trainers/palettes/old_couple.pal delete mode 100644 graphics/trainers/palettes/palace_maven_spenser.pal delete mode 100644 graphics/trainers/palettes/parasol_lady.pal delete mode 100644 graphics/trainers/palettes/picnicker.pal delete mode 100644 graphics/trainers/palettes/pike_queen_lucy.pal delete mode 100644 graphics/trainers/palettes/pokefan_f.pal delete mode 100644 graphics/trainers/palettes/pokefan_m.pal delete mode 100644 graphics/trainers/palettes/pokemaniac.pal delete mode 100644 graphics/trainers/palettes/pokemon_breeder_f.pal delete mode 100644 graphics/trainers/palettes/pokemon_breeder_m.pal delete mode 100644 graphics/trainers/palettes/pokemon_ranger_f.pal delete mode 100644 graphics/trainers/palettes/pokemon_ranger_m.pal delete mode 100644 graphics/trainers/palettes/psychic_f.pal delete mode 100644 graphics/trainers/palettes/psychic_m.pal delete mode 100644 graphics/trainers/palettes/pyramid_king_brandon.pal delete mode 100644 graphics/trainers/palettes/red.pal delete mode 100644 graphics/trainers/palettes/red_back_pic.pal delete mode 100644 graphics/trainers/palettes/rich_boy.pal delete mode 100644 graphics/trainers/palettes/ruin_maniac.pal delete mode 100644 graphics/trainers/palettes/running_triathlete_f.pal delete mode 100644 graphics/trainers/palettes/running_triathlete_m.pal delete mode 100644 graphics/trainers/palettes/sailor.pal delete mode 100644 graphics/trainers/palettes/salon_maiden_anabel.pal delete mode 100644 graphics/trainers/palettes/school_kid_f.pal delete mode 100644 graphics/trainers/palettes/school_kid_m.pal delete mode 100644 graphics/trainers/palettes/sis_and_bro.pal delete mode 100644 graphics/trainers/palettes/sr_and_jr.pal delete mode 100644 graphics/trainers/palettes/swimmer_f.pal delete mode 100644 graphics/trainers/palettes/swimmer_m.pal delete mode 100644 graphics/trainers/palettes/swimming_triathlete_f.pal delete mode 100644 graphics/trainers/palettes/swimming_triathlete_m.pal delete mode 100644 graphics/trainers/palettes/tuber_f.pal delete mode 100644 graphics/trainers/palettes/tuber_m.pal delete mode 100644 graphics/trainers/palettes/twins.pal delete mode 100644 graphics/trainers/palettes/young_couple.pal delete mode 100644 graphics/trainers/palettes/youngster.pal diff --git a/graphics/trainers/back_pics/brendan_back_pic.png b/graphics/trainers/back_pics/brendan.png similarity index 100% rename from graphics/trainers/back_pics/brendan_back_pic.png rename to graphics/trainers/back_pics/brendan.png diff --git a/graphics/trainers/back_pics/ruby_sapphire_brendan_back_pic.png b/graphics/trainers/back_pics/brendan_rs.png similarity index 100% rename from graphics/trainers/back_pics/ruby_sapphire_brendan_back_pic.png rename to graphics/trainers/back_pics/brendan_rs.png diff --git a/graphics/trainers/back_pics/leaf_back_pic.png b/graphics/trainers/back_pics/leaf.png similarity index 100% rename from graphics/trainers/back_pics/leaf_back_pic.png rename to graphics/trainers/back_pics/leaf.png diff --git a/graphics/trainers/back_pics/may_back_pic.png b/graphics/trainers/back_pics/may.png similarity index 100% rename from graphics/trainers/back_pics/may_back_pic.png rename to graphics/trainers/back_pics/may.png diff --git a/graphics/trainers/back_pics/ruby_sapphire_may_back_pic.png b/graphics/trainers/back_pics/may_rs.png similarity index 100% rename from graphics/trainers/back_pics/ruby_sapphire_may_back_pic.png rename to graphics/trainers/back_pics/may_rs.png diff --git a/graphics/trainers/back_pics/red_back_pic.png b/graphics/trainers/back_pics/red.png similarity index 100% rename from graphics/trainers/back_pics/red_back_pic.png rename to graphics/trainers/back_pics/red.png diff --git a/graphics/trainers/back_pics/steven_back_pic.png b/graphics/trainers/back_pics/steven.png similarity index 100% rename from graphics/trainers/back_pics/steven_back_pic.png rename to graphics/trainers/back_pics/steven.png diff --git a/graphics/trainers/back_pics/wally_back_pic.png b/graphics/trainers/back_pics/wally.png similarity index 100% rename from graphics/trainers/back_pics/wally_back_pic.png rename to graphics/trainers/back_pics/wally.png diff --git a/graphics/trainers/front_pics/aqua_admin_f_front_pic.png b/graphics/trainers/front_pics/aqua_admin_f.png similarity index 100% rename from graphics/trainers/front_pics/aqua_admin_f_front_pic.png rename to graphics/trainers/front_pics/aqua_admin_f.png diff --git a/graphics/trainers/front_pics/aqua_admin_m_front_pic.png b/graphics/trainers/front_pics/aqua_admin_m.png similarity index 100% rename from graphics/trainers/front_pics/aqua_admin_m_front_pic.png rename to graphics/trainers/front_pics/aqua_admin_m.png diff --git a/graphics/trainers/front_pics/aqua_grunt_f_front_pic.png b/graphics/trainers/front_pics/aqua_grunt_f.png similarity index 100% rename from graphics/trainers/front_pics/aqua_grunt_f_front_pic.png rename to graphics/trainers/front_pics/aqua_grunt_f.png diff --git a/graphics/trainers/front_pics/aqua_grunt_m_front_pic.png b/graphics/trainers/front_pics/aqua_grunt_m.png similarity index 100% rename from graphics/trainers/front_pics/aqua_grunt_m_front_pic.png rename to graphics/trainers/front_pics/aqua_grunt_m.png diff --git a/graphics/trainers/front_pics/aqua_leader_archie_front_pic.png b/graphics/trainers/front_pics/aqua_leader_archie.png similarity index 100% rename from graphics/trainers/front_pics/aqua_leader_archie_front_pic.png rename to graphics/trainers/front_pics/aqua_leader_archie.png diff --git a/graphics/trainers/front_pics/arena_tycoon_greta_front_pic.png b/graphics/trainers/front_pics/arena_tycoon_greta.png similarity index 100% rename from graphics/trainers/front_pics/arena_tycoon_greta_front_pic.png rename to graphics/trainers/front_pics/arena_tycoon_greta.png diff --git a/graphics/trainers/front_pics/aroma_lady_front_pic.png b/graphics/trainers/front_pics/aroma_lady.png similarity index 100% rename from graphics/trainers/front_pics/aroma_lady_front_pic.png rename to graphics/trainers/front_pics/aroma_lady.png diff --git a/graphics/trainers/front_pics/battle_girl_front_pic.png b/graphics/trainers/front_pics/battle_girl.png similarity index 100% rename from graphics/trainers/front_pics/battle_girl_front_pic.png rename to graphics/trainers/front_pics/battle_girl.png diff --git a/graphics/trainers/front_pics/beauty_front_pic.png b/graphics/trainers/front_pics/beauty.png similarity index 100% rename from graphics/trainers/front_pics/beauty_front_pic.png rename to graphics/trainers/front_pics/beauty.png diff --git a/graphics/trainers/front_pics/bird_keeper_front_pic.png b/graphics/trainers/front_pics/bird_keeper.png similarity index 100% rename from graphics/trainers/front_pics/bird_keeper_front_pic.png rename to graphics/trainers/front_pics/bird_keeper.png diff --git a/graphics/trainers/front_pics/black_belt_front_pic.png b/graphics/trainers/front_pics/black_belt.png similarity index 100% rename from graphics/trainers/front_pics/black_belt_front_pic.png rename to graphics/trainers/front_pics/black_belt.png diff --git a/graphics/trainers/front_pics/brendan_front_pic.png b/graphics/trainers/front_pics/brendan.png similarity index 100% rename from graphics/trainers/front_pics/brendan_front_pic.png rename to graphics/trainers/front_pics/brendan.png diff --git a/graphics/trainers/front_pics/ruby_sapphire_brendan_front_pic.png b/graphics/trainers/front_pics/brendan_rs.png similarity index 100% rename from graphics/trainers/front_pics/ruby_sapphire_brendan_front_pic.png rename to graphics/trainers/front_pics/brendan_rs.png diff --git a/graphics/trainers/front_pics/bug_catcher_front_pic.png b/graphics/trainers/front_pics/bug_catcher.png similarity index 100% rename from graphics/trainers/front_pics/bug_catcher_front_pic.png rename to graphics/trainers/front_pics/bug_catcher.png diff --git a/graphics/trainers/front_pics/bug_maniac_front_pic.png b/graphics/trainers/front_pics/bug_maniac.png similarity index 100% rename from graphics/trainers/front_pics/bug_maniac_front_pic.png rename to graphics/trainers/front_pics/bug_maniac.png diff --git a/graphics/trainers/front_pics/camper_front_pic.png b/graphics/trainers/front_pics/camper.png similarity index 100% rename from graphics/trainers/front_pics/camper_front_pic.png rename to graphics/trainers/front_pics/camper.png diff --git a/graphics/trainers/front_pics/champion_wallace_front_pic.png b/graphics/trainers/front_pics/champion_wallace.png similarity index 100% rename from graphics/trainers/front_pics/champion_wallace_front_pic.png rename to graphics/trainers/front_pics/champion_wallace.png diff --git a/graphics/trainers/front_pics/collector_front_pic.png b/graphics/trainers/front_pics/collector.png similarity index 100% rename from graphics/trainers/front_pics/collector_front_pic.png rename to graphics/trainers/front_pics/collector.png diff --git a/graphics/trainers/front_pics/cooltrainer_f_front_pic.png b/graphics/trainers/front_pics/cooltrainer_f.png similarity index 100% rename from graphics/trainers/front_pics/cooltrainer_f_front_pic.png rename to graphics/trainers/front_pics/cooltrainer_f.png diff --git a/graphics/trainers/front_pics/cooltrainer_m_front_pic.png b/graphics/trainers/front_pics/cooltrainer_m.png similarity index 100% rename from graphics/trainers/front_pics/cooltrainer_m_front_pic.png rename to graphics/trainers/front_pics/cooltrainer_m.png diff --git a/graphics/trainers/front_pics/cycling_triathlete_f_front_pic.png b/graphics/trainers/front_pics/cycling_triathlete_f.png similarity index 100% rename from graphics/trainers/front_pics/cycling_triathlete_f_front_pic.png rename to graphics/trainers/front_pics/cycling_triathlete_f.png diff --git a/graphics/trainers/front_pics/cycling_triathlete_m_front_pic.png b/graphics/trainers/front_pics/cycling_triathlete_m.png similarity index 100% rename from graphics/trainers/front_pics/cycling_triathlete_m_front_pic.png rename to graphics/trainers/front_pics/cycling_triathlete_m.png diff --git a/graphics/trainers/front_pics/dome_ace_tucker_front_pic.png b/graphics/trainers/front_pics/dome_ace_tucker.png similarity index 100% rename from graphics/trainers/front_pics/dome_ace_tucker_front_pic.png rename to graphics/trainers/front_pics/dome_ace_tucker.png diff --git a/graphics/trainers/front_pics/dragon_tamer_front_pic.png b/graphics/trainers/front_pics/dragon_tamer.png similarity index 100% rename from graphics/trainers/front_pics/dragon_tamer_front_pic.png rename to graphics/trainers/front_pics/dragon_tamer.png diff --git a/graphics/trainers/front_pics/elite_four_drake_front_pic.png b/graphics/trainers/front_pics/elite_four_drake.png similarity index 100% rename from graphics/trainers/front_pics/elite_four_drake_front_pic.png rename to graphics/trainers/front_pics/elite_four_drake.png diff --git a/graphics/trainers/front_pics/elite_four_glacia_front_pic.png b/graphics/trainers/front_pics/elite_four_glacia.png similarity index 100% rename from graphics/trainers/front_pics/elite_four_glacia_front_pic.png rename to graphics/trainers/front_pics/elite_four_glacia.png diff --git a/graphics/trainers/front_pics/elite_four_phoebe_front_pic.png b/graphics/trainers/front_pics/elite_four_phoebe.png similarity index 100% rename from graphics/trainers/front_pics/elite_four_phoebe_front_pic.png rename to graphics/trainers/front_pics/elite_four_phoebe.png diff --git a/graphics/trainers/front_pics/elite_four_sidney_front_pic.png b/graphics/trainers/front_pics/elite_four_sidney.png similarity index 100% rename from graphics/trainers/front_pics/elite_four_sidney_front_pic.png rename to graphics/trainers/front_pics/elite_four_sidney.png diff --git a/graphics/trainers/front_pics/expert_f_front_pic.png b/graphics/trainers/front_pics/expert_f.png similarity index 100% rename from graphics/trainers/front_pics/expert_f_front_pic.png rename to graphics/trainers/front_pics/expert_f.png diff --git a/graphics/trainers/front_pics/expert_m_front_pic.png b/graphics/trainers/front_pics/expert_m.png similarity index 100% rename from graphics/trainers/front_pics/expert_m_front_pic.png rename to graphics/trainers/front_pics/expert_m.png diff --git a/graphics/trainers/front_pics/factory_head_noland_front_pic.png b/graphics/trainers/front_pics/factory_head_noland.png similarity index 100% rename from graphics/trainers/front_pics/factory_head_noland_front_pic.png rename to graphics/trainers/front_pics/factory_head_noland.png diff --git a/graphics/trainers/front_pics/fisherman_front_pic.png b/graphics/trainers/front_pics/fisherman.png similarity index 100% rename from graphics/trainers/front_pics/fisherman_front_pic.png rename to graphics/trainers/front_pics/fisherman.png diff --git a/graphics/trainers/front_pics/gentleman_front_pic.png b/graphics/trainers/front_pics/gentleman.png similarity index 100% rename from graphics/trainers/front_pics/gentleman_front_pic.png rename to graphics/trainers/front_pics/gentleman.png diff --git a/graphics/trainers/front_pics/guitarist_front_pic.png b/graphics/trainers/front_pics/guitarist.png similarity index 100% rename from graphics/trainers/front_pics/guitarist_front_pic.png rename to graphics/trainers/front_pics/guitarist.png diff --git a/graphics/trainers/front_pics/hex_maniac_front_pic.png b/graphics/trainers/front_pics/hex_maniac.png similarity index 100% rename from graphics/trainers/front_pics/hex_maniac_front_pic.png rename to graphics/trainers/front_pics/hex_maniac.png diff --git a/graphics/trainers/front_pics/hiker_front_pic.png b/graphics/trainers/front_pics/hiker.png similarity index 100% rename from graphics/trainers/front_pics/hiker_front_pic.png rename to graphics/trainers/front_pics/hiker.png diff --git a/graphics/trainers/front_pics/interviewer_front_pic.png b/graphics/trainers/front_pics/interviewer.png similarity index 100% rename from graphics/trainers/front_pics/interviewer_front_pic.png rename to graphics/trainers/front_pics/interviewer.png diff --git a/graphics/trainers/front_pics/kindler_front_pic.png b/graphics/trainers/front_pics/kindler.png similarity index 100% rename from graphics/trainers/front_pics/kindler_front_pic.png rename to graphics/trainers/front_pics/kindler.png diff --git a/graphics/trainers/front_pics/lady_front_pic.png b/graphics/trainers/front_pics/lady.png similarity index 100% rename from graphics/trainers/front_pics/lady_front_pic.png rename to graphics/trainers/front_pics/lady.png diff --git a/graphics/trainers/front_pics/lass_front_pic.png b/graphics/trainers/front_pics/lass.png similarity index 100% rename from graphics/trainers/front_pics/lass_front_pic.png rename to graphics/trainers/front_pics/lass.png diff --git a/graphics/trainers/front_pics/leader_brawly_front_pic.png b/graphics/trainers/front_pics/leader_brawly.png similarity index 100% rename from graphics/trainers/front_pics/leader_brawly_front_pic.png rename to graphics/trainers/front_pics/leader_brawly.png diff --git a/graphics/trainers/front_pics/leader_flannery_front_pic.png b/graphics/trainers/front_pics/leader_flannery.png similarity index 100% rename from graphics/trainers/front_pics/leader_flannery_front_pic.png rename to graphics/trainers/front_pics/leader_flannery.png diff --git a/graphics/trainers/front_pics/leader_juan_front_pic.png b/graphics/trainers/front_pics/leader_juan.png similarity index 100% rename from graphics/trainers/front_pics/leader_juan_front_pic.png rename to graphics/trainers/front_pics/leader_juan.png diff --git a/graphics/trainers/front_pics/leader_norman_front_pic.png b/graphics/trainers/front_pics/leader_norman.png similarity index 100% rename from graphics/trainers/front_pics/leader_norman_front_pic.png rename to graphics/trainers/front_pics/leader_norman.png diff --git a/graphics/trainers/front_pics/leader_roxanne_front_pic.png b/graphics/trainers/front_pics/leader_roxanne.png similarity index 100% rename from graphics/trainers/front_pics/leader_roxanne_front_pic.png rename to graphics/trainers/front_pics/leader_roxanne.png diff --git a/graphics/trainers/front_pics/leader_tate_and_liza_front_pic.png b/graphics/trainers/front_pics/leader_tate_and_liza.png similarity index 100% rename from graphics/trainers/front_pics/leader_tate_and_liza_front_pic.png rename to graphics/trainers/front_pics/leader_tate_and_liza.png diff --git a/graphics/trainers/front_pics/leader_wattson_front_pic.png b/graphics/trainers/front_pics/leader_wattson.png similarity index 100% rename from graphics/trainers/front_pics/leader_wattson_front_pic.png rename to graphics/trainers/front_pics/leader_wattson.png diff --git a/graphics/trainers/front_pics/leader_winona_front_pic.png b/graphics/trainers/front_pics/leader_winona.png similarity index 100% rename from graphics/trainers/front_pics/leader_winona_front_pic.png rename to graphics/trainers/front_pics/leader_winona.png diff --git a/graphics/trainers/front_pics/leaf_front_pic.png b/graphics/trainers/front_pics/leaf.png similarity index 100% rename from graphics/trainers/front_pics/leaf_front_pic.png rename to graphics/trainers/front_pics/leaf.png diff --git a/graphics/trainers/front_pics/magma_admin_front_pic.png b/graphics/trainers/front_pics/magma_admin.png similarity index 100% rename from graphics/trainers/front_pics/magma_admin_front_pic.png rename to graphics/trainers/front_pics/magma_admin.png diff --git a/graphics/trainers/front_pics/magma_grunt_f_front_pic.png b/graphics/trainers/front_pics/magma_grunt_f.png similarity index 100% rename from graphics/trainers/front_pics/magma_grunt_f_front_pic.png rename to graphics/trainers/front_pics/magma_grunt_f.png diff --git a/graphics/trainers/front_pics/magma_grunt_m_front_pic.png b/graphics/trainers/front_pics/magma_grunt_m.png similarity index 100% rename from graphics/trainers/front_pics/magma_grunt_m_front_pic.png rename to graphics/trainers/front_pics/magma_grunt_m.png diff --git a/graphics/trainers/front_pics/magma_leader_maxie_front_pic.png b/graphics/trainers/front_pics/magma_leader_maxie.png similarity index 100% rename from graphics/trainers/front_pics/magma_leader_maxie_front_pic.png rename to graphics/trainers/front_pics/magma_leader_maxie.png diff --git a/graphics/trainers/front_pics/may_front_pic.png b/graphics/trainers/front_pics/may.png similarity index 100% rename from graphics/trainers/front_pics/may_front_pic.png rename to graphics/trainers/front_pics/may.png diff --git a/graphics/trainers/front_pics/ruby_sapphire_may_front_pic.png b/graphics/trainers/front_pics/may_rs.png similarity index 100% rename from graphics/trainers/front_pics/ruby_sapphire_may_front_pic.png rename to graphics/trainers/front_pics/may_rs.png diff --git a/graphics/trainers/front_pics/ninja_boy_front_pic.png b/graphics/trainers/front_pics/ninja_boy.png similarity index 100% rename from graphics/trainers/front_pics/ninja_boy_front_pic.png rename to graphics/trainers/front_pics/ninja_boy.png diff --git a/graphics/trainers/front_pics/old_couple_front_pic.png b/graphics/trainers/front_pics/old_couple.png similarity index 100% rename from graphics/trainers/front_pics/old_couple_front_pic.png rename to graphics/trainers/front_pics/old_couple.png diff --git a/graphics/trainers/front_pics/palace_maven_spenser_front_pic.png b/graphics/trainers/front_pics/palace_maven_spenser.png similarity index 100% rename from graphics/trainers/front_pics/palace_maven_spenser_front_pic.png rename to graphics/trainers/front_pics/palace_maven_spenser.png diff --git a/graphics/trainers/front_pics/parasol_lady_front_pic.png b/graphics/trainers/front_pics/parasol_lady.png similarity index 100% rename from graphics/trainers/front_pics/parasol_lady_front_pic.png rename to graphics/trainers/front_pics/parasol_lady.png diff --git a/graphics/trainers/front_pics/picnicker_front_pic.png b/graphics/trainers/front_pics/picnicker.png similarity index 100% rename from graphics/trainers/front_pics/picnicker_front_pic.png rename to graphics/trainers/front_pics/picnicker.png diff --git a/graphics/trainers/front_pics/pike_queen_lucy_front_pic.png b/graphics/trainers/front_pics/pike_queen_lucy.png similarity index 100% rename from graphics/trainers/front_pics/pike_queen_lucy_front_pic.png rename to graphics/trainers/front_pics/pike_queen_lucy.png diff --git a/graphics/trainers/front_pics/pokefan_f_front_pic.png b/graphics/trainers/front_pics/pokefan_f.png similarity index 100% rename from graphics/trainers/front_pics/pokefan_f_front_pic.png rename to graphics/trainers/front_pics/pokefan_f.png diff --git a/graphics/trainers/front_pics/pokefan_m_front_pic.png b/graphics/trainers/front_pics/pokefan_m.png similarity index 100% rename from graphics/trainers/front_pics/pokefan_m_front_pic.png rename to graphics/trainers/front_pics/pokefan_m.png diff --git a/graphics/trainers/front_pics/pokemaniac_front_pic.png b/graphics/trainers/front_pics/pokemaniac.png similarity index 100% rename from graphics/trainers/front_pics/pokemaniac_front_pic.png rename to graphics/trainers/front_pics/pokemaniac.png diff --git a/graphics/trainers/front_pics/pokemon_breeder_f_front_pic.png b/graphics/trainers/front_pics/pokemon_breeder_f.png similarity index 100% rename from graphics/trainers/front_pics/pokemon_breeder_f_front_pic.png rename to graphics/trainers/front_pics/pokemon_breeder_f.png diff --git a/graphics/trainers/front_pics/pokemon_breeder_m_front_pic.png b/graphics/trainers/front_pics/pokemon_breeder_m.png similarity index 100% rename from graphics/trainers/front_pics/pokemon_breeder_m_front_pic.png rename to graphics/trainers/front_pics/pokemon_breeder_m.png diff --git a/graphics/trainers/front_pics/pokemon_ranger_f_front_pic.png b/graphics/trainers/front_pics/pokemon_ranger_f.png similarity index 100% rename from graphics/trainers/front_pics/pokemon_ranger_f_front_pic.png rename to graphics/trainers/front_pics/pokemon_ranger_f.png diff --git a/graphics/trainers/front_pics/pokemon_ranger_m_front_pic.png b/graphics/trainers/front_pics/pokemon_ranger_m.png similarity index 100% rename from graphics/trainers/front_pics/pokemon_ranger_m_front_pic.png rename to graphics/trainers/front_pics/pokemon_ranger_m.png diff --git a/graphics/trainers/front_pics/psychic_f_front_pic.png b/graphics/trainers/front_pics/psychic_f.png similarity index 100% rename from graphics/trainers/front_pics/psychic_f_front_pic.png rename to graphics/trainers/front_pics/psychic_f.png diff --git a/graphics/trainers/front_pics/psychic_m_front_pic.png b/graphics/trainers/front_pics/psychic_m.png similarity index 100% rename from graphics/trainers/front_pics/psychic_m_front_pic.png rename to graphics/trainers/front_pics/psychic_m.png diff --git a/graphics/trainers/front_pics/pyramid_king_brandon_front_pic.png b/graphics/trainers/front_pics/pyramid_king_brandon.png similarity index 100% rename from graphics/trainers/front_pics/pyramid_king_brandon_front_pic.png rename to graphics/trainers/front_pics/pyramid_king_brandon.png diff --git a/graphics/trainers/front_pics/red_front_pic.png b/graphics/trainers/front_pics/red.png similarity index 100% rename from graphics/trainers/front_pics/red_front_pic.png rename to graphics/trainers/front_pics/red.png diff --git a/graphics/trainers/front_pics/rich_boy_front_pic.png b/graphics/trainers/front_pics/rich_boy.png similarity index 100% rename from graphics/trainers/front_pics/rich_boy_front_pic.png rename to graphics/trainers/front_pics/rich_boy.png diff --git a/graphics/trainers/front_pics/ruin_maniac_front_pic.png b/graphics/trainers/front_pics/ruin_maniac.png similarity index 100% rename from graphics/trainers/front_pics/ruin_maniac_front_pic.png rename to graphics/trainers/front_pics/ruin_maniac.png diff --git a/graphics/trainers/front_pics/running_triathlete_f_front_pic.png b/graphics/trainers/front_pics/running_triathlete_f.png similarity index 100% rename from graphics/trainers/front_pics/running_triathlete_f_front_pic.png rename to graphics/trainers/front_pics/running_triathlete_f.png diff --git a/graphics/trainers/front_pics/running_triathlete_m_front_pic.png b/graphics/trainers/front_pics/running_triathlete_m.png similarity index 100% rename from graphics/trainers/front_pics/running_triathlete_m_front_pic.png rename to graphics/trainers/front_pics/running_triathlete_m.png diff --git a/graphics/trainers/front_pics/sailor_front_pic.png b/graphics/trainers/front_pics/sailor.png similarity index 100% rename from graphics/trainers/front_pics/sailor_front_pic.png rename to graphics/trainers/front_pics/sailor.png diff --git a/graphics/trainers/front_pics/salon_maiden_anabel_front_pic.png b/graphics/trainers/front_pics/salon_maiden_anabel.png similarity index 100% rename from graphics/trainers/front_pics/salon_maiden_anabel_front_pic.png rename to graphics/trainers/front_pics/salon_maiden_anabel.png diff --git a/graphics/trainers/front_pics/school_kid_f_front_pic.png b/graphics/trainers/front_pics/school_kid_f.png similarity index 100% rename from graphics/trainers/front_pics/school_kid_f_front_pic.png rename to graphics/trainers/front_pics/school_kid_f.png diff --git a/graphics/trainers/front_pics/school_kid_m_front_pic.png b/graphics/trainers/front_pics/school_kid_m.png similarity index 100% rename from graphics/trainers/front_pics/school_kid_m_front_pic.png rename to graphics/trainers/front_pics/school_kid_m.png diff --git a/graphics/trainers/front_pics/sis_and_bro_front_pic.png b/graphics/trainers/front_pics/sis_and_bro.png similarity index 100% rename from graphics/trainers/front_pics/sis_and_bro_front_pic.png rename to graphics/trainers/front_pics/sis_and_bro.png diff --git a/graphics/trainers/front_pics/sr_and_jr_front_pic.png b/graphics/trainers/front_pics/sr_and_jr.png similarity index 100% rename from graphics/trainers/front_pics/sr_and_jr_front_pic.png rename to graphics/trainers/front_pics/sr_and_jr.png diff --git a/graphics/trainers/front_pics/steven_front_pic.png b/graphics/trainers/front_pics/steven.png similarity index 100% rename from graphics/trainers/front_pics/steven_front_pic.png rename to graphics/trainers/front_pics/steven.png diff --git a/graphics/trainers/front_pics/swimmer_f_front_pic.png b/graphics/trainers/front_pics/swimmer_f.png similarity index 100% rename from graphics/trainers/front_pics/swimmer_f_front_pic.png rename to graphics/trainers/front_pics/swimmer_f.png diff --git a/graphics/trainers/front_pics/swimmer_m_front_pic.png b/graphics/trainers/front_pics/swimmer_m.png similarity index 100% rename from graphics/trainers/front_pics/swimmer_m_front_pic.png rename to graphics/trainers/front_pics/swimmer_m.png diff --git a/graphics/trainers/front_pics/swimming_triathlete_f_front_pic.png b/graphics/trainers/front_pics/swimming_triathlete_f.png similarity index 100% rename from graphics/trainers/front_pics/swimming_triathlete_f_front_pic.png rename to graphics/trainers/front_pics/swimming_triathlete_f.png diff --git a/graphics/trainers/front_pics/swimming_triathlete_m_front_pic.png b/graphics/trainers/front_pics/swimming_triathlete_m.png similarity index 100% rename from graphics/trainers/front_pics/swimming_triathlete_m_front_pic.png rename to graphics/trainers/front_pics/swimming_triathlete_m.png diff --git a/graphics/trainers/front_pics/tuber_f_front_pic.png b/graphics/trainers/front_pics/tuber_f.png similarity index 100% rename from graphics/trainers/front_pics/tuber_f_front_pic.png rename to graphics/trainers/front_pics/tuber_f.png diff --git a/graphics/trainers/front_pics/tuber_m_front_pic.png b/graphics/trainers/front_pics/tuber_m.png similarity index 100% rename from graphics/trainers/front_pics/tuber_m_front_pic.png rename to graphics/trainers/front_pics/tuber_m.png diff --git a/graphics/trainers/front_pics/twins_front_pic.png b/graphics/trainers/front_pics/twins.png similarity index 100% rename from graphics/trainers/front_pics/twins_front_pic.png rename to graphics/trainers/front_pics/twins.png diff --git a/graphics/trainers/front_pics/wally_front_pic.png b/graphics/trainers/front_pics/wally.png similarity index 100% rename from graphics/trainers/front_pics/wally_front_pic.png rename to graphics/trainers/front_pics/wally.png diff --git a/graphics/trainers/front_pics/young_couple_front_pic.png b/graphics/trainers/front_pics/young_couple.png similarity index 100% rename from graphics/trainers/front_pics/young_couple_front_pic.png rename to graphics/trainers/front_pics/young_couple.png diff --git a/graphics/trainers/front_pics/youngster_front_pic.png b/graphics/trainers/front_pics/youngster.png similarity index 100% rename from graphics/trainers/front_pics/youngster_front_pic.png rename to graphics/trainers/front_pics/youngster.png diff --git a/graphics/trainers/palettes/aqua_admin_f.pal b/graphics/trainers/palettes/aqua_admin_f.pal deleted file mode 100644 index 4bad687705..0000000000 --- a/graphics/trainers/palettes/aqua_admin_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 131 41 -189 156 90 -238 98 41 -180 65 41 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/aqua_admin_m.pal b/graphics/trainers/palettes/aqua_admin_m.pal deleted file mode 100644 index 2a7a46d462..0000000000 --- a/graphics/trainers/palettes/aqua_admin_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 131 41 -189 156 90 -222 82 24 -164 49 24 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/aqua_grunt_f.pal b/graphics/trainers/palettes/aqua_grunt_f.pal deleted file mode 100644 index 4563eba48e..0000000000 --- a/graphics/trainers/palettes/aqua_grunt_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -164 74 65 -189 156 90 -255 106 98 -205 82 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/aqua_grunt_m.pal b/graphics/trainers/palettes/aqua_grunt_m.pal deleted file mode 100644 index c2b28ead91..0000000000 --- a/graphics/trainers/palettes/aqua_grunt_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 164 197 -189 156 90 -255 115 148 -213 82 115 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/aqua_leader_archie.pal b/graphics/trainers/palettes/aqua_leader_archie.pal deleted file mode 100644 index a778ea6bb6..0000000000 --- a/graphics/trainers/palettes/aqua_leader_archie.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -131 156 180 -106 123 148 -82 90 115 -57 65 98 -213 213 222 -82 90 156 -24 32 49 -148 156 222 -106 115 213 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/arena_tycoon_greta.pal b/graphics/trainers/palettes/arena_tycoon_greta.pal deleted file mode 100644 index 60c45e8e99..0000000000 --- a/graphics/trainers/palettes/arena_tycoon_greta.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -255 230 106 -213 189 90 -213 222 230 -65 82 123 -189 156 90 -255 115 148 -213 82 115 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/aroma_lady.pal b/graphics/trainers/palettes/aroma_lady.pal deleted file mode 100644 index eb9f3dfd43..0000000000 --- a/graphics/trainers/palettes/aroma_lady.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 213 172 -238 197 148 -205 156 115 -115 82 65 -238 230 255 -205 197 213 -156 164 205 -106 98 148 -74 222 148 -172 115 41 -115 65 24 -238 90 131 -189 65 90 -106 255 156 -0 0 0 diff --git a/graphics/trainers/palettes/battle_girl.pal b/graphics/trainers/palettes/battle_girl.pal deleted file mode 100644 index 7f172b169a..0000000000 --- a/graphics/trainers/palettes/battle_girl.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -255 164 82 -230 106 0 -197 65 65 -156 106 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/beauty.pal b/graphics/trainers/palettes/beauty.pal deleted file mode 100644 index ab549df20e..0000000000 --- a/graphics/trainers/palettes/beauty.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -230 172 131 -205 131 115 -123 82 74 -148 131 139 -255 205 106 -213 172 74 -164 123 82 -115 90 115 -74 49 74 -255 82 57 -180 82 74 -131 74 65 -255 255 255 -0 0 24 diff --git a/graphics/trainers/palettes/bird_keeper.pal b/graphics/trainers/palettes/bird_keeper.pal deleted file mode 100644 index 87194c84a1..0000000000 --- a/graphics/trainers/palettes/bird_keeper.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -164 180 197 -131 139 156 -90 98 115 -57 65 82 -213 213 222 -131 16 41 -24 32 49 -213 82 90 -180 41 57 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/black_belt.pal b/graphics/trainers/palettes/black_belt.pal deleted file mode 100644 index 869e5d8df4..0000000000 --- a/graphics/trainers/palettes/black_belt.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -246 205 189 -222 172 148 -172 131 106 -90 65 49 -148 131 123 -106 90 82 -82 90 115 -49 57 82 -205 189 189 -189 164 164 -156 139 139 -255 98 90 -197 65 65 -246 230 230 -0 0 0 diff --git a/graphics/trainers/palettes/ruby_sapphire_brendan.pal b/graphics/trainers/palettes/brendan_rs.pal similarity index 100% rename from graphics/trainers/palettes/ruby_sapphire_brendan.pal rename to graphics/trainers/palettes/brendan_rs.pal diff --git a/graphics/trainers/palettes/bug_catcher.pal b/graphics/trainers/palettes/bug_catcher.pal deleted file mode 100644 index c68f566902..0000000000 --- a/graphics/trainers/palettes/bug_catcher.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -230 180 148 -213 148 115 -123 90 82 -222 222 164 -197 197 139 -156 139 74 -41 57 98 -197 197 238 -246 238 213 -189 49 57 -98 164 222 -49 123 156 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/bug_maniac.pal b/graphics/trainers/palettes/bug_maniac.pal deleted file mode 100644 index 2aa3291792..0000000000 --- a/graphics/trainers/palettes/bug_maniac.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -49 123 156 -49 65 131 -65 74 74 -222 222 164 -197 197 139 -205 213 213 -156 139 74 -98 164 222 -106 115 115 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/camper.pal b/graphics/trainers/palettes/camper.pal deleted file mode 100644 index e5c224fd27..0000000000 --- a/graphics/trainers/palettes/camper.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -230 189 156 -205 156 115 -115 82 65 -131 213 205 -82 164 148 -180 189 222 -57 90 74 -24 49 90 -98 115 230 -57 82 131 -255 98 41 -189 74 41 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/champion_wallace.pal b/graphics/trainers/palettes/champion_wallace.pal deleted file mode 100644 index eaaed070f6..0000000000 --- a/graphics/trainers/palettes/champion_wallace.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -222 180 148 -189 139 106 -98 57 65 -189 131 255 -148 106 172 -115 131 255 -82 106 180 -197 197 213 -57 74 115 -139 139 164 -57 41 57 -98 57 98 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/collector.pal b/graphics/trainers/palettes/collector.pal deleted file mode 100644 index d4d9221e2a..0000000000 --- a/graphics/trainers/palettes/collector.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -230 180 148 -197 139 115 -123 90 82 -106 139 189 -65 98 148 -32 74 123 -255 98 90 -197 65 65 -213 222 230 -131 74 65 -115 123 131 -164 172 180 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/cooltrainer_f.pal b/graphics/trainers/palettes/cooltrainer_f.pal deleted file mode 100644 index 292d0fc781..0000000000 --- a/graphics/trainers/palettes/cooltrainer_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -238 197 156 -205 156 115 -115 82 65 -238 156 115 -205 90 74 -0 189 222 -123 41 24 -180 230 139 -139 180 57 -74 90 32 -255 246 189 -213 205 131 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/cooltrainer_m.pal b/graphics/trainers/palettes/cooltrainer_m.pal deleted file mode 100644 index 52a32e925d..0000000000 --- a/graphics/trainers/palettes/cooltrainer_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -246 205 156 -205 156 115 -115 82 65 -238 156 115 -230 98 82 -180 90 74 -131 49 32 -57 90 41 -164 180 106 -98 123 57 -255 246 189 -213 205 131 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/cycling_triathlete_f.pal b/graphics/trainers/palettes/cycling_triathlete_f.pal deleted file mode 100644 index b72bb3011f..0000000000 --- a/graphics/trainers/palettes/cycling_triathlete_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -57 41 57 -57 74 106 -131 131 156 -139 156 238 -115 131 205 -98 106 172 -205 197 255 -230 90 65 -189 74 41 -139 74 82 -255 255 255 -0 0 24 diff --git a/graphics/trainers/palettes/cycling_triathlete_m.pal b/graphics/trainers/palettes/cycling_triathlete_m.pal deleted file mode 100644 index 9255a4a94a..0000000000 --- a/graphics/trainers/palettes/cycling_triathlete_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -238 189 139 -189 148 115 -139 106 82 -57 41 57 -115 90 106 -156 131 156 -156 213 255 -106 164 222 -82 131 197 -205 197 255 -230 90 65 -189 74 41 -139 74 82 -255 255 255 -0 0 24 diff --git a/graphics/trainers/palettes/dome_ace_tucker.pal b/graphics/trainers/palettes/dome_ace_tucker.pal deleted file mode 100644 index 33bb1aa68c..0000000000 --- a/graphics/trainers/palettes/dome_ace_tucker.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -246 148 230 -230 115 213 -189 90 172 -139 74 115 -213 205 246 -230 213 106 -156 148 197 -238 238 139 -213 180 98 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/dragon_tamer.pal b/graphics/trainers/palettes/dragon_tamer.pal deleted file mode 100644 index 545c55b74b..0000000000 --- a/graphics/trainers/palettes/dragon_tamer.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -74 57 49 -164 57 246 -123 49 172 -131 139 148 -255 98 90 -197 65 65 -213 222 230 -74 74 65 -255 205 106 -213 172 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/elite_four_drake.pal b/graphics/trainers/palettes/elite_four_drake.pal deleted file mode 100644 index 6ab0bae739..0000000000 --- a/graphics/trainers/palettes/elite_four_drake.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -222 172 148 -164 131 106 -98 57 65 -139 131 164 -106 98 123 -41 49 57 -57 65 82 -197 197 213 -255 222 106 -189 156 90 -106 131 238 -65 106 172 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/elite_four_glacia.pal b/graphics/trainers/palettes/elite_four_glacia.pal deleted file mode 100644 index 75b5eb1084..0000000000 --- a/graphics/trainers/palettes/elite_four_glacia.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -115 82 65 -148 148 164 -148 90 164 -115 65 123 -82 41 82 -255 255 164 -213 197 90 -156 148 90 -222 230 238 -189 197 205 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/elite_four_phoebe.pal b/graphics/trainers/palettes/elite_four_phoebe.pal deleted file mode 100644 index 8c07c0d5bf..0000000000 --- a/graphics/trainers/palettes/elite_four_phoebe.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -115 82 65 -57 131 255 -32 106 230 -16 82 205 -41 49 123 -164 205 255 -115 98 106 -74 57 65 -255 82 156 -197 65 90 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/elite_four_sidney.pal b/graphics/trainers/palettes/elite_four_sidney.pal deleted file mode 100644 index d778e0ed6d..0000000000 --- a/graphics/trainers/palettes/elite_four_sidney.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -222 180 148 -189 139 106 -98 57 65 -131 106 74 -106 98 123 -41 49 57 -57 65 82 -197 197 213 -238 213 139 -197 164 106 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/expert_f.pal b/graphics/trainers/palettes/expert_f.pal deleted file mode 100644 index 2fa5f52020..0000000000 --- a/graphics/trainers/palettes/expert_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -180 180 172 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -139 139 131 -189 156 90 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/expert_m.pal b/graphics/trainers/palettes/expert_m.pal deleted file mode 100644 index 2fa5f52020..0000000000 --- a/graphics/trainers/palettes/expert_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -180 180 172 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -139 139 131 -189 156 90 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/factory_head_noland.pal b/graphics/trainers/palettes/factory_head_noland.pal deleted file mode 100644 index 03bce8c770..0000000000 --- a/graphics/trainers/palettes/factory_head_noland.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -172 172 189 -131 131 164 -98 98 123 -65 65 90 -222 213 246 -238 213 106 -246 131 123 -213 90 90 -180 57 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/fisherman.pal b/graphics/trainers/palettes/fisherman.pal deleted file mode 100644 index 3c18e8f1f1..0000000000 --- a/graphics/trainers/palettes/fisherman.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 213 189 -222 172 148 -180 131 115 -82 57 57 -123 98 106 -82 82 123 -213 172 82 -180 139 82 -205 205 222 -123 82 49 -49 49 74 -246 123 49 -189 106 49 -238 238 255 -0 0 24 diff --git a/graphics/trainers/palettes/gentleman.pal b/graphics/trainers/palettes/gentleman.pal deleted file mode 100644 index ef021d0268..0000000000 --- a/graphics/trainers/palettes/gentleman.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -180 148 115 -148 115 82 -123 90 57 -65 49 41 -255 238 156 -213 213 205 -180 180 172 -90 106 172 -57 74 123 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/guitarist.pal b/graphics/trainers/palettes/guitarist.pal deleted file mode 100644 index 74e59e8199..0000000000 --- a/graphics/trainers/palettes/guitarist.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -172 172 164 -139 131 131 -106 98 98 -65 57 57 -255 238 156 -255 197 90 -205 180 148 -255 98 90 -189 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/hex_maniac.pal b/graphics/trainers/palettes/hex_maniac.pal deleted file mode 100644 index 549d7fac93..0000000000 --- a/graphics/trainers/palettes/hex_maniac.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -164 123 156 -139 90 131 -106 65 106 -74 41 74 -213 222 230 -189 205 213 -205 57 82 -115 41 65 -180 49 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/hiker.pal b/graphics/trainers/palettes/hiker.pal deleted file mode 100644 index cb8fce7f61..0000000000 --- a/graphics/trainers/palettes/hiker.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -222 164 148 -205 131 115 -74 65 57 -123 189 90 -115 148 90 -213 180 98 -172 148 98 -205 205 222 -148 148 148 -123 115 74 -230 98 90 -164 74 74 -255 255 255 -0 0 24 diff --git a/graphics/trainers/palettes/interviewer.pal b/graphics/trainers/palettes/interviewer.pal deleted file mode 100644 index 61ace1935d..0000000000 --- a/graphics/trainers/palettes/interviewer.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -148 148 172 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -98 197 255 -90 156 189 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/kindler.pal b/graphics/trainers/palettes/kindler.pal deleted file mode 100644 index af6adf7e87..0000000000 --- a/graphics/trainers/palettes/kindler.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -115 82 65 -246 246 230 -222 222 189 -180 180 139 -123 115 74 -172 213 246 -115 180 205 -57 123 139 -255 82 57 -255 156 90 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/lady.pal b/graphics/trainers/palettes/lady.pal deleted file mode 100644 index b708731111..0000000000 --- a/graphics/trainers/palettes/lady.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 222 -238 180 180 -156 123 106 -172 106 74 -82 82 32 -213 222 230 -255 230 106 -213 172 90 -222 98 123 -148 164 180 -180 238 106 -148 213 82 -123 189 65 -255 255 255 -0 0 24 diff --git a/graphics/trainers/palettes/lass.pal b/graphics/trainers/palettes/lass.pal deleted file mode 100644 index 89e78d683f..0000000000 --- a/graphics/trainers/palettes/lass.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -222 148 115 -123 90 82 -164 172 197 -90 98 148 -49 57 82 -41 57 98 -222 230 238 -255 197 90 -189 156 90 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_brawly.pal b/graphics/trainers/palettes/leader_brawly.pal deleted file mode 100644 index 5a5a482f23..0000000000 --- a/graphics/trainers/palettes/leader_brawly.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -49 49 74 -213 213 222 -255 164 197 -115 115 115 -255 139 65 -213 98 24 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_flannery.pal b/graphics/trainers/palettes/leader_flannery.pal deleted file mode 100644 index 20f2f85799..0000000000 --- a/graphics/trainers/palettes/leader_flannery.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -180 197 230 -90 156 213 -65 115 164 -49 49 74 -213 213 222 -131 74 16 -115 115 115 -255 139 65 -197 98 32 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_juan.pal b/graphics/trainers/palettes/leader_juan.pal deleted file mode 100644 index 96467bdc37..0000000000 --- a/graphics/trainers/palettes/leader_juan.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -222 180 148 -180 131 98 -123 90 82 -213 115 222 -148 65 180 -106 148 255 -82 106 189 -74 74 148 -164 180 189 -98 115 123 -98 49 90 -213 213 222 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_norman.pal b/graphics/trainers/palettes/leader_norman.pal deleted file mode 100644 index e53c168379..0000000000 --- a/graphics/trainers/palettes/leader_norman.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -180 197 230 -139 156 172 -74 98 123 -49 65 82 -213 213 222 -131 16 41 -115 115 115 -213 82 90 -180 41 57 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_roxanne.pal b/graphics/trainers/palettes/leader_roxanne.pal deleted file mode 100644 index c2b28ead91..0000000000 --- a/graphics/trainers/palettes/leader_roxanne.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 164 197 -189 156 90 -255 115 148 -213 82 115 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_tate_and_liza.pal b/graphics/trainers/palettes/leader_tate_and_liza.pal deleted file mode 100644 index ab64e9bea1..0000000000 --- a/graphics/trainers/palettes/leader_tate_and_liza.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 172 65 -255 222 205 -238 180 148 -180 131 106 -106 74 74 -189 189 197 -123 123 131 -74 82 98 -41 49 65 -255 98 90 -164 49 57 -255 197 90 -106 189 255 -90 139 197 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_wattson.pal b/graphics/trainers/palettes/leader_wattson.pal deleted file mode 100644 index c8a4e14208..0000000000 --- a/graphics/trainers/palettes/leader_wattson.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -123 90 82 -164 139 90 -131 106 74 -139 131 106 -82 65 74 -213 213 222 -255 197 90 -189 156 90 -57 41 49 -222 115 131 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leader_winona.pal b/graphics/trainers/palettes/leader_winona.pal deleted file mode 100644 index 62783523b2..0000000000 --- a/graphics/trainers/palettes/leader_winona.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -172 189 213 -139 156 205 -74 98 148 -49 65 82 -205 213 222 -115 57 123 -255 197 90 -189 123 222 -148 90 172 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leaf.pal b/graphics/trainers/palettes/leaf.pal deleted file mode 100644 index 30e2cdde05..0000000000 --- a/graphics/trainers/palettes/leaf.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 180 -230 189 156 -205 148 115 -123 90 82 -123 189 222 -82 139 180 -49 106 139 -24 41 82 -213 213 222 -255 197 90 -189 156 90 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/leaf_back_pic.pal b/graphics/trainers/palettes/leaf_back_pic.pal deleted file mode 100644 index 27436be920..0000000000 --- a/graphics/trainers/palettes/leaf_back_pic.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -172 123 65 -255 197 148 -222 148 115 -123 65 65 -65 65 213 -57 57 123 -115 164 197 -106 41 41 -238 238 255 -180 180 213 -255 106 74 -197 57 57 -255 222 90 -189 156 57 -0 0 0 diff --git a/graphics/trainers/palettes/magma_admin.pal b/graphics/trainers/palettes/magma_admin.pal deleted file mode 100644 index a987cdbc14..0000000000 --- a/graphics/trainers/palettes/magma_admin.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -123 123 123 -90 90 90 -82 98 148 -57 57 65 -65 74 115 -139 49 65 -189 189 180 -222 82 98 -189 57 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/magma_grunt_f.pal b/graphics/trainers/palettes/magma_grunt_f.pal deleted file mode 100644 index a987cdbc14..0000000000 --- a/graphics/trainers/palettes/magma_grunt_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -123 123 123 -90 90 90 -82 98 148 -57 57 65 -65 74 115 -139 49 65 -189 189 180 -222 82 98 -189 57 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/magma_grunt_m.pal b/graphics/trainers/palettes/magma_grunt_m.pal deleted file mode 100644 index a987cdbc14..0000000000 --- a/graphics/trainers/palettes/magma_grunt_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -123 123 123 -90 90 90 -82 98 148 -57 57 65 -65 74 115 -139 49 65 -189 189 180 -222 82 98 -189 57 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/magma_leader_maxie.pal b/graphics/trainers/palettes/magma_leader_maxie.pal deleted file mode 100644 index 151bf6d5b6..0000000000 --- a/graphics/trainers/palettes/magma_leader_maxie.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -164 180 197 -115 123 139 -74 82 98 -49 57 82 -213 213 222 -131 16 41 -24 32 49 -213 82 90 -180 41 57 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/ruby_sapphire_may.pal b/graphics/trainers/palettes/may_rs.pal similarity index 100% rename from graphics/trainers/palettes/ruby_sapphire_may.pal rename to graphics/trainers/palettes/may_rs.pal diff --git a/graphics/trainers/palettes/ninja_boy.pal b/graphics/trainers/palettes/ninja_boy.pal deleted file mode 100644 index 524d3f4ba9..0000000000 --- a/graphics/trainers/palettes/ninja_boy.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -230 180 148 -213 148 115 -123 90 82 -164 180 197 -131 139 156 -82 98 115 -49 57 82 -213 213 222 -131 16 41 -255 172 32 -213 82 90 -180 41 57 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/old_couple.pal b/graphics/trainers/palettes/old_couple.pal deleted file mode 100644 index 2fa5f52020..0000000000 --- a/graphics/trainers/palettes/old_couple.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -180 180 172 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -139 139 131 -189 156 90 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/palace_maven_spenser.pal b/graphics/trainers/palettes/palace_maven_spenser.pal deleted file mode 100644 index 40a6349740..0000000000 --- a/graphics/trainers/palettes/palace_maven_spenser.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -230 205 156 -189 164 115 -164 131 82 -106 74 74 -172 172 213 -123 131 189 -90 98 148 -57 65 90 -222 213 246 -238 213 106 -246 230 180 -230 115 74 -222 180 98 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/parasol_lady.pal b/graphics/trainers/palettes/parasol_lady.pal deleted file mode 100644 index dc5c6f67fd..0000000000 --- a/graphics/trainers/palettes/parasol_lady.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -123 82 65 -90 131 189 -65 90 139 -41 65 98 -255 98 90 -197 65 65 -255 156 106 -131 74 65 -255 205 106 -213 172 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/picnicker.pal b/graphics/trainers/palettes/picnicker.pal deleted file mode 100644 index acd90e9436..0000000000 --- a/graphics/trainers/palettes/picnicker.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -246 205 156 -205 156 115 -115 82 65 -131 213 205 -82 164 148 -180 189 222 -57 90 74 -24 49 90 -98 115 230 -57 82 131 -255 98 41 -189 74 41 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pike_queen_lucy.pal b/graphics/trainers/palettes/pike_queen_lucy.pal deleted file mode 100644 index fd3b46b8b3..0000000000 --- a/graphics/trainers/palettes/pike_queen_lucy.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -205 123 213 -148 90 148 -115 57 106 -57 57 57 -213 222 230 -172 65 65 -255 197 90 -115 106 123 -213 82 115 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokefan_f.pal b/graphics/trainers/palettes/pokefan_f.pal deleted file mode 100644 index 09728f0052..0000000000 --- a/graphics/trainers/palettes/pokefan_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -90 172 189 -65 123 180 -255 0 255 -32 57 82 -197 205 213 -180 139 90 -131 90 41 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokefan_m.pal b/graphics/trainers/palettes/pokefan_m.pal deleted file mode 100644 index 1d1f488750..0000000000 --- a/graphics/trainers/palettes/pokefan_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -222 189 148 -197 156 115 -156 123 82 -49 57 49 -230 90 41 -131 172 222 -172 49 32 -82 123 172 -255 238 74 -213 189 41 -205 205 213 -98 98 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokemaniac.pal b/graphics/trainers/palettes/pokemaniac.pal deleted file mode 100644 index 3ede03b140..0000000000 --- a/graphics/trainers/palettes/pokemaniac.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -246 205 156 -205 156 115 -115 82 65 -246 189 115 -213 123 74 -180 82 74 -139 57 41 -74 74 49 -255 230 57 -98 123 106 -230 82 24 -213 205 230 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokemon_breeder_f.pal b/graphics/trainers/palettes/pokemon_breeder_f.pal deleted file mode 100644 index b15f5db8ab..0000000000 --- a/graphics/trainers/palettes/pokemon_breeder_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -255 98 90 -164 49 65 -255 148 131 -49 49 74 -213 222 230 -205 74 74 -115 148 197 -49 74 123 -57 115 164 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokemon_breeder_m.pal b/graphics/trainers/palettes/pokemon_breeder_m.pal deleted file mode 100644 index 6551f84822..0000000000 --- a/graphics/trainers/palettes/pokemon_breeder_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -131 90 74 -255 98 90 -156 65 74 -255 148 131 -49 49 74 -213 222 230 -205 74 74 -115 148 197 -49 74 123 -57 115 164 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokemon_ranger_f.pal b/graphics/trainers/palettes/pokemon_ranger_f.pal deleted file mode 100644 index 93220f5cbf..0000000000 --- a/graphics/trainers/palettes/pokemon_ranger_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -131 90 65 -82 49 49 -131 139 156 -82 90 115 -49 57 82 -213 213 222 -255 205 65 -255 131 74 -205 98 74 -156 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pokemon_ranger_m.pal b/graphics/trainers/palettes/pokemon_ranger_m.pal deleted file mode 100644 index 2f16ca0cb9..0000000000 --- a/graphics/trainers/palettes/pokemon_ranger_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -139 106 82 -82 49 49 -131 139 156 -90 98 115 -49 57 82 -213 213 222 -255 205 65 -238 139 82 -197 82 74 -115 57 49 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/psychic_f.pal b/graphics/trainers/palettes/psychic_f.pal deleted file mode 100644 index 232cfd7550..0000000000 --- a/graphics/trainers/palettes/psychic_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -246 205 156 -205 156 115 -115 82 65 -98 123 180 -32 98 131 -255 0 246 -41 57 90 -213 131 255 -156 115 180 -115 82 148 -246 139 90 -197 90 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/psychic_m.pal b/graphics/trainers/palettes/psychic_m.pal deleted file mode 100644 index 0ddd2894bf..0000000000 --- a/graphics/trainers/palettes/psychic_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -230 189 148 -205 156 115 -115 82 65 -98 123 180 -32 98 131 -0 255 0 -41 57 90 -213 131 255 -131 106 172 -90 74 131 -246 139 90 -197 90 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/pyramid_king_brandon.pal b/graphics/trainers/palettes/pyramid_king_brandon.pal deleted file mode 100644 index 77b5483b88..0000000000 --- a/graphics/trainers/palettes/pyramid_king_brandon.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -164 213 90 -123 172 65 -82 115 41 -57 82 41 -213 205 213 -172 123 90 -139 139 123 -131 98 65 -213 106 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/red.pal b/graphics/trainers/palettes/red.pal deleted file mode 100644 index 30e2cdde05..0000000000 --- a/graphics/trainers/palettes/red.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 180 -230 189 156 -205 148 115 -123 90 82 -123 189 222 -82 139 180 -49 106 139 -24 41 82 -213 213 222 -255 197 90 -189 156 90 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/red_back_pic.pal b/graphics/trainers/palettes/red_back_pic.pal deleted file mode 100644 index 3097a6556d..0000000000 --- a/graphics/trainers/palettes/red_back_pic.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -131 123 164 -172 123 65 -255 197 148 -222 148 115 -123 65 65 -65 65 213 -57 57 123 -115 164 197 -106 41 41 -238 238 255 -180 180 213 -255 106 74 -197 57 57 -255 222 90 -189 156 57 -0 0 0 diff --git a/graphics/trainers/palettes/rich_boy.pal b/graphics/trainers/palettes/rich_boy.pal deleted file mode 100644 index 1ebb772044..0000000000 --- a/graphics/trainers/palettes/rich_boy.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -213 222 230 -255 230 98 -222 180 90 -156 123 115 -115 82 90 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/ruin_maniac.pal b/graphics/trainers/palettes/ruin_maniac.pal deleted file mode 100644 index bbc342a06a..0000000000 --- a/graphics/trainers/palettes/ruin_maniac.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -255 238 106 -246 246 230 -222 222 189 -180 180 139 -115 106 65 -222 213 246 -115 131 205 -222 189 8 -213 115 139 -172 74 90 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/running_triathlete_f.pal b/graphics/trainers/palettes/running_triathlete_f.pal deleted file mode 100644 index 671c1593f0..0000000000 --- a/graphics/trainers/palettes/running_triathlete_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -180 139 90 -139 65 65 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/running_triathlete_m.pal b/graphics/trainers/palettes/running_triathlete_m.pal deleted file mode 100644 index 13a56a5566..0000000000 --- a/graphics/trainers/palettes/running_triathlete_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -246 205 180 -230 180 148 -180 139 106 -115 82 65 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -180 139 90 -139 65 65 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/sailor.pal b/graphics/trainers/palettes/sailor.pal deleted file mode 100644 index 3b62485765..0000000000 --- a/graphics/trainers/palettes/sailor.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -180 180 172 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -139 139 131 -131 180 230 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/salon_maiden_anabel.pal b/graphics/trainers/palettes/salon_maiden_anabel.pal deleted file mode 100644 index 91776562fb..0000000000 --- a/graphics/trainers/palettes/salon_maiden_anabel.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -230 139 255 -189 115 213 -148 90 172 -123 74 139 -213 205 246 -255 197 90 -156 148 197 -255 222 115 -213 106 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/school_kid_f.pal b/graphics/trainers/palettes/school_kid_f.pal deleted file mode 100644 index ce758377ac..0000000000 --- a/graphics/trainers/palettes/school_kid_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 230 205 -238 189 156 -205 148 115 -106 74 57 -255 139 164 -213 82 131 -131 139 255 -98 115 180 -57 74 131 -246 189 123 -197 131 65 -230 82 41 -139 90 32 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/school_kid_m.pal b/graphics/trainers/palettes/school_kid_m.pal deleted file mode 100644 index dc4298ea0e..0000000000 --- a/graphics/trainers/palettes/school_kid_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -230 180 148 -213 148 115 -123 90 82 -172 164 115 -65 90 148 -49 57 82 -131 123 82 -197 197 238 -255 222 65 -205 189 123 -98 164 222 -49 123 156 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/sis_and_bro.pal b/graphics/trainers/palettes/sis_and_bro.pal deleted file mode 100644 index 823ef66efc..0000000000 --- a/graphics/trainers/palettes/sis_and_bro.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -246 205 189 -222 164 148 -164 123 98 -74 57 49 -255 139 90 -230 82 74 -180 65 65 -90 65 82 -197 65 65 -213 222 230 -255 230 205 -139 172 213 -90 131 189 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/sr_and_jr.pal b/graphics/trainers/palettes/sr_and_jr.pal deleted file mode 100644 index 72238881fc..0000000000 --- a/graphics/trainers/palettes/sr_and_jr.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -180 139 90 -131 90 41 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/swimmer_f.pal b/graphics/trainers/palettes/swimmer_f.pal deleted file mode 100644 index 823ef66efc..0000000000 --- a/graphics/trainers/palettes/swimmer_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -246 205 189 -222 164 148 -164 123 98 -74 57 49 -255 139 90 -230 82 74 -180 65 65 -90 65 82 -197 65 65 -213 222 230 -255 230 205 -139 172 213 -90 131 189 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/swimmer_m.pal b/graphics/trainers/palettes/swimmer_m.pal deleted file mode 100644 index 259a53b9a1..0000000000 --- a/graphics/trainers/palettes/swimmer_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -230 197 172 -213 172 148 -172 123 106 -115 82 65 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -172 172 180 -139 65 65 -222 238 238 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/swimming_triathlete_f.pal b/graphics/trainers/palettes/swimming_triathlete_f.pal deleted file mode 100644 index 671c1593f0..0000000000 --- a/graphics/trainers/palettes/swimming_triathlete_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -180 139 90 -139 65 65 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/swimming_triathlete_m.pal b/graphics/trainers/palettes/swimming_triathlete_m.pal deleted file mode 100644 index 671c1593f0..0000000000 --- a/graphics/trainers/palettes/swimming_triathlete_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -90 131 189 -65 90 139 -41 65 98 -49 41 65 -205 213 222 -180 139 90 -139 65 65 -255 98 90 -197 65 65 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/tuber_f.pal b/graphics/trainers/palettes/tuber_f.pal deleted file mode 100644 index b5cb0047aa..0000000000 --- a/graphics/trainers/palettes/tuber_f.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 230 74 -205 57 82 -238 180 57 -189 131 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/tuber_m.pal b/graphics/trainers/palettes/tuber_m.pal deleted file mode 100644 index b5cb0047aa..0000000000 --- a/graphics/trainers/palettes/tuber_m.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 230 74 -205 57 82 -238 180 57 -189 131 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/twins.pal b/graphics/trainers/palettes/twins.pal deleted file mode 100644 index 3b162de251..0000000000 --- a/graphics/trainers/palettes/twins.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -106 74 74 -139 172 213 -90 131 189 -65 90 139 -57 57 57 -213 222 230 -255 230 74 -180 82 98 -238 180 57 -189 131 74 -255 255 255 -0 0 0 diff --git a/graphics/trainers/palettes/young_couple.pal b/graphics/trainers/palettes/young_couple.pal deleted file mode 100644 index bba95c19a4..0000000000 --- a/graphics/trainers/palettes/young_couple.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -238 180 148 -197 139 106 -98 65 57 -148 164 172 -82 123 164 -57 82 106 -32 49 74 -205 213 222 -123 197 156 -90 164 131 -255 98 90 -197 65 65 -106 106 139 -0 0 0 diff --git a/graphics/trainers/palettes/youngster.pal b/graphics/trainers/palettes/youngster.pal deleted file mode 100644 index f91520d9b0..0000000000 --- a/graphics/trainers/palettes/youngster.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -115 197 164 -255 222 205 -230 180 148 -213 148 115 -123 90 82 -139 197 222 -65 90 148 -49 57 82 -41 57 98 -197 197 238 -255 222 65 -222 172 90 -98 164 222 -49 123 156 -255 255 255 -0 0 0 diff --git a/src/data/graphics/trainers.h b/src/data/graphics/trainers.h index 206d73a881..fbdea74729 100644 --- a/src/data/graphics/trainers.h +++ b/src/data/graphics/trainers.h @@ -1,290 +1,290 @@ -const u32 gTrainerFrontPic_Hiker[] = INCBIN_U32("graphics/trainers/front_pics/hiker_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Hiker[] = INCBIN_U32("graphics/trainers/palettes/hiker.gbapal.lz"); +const u32 gTrainerFrontPic_Hiker[] = INCBIN_U32("graphics/trainers/front_pics/hiker.4bpp.lz"); +const u32 gTrainerPalette_Hiker[] = INCBIN_U32("graphics/trainers/front_pics/hiker.gbapal.lz"); -const u32 gTrainerFrontPic_AquaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_AquaGruntM[] = INCBIN_U32("graphics/trainers/palettes/aqua_grunt_m.gbapal.lz"); +const u32 gTrainerFrontPic_AquaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_m.4bpp.lz"); +const u32 gTrainerPalette_AquaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_m.gbapal.lz"); -const u32 gTrainerFrontPic_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PokemonBreederF[] = INCBIN_U32("graphics/trainers/palettes/pokemon_breeder_f.gbapal.lz"); +const u32 gTrainerFrontPic_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f.4bpp.lz"); +const u32 gTrainerPalette_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f.gbapal.lz"); -const u32 gTrainerFrontPic_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_CoolTrainerM[] = INCBIN_U32("graphics/trainers/palettes/cooltrainer_m.gbapal.lz"); +const u32 gTrainerFrontPic_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m.4bpp.lz"); +const u32 gTrainerPalette_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m.gbapal.lz"); -const u32 gTrainerFrontPic_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper_front_pic.4bpp.lz"); -const u32 gTrainerPalette_BirdKeeper[] = INCBIN_U32("graphics/trainers/palettes/bird_keeper.gbapal.lz"); +const u32 gTrainerFrontPic_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper.4bpp.lz"); +const u32 gTrainerPalette_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper.gbapal.lz"); -const u32 gTrainerFrontPic_Collector[] = INCBIN_U32("graphics/trainers/front_pics/collector_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Collector[] = INCBIN_U32("graphics/trainers/palettes/collector.gbapal.lz"); +const u32 gTrainerFrontPic_Collector[] = INCBIN_U32("graphics/trainers/front_pics/collector.4bpp.lz"); +const u32 gTrainerPalette_Collector[] = INCBIN_U32("graphics/trainers/front_pics/collector.gbapal.lz"); -const u32 gTrainerFrontPic_AquaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_AquaGruntF[] = INCBIN_U32("graphics/trainers/palettes/aqua_grunt_f.gbapal.lz"); +const u32 gTrainerFrontPic_AquaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_f.4bpp.lz"); +const u32 gTrainerPalette_AquaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_f.gbapal.lz"); -const u32 gTrainerFrontPic_SwimmerM[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SwimmerM[] = INCBIN_U32("graphics/trainers/palettes/swimmer_m.gbapal.lz"); +const u32 gTrainerFrontPic_SwimmerM[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_m.4bpp.lz"); +const u32 gTrainerPalette_SwimmerM[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_m.gbapal.lz"); -const u32 gTrainerFrontPic_MagmaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_MagmaGruntM[] = INCBIN_U32("graphics/trainers/palettes/magma_grunt_m.gbapal.lz"); +const u32 gTrainerFrontPic_MagmaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_m.4bpp.lz"); +const u32 gTrainerPalette_MagmaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_m.gbapal.lz"); -const u32 gTrainerFrontPic_ExpertM[] = INCBIN_U32("graphics/trainers/front_pics/expert_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_ExpertM[] = INCBIN_U32("graphics/trainers/palettes/expert_m.gbapal.lz"); +const u32 gTrainerFrontPic_ExpertM[] = INCBIN_U32("graphics/trainers/front_pics/expert_m.4bpp.lz"); +const u32 gTrainerPalette_ExpertM[] = INCBIN_U32("graphics/trainers/front_pics/expert_m.gbapal.lz"); -const u32 gTrainerFrontPic_AquaAdminM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_AquaAdminM[] = INCBIN_U32("graphics/trainers/palettes/aqua_admin_m.gbapal.lz"); +const u32 gTrainerFrontPic_AquaAdminM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_m.4bpp.lz"); +const u32 gTrainerPalette_AquaAdminM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_m.gbapal.lz"); -const u32 gTrainerFrontPic_BlackBelt[] = INCBIN_U32("graphics/trainers/front_pics/black_belt_front_pic.4bpp.lz"); -const u32 gTrainerPalette_BlackBelt[] = INCBIN_U32("graphics/trainers/palettes/black_belt.gbapal.lz"); +const u32 gTrainerFrontPic_BlackBelt[] = INCBIN_U32("graphics/trainers/front_pics/black_belt.4bpp.lz"); +const u32 gTrainerPalette_BlackBelt[] = INCBIN_U32("graphics/trainers/front_pics/black_belt.gbapal.lz"); -const u32 gTrainerFrontPic_AquaAdminF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_AquaAdminF[] = INCBIN_U32("graphics/trainers/palettes/aqua_admin_f.gbapal.lz"); +const u32 gTrainerFrontPic_AquaAdminF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_f.4bpp.lz"); +const u32 gTrainerPalette_AquaAdminF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_f.gbapal.lz"); -const u32 gTrainerFrontPic_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/front_pics/aqua_leader_archie_front_pic.4bpp.lz"); -const u32 gTrainerPalette_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/palettes/aqua_leader_archie.gbapal.lz"); +const u32 gTrainerFrontPic_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/front_pics/aqua_leader_archie.4bpp.lz"); +const u32 gTrainerPalette_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/front_pics/aqua_leader_archie.gbapal.lz"); -const u32 gTrainerFrontPic_HexManiac[] = INCBIN_U32("graphics/trainers/front_pics/hex_maniac_front_pic.4bpp.lz"); -const u32 gTrainerPalette_HexManiac[] = INCBIN_U32("graphics/trainers/palettes/hex_maniac.gbapal.lz"); +const u32 gTrainerFrontPic_HexManiac[] = INCBIN_U32("graphics/trainers/front_pics/hex_maniac.4bpp.lz"); +const u32 gTrainerPalette_HexManiac[] = INCBIN_U32("graphics/trainers/front_pics/hex_maniac.gbapal.lz"); -const u32 gTrainerFrontPic_AromaLady[] = INCBIN_U32("graphics/trainers/front_pics/aroma_lady_front_pic.4bpp.lz"); -const u32 gTrainerPalette_AromaLady[] = INCBIN_U32("graphics/trainers/palettes/aroma_lady.gbapal.lz"); +const u32 gTrainerFrontPic_AromaLady[] = INCBIN_U32("graphics/trainers/front_pics/aroma_lady.4bpp.lz"); +const u32 gTrainerPalette_AromaLady[] = INCBIN_U32("graphics/trainers/front_pics/aroma_lady.gbapal.lz"); -const u32 gTrainerFrontPic_RuinManiac[] = INCBIN_U32("graphics/trainers/front_pics/ruin_maniac_front_pic.4bpp.lz"); -const u32 gTrainerPalette_RuinManiac[] = INCBIN_U32("graphics/trainers/palettes/ruin_maniac.gbapal.lz"); +const u32 gTrainerFrontPic_RuinManiac[] = INCBIN_U32("graphics/trainers/front_pics/ruin_maniac.4bpp.lz"); +const u32 gTrainerPalette_RuinManiac[] = INCBIN_U32("graphics/trainers/front_pics/ruin_maniac.gbapal.lz"); -const u32 gTrainerFrontPic_Interviewer[] = INCBIN_U32("graphics/trainers/front_pics/interviewer_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Interviewer[] = INCBIN_U32("graphics/trainers/palettes/interviewer.gbapal.lz"); +const u32 gTrainerFrontPic_Interviewer[] = INCBIN_U32("graphics/trainers/front_pics/interviewer.4bpp.lz"); +const u32 gTrainerPalette_Interviewer[] = INCBIN_U32("graphics/trainers/front_pics/interviewer.gbapal.lz"); -const u32 gTrainerFrontPic_TuberF[] = INCBIN_U32("graphics/trainers/front_pics/tuber_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_TuberF[] = INCBIN_U32("graphics/trainers/palettes/tuber_f.gbapal.lz"); +const u32 gTrainerFrontPic_TuberF[] = INCBIN_U32("graphics/trainers/front_pics/tuber_f.4bpp.lz"); +const u32 gTrainerPalette_TuberF[] = INCBIN_U32("graphics/trainers/front_pics/tuber_f.gbapal.lz"); -const u32 gTrainerFrontPic_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_TuberM[] = INCBIN_U32("graphics/trainers/palettes/tuber_m.gbapal.lz"); +const u32 gTrainerFrontPic_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m.4bpp.lz"); +const u32 gTrainerPalette_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m.gbapal.lz"); -const u32 gTrainerFrontPic_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_CoolTrainerF[] = INCBIN_U32("graphics/trainers/palettes/cooltrainer_f.gbapal.lz"); +const u32 gTrainerFrontPic_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f.4bpp.lz"); +const u32 gTrainerPalette_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f.gbapal.lz"); -const u32 gTrainerFrontPic_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Lady[] = INCBIN_U32("graphics/trainers/palettes/lady.gbapal.lz"); +const u32 gTrainerFrontPic_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady.4bpp.lz"); +const u32 gTrainerPalette_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady.gbapal.lz"); -const u32 gTrainerFrontPic_Beauty[] = INCBIN_U32("graphics/trainers/front_pics/beauty_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Beauty[] = INCBIN_U32("graphics/trainers/palettes/beauty.gbapal.lz"); +const u32 gTrainerFrontPic_Beauty[] = INCBIN_U32("graphics/trainers/front_pics/beauty.4bpp.lz"); +const u32 gTrainerPalette_Beauty[] = INCBIN_U32("graphics/trainers/front_pics/beauty.gbapal.lz"); -const u32 gTrainerFrontPic_RichBoy[] = INCBIN_U32("graphics/trainers/front_pics/rich_boy_front_pic.4bpp.lz"); -const u32 gTrainerPalette_RichBoy[] = INCBIN_U32("graphics/trainers/palettes/rich_boy.gbapal.lz"); +const u32 gTrainerFrontPic_RichBoy[] = INCBIN_U32("graphics/trainers/front_pics/rich_boy.4bpp.lz"); +const u32 gTrainerPalette_RichBoy[] = INCBIN_U32("graphics/trainers/front_pics/rich_boy.gbapal.lz"); -const u32 gTrainerFrontPic_ExpertF[] = INCBIN_U32("graphics/trainers/front_pics/expert_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_ExpertF[] = INCBIN_U32("graphics/trainers/palettes/expert_f.gbapal.lz"); +const u32 gTrainerFrontPic_ExpertF[] = INCBIN_U32("graphics/trainers/front_pics/expert_f.4bpp.lz"); +const u32 gTrainerPalette_ExpertF[] = INCBIN_U32("graphics/trainers/front_pics/expert_f.gbapal.lz"); -const u32 gTrainerFrontPic_Pokemaniac[] = INCBIN_U32("graphics/trainers/front_pics/pokemaniac_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Pokemaniac[] = INCBIN_U32("graphics/trainers/palettes/pokemaniac.gbapal.lz"); +const u32 gTrainerFrontPic_Pokemaniac[] = INCBIN_U32("graphics/trainers/front_pics/pokemaniac.4bpp.lz"); +const u32 gTrainerPalette_Pokemaniac[] = INCBIN_U32("graphics/trainers/front_pics/pokemaniac.gbapal.lz"); -const u32 gTrainerFrontPic_MagmaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_MagmaGruntF[] = INCBIN_U32("graphics/trainers/palettes/magma_grunt_f.gbapal.lz"); +const u32 gTrainerFrontPic_MagmaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_f.4bpp.lz"); +const u32 gTrainerPalette_MagmaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_f.gbapal.lz"); -const u32 gTrainerFrontPic_Guitarist[] = INCBIN_U32("graphics/trainers/front_pics/guitarist_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Guitarist[] = INCBIN_U32("graphics/trainers/palettes/guitarist.gbapal.lz"); +const u32 gTrainerFrontPic_Guitarist[] = INCBIN_U32("graphics/trainers/front_pics/guitarist.4bpp.lz"); +const u32 gTrainerPalette_Guitarist[] = INCBIN_U32("graphics/trainers/front_pics/guitarist.gbapal.lz"); -const u32 gTrainerFrontPic_Kindler[] = INCBIN_U32("graphics/trainers/front_pics/kindler_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Kindler[] = INCBIN_U32("graphics/trainers/palettes/kindler.gbapal.lz"); +const u32 gTrainerFrontPic_Kindler[] = INCBIN_U32("graphics/trainers/front_pics/kindler.4bpp.lz"); +const u32 gTrainerPalette_Kindler[] = INCBIN_U32("graphics/trainers/front_pics/kindler.gbapal.lz"); -const u32 gTrainerFrontPic_Camper[] = INCBIN_U32("graphics/trainers/front_pics/camper_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Camper[] = INCBIN_U32("graphics/trainers/palettes/camper.gbapal.lz"); +const u32 gTrainerFrontPic_Camper[] = INCBIN_U32("graphics/trainers/front_pics/camper.4bpp.lz"); +const u32 gTrainerPalette_Camper[] = INCBIN_U32("graphics/trainers/front_pics/camper.gbapal.lz"); -const u32 gTrainerFrontPic_Picnicker[] = INCBIN_U32("graphics/trainers/front_pics/picnicker_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Picnicker[] = INCBIN_U32("graphics/trainers/palettes/picnicker.gbapal.lz"); +const u32 gTrainerFrontPic_Picnicker[] = INCBIN_U32("graphics/trainers/front_pics/picnicker.4bpp.lz"); +const u32 gTrainerPalette_Picnicker[] = INCBIN_U32("graphics/trainers/front_pics/picnicker.gbapal.lz"); -const u32 gTrainerFrontPic_BugManiac[] = INCBIN_U32("graphics/trainers/front_pics/bug_maniac_front_pic.4bpp.lz"); -const u32 gTrainerPalette_BugManiac[] = INCBIN_U32("graphics/trainers/palettes/bug_maniac.gbapal.lz"); +const u32 gTrainerFrontPic_BugManiac[] = INCBIN_U32("graphics/trainers/front_pics/bug_maniac.4bpp.lz"); +const u32 gTrainerPalette_BugManiac[] = INCBIN_U32("graphics/trainers/front_pics/bug_maniac.gbapal.lz"); -const u32 gTrainerFrontPic_PokemonBreederM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PokemonBreederM[] = INCBIN_U32("graphics/trainers/palettes/pokemon_breeder_m.gbapal.lz"); +const u32 gTrainerFrontPic_PokemonBreederM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_m.4bpp.lz"); +const u32 gTrainerPalette_PokemonBreederM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_m.gbapal.lz"); -const u32 gTrainerFrontPic_PsychicM[] = INCBIN_U32("graphics/trainers/front_pics/psychic_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PsychicM[] = INCBIN_U32("graphics/trainers/palettes/psychic_m.gbapal.lz"); +const u32 gTrainerFrontPic_PsychicM[] = INCBIN_U32("graphics/trainers/front_pics/psychic_m.4bpp.lz"); +const u32 gTrainerPalette_PsychicM[] = INCBIN_U32("graphics/trainers/front_pics/psychic_m.gbapal.lz"); -const u32 gTrainerFrontPic_PsychicF[] = INCBIN_U32("graphics/trainers/front_pics/psychic_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PsychicF[] = INCBIN_U32("graphics/trainers/palettes/psychic_f.gbapal.lz"); +const u32 gTrainerFrontPic_PsychicF[] = INCBIN_U32("graphics/trainers/front_pics/psychic_f.4bpp.lz"); +const u32 gTrainerPalette_PsychicF[] = INCBIN_U32("graphics/trainers/front_pics/psychic_f.gbapal.lz"); -const u32 gTrainerFrontPic_Gentleman[] = INCBIN_U32("graphics/trainers/front_pics/gentleman_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Gentleman[] = INCBIN_U32("graphics/trainers/palettes/gentleman.gbapal.lz"); +const u32 gTrainerFrontPic_Gentleman[] = INCBIN_U32("graphics/trainers/front_pics/gentleman.4bpp.lz"); +const u32 gTrainerPalette_Gentleman[] = INCBIN_U32("graphics/trainers/front_pics/gentleman.gbapal.lz"); -const u32 gTrainerFrontPic_EliteFourSidney[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_sidney_front_pic.4bpp.lz"); -const u32 gTrainerPalette_EliteFourSidney[] = INCBIN_U32("graphics/trainers/palettes/elite_four_sidney.gbapal.lz"); +const u32 gTrainerFrontPic_EliteFourSidney[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_sidney.4bpp.lz"); +const u32 gTrainerPalette_EliteFourSidney[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_sidney.gbapal.lz"); -const u32 gTrainerFrontPic_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_phoebe_front_pic.4bpp.lz"); -const u32 gTrainerPalette_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/palettes/elite_four_phoebe.gbapal.lz"); +const u32 gTrainerFrontPic_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_phoebe.4bpp.lz"); +const u32 gTrainerPalette_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_phoebe.gbapal.lz"); -const u32 gTrainerFrontPic_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_glacia_front_pic.4bpp.lz"); -const u32 gTrainerPalette_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/palettes/elite_four_glacia.gbapal.lz"); +const u32 gTrainerFrontPic_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_glacia.4bpp.lz"); +const u32 gTrainerPalette_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_glacia.gbapal.lz"); -const u32 gTrainerFrontPic_EliteFourDrake[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_drake_front_pic.4bpp.lz"); -const u32 gTrainerPalette_EliteFourDrake[] = INCBIN_U32("graphics/trainers/palettes/elite_four_drake.gbapal.lz"); +const u32 gTrainerFrontPic_EliteFourDrake[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_drake.4bpp.lz"); +const u32 gTrainerPalette_EliteFourDrake[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_drake.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/front_pics/leader_roxanne_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/palettes/leader_roxanne.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/front_pics/leader_roxanne.4bpp.lz"); +const u32 gTrainerPalette_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/front_pics/leader_roxanne.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderBrawly[] = INCBIN_U32("graphics/trainers/front_pics/leader_brawly_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderBrawly[] = INCBIN_U32("graphics/trainers/palettes/leader_brawly.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderBrawly[] = INCBIN_U32("graphics/trainers/front_pics/leader_brawly.4bpp.lz"); +const u32 gTrainerPalette_LeaderBrawly[] = INCBIN_U32("graphics/trainers/front_pics/leader_brawly.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderWattson[] = INCBIN_U32("graphics/trainers/front_pics/leader_wattson_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderWattson[] = INCBIN_U32("graphics/trainers/palettes/leader_wattson.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderWattson[] = INCBIN_U32("graphics/trainers/front_pics/leader_wattson.4bpp.lz"); +const u32 gTrainerPalette_LeaderWattson[] = INCBIN_U32("graphics/trainers/front_pics/leader_wattson.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderFlannery[] = INCBIN_U32("graphics/trainers/front_pics/leader_flannery_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderFlannery[] = INCBIN_U32("graphics/trainers/palettes/leader_flannery.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderFlannery[] = INCBIN_U32("graphics/trainers/front_pics/leader_flannery.4bpp.lz"); +const u32 gTrainerPalette_LeaderFlannery[] = INCBIN_U32("graphics/trainers/front_pics/leader_flannery.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderNorman[] = INCBIN_U32("graphics/trainers/front_pics/leader_norman_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderNorman[] = INCBIN_U32("graphics/trainers/palettes/leader_norman.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderNorman[] = INCBIN_U32("graphics/trainers/front_pics/leader_norman.4bpp.lz"); +const u32 gTrainerPalette_LeaderNorman[] = INCBIN_U32("graphics/trainers/front_pics/leader_norman.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderWinona[] = INCBIN_U32("graphics/trainers/front_pics/leader_winona_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderWinona[] = INCBIN_U32("graphics/trainers/palettes/leader_winona.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderWinona[] = INCBIN_U32("graphics/trainers/front_pics/leader_winona.4bpp.lz"); +const u32 gTrainerPalette_LeaderWinona[] = INCBIN_U32("graphics/trainers/front_pics/leader_winona.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/front_pics/leader_tate_and_liza_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/palettes/leader_tate_and_liza.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/front_pics/leader_tate_and_liza.4bpp.lz"); +const u32 gTrainerPalette_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/front_pics/leader_tate_and_liza.gbapal.lz"); -const u32 gTrainerFrontPic_LeaderJuan[] = INCBIN_U32("graphics/trainers/front_pics/leader_juan_front_pic.4bpp.lz"); -const u32 gTrainerPalette_LeaderJuan[] = INCBIN_U32("graphics/trainers/palettes/leader_juan.gbapal.lz"); +const u32 gTrainerFrontPic_LeaderJuan[] = INCBIN_U32("graphics/trainers/front_pics/leader_juan.4bpp.lz"); +const u32 gTrainerPalette_LeaderJuan[] = INCBIN_U32("graphics/trainers/front_pics/leader_juan.gbapal.lz"); -const u32 gTrainerFrontPic_SchoolKidM[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SchoolKidM[] = INCBIN_U32("graphics/trainers/palettes/school_kid_m.gbapal.lz"); +const u32 gTrainerFrontPic_SchoolKidM[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_m.4bpp.lz"); +const u32 gTrainerPalette_SchoolKidM[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_m.gbapal.lz"); -const u32 gTrainerFrontPic_SchoolKidF[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SchoolKidF[] = INCBIN_U32("graphics/trainers/palettes/school_kid_f.gbapal.lz"); +const u32 gTrainerFrontPic_SchoolKidF[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_f.4bpp.lz"); +const u32 gTrainerPalette_SchoolKidF[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_f.gbapal.lz"); -const u32 gTrainerFrontPic_SrAndJr[] = INCBIN_U32("graphics/trainers/front_pics/sr_and_jr_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SrAndJr[] = INCBIN_U32("graphics/trainers/palettes/sr_and_jr.gbapal.lz"); +const u32 gTrainerFrontPic_SrAndJr[] = INCBIN_U32("graphics/trainers/front_pics/sr_and_jr.4bpp.lz"); +const u32 gTrainerPalette_SrAndJr[] = INCBIN_U32("graphics/trainers/front_pics/sr_and_jr.gbapal.lz"); -const u32 gTrainerFrontPic_PokefanM[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PokefanM[] = INCBIN_U32("graphics/trainers/palettes/pokefan_m.gbapal.lz"); +const u32 gTrainerFrontPic_PokefanM[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_m.4bpp.lz"); +const u32 gTrainerPalette_PokefanM[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_m.gbapal.lz"); -const u32 gTrainerFrontPic_PokefanF[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PokefanF[] = INCBIN_U32("graphics/trainers/palettes/pokefan_f.gbapal.lz"); +const u32 gTrainerFrontPic_PokefanF[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_f.4bpp.lz"); +const u32 gTrainerPalette_PokefanF[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_f.gbapal.lz"); -const u32 gTrainerFrontPic_Youngster[] = INCBIN_U32("graphics/trainers/front_pics/youngster_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Youngster[] = INCBIN_U32("graphics/trainers/palettes/youngster.gbapal.lz"); +const u32 gTrainerFrontPic_Youngster[] = INCBIN_U32("graphics/trainers/front_pics/youngster.4bpp.lz"); +const u32 gTrainerPalette_Youngster[] = INCBIN_U32("graphics/trainers/front_pics/youngster.gbapal.lz"); -const u32 gTrainerFrontPic_ChampionWallace[] = INCBIN_U32("graphics/trainers/front_pics/champion_wallace_front_pic.4bpp.lz"); -const u32 gTrainerPalette_ChampionWallace[] = INCBIN_U32("graphics/trainers/palettes/champion_wallace.gbapal.lz"); +const u32 gTrainerFrontPic_ChampionWallace[] = INCBIN_U32("graphics/trainers/front_pics/champion_wallace.4bpp.lz"); +const u32 gTrainerPalette_ChampionWallace[] = INCBIN_U32("graphics/trainers/front_pics/champion_wallace.gbapal.lz"); -const u32 gTrainerFrontPic_Fisherman[] = INCBIN_U32("graphics/trainers/front_pics/fisherman_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Fisherman[] = INCBIN_U32("graphics/trainers/palettes/fisherman.gbapal.lz"); +const u32 gTrainerFrontPic_Fisherman[] = INCBIN_U32("graphics/trainers/front_pics/fisherman.4bpp.lz"); +const u32 gTrainerPalette_Fisherman[] = INCBIN_U32("graphics/trainers/front_pics/fisherman.gbapal.lz"); -const u32 gTrainerFrontPic_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/palettes/cycling_triathlete_m.gbapal.lz"); +const u32 gTrainerFrontPic_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_m.4bpp.lz"); +const u32 gTrainerPalette_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_m.gbapal.lz"); -const u32 gTrainerFrontPic_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/palettes/cycling_triathlete_f.gbapal.lz"); +const u32 gTrainerFrontPic_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_f.4bpp.lz"); +const u32 gTrainerPalette_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_f.gbapal.lz"); -const u32 gTrainerFrontPic_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/palettes/running_triathlete_m.gbapal.lz"); +const u32 gTrainerFrontPic_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_m.4bpp.lz"); +const u32 gTrainerPalette_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_m.gbapal.lz"); -const u32 gTrainerFrontPic_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/palettes/running_triathlete_f.gbapal.lz"); +const u32 gTrainerFrontPic_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_f.4bpp.lz"); +const u32 gTrainerPalette_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_f.gbapal.lz"); -const u32 gTrainerFrontPic_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/palettes/swimming_triathlete_m.gbapal.lz"); +const u32 gTrainerFrontPic_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_m.4bpp.lz"); +const u32 gTrainerPalette_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_m.gbapal.lz"); -const u32 gTrainerFrontPic_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/palettes/swimming_triathlete_f.gbapal.lz"); +const u32 gTrainerFrontPic_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_f.4bpp.lz"); +const u32 gTrainerPalette_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_f.gbapal.lz"); -const u32 gTrainerFrontPic_DragonTamer[] = INCBIN_U32("graphics/trainers/front_pics/dragon_tamer_front_pic.4bpp.lz"); -const u32 gTrainerPalette_DragonTamer[] = INCBIN_U32("graphics/trainers/palettes/dragon_tamer.gbapal.lz"); +const u32 gTrainerFrontPic_DragonTamer[] = INCBIN_U32("graphics/trainers/front_pics/dragon_tamer.4bpp.lz"); +const u32 gTrainerPalette_DragonTamer[] = INCBIN_U32("graphics/trainers/front_pics/dragon_tamer.gbapal.lz"); -const u32 gTrainerFrontPic_NinjaBoy[] = INCBIN_U32("graphics/trainers/front_pics/ninja_boy_front_pic.4bpp.lz"); -const u32 gTrainerPalette_NinjaBoy[] = INCBIN_U32("graphics/trainers/palettes/ninja_boy.gbapal.lz"); +const u32 gTrainerFrontPic_NinjaBoy[] = INCBIN_U32("graphics/trainers/front_pics/ninja_boy.4bpp.lz"); +const u32 gTrainerPalette_NinjaBoy[] = INCBIN_U32("graphics/trainers/front_pics/ninja_boy.gbapal.lz"); -const u32 gTrainerFrontPic_BattleGirl[] = INCBIN_U32("graphics/trainers/front_pics/battle_girl_front_pic.4bpp.lz"); -const u32 gTrainerPalette_BattleGirl[] = INCBIN_U32("graphics/trainers/palettes/battle_girl.gbapal.lz"); +const u32 gTrainerFrontPic_BattleGirl[] = INCBIN_U32("graphics/trainers/front_pics/battle_girl.4bpp.lz"); +const u32 gTrainerPalette_BattleGirl[] = INCBIN_U32("graphics/trainers/front_pics/battle_girl.gbapal.lz"); -const u32 gTrainerFrontPic_ParasolLady[] = INCBIN_U32("graphics/trainers/front_pics/parasol_lady_front_pic.4bpp.lz"); -const u32 gTrainerPalette_ParasolLady[] = INCBIN_U32("graphics/trainers/palettes/parasol_lady.gbapal.lz"); +const u32 gTrainerFrontPic_ParasolLady[] = INCBIN_U32("graphics/trainers/front_pics/parasol_lady.4bpp.lz"); +const u32 gTrainerPalette_ParasolLady[] = INCBIN_U32("graphics/trainers/front_pics/parasol_lady.gbapal.lz"); -const u32 gTrainerFrontPic_SwimmerF[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SwimmerF[] = INCBIN_U32("graphics/trainers/palettes/swimmer_f.gbapal.lz"); +const u32 gTrainerFrontPic_SwimmerF[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_f.4bpp.lz"); +const u32 gTrainerPalette_SwimmerF[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_f.gbapal.lz"); -const u32 gTrainerFrontPic_Twins[] = INCBIN_U32("graphics/trainers/front_pics/twins_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Twins[] = INCBIN_U32("graphics/trainers/palettes/twins.gbapal.lz"); +const u32 gTrainerFrontPic_Twins[] = INCBIN_U32("graphics/trainers/front_pics/twins.4bpp.lz"); +const u32 gTrainerPalette_Twins[] = INCBIN_U32("graphics/trainers/front_pics/twins.gbapal.lz"); -const u32 gTrainerFrontPic_Sailor[] = INCBIN_U32("graphics/trainers/front_pics/sailor_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Sailor[] = INCBIN_U32("graphics/trainers/palettes/sailor.gbapal.lz"); +const u32 gTrainerFrontPic_Sailor[] = INCBIN_U32("graphics/trainers/front_pics/sailor.4bpp.lz"); +const u32 gTrainerPalette_Sailor[] = INCBIN_U32("graphics/trainers/front_pics/sailor.gbapal.lz"); -const u32 gTrainerFrontPic_MagmaAdmin[] = INCBIN_U32("graphics/trainers/front_pics/magma_admin_front_pic.4bpp.lz"); -const u32 gTrainerPalette_MagmaAdmin[] = INCBIN_U32("graphics/trainers/palettes/magma_admin.gbapal.lz"); +const u32 gTrainerFrontPic_MagmaAdmin[] = INCBIN_U32("graphics/trainers/front_pics/magma_admin.4bpp.lz"); +const u32 gTrainerPalette_MagmaAdmin[] = INCBIN_U32("graphics/trainers/front_pics/magma_admin.gbapal.lz"); -const u32 gTrainerFrontPic_Wally[] = INCBIN_U32("graphics/trainers/front_pics/wally_front_pic.4bpp.lz"); +const u32 gTrainerFrontPic_Wally[] = INCBIN_U32("graphics/trainers/front_pics/wally.4bpp.lz"); const u32 gTrainerPalette_Wally[] = INCBIN_U32("graphics/trainers/palettes/wally.gbapal.lz"); -const u32 gTrainerFrontPic_Brendan[] = INCBIN_U32("graphics/trainers/front_pics/brendan_front_pic.4bpp.lz"); +const u32 gTrainerFrontPic_Brendan[] = INCBIN_U32("graphics/trainers/front_pics/brendan.4bpp.lz"); const u32 gTrainerPalette_Brendan[] = INCBIN_U32("graphics/trainers/palettes/brendan.gbapal.lz"); -const u32 gTrainerFrontPic_May[] = INCBIN_U32("graphics/trainers/front_pics/may_front_pic.4bpp.lz"); +const u32 gTrainerFrontPic_May[] = INCBIN_U32("graphics/trainers/front_pics/may.4bpp.lz"); const u32 gTrainerPalette_May[] = INCBIN_U32("graphics/trainers/palettes/may.gbapal.lz"); -const u32 gTrainerFrontPic_BugCatcher[] = INCBIN_U32("graphics/trainers/front_pics/bug_catcher_front_pic.4bpp.lz"); -const u32 gTrainerPalette_BugCatcher[] = INCBIN_U32("graphics/trainers/palettes/bug_catcher.gbapal.lz"); +const u32 gTrainerFrontPic_BugCatcher[] = INCBIN_U32("graphics/trainers/front_pics/bug_catcher.4bpp.lz"); +const u32 gTrainerPalette_BugCatcher[] = INCBIN_U32("graphics/trainers/front_pics/bug_catcher.gbapal.lz"); -const u32 gTrainerFrontPic_PokemonRangerM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PokemonRangerM[] = INCBIN_U32("graphics/trainers/palettes/pokemon_ranger_m.gbapal.lz"); +const u32 gTrainerFrontPic_PokemonRangerM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_m.4bpp.lz"); +const u32 gTrainerPalette_PokemonRangerM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_m.gbapal.lz"); -const u32 gTrainerFrontPic_PokemonRangerF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PokemonRangerF[] = INCBIN_U32("graphics/trainers/palettes/pokemon_ranger_f.gbapal.lz"); +const u32 gTrainerFrontPic_PokemonRangerF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_f.4bpp.lz"); +const u32 gTrainerPalette_PokemonRangerF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_f.gbapal.lz"); -const u32 gTrainerFrontPic_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/front_pics/magma_leader_maxie_front_pic.4bpp.lz"); -const u32 gTrainerPalette_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/palettes/magma_leader_maxie.gbapal.lz"); +const u32 gTrainerFrontPic_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/front_pics/magma_leader_maxie.4bpp.lz"); +const u32 gTrainerPalette_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/front_pics/magma_leader_maxie.gbapal.lz"); -const u32 gTrainerFrontPic_Lass[] = INCBIN_U32("graphics/trainers/front_pics/lass_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Lass[] = INCBIN_U32("graphics/trainers/palettes/lass.gbapal.lz"); +const u32 gTrainerFrontPic_Lass[] = INCBIN_U32("graphics/trainers/front_pics/lass.4bpp.lz"); +const u32 gTrainerPalette_Lass[] = INCBIN_U32("graphics/trainers/front_pics/lass.gbapal.lz"); -const u32 gTrainerFrontPic_YoungCouple[] = INCBIN_U32("graphics/trainers/front_pics/young_couple_front_pic.4bpp.lz"); -const u32 gTrainerPalette_YoungCouple[] = INCBIN_U32("graphics/trainers/palettes/young_couple.gbapal.lz"); +const u32 gTrainerFrontPic_YoungCouple[] = INCBIN_U32("graphics/trainers/front_pics/young_couple.4bpp.lz"); +const u32 gTrainerPalette_YoungCouple[] = INCBIN_U32("graphics/trainers/front_pics/young_couple.gbapal.lz"); -const u32 gTrainerFrontPic_OldCouple[] = INCBIN_U32("graphics/trainers/front_pics/old_couple_front_pic.4bpp.lz"); -const u32 gTrainerPalette_OldCouple[] = INCBIN_U32("graphics/trainers/palettes/old_couple.gbapal.lz"); +const u32 gTrainerFrontPic_OldCouple[] = INCBIN_U32("graphics/trainers/front_pics/old_couple.4bpp.lz"); +const u32 gTrainerPalette_OldCouple[] = INCBIN_U32("graphics/trainers/front_pics/old_couple.gbapal.lz"); -const u32 gTrainerFrontPic_SisAndBro[] = INCBIN_U32("graphics/trainers/front_pics/sis_and_bro_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SisAndBro[] = INCBIN_U32("graphics/trainers/palettes/sis_and_bro.gbapal.lz"); +const u32 gTrainerFrontPic_SisAndBro[] = INCBIN_U32("graphics/trainers/front_pics/sis_and_bro.4bpp.lz"); +const u32 gTrainerPalette_SisAndBro[] = INCBIN_U32("graphics/trainers/front_pics/sis_and_bro.gbapal.lz"); -const u32 gTrainerFrontPic_Steven[] = INCBIN_U32("graphics/trainers/front_pics/steven_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Steven[] = INCBIN_U32("graphics/trainers/palettes/steven.gbapal.lz"); +const u32 gTrainerFrontPic_Steven[] = INCBIN_U32("graphics/trainers/front_pics/steven.4bpp.lz"); +const u32 gTrainerPalette_Steven[] = INCBIN_U32("graphics/trainers/front_pics/steven.gbapal.lz"); -const u32 gTrainerFrontPic_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/front_pics/salon_maiden_anabel_front_pic.4bpp.lz"); -const u32 gTrainerPalette_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/palettes/salon_maiden_anabel.gbapal.lz"); +const u32 gTrainerFrontPic_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/front_pics/salon_maiden_anabel.4bpp.lz"); +const u32 gTrainerPalette_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/front_pics/salon_maiden_anabel.gbapal.lz"); -const u32 gTrainerFrontPic_DomeAceTucker[] = INCBIN_U32("graphics/trainers/front_pics/dome_ace_tucker_front_pic.4bpp.lz"); -const u32 gTrainerPalette_DomeAceTucker[] = INCBIN_U32("graphics/trainers/palettes/dome_ace_tucker.gbapal.lz"); +const u32 gTrainerFrontPic_DomeAceTucker[] = INCBIN_U32("graphics/trainers/front_pics/dome_ace_tucker.4bpp.lz"); +const u32 gTrainerPalette_DomeAceTucker[] = INCBIN_U32("graphics/trainers/front_pics/dome_ace_tucker.gbapal.lz"); -const u32 gTrainerFrontPic_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/front_pics/palace_maven_spenser_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/palettes/palace_maven_spenser.gbapal.lz"); +const u32 gTrainerFrontPic_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/front_pics/palace_maven_spenser.4bpp.lz"); +const u32 gTrainerPalette_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/front_pics/palace_maven_spenser.gbapal.lz"); -const u32 gTrainerFrontPic_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/front_pics/arena_tycoon_greta_front_pic.4bpp.lz"); -const u32 gTrainerPalette_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/palettes/arena_tycoon_greta.gbapal.lz"); +const u32 gTrainerFrontPic_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/front_pics/arena_tycoon_greta.4bpp.lz"); +const u32 gTrainerPalette_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/front_pics/arena_tycoon_greta.gbapal.lz"); -const u32 gTrainerFrontPic_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/front_pics/factory_head_noland_front_pic.4bpp.lz"); -const u32 gTrainerPalette_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/palettes/factory_head_noland.gbapal.lz"); +const u32 gTrainerFrontPic_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/front_pics/factory_head_noland.4bpp.lz"); +const u32 gTrainerPalette_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/front_pics/factory_head_noland.gbapal.lz"); -const u32 gTrainerFrontPic_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/front_pics/pike_queen_lucy_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/palettes/pike_queen_lucy.gbapal.lz"); +const u32 gTrainerFrontPic_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/front_pics/pike_queen_lucy.4bpp.lz"); +const u32 gTrainerPalette_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/front_pics/pike_queen_lucy.gbapal.lz"); -const u32 gTrainerFrontPic_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/front_pics/pyramid_king_brandon_front_pic.4bpp.lz"); -const u32 gTrainerPalette_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/palettes/pyramid_king_brandon.gbapal.lz"); +const u32 gTrainerFrontPic_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/front_pics/pyramid_king_brandon.4bpp.lz"); +const u32 gTrainerPalette_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/front_pics/pyramid_king_brandon.gbapal.lz"); -const u32 gTrainerFrontPic_Red[] = INCBIN_U32("graphics/trainers/front_pics/red_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Red[] = INCBIN_U32("graphics/trainers/palettes/red.gbapal.lz"); +const u32 gTrainerFrontPic_Red[] = INCBIN_U32("graphics/trainers/front_pics/red.4bpp.lz"); +const u32 gTrainerPalette_Red[] = INCBIN_U32("graphics/trainers/front_pics/red.gbapal.lz"); -const u32 gTrainerFrontPic_Leaf[] = INCBIN_U32("graphics/trainers/front_pics/leaf_front_pic.4bpp.lz"); -const u32 gTrainerPalette_Leaf[] = INCBIN_U32("graphics/trainers/palettes/leaf.gbapal.lz"); +const u32 gTrainerFrontPic_Leaf[] = INCBIN_U32("graphics/trainers/front_pics/leaf.4bpp.lz"); +const u32 gTrainerPalette_Leaf[] = INCBIN_U32("graphics/trainers/front_pics/leaf.gbapal.lz"); -const u32 gTrainerFrontPic_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/front_pics/ruby_sapphire_brendan_front_pic.4bpp.lz"); -const u32 gTrainerPalette_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/palettes/ruby_sapphire_brendan.gbapal.lz"); +const u32 gTrainerFrontPic_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/front_pics/brendan_rs.4bpp.lz"); +const u32 gTrainerPalette_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/palettes/brendan_rs.gbapal.lz"); -const u32 gTrainerFrontPic_RubySapphireMay[] = INCBIN_U32("graphics/trainers/front_pics/ruby_sapphire_may_front_pic.4bpp.lz"); -const u32 gTrainerPalette_RubySapphireMay[] = INCBIN_U32("graphics/trainers/palettes/ruby_sapphire_may.gbapal.lz"); +const u32 gTrainerFrontPic_RubySapphireMay[] = INCBIN_U32("graphics/trainers/front_pics/may_rs.4bpp.lz"); +const u32 gTrainerPalette_RubySapphireMay[] = INCBIN_U32("graphics/trainers/palettes/may_rs.gbapal.lz"); -const u8 gTrainerBackPic_Brendan[] = INCBIN_U8("graphics/trainers/back_pics/brendan_back_pic.4bpp"); -const u8 gTrainerBackPic_May[] = INCBIN_U8("graphics/trainers/back_pics/may_back_pic.4bpp"); -const u8 gTrainerBackPic_Red[] = INCBIN_U8("graphics/trainers/back_pics/red_back_pic.4bpp"); -const u8 gTrainerBackPic_Leaf[] = INCBIN_U8("graphics/trainers/back_pics/leaf_back_pic.4bpp"); -const u8 gTrainerBackPic_RubySapphireBrendan[] = INCBIN_U8("graphics/trainers/back_pics/ruby_sapphire_brendan_back_pic.4bpp"); -const u8 gTrainerBackPic_RubySapphireMay[] = INCBIN_U8("graphics/trainers/back_pics/ruby_sapphire_may_back_pic.4bpp"); -const u8 gTrainerBackPic_Wally[] = INCBIN_U8("graphics/trainers/back_pics/wally_back_pic.4bpp"); -const u8 gTrainerBackPic_Steven[] = INCBIN_U8("graphics/trainers/back_pics/steven_back_pic.4bpp"); +const u8 gTrainerBackPic_Brendan[] = INCBIN_U8("graphics/trainers/back_pics/brendan.4bpp"); +const u8 gTrainerBackPic_May[] = INCBIN_U8("graphics/trainers/back_pics/may.4bpp"); +const u8 gTrainerBackPic_Red[] = INCBIN_U8("graphics/trainers/back_pics/red.4bpp"); +const u8 gTrainerBackPic_Leaf[] = INCBIN_U8("graphics/trainers/back_pics/leaf.4bpp"); +const u8 gTrainerBackPic_RubySapphireBrendan[] = INCBIN_U8("graphics/trainers/back_pics/brendan_rs.4bpp"); +const u8 gTrainerBackPic_RubySapphireMay[] = INCBIN_U8("graphics/trainers/back_pics/may_rs.4bpp"); +const u8 gTrainerBackPic_Wally[] = INCBIN_U8("graphics/trainers/back_pics/wally.4bpp"); +const u8 gTrainerBackPic_Steven[] = INCBIN_U8("graphics/trainers/back_pics/steven.4bpp"); -const u32 gTrainerBackPicPalette_Red[] = INCBIN_U32("graphics/trainers/palettes/red_back_pic.gbapal.lz"); -const u32 gTrainerBackPicPalette_Leaf[] = INCBIN_U32("graphics/trainers/palettes/leaf_back_pic.gbapal.lz"); +const u32 gTrainerBackPicPalette_Red[] = INCBIN_U32("graphics/trainers/back_pics/red.gbapal.lz"); +const u32 gTrainerBackPicPalette_Leaf[] = INCBIN_U32("graphics/trainers/back_pics/leaf.gbapal.lz"); From 584bfe022192f6e68ae202c40febc1dc7839db4e Mon Sep 17 00:00:00 2001 From: sbird Date: Tue, 6 Sep 2022 13:40:29 +0200 Subject: [PATCH 10/47] [debug] add support for mgba printf * adds support for mgba printf debugging as well as adding support for switching between debugging configuration * adds `mini_printf` as an alternative to libc printf as well as switches to choose a pretty printing handler * adds a pretty printing format to `mini_printf` to print preproc encoded strings --- include/config.h | 29 +++- include/gba/isagbprint.h | 72 ++++---- include/mini_printf.h | 52 ++++++ src/libisagbprn.c | 134 ++++++++++++++- src/main.c | 7 + src/mini_printf.c | 353 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 605 insertions(+), 42 deletions(-) create mode 100644 include/mini_printf.h create mode 100644 src/mini_printf.c diff --git a/include/config.h b/include/config.h index 5f2fa4d2cc..4e2ee21bd1 100644 --- a/include/config.h +++ b/include/config.h @@ -8,12 +8,31 @@ // Ruby's actual debug build does not use the AGBPrint features. #define NDEBUG -// To enable print debugging, comment out "#define NDEBUG". This allows +// To enable printf debugging, comment out "#define NDEBUG". This allows // the various AGBPrint functions to be used. (See include/gba/isagbprint.h). -// Some emulators support a debug console window: uncomment NoCashGBAPrint() -// and NoCashGBAPrintf() in libisagbprn.c to use no$gba's own proprietary -// printing system. Use NoCashGBAPrint() and NoCashGBAPrintf() like you -// would normally use AGBPrint() and AGBPrintf(). +// See below for enabling different pretty printing versions. + +#ifndef NDEBUG + +#define PRETTY_PRINT_MINI_PRINTF (0) +#define PRETTY_PRINT_LIBC (1) + +#define LOG_HANDLER_AGB_PRINT (0) +#define LOG_HANDLER_NOCASH_PRINT (1) +#define LOG_HANDLER_MGBA_PRINT (2) + +// Use this switch to choose a handler for pretty printing. +// NOTE: mini_printf supports a custom pretty printing formatter to display preproc encoded strings. (%S) +// some libc distributions (especially dkp arm-libc) will fail to link pretty printing. +#define PRETTY_PRINT_HANDLER (PRETTY_PRINT_MINI_PRINTF) + +// Use this switch to choose a handler for printf output. +// NOTE: These will only work on the respective emulators and should not be used in a productive environment. +// Some emulators or real hardware might (and is allowed to) crash if they are used. +// AGB_PRINT is supported on respective debug units. + +#define LOG_HANDLER (LOG_HANDLER_MGBA_PRINT) +#endif #define ENGLISH diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index 13687825ef..abe7fb2107 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -1,36 +1,50 @@ #ifndef GUARD_GBA_ISAGBPRINT_H #define GUARD_GBA_ISAGBPRINT_H -#ifdef NDEBUG -#define AGBPrintInit() -#define AGBPutc(cChr) -#define AGBPrint(pBuf) -#define AGBPrintf(pBuf, ...) -#define AGBPrintFlush1Block() -#define AGBPrintFlush() -#define AGBAssert(pFile, nLine, pExpression, nStopProgram) -#else -void AGBPrintInit(void); -void AGBPutc(const char cChr); -void AGBPrint(const char *pBuf); -void AGBPrintf(const char *pBuf, ...); -void AGBPrintFlush1Block(void); -void AGBPrintFlush(void); -void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); -#endif +#include "gba/types.h" -#undef AGB_ASSERT #ifdef NDEBUG +#define DebugPrintf(pBuf, ...) +#define MgbaOpen() +#define MgbaClose() #define AGB_ASSERT(exp) -#else -#define AGB_ASSERT(exp) (exp) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #exp, 1); -#endif - -#undef AGB_WARNING -#ifdef NDEBUG #define AGB_WARNING(exp) +#define AGBPrintInit() #else -#define AGB_WARNING(exp) (exp) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #exp, 0); +#if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) +bool32 MgbaOpen(void); +void MgbaClose(void); +void MgbaPrintf(const char *pBuf, ...); +void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram); +#define DebugPrintf(pBuf, ...) MgbaPrintf(pBuf, __VA_ARGS__) +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, 1) +#define AGB_WARNING(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, 0) + +// Not used in this configuration +#define AGBPrintfInit() +#elif (LOG_HANDLER == LOG_HANDLER_NOCASH_PRINT) +void NoCashGBAPrintf(const char *pBuf, ...) +void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram) +#define DebugPrintf(pBuf, ...) NoCashGBAPrintf(pBuf, __VA_ARGS__) +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, 1); +#define AGB_WARNING(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, 0) + +// Not used in this configuration +#define MgbaOpen() +#define MgbaClose() +#define AGBPrintInit() +#else // Default to AGBPrint +void AGBPrintf(const char *pBuf, ...); +void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); +void AGBPrintInit(void); +#define DebugPrintf(pBuf, ...) AGBPrintf(const char *pBuf, ...) +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 1) +#define AGB_WARNING(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, 0) + +// Not used in this configuration +#define MgbaOpen() +#define MgbaClose() +#endif #endif // for matching purposes @@ -38,13 +52,7 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP #ifdef NDEBUG #define AGB_ASSERT_EX(exp, file, line) #else -#define AGB_ASSERT_EX(exp, file, line) (exp) ? ((void *)0) : AGBAssert(file, line, #exp, 1); -#endif - -#ifdef NDEBUG -#define AGB_WARNING_EX(exp, file, line) -#else -#define AGB_WARNING_EX(exp, file, line) (exp) ? ((void *)0) : AGBAssert(file, line, #exp, 0); +#define AGB_ASSERT_EX(exp, file, line) AGB_ASSERT(exp); #endif #endif // GUARD_GBA_ISAGBPRINT_H diff --git a/include/mini_printf.h b/include/mini_printf.h new file mode 100644 index 0000000000..a891327cc4 --- /dev/null +++ b/include/mini_printf.h @@ -0,0 +1,52 @@ +/* + * The Minimal snprintf() implementation + * + * Copyright (c) 2013 Michal Ludvig + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the auhor nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Courtey of https://github.com/mludvig/mini-printf + * stripped to reduce file size for agb needs + */ + +#ifndef __MINI_PRINTF__ +#define __MINI_PRINTF__ + +#include +#include "gba/types.h" + +#ifdef NDEBUG + +#define mini_vsnprintf(buffer, buffer_len, fmt, va) +#define mini_vpprintf(buf, fmt, va) + +#else + +s32 mini_vsnprintf(char* buffer, u32 buffer_len, const char *fmt, va_list va); +s32 mini_vpprintf(void* buf, const char *fmt, va_list va); + +#endif +#endif diff --git a/src/libisagbprn.c b/src/libisagbprn.c index 6fb9d5ec08..0dbaec157d 100644 --- a/src/libisagbprn.c +++ b/src/libisagbprn.c @@ -2,6 +2,8 @@ #include #include "gba/gba.h" #include "config.h" +#include "malloc.h" +#include "mini_printf.h" #define AGB_PRINT_FLUSH_ADDR 0x9FE209D #define AGB_PRINT_STRUCT_ADDR 0x9FE20F8 @@ -14,6 +16,11 @@ #define NOCASHGBAPRINTADDR1 0x4FFFA10 // automatically adds a newline after the string has finished #define NOCASHGBAPRINTADDR2 0x4FFFA14 // does not automatically add the newline. by default, NOCASHGBAPRINTADDR2 is used. this is used to keep strings consistent between no$gba and VBA-RR, but a user can choose to forgo this. +// hardware extensions for LOG_HANDLER_MGBA_PRINT +#define REG_DEBUG_ENABLE ((vu16*) (0x4FFF780)) // handshake: (w)[0xC0DE] -> (r)[0x1DEA] +#define REG_DEBUG_FLAGS ((vu16*) (0x4FFF700)) +#define REG_DEBUG_STRING ((char*) (0x4FFF600)) + struct AGBPrintStruct { u16 m_nRequest; @@ -26,6 +33,8 @@ typedef void (*LPFN_PRINT_FLUSH)(void); #ifndef NDEBUG +// AGBPrint print functions +#if (LOG_HANDLER == LOG_HANDLER_AGB_PRINT) void AGBPrintFlush1Block(void); void AGBPrintInit(void) @@ -87,7 +96,13 @@ void AGBPrintf(const char *pBuf, ...) char bufPrint[0x100]; va_list vArgv; va_start(vArgv, pBuf); - vsprintf(bufPrint, pBuf, vArgv); + #if (PRETTY_PRINT_HANDLER == PRETTY_PRINT_MINI_PRINTF) + mini_vsnprintf(bufPrint, 0x100, pBuf, vArgv); + #elif (PRETTY_PRINT_HANDLER == PRETTY_PRINT_LIBC) + vsnprintf(bufPrint, 0x100, pBuf, vArgv); + #else + #error "unspecified pretty printing handler." + #endif va_end(vArgv); AGBPrint(bufPrint); } @@ -155,9 +170,10 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP AGBPrintf("WARING FILE=[%s] LINE=[%d] EXP=[%s] \n", pFile, nLine, pExpression); } } +#endif -// no$gba print functions, uncomment to use -/* +// no$gba print functions +#if (LOG_HANDLER == LOG_HANDLER_NOCASH_PRINT) void NoCashGBAPrint(const char *pBuf) { *(volatile u32 *)NOCASHGBAPRINTADDR2 = (u32)pBuf; @@ -168,10 +184,118 @@ void NoCashGBAPrintf(const char *pBuf, ...) char bufPrint[0x100]; va_list vArgv; va_start(vArgv, pBuf); - vsprintf(bufPrint, pBuf, vArgv); + #if (PRETTY_PRINT_HANDLER == PRETTY_PRINT_MINI_PRINTF) + mini_vsnprintf(bufPrint, 0x100, pBuf, vArgv); + #elif (PRETTY_PRINT_HANDLER == PRETTY_PRINT_LIBC) + vsnprintf(bufPrint, 0x100, pBuf, vArgv); + #else + #error "unspecified pretty printing handler." + #endif va_end(vArgv); NoCashGBAPrint(bufPrint); } -*/ +void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram) +{ + if (nStopProgram) + { + NoCashGBAPrintf("ASSERTION FAILED FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); + asm(".hword 0xEFFF"); + } + else + { + NoCashGBAPrintf("WARING FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); + } +} +#endif + +// mgba print functions +#if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) +#define MGBA_PRINTF_BUFFER_SIZE (4096) + +#define MGBA_LOG_FATAL (0) +#define MGBA_LOG_ERROR (1) +#define MGBA_LOG_WARN (2) +#define MGBA_LOG_INFO (3) +#define MGBA_LOG_DEBUG (4) + +#define MGBA_REG_DEBUG_MAX (256) + +bool32 MgbaOpen(void) +{ + *REG_DEBUG_ENABLE = 0xC0DE; + return *REG_DEBUG_ENABLE == 0x1DEA; +} + +void MgbaClose(void) +{ + *REG_DEBUG_ENABLE = 0; +} + +static void MgbaPrintfBounded(s32 level, const char* ptr, ...) +{ + va_list args; + + level &= 0x7; + va_start(args, ptr); + #if (PRETTY_PRINT_HANDLER == PRETTY_PRINT_MINI_PRINTF) + mini_vsnprintf(REG_DEBUG_STRING, MGBA_REG_DEBUG_MAX, ptr, args); + #elif (PRETTY_PRINT_HANDLER == PRETTY_PRINT_LIBC) + vsnprintf(REG_DEBUG_STRING, MGBA_REG_DEBUG_MAX, ptr, args); + #else + #error "unspecified pretty printing handler." + #endif + va_end(args); + *REG_DEBUG_FLAGS = level | 0x100; +} + +void MgbaPrintf(const char* ptr, ...) +{ + va_list args; + u32 offset = 0; + u32 n = 0; + u32 i; + char *buffer = Alloc(MGBA_PRINTF_BUFFER_SIZE); + AGB_ASSERT(buffer != NULL); + + va_start(args, ptr); + #if (PRETTY_PRINT_HANDLER == PRETTY_PRINT_MINI_PRINTF) + n = mini_vsnprintf(buffer, MGBA_PRINTF_BUFFER_SIZE, ptr, args); + #elif (PRETTY_PRINT_HANDLER == PRETTY_PRINT_LIBC) + n = vsnprintf(buffer, MGBA_PRINTF_BUFFER_SIZE, ptr, args); + #else + #error "unspecified pretty printing handler." + #endif + va_end(args); + + AGB_ASSERT(n < MGBA_PRINTF_BUFFER_SIZE); + + do + { + for (i = 0; i < MGBA_REG_DEBUG_MAX; ++i) + { + REG_DEBUG_STRING[i] = buffer[offset + i]; + if (buffer[offset + i] == 0) + break; + } + offset += i; + *REG_DEBUG_FLAGS = MGBA_LOG_INFO | 0x100; + } while ((i == MGBA_REG_DEBUG_MAX) && (buffer[offset] != '\0')); + + Free(buffer); +} + +void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram) +{ + if (nStopProgram) + { + MgbaPrintfBounded(MGBA_LOG_ERROR, "ASSERTION FAILED FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); + asm(".hword 0xEFFF"); + } + else + { + MgbaPrintfBounded(MGBA_LOG_WARN, "WARING FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); + } +} +#endif #endif diff --git a/src/main.c b/src/main.c index 5fd236447b..a0ff6452a6 100644 --- a/src/main.c +++ b/src/main.c @@ -119,6 +119,13 @@ void AgbMain() gLinkTransferringData = FALSE; sUnusedVar = 0xFC0; +#ifndef NDEBUG +#if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) + (void) MgbaOpen(); +#elif (LOG_HANDLER == LOG_HANDLER_AGB_PRINT) + AGBPrintfInit(); +#endif +#endif for (;;) { ReadKeys(); diff --git a/src/mini_printf.c b/src/mini_printf.c new file mode 100644 index 0000000000..8345a3935e --- /dev/null +++ b/src/mini_printf.c @@ -0,0 +1,353 @@ +/* + * The Minimal snprintf() implementation + * + * Copyright (c) 2013,2014 Michal Ludvig + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the auhor nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * mini-printf courtesy of https://github.com/mludvig/mini-printf + * stripped to reduce file size for agb needs + */ + +#include "mini_printf.h" +#include "gba/types.h" +#include "gba/defines.h" +#include "config.h" +#include "characters.h" +#include "string_util.h" + +#ifndef NDEBUG + +struct mini_buff +{ + char *buffer, *pbuffer; + u32 buffer_len; +}; + +static inline char mini_pchar_decode(char encoded) +{ + char ret = '?'; + if (encoded >= CHAR_a && encoded <= CHAR_z) + ret = encoded-(CHAR_a-'a'); // lower-case characters + else if (encoded >= CHAR_A && encoded <= CHAR_Z) + ret = encoded-(CHAR_A-'A'); // upper-case characters + else if (encoded >= CHAR_0 && encoded <= CHAR_9) + ret = encoded-(CHAR_0-'0'); // numbers + else if (encoded == CHAR_SPACE) + ret = ' '; // space + else if (encoded == CHAR_EXCL_MARK) + ret = '!'; // exclamation point + else if (encoded == CHAR_QUESTION_MARK) + ret = '?'; // question mark + else if (encoded == CHAR_PERIOD) + ret = '.'; // period + else if (encoded == CHAR_DBL_QUOTE_LEFT || encoded == CHAR_DBL_QUOTE_RIGHT) + ret = '"'; // double quote + else if (encoded == CHAR_SGL_QUOTE_LEFT || encoded == CHAR_SGL_QUOTE_RIGHT) + ret = '\''; // single quote + else if (encoded == CHAR_CURRENCY) + ret = '$'; // currency mark (pokemonies in game, dollar sign in logs) + else if (encoded == CHAR_COMMA) + ret = ','; // comma + else if (encoded == CHAR_MULT_SIGN) + ret = '#'; // pound, hashtag, octothorpe, whatever + else if (encoded == CHAR_SLASH) + ret = '/'; // slash + else if (encoded == CHAR_LESS_THAN) + ret = '<'; // less than sign + else if (encoded == CHAR_GREATER_THAN) + ret = '>'; // greater than sign + else if (encoded == CHAR_PERCENT) + ret = '%'; // percentage + else if (encoded == CHAR_LEFT_PAREN) + ret = '('; // opening parentheses + else if (encoded == CHAR_RIGHT_PAREN) + ret = ')'; // closing parentheses + return ret; +} + +static s32 _putsAscii(char *s, s32 len, void *buf) +{ + char *p0; + s32 i; + struct mini_buff *b; + + if (!buf) + return len; + + b = buf; + p0 = b->buffer; + + /* Copy to buffer */ + for (i = 0; i < len; i++) { + if(b->pbuffer == b->buffer + b->buffer_len - 1) { + break; + } + *(b->pbuffer ++) = s[i]; + } + *(b->pbuffer) = 0; + return b->pbuffer - p0; +} + +static s32 _putsEncoded(char *s, s32 len, void *buf) +{ + char *p0; + s32 i; + struct mini_buff *b; + + if (!buf) + return len; + + b = buf; + p0 = b->buffer; + + /* Copy to buffer */ + for (i = 0; i < len; i++) { + if(b->pbuffer == b->buffer + b->buffer_len - 1) { + break; + } + *(b->pbuffer ++) = mini_pchar_decode(s[i]); + } + *(b->pbuffer) = 0; + return b->pbuffer - p0; +} + +static s32 mini_strlen(const char *s) +{ + s32 len = 0; + while (s[len] != '\0') len++; + return len; +} + +static s32 mini_itoa(u32 value, u32 radix, s32 uppercase, bool32 unsig, char *buffer) +{ + char *pbuffer = buffer; + s32 negative = 0; + s32 i, len; + + /* No support for unusual radixes. */ + if (radix > 16) + return 0; + + if (value < 0 && !unsig) + { + negative = 1; + value = -value; + } + + /* This builds the string back to front ... */ + do + { + s32 digit = value % radix; + *(pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10); + value /= radix; + } while (value > 0); + + if (negative) + *(pbuffer++) = '-'; + + *(pbuffer) = '\0'; + + /* ... now we reverse it (could do it recursively but will + * conserve the stack space) */ + len = (pbuffer - buffer); + for (i = 0; i < len / 2; i++) + { + char j = buffer[i]; + buffer[i] = buffer[len-i-1]; + buffer[len-i-1] = j; + } + + return len; +} + +static s32 mini_pad(char* ptr, s32 len, char pad_char, s32 pad_to, char *buffer) +{ + s32 i; + bool32 overflow = FALSE; + char * pbuffer = buffer; + if(pad_to == 0) + pad_to = len; + if (len > pad_to) { + len = pad_to; + overflow = TRUE; + } + for(i = pad_to - len; i > 0; i --) + { + *(pbuffer++) = pad_char; + } + for(i = len; i > 0; i --) + { + *(pbuffer++) = *(ptr++); + } + len = pbuffer - buffer; + if(overflow) + { + for (i = 0; i < 3 && pbuffer > buffer; i ++) + { + *(pbuffer-- - 1) = '*'; + } + } + return len; +} + +s32 mini_vsnprintf(char *buffer, u32 buffer_len, const char *fmt, va_list va) +{ + struct mini_buff b; + s32 n; + b.buffer = buffer; + b.pbuffer = buffer; + b.buffer_len = buffer_len; + if (buffer_len == 0) + buffer = NULL; + n = mini_vpprintf((buffer != NULL) ? &b : NULL, fmt, va); + if (buffer == NULL) + return n; + return b.pbuffer - b.buffer; +} + +s32 mini_vpprintf(void* buf, const char *fmt, va_list va) +{ + char bf[24]; + char bf2[24]; + char ch; + s32 n; + n = 0; + while ((ch=*(fmt++))) + { + s32 len; + if (ch != '%') + { + len = 1; + len = _putsAscii(&ch, len, buf); + } else + { + char pad_char = ' '; + s32 pad_to = 0; + char l = 0; + char *ptr; + + ch=*(fmt++); + + /* Zero padding requested */ + if (ch == '0') + pad_char = '0'; + while (ch >= '0' && ch <= '9') + { + pad_to = pad_to * 10 + (ch - '0'); + ch= *(fmt++); + } + if(pad_to > (s32) sizeof(bf)) + { + pad_to = sizeof(bf); + } + if (ch == 'l') + { + l = 1; + ch=*(fmt++); + } + + switch (ch) + { + case 0: + goto end; + case 'u': + case 'd': + if(l) + { + len = mini_itoa(va_arg(va, u32), 10, 0, (ch=='u'), bf2); + } else + { + if(ch == 'u') + { + len = mini_itoa((u32) va_arg(va, u32), 10, 0, 1, bf2); + } + else + { + len = mini_itoa((s32) va_arg(va, s32), 10, 0, 0, bf2); + } + } + len = mini_pad(bf2, len, pad_char, pad_to, bf); + len = _putsAscii(bf, len, buf); + break; + + case 'x': + case 'X': + if(l) + { + len = mini_itoa(va_arg(va, u32), 16, (ch=='X'), 1, bf2); + } + else + { + len = mini_itoa((u32) va_arg(va, u32), 16, (ch=='X'), 1, bf2); + } + len = mini_pad(bf2, len, pad_char, pad_to, bf); + len = _putsAscii(bf, len, buf); + break; + + case 'c' : + ch = (char)(va_arg(va, s32)); + len = mini_pad(&ch, 1, pad_char, pad_to, bf); + len = _putsAscii(bf, len, buf); + break; + + case 's' : + ptr = va_arg(va, char*); + len = mini_strlen(ptr); + if (pad_to > 0) + { + len = mini_pad(ptr, len, pad_char, pad_to, bf); + len = _putsAscii(bf, len, buf); + } else + { + len = _putsAscii(ptr, len, buf); + } + break; + case 'S' : // preproc encoded string handler + ptr = va_arg(va, char*); + len = StringLength(ptr); + if (pad_to > 0) + { + len = mini_pad(ptr, len, pad_char, pad_to, bf); + len = _putsEncoded(bf, len, buf); + } else + { + len = _putsEncoded(ptr, len, buf); + } + break; + default: + len = 1; + len = _putsAscii(&ch, len, buf); + break; + } + } + n = n + len; + } +end: + return n; +} + +#endif From 21df8c279b36507b9215441af7f0cda1a8e11305 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 08:59:53 -0400 Subject: [PATCH 11/47] Added SPECIES_FLAG_CANNOT_BE_TRADED - Also corrected Cylarex's forms not having the legendary flag --- include/constants/pokemon.h | 1 + include/constants/trade.h | 11 ++++++----- include/strings.h | 2 +- src/data/party_menu.h | 4 ++-- src/data/pokemon/base_stats.h | 10 ++++++---- src/party_menu.c | 5 ++++- src/strings.c | 1 + src/trade.c | 24 ++++++++++++++++++++---- 8 files changed, 41 insertions(+), 17 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 60bca5a838..55f13caf96 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -352,6 +352,7 @@ #define SPECIES_FLAG_GENDER_DIFFERENCE (1 << 6) #define SPECIES_FLAG_ALL_PERFECT_IVS (1 << 7) #define SPECIES_FLAG_SHINY_LOCKED (1 << 8) +#define SPECIES_FLAG_CANNOT_BE_TRADED (1 << 9) #define LEGENDARY_PERFECT_IV_COUNT 3 diff --git a/include/constants/trade.h b/include/constants/trade.h index fa42e6b43f..e8afc2a77f 100644 --- a/include/constants/trade.h +++ b/include/constants/trade.h @@ -99,8 +99,8 @@ #define UR_TRADE_MSG_NONE 0 #define UR_TRADE_MSG_NOT_MON_PARTNER_WANTS 1 #define UR_TRADE_MSG_NOT_EGG 2 -#define UR_TRADE_MSG_MON_CANT_BE_TRADED_1 3 -#define UR_TRADE_MSG_MON_CANT_BE_TRADED_2 4 +#define UR_TRADE_MSG_MON_CANT_BE_TRADED_NOW 3 +#define UR_TRADE_MSG_MON_CANT_BE_TRADED 4 #define UR_TRADE_MSG_PARTNERS_MON_CANT_BE_TRADED 5 #define UR_TRADE_MSG_EGG_CANT_BE_TRADED 6 #define UR_TRADE_MSG_PARTNER_CANT_ACCEPT_MON 7 @@ -108,9 +108,10 @@ #define UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_2 9 // Return values for CanRegisterMonForTradingBoard -#define CAN_REGISTER_MON 0 -#define CANT_REGISTER_MON 1 -#define CANT_REGISTER_EGG 2 +#define CAN_REGISTER_MON 0 +#define CANT_REGISTER_MON_NOW 1 +#define CANT_REGISTER_MON 2 +#define CANT_REGISTER_EGG 3 #endif //GUARD_CONSTANTS_TRADE_H diff --git a/include/strings.h b/include/strings.h index 25a96eef08..d71daf4160 100644 --- a/include/strings.h +++ b/include/strings.h @@ -464,6 +464,7 @@ extern const u8 gText_MailMessageWillBeLost[]; extern const u8 gText_MailTakenFromPkmn[]; extern const u8 gText_NoMoreThanVar1Pkmn[]; extern const u8 gText_PkmnCantBeTradedNow[]; +extern const u8 gText_PkmnCantBeTraded[]; extern const u8 gText_EggCantBeTradedNow[]; extern const u8 gText_OnlyPkmnForBattle[]; extern const u8 gJPText_AreYouSureYouWantToSpinTradeMon[]; @@ -2154,7 +2155,6 @@ extern const u8 gText_Switch2[]; extern const u8 gText_Item[]; extern const u8 gText_NotPkmnOtherTrainerWants[]; extern const u8 gText_ThatIsntAnEgg[]; -extern const u8 gText_PkmnCantBeTradedNow[]; extern const u8 gText_OtherTrainersPkmnCantBeTraded[]; extern const u8 gText_EggCantBeTradedNow[]; extern const u8 gText_OtherTrainerCantAcceptPkmn[]; diff --git a/src/data/party_menu.h b/src/data/party_menu.h index 9411ec3bb7..8d871c2022 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -789,8 +789,8 @@ static const u8 *const sUnionRoomTradeMessages[] = { [UR_TRADE_MSG_NOT_MON_PARTNER_WANTS - 1] = gText_NotPkmnOtherTrainerWants, [UR_TRADE_MSG_NOT_EGG - 1] = gText_ThatIsntAnEgg, - [UR_TRADE_MSG_MON_CANT_BE_TRADED_1 - 1] = gText_PkmnCantBeTradedNow, - [UR_TRADE_MSG_MON_CANT_BE_TRADED_2 - 1] = gText_PkmnCantBeTradedNow, + [UR_TRADE_MSG_MON_CANT_BE_TRADED_NOW - 1] = gText_PkmnCantBeTradedNow, + [UR_TRADE_MSG_MON_CANT_BE_TRADED - 1] = gText_PkmnCantBeTraded, [UR_TRADE_MSG_PARTNERS_MON_CANT_BE_TRADED - 1] = gText_OtherTrainersPkmnCantBeTraded, [UR_TRADE_MSG_EGG_CANT_BE_TRADED -1] = gText_EggCantBeTradedNow, [UR_TRADE_MSG_PARTNER_CANT_ACCEPT_MON - 1] = gText_OtherTrainerCantAcceptPkmn, diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index bb85f2840f..2a3798dcb6 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -25974,7 +25974,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_CANNOT_BE_TRADED, }, [SPECIES_KYUREM_BLACK] = @@ -25999,7 +25999,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_CANNOT_BE_TRADED, }, [SPECIES_KELDEO_RESOLUTE] = @@ -26489,7 +26489,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_CANNOT_BE_TRADED, }, [SPECIES_NECROZMA_DAWN_WINGS] = @@ -26514,7 +26514,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_CANNOT_BE_TRADED, }, [SPECIES_NECROZMA_ULTRA] = @@ -26738,6 +26738,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AS_ONE_ICE_RIDER, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_CANNOT_BE_TRADED, }, [SPECIES_CALYREX_SHADOW_RIDER] = @@ -26762,6 +26763,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AS_ONE_SHADOW_RIDER, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_CANNOT_BE_TRADED, }, #endif }; diff --git a/src/party_menu.c b/src/party_menu.c index 00224f6bd6..3fe52231af 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -3587,9 +3587,12 @@ static void CursorCb_Register(u8 taskId) switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal)) { - case CANT_REGISTER_MON: + case CANT_REGISTER_MON_NOW: StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow); break; + case CANT_REGISTER_MON: + StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTraded); + break; case CANT_REGISTER_EGG: StringExpandPlaceholders(gStringVar4, gText_EggCantBeTradedNow); break; diff --git a/src/strings.c b/src/strings.c index d199b92d4b..b951c8ff5e 100644 --- a/src/strings.c +++ b/src/strings.c @@ -478,6 +478,7 @@ const u8 gText_PauseUntilPress[] = _("{PAUSE_UNTIL_PRESS}"); const u8 gJPText_AreYouSureYouWantToSpinTradeMon[] = _("{STR_VAR_1}を ぐるぐるこうかんに\nだして よろしいですか?"); ALIGNED(4) const u8 gText_OnlyPkmnForBattle[] = _("That's your only\nPOKéMON for battle."); ALIGNED(4) const u8 gText_PkmnCantBeTradedNow[] = _("That POKéMON can't be traded\nnow."); +ALIGNED(4) const u8 gText_PkmnCantBeTraded[] = _("That POKéMON can't be traded."); ALIGNED(4) const u8 gText_EggCantBeTradedNow[] = _("An EGG can't be traded now."); ALIGNED(4) const u8 gText_OtherTrainersPkmnCantBeTraded[] = _("The other TRAINER's POKéMON\ncan't be traded now."); ALIGNED(4) const u8 gText_OtherTrainerCantAcceptPkmn[] = _("The other TRAINER can't accept\nthat POKéMON now."); diff --git a/src/trade.c b/src/trade.c index abf35f26a4..8ff31bfd0c 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1504,6 +1504,10 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 player return PARTNER_MON_INVALID; } + // Can't trade specific species + if (gBaseStats[partnerSpecies].flags & SPECIES_FLAG_CANNOT_BE_TRADED) + return PARTNER_MON_INVALID; + // Partner cant trade Egg or non-Hoenn mon if player doesn't have National Dex if (!IsNationalPokedexEnabled()) { @@ -2360,6 +2364,10 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int return CANT_TRADE_INVALID_MON; } + // Can't trade specific species + if (gBaseStats[species[monIdx]].flags & SPECIES_FLAG_CANNOT_BE_TRADED) + return CANT_TRADE_INVALID_MON; + // Make Eggs not count for numMonsLeft for (i = 0; i < partyCount; i++) { @@ -2450,7 +2458,11 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf // Cannot trade illegitimate Deoxys/Mew if (IsDeoxysOrMewUntradable(playerSpecies, isEventLegal)) - return UR_TRADE_MSG_MON_CANT_BE_TRADED_2; + return UR_TRADE_MSG_MON_CANT_BE_TRADED; + + // Can't trade specific species + if (gBaseStats[playerSpecies].flags & SPECIES_FLAG_CANNOT_BE_TRADED) + return UR_TRADE_MSG_MON_CANT_BE_TRADED; if (partnerSpecies == SPECIES_EGG) { @@ -2469,7 +2481,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf // If the player is trading an Egg then the partner must also be trading an Egg // Odd that this wasn't checked earlier, as by this point we know either the partner doesn't have an Egg or that both do. if (playerSpecies2 == SPECIES_EGG && playerSpecies2 != partnerSpecies) - return UR_TRADE_MSG_MON_CANT_BE_TRADED_1; + return UR_TRADE_MSG_MON_CANT_BE_TRADED_NOW; // If the player doesn't have the National Dex then Eggs and non-Hoenn Pokémon can't be traded if (!playerHasNationalDex) @@ -2478,7 +2490,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf return UR_TRADE_MSG_EGG_CANT_BE_TRADED; if (!IsSpeciesInHoennDex(playerSpecies2)) - return UR_TRADE_MSG_MON_CANT_BE_TRADED_2; + return UR_TRADE_MSG_MON_CANT_BE_TRADED_NOW; if (!IsSpeciesInHoennDex(partnerSpecies)) return UR_TRADE_MSG_PARTNERS_MON_CANT_BE_TRADED; @@ -2497,6 +2509,10 @@ int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 sp bool8 hasNationalDex = player.hasNationalDex; if (IsDeoxysOrMewUntradable(species, isEventLegal)) + return CANT_REGISTER_MON_NOW; + + // Can't trade specific species + if (gBaseStats[species].flags & SPECIES_FLAG_CANNOT_BE_TRADED) return CANT_REGISTER_MON; if (hasNationalDex) @@ -2509,7 +2525,7 @@ int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 sp if (IsSpeciesInHoennDex(species2)) return CAN_REGISTER_MON; - return CANT_REGISTER_MON; + return CANT_REGISTER_MON_NOW; } // Spin Trade wasnt fully implemented, but this checks if a mon would be valid to Spin Trade From 041870672ac07c98f4cab39c25737201740728ea Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 12 Sep 2022 15:11:58 -0400 Subject: [PATCH 12/47] Add misc constant usage to field_weather_effect --- src/field_weather_effect.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 820628ff83..f5769cc230 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -596,8 +596,8 @@ static void UpdateRainSprite(struct Sprite *sprite) sprite->y = sprite->tPosY >> 4; if (sprite->tActive - && (sprite->x >= -8 && sprite->x <= 248) - && sprite->y >= -16 && sprite->y <= 176) + && (sprite->x >= -8 && sprite->x <= DISPLAY_WIDTH + 8) + && sprite->y >= -16 && sprite->y <= DISPLAY_HEIGHT + 16) sprite->invisible = FALSE; else sprite->invisible = TRUE; @@ -1442,9 +1442,9 @@ static void FogHorizontalSpriteCallback(struct Sprite *sprite) { sprite->y2 = (u8)gSpriteCoordOffsetY; sprite->x = gWeatherPtr->fogHScrollPosX + 32 + sprite->tSpriteColumn * 64; - if (sprite->x > 271) + if (sprite->x >= DISPLAY_WIDTH + 32) { - sprite->x = 480 + gWeatherPtr->fogHScrollPosX - (4 - sprite->tSpriteColumn) * 64; + sprite->x = (DISPLAY_WIDTH * 2) + gWeatherPtr->fogHScrollPosX - (4 - sprite->tSpriteColumn) * 64; sprite->x &= 0x1FF; } } @@ -1701,9 +1701,9 @@ static void UpdateAshSprite(struct Sprite *sprite) sprite->y = gSpriteCoordOffsetY + sprite->tOffsetY; sprite->x = gWeatherPtr->ashBaseSpritesX + 32 + sprite->tSpriteColumn * 64; - if (sprite->x > 271) + if (sprite->x >= DISPLAY_WIDTH + 32) { - sprite->x = gWeatherPtr->ashBaseSpritesX + 480 - (4 - sprite->tSpriteColumn) * 64; + sprite->x = gWeatherPtr->ashBaseSpritesX + (DISPLAY_WIDTH * 2) - (4 - sprite->tSpriteColumn) * 64; sprite->x &= 0x1FF; } } @@ -1911,9 +1911,9 @@ static void UpdateFogDiagonalSprite(struct Sprite *sprite) { sprite->y2 = gWeatherPtr->fogDPosY; sprite->x = gWeatherPtr->fogDBaseSpritesX + 32 + sprite->tSpriteColumn * 64; - if (sprite->x > 271) + if (sprite->x >= DISPLAY_WIDTH + 32) { - sprite->x = gWeatherPtr->fogDBaseSpritesX + 480 - (4 - sprite->tSpriteColumn) * 64; + sprite->x = gWeatherPtr->fogDBaseSpritesX + (DISPLAY_WIDTH * 2) - (4 - sprite->tSpriteColumn) * 64; sprite->x &= 0x1FF; } } @@ -2187,9 +2187,9 @@ static void UpdateSandstormSprite(struct Sprite *sprite) { sprite->y2 = gWeatherPtr->sandstormPosY; sprite->x = gWeatherPtr->sandstormBaseSpritesX + 32 + sprite->tSpriteColumn * 64; - if (sprite->x > 271) + if (sprite->x >= DISPLAY_WIDTH + 32) { - sprite->x = gWeatherPtr->sandstormBaseSpritesX + 480 - (4 - sprite->tSpriteColumn) * 64; + sprite->x = gWeatherPtr->sandstormBaseSpritesX + (DISPLAY_WIDTH * 2) - (4 - sprite->tSpriteColumn) * 64; sprite->x &= 0x1FF; } } @@ -2206,7 +2206,7 @@ static void UpdateSandstormSwirlSprite(struct Sprite *sprite) if (--sprite->y < -48) { - sprite->y = 208; + sprite->y = DISPLAY_HEIGHT + 48; sprite->tRadius = 4; } @@ -2567,14 +2567,16 @@ void ResumePausedWeather(void) SetCurrentAndNextWeather(weather); } -static const u8 sWeatherCycleRoute119[] = +#define WEATHER_CYCLE_LENGTH 4 + +static const u8 sWeatherCycleRoute119[WEATHER_CYCLE_LENGTH] = { WEATHER_SUNNY, WEATHER_RAIN, WEATHER_RAIN_THUNDERSTORM, WEATHER_RAIN, }; -static const u8 sWeatherCycleRoute123[] = +static const u8 sWeatherCycleRoute123[WEATHER_CYCLE_LENGTH] = { WEATHER_SUNNY, WEATHER_SUNNY, @@ -2611,7 +2613,7 @@ static u8 TranslateWeatherNum(u8 weather) void UpdateWeatherPerDay(u16 increment) { u16 weatherStage = gSaveBlock1Ptr->weatherCycleStage + increment; - weatherStage %= 4; + weatherStage %= WEATHER_CYCLE_LENGTH; gSaveBlock1Ptr->weatherCycleStage = weatherStage; } From 492380bd24912a80be4e7a14e8e4bf8355c277fd Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 14 Sep 2022 12:20:59 -0300 Subject: [PATCH 13/47] gReservedSpritePaletteCount using MAX_BATTLERS_COUNT for battles --- src/battle_main.c | 6 +++--- src/reshow_battle_screen.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 52a1005989..903588fe73 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -665,7 +665,7 @@ static void CB2_InitBattleInternal(void) ResetTasks(); DrawBattleEntryBackground(); FreeAllSpritePalettes(); - gReservedSpritePaletteCount = 4; + gReservedSpritePaletteCount = MAX_BATTLERS_COUNT; SetVBlankCallback(VBlankCB_Battle); SetUpBattleVarsAndBirchZigzagoon(); @@ -2221,7 +2221,7 @@ void CB2_InitEndLinkBattle(void) DrawBattleEntryBackground(); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); FreeAllSpritePalettes(); - gReservedSpritePaletteCount = 4; + gReservedSpritePaletteCount = MAX_BATTLERS_COUNT; SetVBlankCallback(VBlankCB_Battle); // Show end Vs screen with battle results @@ -2425,7 +2425,7 @@ static void CB2_InitAskRecordBattle(void) ResetSpriteData(); ResetTasks(); FreeAllSpritePalettes(); - gReservedSpritePaletteCount = 4; + gReservedSpritePaletteCount = MAX_BATTLERS_COUNT; SetVBlankCallback(VBlankCB_Battle); SetMainCallback2(CB2_AskRecordBattle); BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 4217d78c73..fd2ed03cca 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -73,7 +73,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void) break; case 4: FreeAllSpritePalettes(); - gReservedSpritePaletteCount = 4; + gReservedSpritePaletteCount = MAX_BATTLERS_COUNT; break; case 5: ClearSpritesHealthboxAnimData(); From bca1267ca84af5dab9f82ec1c2209c786eb1f6b7 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 15 Sep 2022 14:52:18 -0300 Subject: [PATCH 14/47] Altered MAX_FRONTIER_PARTY_SIZE to be automatically calculated by the other frontier party sizes --- include/constants/global.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/constants/global.h b/include/constants/global.h index 2a0ac7d6f1..8e40e63786 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -35,7 +35,9 @@ #define FRONTIER_PARTY_SIZE 3 #define FRONTIER_DOUBLES_PARTY_SIZE 4 #define FRONTIER_MULTI_PARTY_SIZE 2 -#define MAX_FRONTIER_PARTY_SIZE FRONTIER_DOUBLES_PARTY_SIZE +#define MAX_FRONTIER_PARTY_SIZE (max(FRONTIER_PARTY_SIZE, \ + max(FRONTIER_DOUBLES_PARTY_SIZE,\ + FRONTIER_MULTI_PARTY_SIZE))) #define UNION_ROOM_PARTY_SIZE 2 // capacities of various saveblock objects From 63156b4398213bc89fb6666f2126f751902a4d84 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 16 Sep 2022 20:24:26 -0300 Subject: [PATCH 15/47] Removed malloc macro --- gflib/malloc.h | 1 - src/decoration.c | 2 +- src/diploma.c | 2 +- src/easy_chat.c | 2 +- src/event_object_movement.c | 2 +- src/field_region_map.c | 2 +- src/link.c | 2 +- src/record_mixing.c | 6 +++--- src/region_map.c | 2 +- src/tv.c | 4 ++-- 10 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gflib/malloc.h b/gflib/malloc.h index 8d49e0be7d..27004adf71 100644 --- a/gflib/malloc.h +++ b/gflib/malloc.h @@ -2,7 +2,6 @@ #define GUARD_ALLOC_H #define HEAP_SIZE 0x1C000 -#define malloc Alloc #define calloc(ct, sz) AllocZeroed((ct) * (sz)) #define free Free diff --git a/src/decoration.c b/src/decoration.c index c5c7c02c34..2384daa801 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -2060,7 +2060,7 @@ static u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 palette.data = GetDecorationIconPicOrPalette(decor, 1); palette.tag = paletteTag; LoadCompressedSpritePalette(&palette); - template = malloc(sizeof(struct SpriteTemplate)); + template = Alloc(sizeof(struct SpriteTemplate)); *template = gItemIconSpriteTemplate; template->tileTag = tilesTag; template->paletteTag = paletteTag; diff --git a/src/diploma.c b/src/diploma.c index ce31578dcb..a30d715546 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -73,7 +73,7 @@ void CB2_ShowDiploma(void) ResetPaletteFade(); FreeAllSpritePalettes(); LoadPalette(sDiplomaPalettes, 0, 64); - sDiplomaTilemapPtr = malloc(0x1000); + sDiplomaTilemapPtr = Alloc(0x1000); InitDiplomaBg(); InitDiplomaWindow(); ResetTempTileDataBuffers(); diff --git a/src/easy_chat.c b/src/easy_chat.c index ebc843b3cc..054c65c0fb 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1627,7 +1627,7 @@ static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonTyp u8 templateId; int i; - sEasyChatScreen = malloc(sizeof(*sEasyChatScreen)); + sEasyChatScreen = Alloc(sizeof(*sEasyChatScreen)); if (sEasyChatScreen == NULL) return FALSE; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index a63eeb22b8..83f12c4bb6 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1537,7 +1537,7 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), struct Sprite *sprite; u8 spriteId; - spriteTemplate = malloc(sizeof(struct SpriteTemplate)); + spriteTemplate = Alloc(sizeof(struct SpriteTemplate)); CopyObjectGraphicsInfoToSpriteTemplate(graphicsId, callback, spriteTemplate, &subspriteTables); if (spriteTemplate->paletteTag != TAG_NONE) LoadObjectEventPalette(spriteTemplate->paletteTag); diff --git a/src/field_region_map.c b/src/field_region_map.c index 5e14920fba..43055174fa 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -92,7 +92,7 @@ static const struct WindowTemplate sFieldRegionMapWindowTemplates[] = void FieldInitRegionMap(MainCallback callback) { SetVBlankCallback(NULL); - sFieldRegionMapHandler = malloc(sizeof(*sFieldRegionMapHandler)); + sFieldRegionMapHandler = Alloc(sizeof(*sFieldRegionMapHandler)); sFieldRegionMapHandler->state = 0; sFieldRegionMapHandler->callback = callback; SetMainCallback2(MCB2_InitRegionMapRegisters); diff --git a/src/link.c b/src/link.c index 57e33c8115..b01be9d890 100644 --- a/src/link.c +++ b/src/link.c @@ -1608,7 +1608,7 @@ void CB2_LinkError(void) SetVBlankCallback(VBlankCB_LinkError); ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sLinkErrorBgTemplates, ARRAY_COUNT(sLinkErrorBgTemplates)); - sLinkErrorBgTilemapBuffer = tilemapBuffer = malloc(BG_SCREEN_SIZE); + sLinkErrorBgTilemapBuffer = tilemapBuffer = Alloc(BG_SCREEN_SIZE); SetBgTilemapBuffer(1, tilemapBuffer); if (InitWindows(sLinkErrorWindowTemplates)) { diff --git a/src/record_mixing.c b/src/record_mixing.c index c899db25e7..72edd52f29 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -315,8 +315,8 @@ static void Task_RecordMixing_Main(u8 taskId) switch (tState) { case 0: // init - sSentRecord = malloc(sizeof(*sSentRecord)); - sReceivedRecords = malloc(sizeof(*sReceivedRecords) * MAX_LINK_PLAYERS); + sSentRecord = Alloc(sizeof(*sSentRecord)); + sReceivedRecords = Alloc(sizeof(*sReceivedRecords) * MAX_LINK_PLAYERS); SetLocalLinkPlayerId(gSpecialVar_0x8005); VarSet(VAR_TEMP_0, 1); sReadyToReceive = FALSE; @@ -689,7 +689,7 @@ static void ReceiveLilycoveLadyData(LilycoveLady *records, size_t recordSize, u8 if (GetLilycoveLadyId() == 0) { - lilycoveLady = malloc(sizeof(*lilycoveLady)); + lilycoveLady = Alloc(sizeof(*lilycoveLady)); if (lilycoveLady == NULL) return; diff --git a/src/region_map.c b/src/region_map.c index a4db1cb048..8157f8a4e7 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1664,7 +1664,7 @@ void CB2_OpenFlyMap(void) SetGpuReg(REG_OFFSET_BG2HOFS, 0); SetGpuReg(REG_OFFSET_BG3HOFS, 0); SetGpuReg(REG_OFFSET_BG3VOFS, 0); - sFlyMap = malloc(sizeof(*sFlyMap)); + sFlyMap = Alloc(sizeof(*sFlyMap)); if (sFlyMap == NULL) { SetMainCallback2(CB2_ReturnToFieldWithOpenMenu); diff --git a/src/tv.c b/src/tv.c index 0c394acf76..fe663bb35a 100644 --- a/src/tv.c +++ b/src/tv.c @@ -3450,7 +3450,7 @@ void ReceiveTvShowsData(void *src, u32 size, u8 playersLinkId) TVShow (*rmBuffer2)[MAX_LINK_PLAYERS][TV_SHOWS_COUNT]; TVShow (*rmBuffer)[MAX_LINK_PLAYERS][TV_SHOWS_COUNT]; - rmBuffer2 = malloc(MAX_LINK_PLAYERS * TV_SHOWS_COUNT * sizeof(TVShow)); + rmBuffer2 = Alloc(MAX_LINK_PLAYERS * TV_SHOWS_COUNT * sizeof(TVShow)); if (rmBuffer2 != NULL) { for (i = 0; i < MAX_LINK_PLAYERS; i++) @@ -3835,7 +3835,7 @@ void ReceivePokeNewsData(void *src, u32 size, u8 playersLinkId) PokeNews (*rmBuffer2)[MAX_LINK_PLAYERS][POKE_NEWS_COUNT]; PokeNews (*rmBuffer)[MAX_LINK_PLAYERS][POKE_NEWS_COUNT]; - rmBuffer2 = malloc(MAX_LINK_PLAYERS * POKE_NEWS_COUNT * sizeof(PokeNews)); + rmBuffer2 = Alloc(MAX_LINK_PLAYERS * POKE_NEWS_COUNT * sizeof(PokeNews)); if (rmBuffer2 != NULL) { for (i = 0; i < MAX_LINK_PLAYERS; i++) From e412ec30a0d9ddcf1a1cc427488fdc8279ae08a6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 16 Sep 2022 20:34:22 -0300 Subject: [PATCH 16/47] Removed calloc macro --- gflib/malloc.h | 1 - src/frontier_util.c | 6 +++--- src/link_rfu_3.c | 2 +- src/mail.c | 2 +- src/secret_base.c | 2 +- src/tv.c | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gflib/malloc.h b/gflib/malloc.h index 27004adf71..e21bd5a2c8 100644 --- a/gflib/malloc.h +++ b/gflib/malloc.h @@ -2,7 +2,6 @@ #define GUARD_ALLOC_H #define HEAP_SIZE 0x1C000 -#define calloc(ct, sz) AllocZeroed((ct) * (sz)) #define free Free #define FREE_AND_SET_NULL(ptr) \ diff --git a/src/frontier_util.c b/src/frontier_util.c index f5dde452fc..7906df7366 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -2271,7 +2271,7 @@ static void Fill1PRecords(struct RankingHall1P *dst, s32 hallFacilityId, s32 lvl { s32 i, j; struct RankingHall1P record1P[HALL_RECORDS_COUNT + 1]; - struct PlayerHallRecords *playerHallRecords = calloc(1, sizeof(struct PlayerHallRecords)); + struct PlayerHallRecords *playerHallRecords = AllocZeroed(sizeof(struct PlayerHallRecords)); GetPlayerHallRecords(playerHallRecords); for (i = 0; i < HALL_RECORDS_COUNT; i++) @@ -2305,7 +2305,7 @@ static void Fill2PRecords(struct RankingHall2P *dst, s32 lvlMode) { s32 i, j; struct RankingHall2P record2P[HALL_RECORDS_COUNT + 1]; - struct PlayerHallRecords *playerHallRecords = calloc(1, sizeof(struct PlayerHallRecords)); + struct PlayerHallRecords *playerHallRecords = AllocZeroed(sizeof(struct PlayerHallRecords)); GetPlayerHallRecords(playerHallRecords); for (i = 0; i < HALL_RECORDS_COUNT; i++) @@ -2421,7 +2421,7 @@ void ClearRankingHallRecords(void) void SaveGameFrontier(void) { s32 i; - struct Pokemon *monsParty = calloc(PARTY_SIZE, sizeof(struct Pokemon)); + struct Pokemon *monsParty = AllocZeroed(sizeof(struct Pokemon) * PARTY_SIZE); for (i = 0; i < PARTY_SIZE; i++) monsParty[i] = gPlayerParty[i]; diff --git a/src/link_rfu_3.c b/src/link_rfu_3.c index 0825daea2c..26102a8c3d 100644 --- a/src/link_rfu_3.c +++ b/src/link_rfu_3.c @@ -913,7 +913,7 @@ void SaveLinkTrainerNames(void) s32 j; s32 nextSpace; s32 connectedTrainerRecordIndices[MAX_RFU_PLAYERS]; - struct TrainerNameRecord *newRecords = calloc(ARRAY_COUNT(gSaveBlock1Ptr->trainerNameRecords), sizeof(struct TrainerNameRecord)); + struct TrainerNameRecord *newRecords = AllocZeroed(sizeof(gSaveBlock1Ptr->trainerNameRecords)); // Check if we already have a record saved for connected trainers. for (i = 0; i < GetLinkPlayerCount(); i++) diff --git a/src/mail.c b/src/mail.c index 651fcbb84e..f1e4fbedf3 100644 --- a/src/mail.c +++ b/src/mail.c @@ -448,7 +448,7 @@ void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText) u16 buffer[2]; u16 species; - sMailRead = calloc(1, sizeof(*sMailRead)); + sMailRead = AllocZeroed(sizeof(*sMailRead)); sMailRead->language = GAME_LANGUAGE; sMailRead->international = TRUE; sMailRead->parserSingle = CopyEasyChatWord; diff --git a/src/secret_base.c b/src/secret_base.c index 74129d3ff5..7459ba66b0 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -921,7 +921,7 @@ static void Task_ShowSecretBaseRegistryMenu(u8 taskId) tSelectedRow = 0; tScrollOffset = 0; ClearDialogWindowAndFrame(0, FALSE); - sRegistryMenu = calloc(1, sizeof(*sRegistryMenu)); + sRegistryMenu = AllocZeroed(sizeof(*sRegistryMenu)); tMainWindowId = AddWindow(&sRegistryWindowTemplates[0]); BuildRegistryMenuItems(taskId); FinalizeRegistryMenu(taskId); diff --git a/src/tv.c b/src/tv.c index fe663bb35a..530dd5d943 100644 --- a/src/tv.c +++ b/src/tv.c @@ -3966,7 +3966,7 @@ static void TranslateShowNames(TVShow *show, u32 language) int i; TVShow **shows; - shows = calloc(11, sizeof(TVShow *)); + shows = AllocZeroed(sizeof(TVShow *) * 11); for (i = 0; i < LAST_TVSHOW_IDX; i++) { switch (show[i].common.kind) From 8a68596b6436a28fee13cc216aed290736b3156d Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 16 Sep 2022 20:36:44 -0300 Subject: [PATCH 17/47] Removed free macro --- gflib/malloc.h | 3 +-- src/battle_pike.c | 4 ++-- src/battle_pyramid.c | 8 ++++---- src/decoration.c | 8 ++++---- src/event_object_movement.c | 2 +- src/frontier_util.c | 6 +++--- src/link_rfu_3.c | 2 +- src/record_mixing.c | 6 +++--- src/recorded_battle.c | 4 ++-- src/secret_base.c | 2 +- src/tv.c | 6 +++--- src/union_room.c | 10 +++++----- 12 files changed, 30 insertions(+), 31 deletions(-) diff --git a/gflib/malloc.h b/gflib/malloc.h index e21bd5a2c8..851db83a62 100644 --- a/gflib/malloc.h +++ b/gflib/malloc.h @@ -2,11 +2,10 @@ #define GUARD_ALLOC_H #define HEAP_SIZE 0x1C000 -#define free Free #define FREE_AND_SET_NULL(ptr) \ { \ - free(ptr); \ + Free(ptr); \ ptr = NULL; \ } diff --git a/src/battle_pike.c b/src/battle_pike.c index 139ea497ba..4f9af98ea6 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -1084,7 +1084,7 @@ static u8 GetNextRoomType(void) } nextRoomType = roomCandidates[Random() % numRoomCandidates]; - free(roomCandidates); + Free(roomCandidates); if (nextRoomType == PIKE_ROOM_STATUS) TryInflictRandomStatus(); @@ -1363,7 +1363,7 @@ static void SetHintedRoom(void) } gSaveBlock2Ptr->frontier.pikeHintedRoomType = roomCandidates[Random() % count]; - free(roomCandidates); + Free(roomCandidates); if (gSaveBlock2Ptr->frontier.pikeHintedRoomType == PIKE_ROOM_STATUS && !AtLeastOneHealthyMon()) gSaveBlock2Ptr->frontier.pikeHintedRoomType = PIKE_ROOM_NPC; if (gSaveBlock2Ptr->frontier.pikeHintedRoomType == PIKE_ROOM_DOUBLE_BATTLE && !AtLeastTwoAliveMons()) diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 6e8c6a37ea..cbc1589bd9 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -1568,7 +1568,7 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio } } RunOnLoadMapScript(); - free(floorLayoutOffsets); + Free(floorLayoutOffsets); } void LoadBattlePyramidObjectEventTemplates(void) @@ -1697,7 +1697,7 @@ static void SetPyramidObjectPositionsUniformly(u8 objType) } while (!(bits & 4) && TrySetPyramidObjectEventPositionInSquare(objType, floorLayoutOffsets, squareId, objectStartIndex + i)); bits &= 1; } - free(floorLayoutOffsets); + Free(floorLayoutOffsets); } static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId) @@ -1760,7 +1760,7 @@ static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId) r7 &= 1; } #ifdef BUGFIX - free(floorLayoutOffsets); + Free(floorLayoutOffsets); #endif return (numObjects / 2) > numPlacedObjects; @@ -1814,7 +1814,7 @@ static bool8 SetPyramidObjectPositionsNearSquare(u8 objType, u8 squareId) break; } #ifdef BUGFIX - free(floorLayoutOffsets); + Free(floorLayoutOffsets); #endif return (numObjects / 2) > numPlacedObjects; diff --git a/src/decoration.c b/src/decoration.c index 2384daa801..cd3e185da3 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1000,7 +1000,7 @@ static void HandleDecorationItemsMenuInput(u8 taskId) DestroyListMenuTask(tMenuTaskId, &sDecorationsScrollOffset, &sDecorationsCursorPos); RemoveDecorationWindow(WINDOW_DECORATION_CATEGORIES); RemoveDecorationItemsOtherWindows(); - free(sDecorationItemsMenu); + Free(sDecorationItemsMenu); sSecretBasePC_SelectedDecorationActions[tDecorationMenuCommand][0](taskId); break; } @@ -1161,7 +1161,7 @@ static void DecorationItemsMenuAction_Cancel(u8 taskId) RemoveDecorationItemsScrollIndicators(); RemoveDecorationItemsOtherWindows(); DestroyListMenuTask(tMenuTaskId, NULL, NULL); - free(sDecorationItemsMenu); + Free(sDecorationItemsMenu); ReinitDecorationCategoriesWindow(taskId); } @@ -2066,7 +2066,7 @@ static u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 template->paletteTag = paletteTag; spriteId = CreateSprite(template, 0, 0, 0); FreeItemIconTemporaryBuffers(); - free(template); + Free(template); return spriteId; } @@ -2105,7 +2105,7 @@ static u8 AddDecorationIconObjectFromObjectEvent(u16 tilesTag, u16 paletteTag, u template->tileTag = tilesTag; template->paletteTag = paletteTag; spriteId = CreateSprite(template, 0, 0, 0); - free(template); + Free(template); } else { diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 83f12c4bb6..1e8668d55c 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1543,7 +1543,7 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), LoadObjectEventPalette(spriteTemplate->paletteTag); spriteId = CreateSprite(spriteTemplate, x, y, subpriority); - free(spriteTemplate); + Free(spriteTemplate); if (spriteId != MAX_SPRITES && subspriteTables != NULL) { diff --git a/src/frontier_util.c b/src/frontier_util.c index 7906df7366..686b69388a 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -2298,7 +2298,7 @@ static void Fill1PRecords(struct RankingHall1P *dst, s32 hallFacilityId, s32 lvl record1P[highestId].winStreak = 0; } - free(playerHallRecords); + Free(playerHallRecords); } static void Fill2PRecords(struct RankingHall2P *dst, s32 lvlMode) @@ -2332,7 +2332,7 @@ static void Fill2PRecords(struct RankingHall2P *dst, s32 lvlMode) record2P[highestId].winStreak = 0; } - free(playerHallRecords); + Free(playerHallRecords); } static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode) @@ -2436,7 +2436,7 @@ void SaveGameFrontier(void) for (i = 0; i < PARTY_SIZE; i++) gPlayerParty[i] = monsParty[i]; - free(monsParty); + Free(monsParty); } // Frontier Brain functions. diff --git a/src/link_rfu_3.c b/src/link_rfu_3.c index 26102a8c3d..0d028cd48a 100644 --- a/src/link_rfu_3.c +++ b/src/link_rfu_3.c @@ -955,7 +955,7 @@ void SaveLinkTrainerNames(void) // Finalize the new list, and clean up. memcpy(gSaveBlock1Ptr->trainerNameRecords, newRecords, sizeof(gSaveBlock1Ptr->trainerNameRecords)); - free(newRecords); + Free(newRecords); } } diff --git a/src/record_mixing.c b/src/record_mixing.c index 72edd52f29..5d75f3fc89 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -358,8 +358,8 @@ static void Task_RecordMixing_Main(u8 taskId) case 5: // Wait for the task created by CreateTask_ReestablishCableClubLink if (!gTasks[tLinkTaskId].isActive) { - free(sReceivedRecords); - free(sSentRecord); + Free(sReceivedRecords); + Free(sSentRecord); SetLinkWaitingForScript(); if (gWirelessCommType != 0) CreateTask(Task_ReturnToFieldRecordMixing, 10); @@ -705,7 +705,7 @@ static void ReceiveLilycoveLadyData(LilycoveLady *records, size_t recordSize, u8 if (lilycoveLady != NULL) { QuizLadyClearQuestionForRecordMix(lilycoveLady); - free(lilycoveLady); + Free(lilycoveLady); } } diff --git a/src/recorded_battle.c b/src/recorded_battle.c index e8785b5f82..dead1dd7e3 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -475,8 +475,8 @@ bool32 MoveRecordedBattleToSaveData(void) break; } - free(battleSave); - free(savSection); + Free(battleSave); + Free(savSection); return ret; } diff --git a/src/secret_base.c b/src/secret_base.c index 7459ba66b0..ea19993439 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -1006,7 +1006,7 @@ static void HandleRegistryMenuInput(u8 taskId) ClearWindowTilemap(tMainWindowId); RemoveWindow(tMainWindowId); ScheduleBgCopyTilemapToVram(0); - free(sRegistryMenu); + Free(sRegistryMenu); GoToSecretBasePCRegisterMenu(taskId); break; default: diff --git a/src/tv.c b/src/tv.c index 530dd5d943..b32881d090 100644 --- a/src/tv.c +++ b/src/tv.c @@ -3488,7 +3488,7 @@ void ReceiveTvShowsData(void *src, u32 size, u8 playersLinkId) CompactTVShowArray(gSaveBlock1Ptr->tvShows); DeactivateShowsWithUnseenSpecies(); DeactivateGameCompleteShowsIfNotUnlocked(); - free(rmBuffer2); + Free(rmBuffer2); } } @@ -3861,7 +3861,7 @@ void ReceivePokeNewsData(void *src, u32 size, u8 playersLinkId) } ClearInvalidPokeNews(); ClearPokeNewsIfGameNotComplete(); - free(rmBuffer2); + Free(rmBuffer2); } } @@ -4023,7 +4023,7 @@ static void TranslateShowNames(TVShow *show, u32 language) break; } } - free(shows); + Free(shows); } void SanitizeTVShowsForRuby(TVShow *shows) diff --git a/src/union_room.c b/src/union_room.c index 7d14176717..b47ddb41c0 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -3365,12 +3365,12 @@ static void Task_InitUnionRoom(u8 taskId) } break; case 4: - free(data->spawnPlayer); - free(data->playerList); - free(data->incomingParentList); - free(data->incomingChildList); + Free(data->spawnPlayer); + Free(data->playerList); + Free(data->incomingParentList); + Free(data->incomingChildList); DestroyTask(data->searchTaskId); - free(sWirelessLinkMain.uRoom); + Free(sWirelessLinkMain.uRoom); LinkRfu_Shutdown(); DestroyTask(taskId); break; From 13877f71dcb884aac6a6bb58493ad4a56811dade Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Sat, 17 Sep 2022 13:33:10 -0400 Subject: [PATCH 18/47] Minor documentation Some things I figured out while working on my hack. - The Subsprite tables do not use `DISPLAY_WIDTH`, but rather use -16, since they are signed bytes. The negative numbers better illustrate what the tables are doing. - Figured out the as-of-yet undocumented data in SpriteCB_FlygonSilhouette --- src/battle_interface.c | 40 +++++++++++++++++++++------ src/intro.c | 62 ++++++++++++++++++++++++------------------ 2 files changed, 67 insertions(+), 35 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index ed4aa9ed8a..bacdec12a8 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -318,10 +318,17 @@ static const struct SpriteTemplate sHealthbarSpriteTemplates[MAX_BATTLERS_COUNT] } }; +/* v-- Origin +[0 + ][1 ] +[ ][ ] sUnused_Subsprites_0 +[ ][ ] +[______________][______] 96x40 +[2 ][3 ][4 ] +*/ static const struct Subsprite sUnused_Subsprites_0[] = { { - .x = DISPLAY_WIDTH, + .x = -16, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -337,7 +344,7 @@ static const struct Subsprite sUnused_Subsprites_0[] = .priority = 1 }, { - .x = DISPLAY_WIDTH, + .x = -16, .y = 32, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -362,10 +369,11 @@ static const struct Subsprite sUnused_Subsprites_0[] = } }; +// This subsprite table has the same layout as above, but offset by 64 base tiles. static const struct Subsprite sUnused_Subsprites_2[] = { { - .x = DISPLAY_WIDTH, + .x = -16, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -381,7 +389,7 @@ static const struct Subsprite sUnused_Subsprites_2[] = .priority = 1 }, { - .x = DISPLAY_WIDTH, + .x = -16, .y = 32, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -406,10 +414,16 @@ static const struct Subsprite sUnused_Subsprites_2[] = } }; +/* v-- Origin +[0 + ][1 ] +[ ][ ] +[ ][ ] +[ ][ ] 96x32 +*/ static const struct Subsprite sUnused_Subsprites_1[] = { { - .x = DISPLAY_WIDTH, + .x = -16, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -426,10 +440,11 @@ static const struct Subsprite sUnused_Subsprites_1[] = } }; +// Same as above static const struct Subsprite sUnused_Subsprites_3[] = { { - .x = DISPLAY_WIDTH, + .x = -16, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -446,10 +461,13 @@ static const struct Subsprite sUnused_Subsprites_3[] = } }; +/* v-- Origin +[0 + ][1 ] 64x8 +*/ static const struct Subsprite sHealthBar_Subsprites_Player[] = { { - .x = DISPLAY_WIDTH, + .x = -16, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -466,10 +484,14 @@ static const struct Subsprite sHealthBar_Subsprites_Player[] = } }; +/* v-- Origin +[] [0 + ][1 ] 72x8 +2^ ^--- Note 8px space +*/ static const struct Subsprite sHealthBar_Subsprites_Opponent[] = { { - .x = DISPLAY_WIDTH, + .x = -16, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -485,7 +507,7 @@ static const struct Subsprite sHealthBar_Subsprites_Opponent[] = .priority = 1 }, { - .x = DISPLAY_WIDTH - 16, + .x = -32, .y = 0, .shape = SPRITE_SHAPE(8x8), .size = SPRITE_SIZE(8x8), diff --git a/src/intro.c b/src/intro.c index b067891429..b42dc3a057 100644 --- a/src/intro.c +++ b/src/intro.c @@ -3322,24 +3322,29 @@ static u8 CreateGameFreakLogoSprites(s16 x, s16 y, s16 unused) #undef sLetterX #undef COLOR_CHANGES +#define sScale data[1] +#define sRot data[2] +#define sPos data[3] +#define sTimer data[7] + static void SpriteCB_FlygonSilhouette(struct Sprite *sprite) { - sprite->data[7]++; + sprite->sTimer++; if (sprite->sState != 0) { - s16 sin1; - s16 sin2; + s16 sin; + s16 cos; s16 a, b, c, d; - - sin1 = gSineTable[(u8)sprite->data[2]]; - sin2 = gSineTable[(u8)(sprite->data[2] + 64)]; - - d = Q_8_8_TO_INT(sin2 * sprite->data[1]); - c = Q_8_8_TO_INT(-sin1 * sprite->data[1]); - b = Q_8_8_TO_INT(sin1 * sprite->data[1]); - a = Q_8_8_TO_INT(sin2 * sprite->data[1]); + // Determines rotation of the sprite + sin = gSineTable[(u8)sprite->sRot]; + cos = gSineTable[(u8)(sprite->sRot + 64)]; + // Converts rotation and scale into the OAM matrix + d = Q_8_8_TO_INT( cos * sprite->sScale); + c = Q_8_8_TO_INT(-sin * sprite->sScale); + b = Q_8_8_TO_INT( sin * sprite->sScale); + a = Q_8_8_TO_INT( cos * sprite->sScale); SetOamMatrix(1, a, b, c, d); } @@ -3353,36 +3358,41 @@ static void SpriteCB_FlygonSilhouette(struct Sprite *sprite) CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE); sprite->invisible = FALSE; sprite->sState = 1; - sprite->data[1] = 0x80; - sprite->data[2] = 0; - sprite->data[3] = 0; + sprite->sScale = 128; + sprite->sRot = 0; + sprite->sPos = 0; break; case 1: - sprite->x2 = -Sin((u8)sprite->data[3], 140); - sprite->y2 = -Sin((u8)sprite->data[3], 120); - sprite->data[1] += 7; - sprite->data[3] += 3; + sprite->x2 = -Sin((u8)sprite->sPos, 140); + sprite->y2 = -Sin((u8)sprite->sPos, 120); + sprite->sScale += 7; + sprite->sPos += 3; if (sprite->x + sprite->x2 <= -16) { sprite->oam.priority = 3; sprite->sState++; sprite->x = 20; sprite->y = 40; - sprite->data[1] = 0x200; - sprite->data[2] = 0; - sprite->data[3] = 0x10; + sprite->sScale = 512; + sprite->sRot = 0; + sprite->sPos = 16; } break; case 2: - sprite->x2 = Sin((u8)sprite->data[3], 34); - sprite->y2 = -Cos((u8)sprite->data[3], 60); - sprite->data[1] += 2; - if (sprite->data[7] % 5 == 0) - sprite->data[3]++; + sprite->x2 = Sin((u8)sprite->sPos, 34); + sprite->y2 = -Cos((u8)sprite->sPos, 60); + sprite->sScale += 2; + if (sprite->sTimer % 5 == 0) + sprite->sPos++; break; } } +#undef sScale +#undef sRot +#undef sPos +#undef sTimer + static void SpriteCB_RayquazaOrb(struct Sprite *sprite) { u16 foo; From c371a44a83616a06bff012dd81dfdd4cca9b7f78 Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Sat, 17 Sep 2022 13:34:54 -0400 Subject: [PATCH 19/47] Formatting --- src/battle_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index bacdec12a8..4c97879d82 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -320,8 +320,8 @@ static const struct SpriteTemplate sHealthbarSpriteTemplates[MAX_BATTLERS_COUNT] /* v-- Origin [0 + ][1 ] -[ ][ ] sUnused_Subsprites_0 -[ ][ ] +[ ][ ] +[ ][ ] [______________][______] 96x40 [2 ][3 ][4 ] */ From 5c55e441734458119a8bf7b748d6dadc77c9302a Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Sat, 17 Sep 2022 14:34:20 -0400 Subject: [PATCH 20/47] More diagrams - Diagramed all subsprite tables in the code base. There's a LOT in the slot machine code. --- src/battle_interface.c | 22 +++--- src/contest.c | 3 + src/field_effect.c | 10 +++ src/naming_screen.c | 20 ++++++ src/slot_machine.c | 153 ++++++++++++++++++++++++++++++++++++++++- 5 files changed, 199 insertions(+), 9 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 4c97879d82..355397a1ed 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -485,7 +485,7 @@ static const struct Subsprite sHealthBar_Subsprites_Player[] = }; /* v-- Origin -[] [0 + ][1 ] 72x8 +[] [0 + ][1 ] 8x8 + 64x8 2^ ^--- Note 8px space */ static const struct Subsprite sHealthBar_Subsprites_Opponent[] = @@ -529,11 +529,13 @@ static const struct SubspriteTable sHealthBar_SubspriteTables[] = [B_SIDE_PLAYER] = {ARRAY_COUNT(sHealthBar_Subsprites_Player), sHealthBar_Subsprites_Player}, [B_SIDE_OPPONENT] = {ARRAY_COUNT(sHealthBar_Subsprites_Opponent), sHealthBar_Subsprites_Opponent} }; - +/* v-- Origin +[0 ][1 ][2 ][3 ] 128x8 +*/ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] = { { - .x = 32 * 5, + .x = 32 * -3, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -541,7 +543,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] = .priority = 1 }, { - .x = 32 * 6, + .x = 32 * -2, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -549,7 +551,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] = .priority = 1 }, { - .x = 32 * 7, + .x = 32 * -1, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -566,10 +568,14 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] = } }; +/* v-- Origin +[0 ][1 ][2 ][3 ][4 ][5 ] 192x8 + ^-- uses same tiles --^ +*/ static const struct Subsprite sStatusSummaryBar_Subsprites_Exit[] = { { - .x = 32 * 5, + .x = 32 * -3, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -577,7 +583,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Exit[] = .priority = 1 }, { - .x = 32 * 6, + .x = 32 * -2, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -585,7 +591,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Exit[] = .priority = 1 }, { - .x = 32 * 7, + .x = 32 * -1, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), diff --git a/src/contest.c b/src/contest.c index b2c875a583..0f77df814c 100644 --- a/src/contest.c +++ b/src/contest.c @@ -525,6 +525,9 @@ static const struct SpriteTemplate sSpriteTemplates_NextTurn[CONTESTANT_COUNT] = } }; +/* v-- Origin +[0 +][1 ] 64x8 +*/ static const struct Subsprite sSubsprites_NextTurn[] = { { diff --git a/src/field_effect.c b/src/field_effect.c index 1ab45bb25c..7612935d51 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -405,6 +405,11 @@ static const struct SpriteFrameImage sPicTable_HofMonitorSmall[] = {.data = sHofMonitorSmall_Gfx, .size = 0x200} // the macro breaks down here }; +/* +[0_][] <-1 24x16 +[2 ][] <-3 + ^-- Origin +*/ static const struct Subsprite sSubsprites_PokecenterMonitor[] = { { @@ -443,6 +448,11 @@ static const struct Subsprite sSubsprites_PokecenterMonitor[] = static const struct SubspriteTable sSubspriteTable_PokecenterMonitor = subsprite_table(sSubsprites_PokecenterMonitor); +/* +[0_____][1_____] 24x16 +[2 ][3 ] + ^-- Origin +*/ static const struct Subsprite sSubsprites_HofMonitorBig[] = { { diff --git a/src/naming_screen.c b/src/naming_screen.c index b4007b2658..fe858b8795 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -2179,6 +2179,12 @@ static const struct OamData sOam_32x16 = .paletteNum = 0, }; +/* +[0_____][] <-1 40x32 +[2_____][] <-3 +[3___+_][] <-5/Origin +[4 ][] <-7 +*/ static const struct Subsprite sSubsprites_PageSwapFrame[] = { { @@ -2247,6 +2253,10 @@ static const struct Subsprite sSubsprites_PageSwapFrame[] = } }; +/* +[0_][] <-1 24x8 + ^-- Origin +*/ static const struct Subsprite sSubsprites_PageSwapText[] = { { @@ -2267,6 +2277,11 @@ static const struct Subsprite sSubsprites_PageSwapText[] = } }; +/* +[0_____][] <-1 40x24 +[2_____][] <-3 +[3___+_][] <-5/Origin +*/ static const struct Subsprite sSubsprites_Button[] = { { @@ -2319,6 +2334,11 @@ static const struct Subsprite sSubsprites_Button[] = } }; +/* +[0_] 16x24 +[1+] <--Origin +[2_] +*/ static const struct Subsprite sSubsprites_PCIcon[] = { { diff --git a/src/slot_machine.c b/src/slot_machine.c index 3b82afde19..8a67acae36 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -6433,6 +6433,20 @@ static const struct SpriteTemplate sSpriteTemplate_PikaPowerBolt = .callback = SpriteCB_PikaPowerBolt }; +/* +[0 ][1 ] +[ ][ ] +[ ][ ] +[ ][ ] +[ ][ ] +[______________][______________] 128x128 +[ ]+ <- Origin ] +[ ][ ] +[ ][ ] +[ ][ ] +[ ][ ] +[2 ][3 ] +*/ static const struct Subsprite sSubsprites_ReelBackground[] = { { @@ -6474,6 +6488,11 @@ static const struct SubspriteTable sSubspriteTable_ReelBackground[] = ARRAY_COUNT(sSubsprites_ReelBackground), sSubsprites_ReelBackground }; +/* v-- Origin on 3 +[0_____][1_____] +[2_____][3_____] 64x24 +[4 ][5 ] +*/ static const struct Subsprite sSubsprites_ReelTimeMachineAntennae[] = { { @@ -6531,6 +6550,13 @@ static const struct SubspriteTable sSubspriteTable_ReelTimeMachineAntennae[] = ARRAY_COUNT(sSubsprites_ReelTimeMachineAntennae), sSubsprites_ReelTimeMachineAntennae }; +/* +[0 ] +[ ] +[ + Origin] +[______________] 64x40 +[1 ][2 ] +*/ static const struct Subsprite sSubsprites_ReelTimeMachine[] = { { @@ -6564,6 +6590,14 @@ static const struct SubspriteTable sSubspriteTable_ReelTimeMachine[] = ARRAY_COUNT(sSubsprites_ReelTimeMachine), sSubsprites_ReelTimeMachine }; +/* +[0 ] +[ ] +[ + Origin] +[______________] 64x48 +[1 ][2 ] +[3 ][4 ] +*/ static const struct Subsprite sSubsprites_BrokenReelTimeMachine[] = { { @@ -6613,6 +6647,10 @@ static const struct SubspriteTable sSubspriteTable_BrokenReelTimeMachine[] = ARRAY_COUNT(sSubsprites_BrokenReelTimeMachine), sSubsprites_BrokenReelTimeMachine }; +/* v-- Origin on 3 +[0_____][1_____] +[2 ][3 ] 64x16 +*/ static const struct Subsprite sSubsprites_ReelTimeShadow[] = { { @@ -6654,6 +6692,11 @@ static const struct SubspriteTable sSubspriteTable_ReelTimeShadow[] = ARRAY_COUNT(sSubsprites_ReelTimeShadow), sSubsprites_ReelTimeShadow }; +/* +[0_] 16x24 +[1+] <--Origin +[2_] +*/ static const struct Subsprite sSubsprites_ReelTimeNumberGap[] = { { @@ -6687,6 +6730,14 @@ static const struct SubspriteTable sSubspriteTable_ReelTimeNumberGap[] = ARRAY_COUNT(sSubsprites_ReelTimeNumberGap), sSubsprites_ReelTimeNumberGap }; +/* +[0 ] +[ ] +[ + Origin] +[______________] 64x48 +[1 ][2 ] +[3 ][4 ] +*/ static const struct Subsprite sSubsprites_DigitalDisplay_Reel[] = { { @@ -6736,6 +6787,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Reel[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_Reel), sSubsprites_DigitalDisplay_Reel }; +/* v-- Origin on 3 +[0_____][1_____] +[2 ][3 ] 64x16 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_Time[] = { { @@ -6777,6 +6832,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Time[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_Time), sSubsprites_DigitalDisplay_Time }; +/* v-- Origin on 3 +[0_____][1_____] +[2 ][3 ] 64x16 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_Insert[] = { { @@ -6818,6 +6877,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Insert[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_Insert), sSubsprites_DigitalDisplay_Insert }; +/* v-- Origin on 3 +[0_____][1_____] +[2 ][3 ] 64x16 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_Unused1[] = { { @@ -6859,6 +6922,11 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Unused1[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_Unused1), sSubsprites_DigitalDisplay_Unused1 }; +/* v-- Origin on 3 +[0_____][1_____] +[2_____][3_____] +[4 ][5 ] 64x24 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_Win[] = { { @@ -6950,6 +7018,14 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Unused2[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_Unused2), sSubsprites_DigitalDisplay_Unused2 }; +/* +[0_____][1_] +[2_____][3_] +[4_____][5_] +[6_____][7+] <-- Origin +[8_____][9_] +[10____][11] +*/ static const struct Subsprite sSubsprites_DigitalDisplay_Pokeball[] = { { @@ -6962,7 +7038,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Pokeball[] = }, { .x = 8, - -24, + .y = -24, .shape = SPRITE_SHAPE(16x8), .size = SPRITE_SIZE(16x8), .tileOffset = 4, @@ -7055,6 +7131,11 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Pokeball[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_Pokeball), sSubsprites_DigitalDisplay_Pokeball }; +/* +[0 ] 32x24 +[ + ] <- Origin +[1 ][2 ] +*/ static const struct Subsprite sSubsprites_DigitalDisplay_DPad[] = { { @@ -7088,6 +7169,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_DPad[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_DPad), sSubsprites_DigitalDisplay_DPad }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_StopS[] = { { @@ -7113,6 +7198,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopS[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_StopS), sSubsprites_DigitalDisplay_StopS }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_StopT[] = { { @@ -7138,6 +7227,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopT[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_StopT), sSubsprites_DigitalDisplay_StopT }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_StopO[] = { { @@ -7163,6 +7256,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopO[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_StopO), sSubsprites_DigitalDisplay_StopO }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_StopP[] = { { @@ -7188,6 +7285,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopP[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_StopP), sSubsprites_DigitalDisplay_StopP }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BonusB[] = { { @@ -7213,6 +7314,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusB[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusB), sSubsprites_DigitalDisplay_BonusB }; +/* +[]<-0 16x16 +[]<-1 <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BonusO[] = { { @@ -7238,6 +7343,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusO[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusO), sSubsprites_DigitalDisplay_BonusO }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BonusN[] = { { @@ -7263,6 +7372,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusN[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusN), sSubsprites_DigitalDisplay_BonusN }; +/* +[]<-0 16x16 +[]<-1 <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BonusU[] = { { @@ -7288,6 +7401,10 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusU[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusU), sSubsprites_DigitalDisplay_BonusU }; +/* +[0 ] 16x16 +[1+] <- Origin +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BonusS[] = { { @@ -7313,6 +7430,12 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusS[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusS), sSubsprites_DigitalDisplay_BonusS }; +/* +[0_][] <-1 +[2_][] <-3 +[4_][] <-5 + ^-- Origin on 3 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BigB[] = { { @@ -7370,6 +7493,11 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BigB[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BigB), sSubsprites_DigitalDisplay_BigB }; +/* +[0_] 16x24 +[1+] <--Origin +[2_] +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BigI[] = { { @@ -7403,6 +7531,12 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BigI[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BigI), sSubsprites_DigitalDisplay_BigI }; +/* +[0_][] <-1 +[2_][] <-3 +[4_][] <-5 + ^-- Origin on 3 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_BigG[] = { { @@ -7460,6 +7594,12 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BigG[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_BigG), sSubsprites_DigitalDisplay_BigG }; +/* +[0_][] <-1 +[2_][] <-3 +[4_][] <-5 + ^-- Origin on 3 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_RegR[] = { { @@ -7517,6 +7657,11 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_RegR[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_RegR), sSubsprites_DigitalDisplay_RegR }; +/* +[0_] 16x24 +[1+] <--Origin +[2_] +*/ static const struct Subsprite sSubsprites_DigitalDisplay_RegE[] = { { @@ -7550,6 +7695,12 @@ static const struct SubspriteTable sSubspriteTable_DigitalDisplay_RegE[] = ARRAY_COUNT(sSubsprites_DigitalDisplay_RegE), sSubsprites_DigitalDisplay_RegE }; +/* +[0_][] <-1 +[2_][] <-3 +[4_][] <-5 + ^-- Origin on 3 +*/ static const struct Subsprite sSubsprites_DigitalDisplay_RegG[] = { { From 1107ff954d93dff53bdc8025a763d5f6a328f141 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 22 Sep 2022 13:32:35 -0400 Subject: [PATCH 21/47] Clean up shop.c --- include/constants/items.h | 5 +- include/shop.h | 41 --- src/battle_pyramid_bag.c | 2 +- .../battle_frontier_exchange_corner.h | 8 +- src/data/item_icon_table.h | 4 +- src/field_specials.c | 4 +- src/item_icon.c | 4 +- src/item_menu.c | 2 +- src/player_pc.c | 2 +- src/shop.c | 282 ++++++++++-------- 10 files changed, 178 insertions(+), 176 deletions(-) diff --git a/include/constants/items.h b/include/constants/items.h index e9d889cfa0..daf129c76f 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -477,7 +477,10 @@ #define ITEM_OLD_SEA_MAP 376 #define ITEMS_COUNT 377 -#define ITEM_FIELD_ARROW ITEMS_COUNT + +// A special item id associated with "Cancel"/"Exit" etc. in a list of items or decorations +// Its icon is defined at ITEMS_COUNT as the "return to field" arrow +#define ITEM_LIST_END 0xFFFF // Range of berries given out by various NPCS #define FIRST_BERRY_MASTER_BERRY ITEM_POMEG_BERRY diff --git a/include/shop.h b/include/shop.h index c338103b4a..7fd7669ea5 100644 --- a/include/shop.h +++ b/include/shop.h @@ -3,47 +3,6 @@ extern EWRAM_DATA struct ItemSlot gMartPurchaseHistory[3]; -enum -{ - MART_TYPE_NORMAL, // normal mart - MART_TYPE_DECOR, - MART_TYPE_DECOR2, -}; - -// shop view window NPC info enum -enum -{ - OBJ_EVENT_ID, - X_COORD, - Y_COORD, - ANIM_NUM, - LAYER_TYPE -}; - -struct MartInfo -{ - /*0x0*/ void (*callback)(void); - /*0x4*/ const struct MenuAction *menuActions; - /*0x8*/ const u16 *itemList; - /*0xC*/ u16 itemCount; - /*0xE*/ u8 windowId; - /*0xF*/ u8 martType; -}; - -struct ShopData -{ - /*0x0000*/ u16 tilemapBuffers[4][0x400]; - /*0x2000*/ u32 totalCost; - /*0x2004*/ u16 itemsShowed; - /*0x2006*/ u16 selectedRow; - /*0x2008*/ u16 scrollOffset; - /*0x200A*/ u8 maxQuantity; - /*0x200B*/ u8 scrollIndicatorsTaskId; - /*0x200C*/ u8 iconSlot; - /*0x200D*/ u8 itemSpriteIds[2]; - /*0x2010*/ s16 viewportObjects[OBJECT_EVENTS_COUNT][5]; -}; - void CreatePokemartMenu(const u16 *); void CreateDecorationShop1Menu(const u16 *); void CreateDecorationShop2Menu(const u16 *); diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 7a4d981f01..67afaefe1b 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -645,7 +645,7 @@ static void BagCursorMoved(s32 itemIndex, bool8 onInit, struct ListMenu *list) if (itemIndex != LIST_CANCEL) ShowItemIcon(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][itemIndex], gPyramidBagMenu->isAltIcon); else - ShowItemIcon(0xFFFF, gPyramidBagMenu->isAltIcon); // Show exit arrow if on Cancel + ShowItemIcon(ITEM_LIST_END, gPyramidBagMenu->isAltIcon); // Show exit arrow if on Cancel gPyramidBagMenu->isAltIcon ^= 1; PrintItemDescription(itemIndex); } diff --git a/src/data/battle_frontier/battle_frontier_exchange_corner.h b/src/data/battle_frontier/battle_frontier_exchange_corner.h index 426285e92e..3a1eef76d4 100644 --- a/src/data/battle_frontier/battle_frontier_exchange_corner.h +++ b/src/data/battle_frontier/battle_frontier_exchange_corner.h @@ -10,7 +10,7 @@ static const u16 sFrontierExchangeCorner_Decor1[] = DECOR_CYNDAQUIL_DOLL, DECOR_CHIKORITA_DOLL, DECOR_TOTODILE_DOLL, - 0xFFFF + ITEM_LIST_END }; static const u16 sFrontierExchangeCorner_Decor2[] = @@ -20,7 +20,7 @@ static const u16 sFrontierExchangeCorner_Decor2[] = DECOR_VENUSAUR_DOLL, DECOR_CHARIZARD_DOLL, DECOR_BLASTOISE_DOLL, - 0xFFFF + ITEM_LIST_END }; static const u16 sFrontierExchangeCorner_Vitamins[] = @@ -31,7 +31,7 @@ static const u16 sFrontierExchangeCorner_Vitamins[] = ITEM_ZINC, ITEM_CARBOS, ITEM_HP_UP, - 0xFFFF + ITEM_LIST_END }; static const u16 sFrontierExchangeCorner_HoldItems[] = @@ -45,7 +45,7 @@ static const u16 sFrontierExchangeCorner_HoldItems[] = ITEM_KINGS_ROCK, ITEM_FOCUS_BAND, ITEM_SCOPE_LENS, - 0xFFFF + ITEM_LIST_END }; static const u8 *const sFrontierExchangeCorner_Decor1Descriptions[] = diff --git a/src/data/item_icon_table.h b/src/data/item_icon_table.h index ea8315e760..64328f7b17 100644 --- a/src/data/item_icon_table.h +++ b/src/data/item_icon_table.h @@ -1,4 +1,4 @@ -const u32 *const gItemIconTable[][2] = +const u32 *const gItemIconTable[ITEMS_COUNT + 1][2] = { [ITEM_NONE] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // Pokeballs @@ -402,5 +402,5 @@ const u32 *const gItemIconTable[][2] = [ITEM_MAGMA_EMBLEM] = {gItemIcon_MagmaEmblem, gItemIconPalette_MagmaEmblem}, [ITEM_OLD_SEA_MAP] = {gItemIcon_OldSeaMap, gItemIconPalette_OldSeaMap}, // Return to field arrow - [ITEM_FIELD_ARROW] = {gItemIcon_ReturnToFieldArrow, gItemIconPalette_ReturnToFieldArrow}, + [ITEMS_COUNT] = {gItemIcon_ReturnToFieldArrow, gItemIconPalette_ReturnToFieldArrow}, }; diff --git a/src/field_specials.c b/src/field_specials.c index 2e33b443ca..11ae04f554 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2919,7 +2919,7 @@ static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) { case SCROLL_MULTI_BF_EXCHANGE_CORNER_DECOR_VENDOR_1: AddTextPrinterParameterized2(0, FONT_NORMAL, sFrontierExchangeCorner_Decor1Descriptions[selection], 0, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); - if (sFrontierExchangeCorner_Decor1[selection] == 0xFFFF) + if (sFrontierExchangeCorner_Decor1[selection] == ITEM_LIST_END) { ShowFrontierExchangeCornerItemIcon(sFrontierExchangeCorner_Decor1[selection]); } @@ -2932,7 +2932,7 @@ static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection) break; case SCROLL_MULTI_BF_EXCHANGE_CORNER_DECOR_VENDOR_2: AddTextPrinterParameterized2(0, FONT_NORMAL, sFrontierExchangeCorner_Decor2Descriptions[selection], 0, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); - if (sFrontierExchangeCorner_Decor2[selection] == 0xFFFF) + if (sFrontierExchangeCorner_Decor2[selection] == ITEM_LIST_END) { ShowFrontierExchangeCornerItemIcon(sFrontierExchangeCorner_Decor2[selection]); } diff --git a/src/item_icon.c b/src/item_icon.c index 274ed03b36..fd6f041695 100644 --- a/src/item_icon.c +++ b/src/item_icon.c @@ -159,8 +159,8 @@ u8 AddCustomItemIconSprite(const struct SpriteTemplate *customSpriteTemplate, u1 const void *GetItemIconPicOrPalette(u16 itemId, u8 which) { - if (itemId == 0xFFFF) - itemId = ITEM_FIELD_ARROW; + if (itemId == ITEM_LIST_END) + itemId = ITEMS_COUNT; // Use last icon, the "return to field" arrow else if (itemId >= ITEMS_COUNT) itemId = 0; diff --git a/src/item_menu.c b/src/item_menu.c index 288c2d9565..9e79665288 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -937,7 +937,7 @@ static void BagMenu_MoveCursorCallback(s32 itemIndex, bool8 onInit, struct ListM if (itemIndex != LIST_CANCEL) AddBagItemIconSprite(BagGetItemIdByPocketPosition(gBagPosition.pocket + 1, itemIndex), gBagMenu->itemIconSlot); else - AddBagItemIconSprite(-1, gBagMenu->itemIconSlot); + AddBagItemIconSprite(ITEM_LIST_END, gBagMenu->itemIconSlot); gBagMenu->itemIconSlot ^= 1; if (!gBagMenu->inhibitItemDescriptionPrint) PrintItemDescription(itemIndex); diff --git a/src/player_pc.c b/src/player_pc.c index 9ec36d61d2..b1a323a328 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -1015,7 +1015,7 @@ static void ItemStorage_MoveCursor(s32 id, bool8 onInit, struct ListMenu *list) if (id != LIST_CANCEL) ItemStorage_DrawItemIcon(gSaveBlock1Ptr->pcItems[id].itemId); else - ItemStorage_DrawItemIcon(MSG_GO_BACK_TO_PREV); + ItemStorage_DrawItemIcon(ITEM_LIST_END); ItemStorage_PrintDescription(id); } } diff --git a/src/shop.c b/src/shop.c index 451fa171cb..d3569c2e54 100755 --- a/src/shop.c +++ b/src/shop.c @@ -42,10 +42,72 @@ #define TAG_SCROLL_ARROW 2100 #define TAG_ITEM_ICON_BASE 2110 +#define MAX_ITEMS_SHOWN 8 + +enum { + WIN_BUY_SELL_QUIT, + WIN_BUY_QUIT, +}; + +enum { + WIN_MONEY, + WIN_ITEM_LIST, + WIN_ITEM_DESCRIPTION, + WIN_QUANTITY_IN_BAG, + WIN_QUANTITY_PRICE, + WIN_MESSAGE, +}; + +enum { + COLORID_NORMAL, // Item descriptions, quantity in bag, and quantity/price + COLORID_ITEM_LIST, // The text in the item list, and the cursor normally + COLORID_GRAY_CURSOR, // When the cursor has selected an item to purchase +}; + +enum { + MART_TYPE_NORMAL, + MART_TYPE_DECOR, + MART_TYPE_DECOR2, +}; + +// shop view window NPC info enum +enum +{ + OBJ_EVENT_ID, + X_COORD, + Y_COORD, + ANIM_NUM, + LAYER_TYPE +}; + +struct MartInfo +{ + void (*callback)(void); + const struct MenuAction *menuActions; + const u16 *itemList; + u16 itemCount; + u8 windowId; + u8 martType; +}; + +struct ShopData +{ + u16 tilemapBuffers[4][0x400]; + u32 totalCost; + u16 itemsShowed; + u16 selectedRow; + u16 scrollOffset; + u8 maxQuantity; + u8 scrollIndicatorsTaskId; + u8 iconSlot; + u8 itemSpriteIds[2]; + s16 viewportObjects[OBJECT_EVENTS_COUNT][5]; +}; + static EWRAM_DATA struct MartInfo sMartInfo = {0}; static EWRAM_DATA struct ShopData *sShopData = NULL; static EWRAM_DATA struct ListMenuItem *sListMenuItems = NULL; -static EWRAM_DATA u8 (*sItemNames)[16] = {0}; +static EWRAM_DATA u8 (*sItemNames)[ITEM_NAME_LENGTH + 2] = {0}; static EWRAM_DATA u8 sPurchaseHistoryId = 0; EWRAM_DATA struct ItemSlot gMartPurchaseHistory[SMARTSHOPPER_NUM_ITEMS] = {0}; @@ -114,7 +176,7 @@ static const struct MenuAction sShopMenuActions_BuyQuit[] = static const struct WindowTemplate sShopMenuWindowTemplates[] = { - { + [WIN_BUY_SELL_QUIT] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, @@ -123,7 +185,8 @@ static const struct WindowTemplate sShopMenuWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x0008, }, - { + // Separate shop menu window for decorations, which can't be sold + [WIN_BUY_QUIT] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, @@ -141,7 +204,7 @@ static const struct ListMenuTemplate sShopBuyMenuListTemplate = .itemPrintFunc = BuyMenuPrintPriceInList, .totalItems = 0, .maxShowed = 0, - .windowId = 1, + .windowId = WIN_ITEM_LIST, .header_X = 0, .item_X = 8, .cursor_X = 0, @@ -198,7 +261,7 @@ static const struct BgTemplate sShopBuyMenuBgTemplates[] = static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = { - { + [WIN_MONEY] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, @@ -207,7 +270,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x001E, }, - { + [WIN_ITEM_LIST] = { .bg = 0, .tilemapLeft = 14, .tilemapTop = 2, @@ -216,7 +279,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x0032, }, - { + [WIN_ITEM_DESCRIPTION] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, @@ -225,7 +288,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x0122, }, - { + [WIN_QUANTITY_IN_BAG] = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 11, @@ -234,7 +297,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x0176, }, - { + [WIN_QUANTITY_PRICE] = { .bg = 0, .tilemapLeft = 18, .tilemapTop = 11, @@ -243,7 +306,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .paletteNum = 15, .baseBlock = 0x018E, }, - { + [WIN_MESSAGE] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, @@ -268,9 +331,9 @@ static const struct WindowTemplate sShopBuyMenuYesNoWindowTemplates = static const u8 sShopBuyMenuTextColors[][3] = { - {1, 2, 3}, - {0, 2, 3}, - {0, 3, 2} + [COLORID_NORMAL] = {1, 2, 3}, + [COLORID_ITEM_LIST] = {0, 2, 3}, + [COLORID_GRAY_CURSOR] = {0, 3, 2}, }; static u8 CreateShopMenu(u8 martType) @@ -282,8 +345,7 @@ static u8 CreateShopMenu(u8 martType) if (martType == MART_TYPE_NORMAL) { - struct WindowTemplate winTemplate; - winTemplate = sShopMenuWindowTemplates[0]; + struct WindowTemplate winTemplate = sShopMenuWindowTemplates[WIN_BUY_SELL_QUIT]; winTemplate.width = GetMaxWidthInMenuTable(sShopMenuActions_BuySellQuit, ARRAY_COUNT(sShopMenuActions_BuySellQuit)); sMartInfo.windowId = AddWindow(&winTemplate); sMartInfo.menuActions = sShopMenuActions_BuySellQuit; @@ -291,8 +353,7 @@ static u8 CreateShopMenu(u8 martType) } else { - struct WindowTemplate winTemplate; - winTemplate = sShopMenuWindowTemplates[1]; + struct WindowTemplate winTemplate = sShopMenuWindowTemplates[WIN_BUY_QUIT]; winTemplate.width = GetMaxWidthInMenuTable(sShopMenuActions_BuyQuit, ARRAY_COUNT(sShopMenuActions_BuyQuit)); sMartInfo.windowId = AddWindow(&winTemplate); sMartInfo.menuActions = sShopMenuActions_BuyQuit; @@ -320,6 +381,7 @@ static void SetShopItemsForSale(const u16 *items) sMartInfo.itemList = items; sMartInfo.itemCount = 0; + // Read items until ITEM_NONE / DECOR_NONE is reached while (sMartInfo.itemList[i]) { sMartInfo.itemCount++; @@ -344,11 +406,17 @@ static void Task_ShopMenu(u8 taskId) } } +#define tItemCount data[1] +#define tItemId data[5] +#define tListTaskId data[7] +#define tCallbackHi data[8] +#define tCallbackLo data[9] + static void Task_HandleShopMenuBuy(u8 taskId) { s16 *data = gTasks[taskId].data; - data[8] = (u32)CB2_InitBuyMenu >> 16; - data[9] = (u32)CB2_InitBuyMenu; + tCallbackHi = (u32)CB2_InitBuyMenu >> 16; + tCallbackLo = (u32)CB2_InitBuyMenu; gTasks[taskId].func = Task_GoToBuyOrSellMenu; FadeScreen(FADE_TO_BLACK, 0); } @@ -356,8 +424,8 @@ static void Task_HandleShopMenuBuy(u8 taskId) static void Task_HandleShopMenuSell(u8 taskId) { s16 *data = gTasks[taskId].data; - data[8] = (u32)CB2_GoToSellMenu >> 16; - data[9] = (u32)CB2_GoToSellMenu; + tCallbackHi = (u32)CB2_GoToSellMenu >> 16; + tCallbackLo = (u32)CB2_GoToSellMenu; gTasks[taskId].func = Task_GoToBuyOrSellMenu; FadeScreen(FADE_TO_BLACK, 0); } @@ -386,7 +454,7 @@ static void Task_GoToBuyOrSellMenu(u8 taskId) if (!gPaletteFade.active) { DestroyTask(taskId); - SetMainCallback2((void *)((u16)data[8] << 16 | (u16)data[9])); + SetMainCallback2((void *)((u16)tCallbackHi << 16 | (u16)tCallbackLo)); } } @@ -429,10 +497,6 @@ static void VBlankCB_BuyMenu(void) TransferPlttBuffer(); } -#define tItemCount data[1] -#define tItemId data[5] -#define tListTaskId data[7] - static void CB2_InitBuyMenu(void) { u8 taskId; @@ -472,8 +536,8 @@ static void CB2_InitBuyMenu(void) BuyMenuAddScrollIndicatorArrows(); taskId = CreateTask(Task_BuyMenu, 8); gTasks[taskId].tListTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); - BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_BuyMenu); SetMainCallback2(CB2_BuyMenu); break; @@ -504,8 +568,8 @@ static void BuyMenuBuildListMenuTemplate(void) gMultiuseListMenuTemplate = sShopBuyMenuListTemplate; gMultiuseListMenuTemplate.items = sListMenuItems; gMultiuseListMenuTemplate.totalItems = sMartInfo.itemCount + 1; - if (gMultiuseListMenuTemplate.totalItems > 8) - gMultiuseListMenuTemplate.maxShowed = 8; + if (gMultiuseListMenuTemplate.totalItems > MAX_ITEMS_SHOWN) + gMultiuseListMenuTemplate.maxShowed = MAX_ITEMS_SHOWN; else gMultiuseListMenuTemplate.maxShowed = gMultiuseListMenuTemplate.totalItems; @@ -532,7 +596,7 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, s if (item != LIST_CANCEL) BuyMenuAddItemIcon(item, sShopData->iconSlot); else - BuyMenuAddItemIcon(-1, sShopData->iconSlot); + BuyMenuAddItemIcon(ITEM_LIST_END, sShopData->iconSlot); BuyMenuRemoveItemIcon(item, sShopData->iconSlot ^ 1); sShopData->iconSlot ^= 1; @@ -548,8 +612,8 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, s description = gText_QuitShopping; } - FillWindowPixelBuffer(2, PIXEL_FILL(0)); - BuyMenuPrint(2, description, 3, 1, 0, 0); + FillWindowPixelBuffer(WIN_ITEM_DESCRIPTION, PIXEL_FILL(0)); + BuyMenuPrint(WIN_ITEM_DESCRIPTION, description, 3, 1, 0, COLORID_NORMAL); } static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y) @@ -576,21 +640,21 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y) } StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); - x = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 0x78); - AddTextPrinterParameterized4(windowId, FONT_NARROW, x, y, 0, 0, sShopBuyMenuTextColors[1], TEXT_SKIP_DRAW, gStringVar4); + x = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 120); + AddTextPrinterParameterized4(windowId, FONT_NARROW, x, y, 0, 0, sShopBuyMenuTextColors[COLORID_ITEM_LIST], TEXT_SKIP_DRAW, gStringVar4); } } static void BuyMenuAddScrollIndicatorArrows(void) { - if (sShopData->scrollIndicatorsTaskId == TASK_NONE && sMartInfo.itemCount + 1 > 8) + if (sShopData->scrollIndicatorsTaskId == TASK_NONE && sMartInfo.itemCount + 1 > MAX_ITEMS_SHOWN) { sShopData->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized( SCROLL_ARROW_UP, 172, 12, 148, - sMartInfo.itemCount - 7, + sMartInfo.itemCount - (MAX_ITEMS_SHOWN - 1), TAG_SCROLL_ARROW, TAG_SCROLL_ARROW, &sShopData->scrollOffset); @@ -609,7 +673,7 @@ static void BuyMenuRemoveScrollIndicatorArrows(void) static void BuyMenuPrintCursor(u8 scrollIndicatorsTaskId, u8 colorSet) { u8 y = ListMenuGetYCoordForPrintingArrowCursor(scrollIndicatorsTaskId); - BuyMenuPrint(1, gText_SelectorArrow2, 0, y, 0, colorSet); + BuyMenuPrint(WIN_ITEM_LIST, gText_SelectorArrow2, 0, y, 0, colorSet); } static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) @@ -619,7 +683,7 @@ static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) if (*spriteIdPtr != SPRITE_NONE) return; - if (sMartInfo.martType == MART_TYPE_NORMAL || item == 0xFFFF) + if (sMartInfo.martType == MART_TYPE_NORMAL || item == ITEM_LIST_END) { spriteId = AddItemIconSprite(iconSlot + TAG_ITEM_ICON_BASE, iconSlot + TAG_ITEM_ICON_BASE, item); if (spriteId != MAX_SPRITES) @@ -683,11 +747,11 @@ static void BuyMenuInitWindows(void) { InitWindows(sShopBuyMenuWindowTemplates); DeactivateAllTextPrinters(); - LoadUserWindowBorderGfx(0, 1, 0xD0); - LoadMessageBoxGfx(0, 0xA, 0xE0); - PutWindowTilemap(0); - PutWindowTilemap(1); - PutWindowTilemap(2); + LoadUserWindowBorderGfx(WIN_MONEY, 1, 0xD0); + LoadMessageBoxGfx(WIN_MONEY, 0xA, 0xE0); + PutWindowTilemap(WIN_MONEY); + PutWindowTilemap(WIN_ITEM_LIST); + PutWindowTilemap(WIN_ITEM_DESCRIPTION); } static void BuyMenuPrint(u8 windowId, const u8 *text, u8 x, u8 y, s8 speed, u8 colorSet) @@ -697,7 +761,7 @@ static void BuyMenuPrint(u8 windowId, const u8 *text, u8 x, u8 y, s8 speed, u8 c static void BuyMenuDisplayMessage(u8 taskId, const u8 *text, TaskFunc callback) { - DisplayMessageAndContinueTask(taskId, 5, 10, 14, FONT_NORMAL, GetPlayerTextSpeedDelay(), text, callback); + DisplayMessageAndContinueTask(taskId, WIN_MESSAGE, 10, 14, FONT_NORMAL, GetPlayerTextSpeedDelay(), text, callback); ScheduleBgCopyTilemapToVram(0); } @@ -706,7 +770,7 @@ static void BuyMenuDrawGraphics(void) BuyMenuDrawMapGraphics(); BuyMenuCopyMenuBgToBg1TilemapBuffer(); AddMoneyLabelObject(19, 11); - PrintMoneyAmountInMoneyBoxWithBorder(0, 1, 13, GetMoney(&gSaveBlock1Ptr->money)); + PrintMoneyAmountInMoneyBoxWithBorder(WIN_MONEY, 1, 13, GetMoney(&gSaveBlock1Ptr->money)); ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(1); ScheduleBgCopyTilemapToVram(2); @@ -722,10 +786,8 @@ static void BuyMenuDrawMapGraphics(void) static void BuyMenuDrawMapBg(void) { - s16 i; - s16 j; - s16 x; - s16 y; + s16 i, j; + s16 x, y; const struct MapLayout *mapLayout; u16 metatile; u8 metatileLayerType; @@ -746,13 +808,9 @@ static void BuyMenuDrawMapBg(void) metatileLayerType = METATILE_LAYER_TYPE_COVERED; if (metatile < NUM_METATILES_IN_PRIMARY) - { BuyMenuDrawMapMetatile(i, j, (u16 *)mapLayout->primaryTileset->metatiles + metatile * 8, metatileLayerType); - } else - { BuyMenuDrawMapMetatile(i, j, (u16 *)mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * 8), metatileLayerType); - } } } } @@ -794,11 +852,13 @@ static void BuyMenuCollectObjectEventData(void) s16 facingY; u8 y; u8 x; - u8 r8 = 0; + u8 numObjects = 0; GetXYCoordsOneStepInFrontOfPlayer(&facingX, &facingY); + for (y = 0; y < OBJECT_EVENTS_COUNT; y++) sShopData->viewportObjects[y][OBJ_EVENT_ID] = OBJECT_EVENTS_COUNT; + for (y = 0; y < 5; y++) { for (x = 0; x < 7; x++) @@ -807,28 +867,28 @@ static void BuyMenuCollectObjectEventData(void) if (objEventId != OBJECT_EVENTS_COUNT) { - sShopData->viewportObjects[r8][OBJ_EVENT_ID] = objEventId; - sShopData->viewportObjects[r8][X_COORD] = x; - sShopData->viewportObjects[r8][Y_COORD] = y; - sShopData->viewportObjects[r8][LAYER_TYPE] = MapGridGetMetatileLayerTypeAt(facingX - 4 + x, facingY - 2 + y); + sShopData->viewportObjects[numObjects][OBJ_EVENT_ID] = objEventId; + sShopData->viewportObjects[numObjects][X_COORD] = x; + sShopData->viewportObjects[numObjects][Y_COORD] = y; + sShopData->viewportObjects[numObjects][LAYER_TYPE] = MapGridGetMetatileLayerTypeAt(facingX - 4 + x, facingY - 2 + y); switch (gObjectEvents[objEventId].facingDirection) { - case DIR_SOUTH: - sShopData->viewportObjects[r8][ANIM_NUM] = 0; - break; - case DIR_NORTH: - sShopData->viewportObjects[r8][ANIM_NUM] = 1; - break; - case DIR_WEST: - sShopData->viewportObjects[r8][ANIM_NUM] = 2; - break; - case DIR_EAST: - default: - sShopData->viewportObjects[r8][ANIM_NUM] = 3; - break; + case DIR_SOUTH: + sShopData->viewportObjects[numObjects][ANIM_NUM] = ANIM_STD_FACE_SOUTH; + break; + case DIR_NORTH: + sShopData->viewportObjects[numObjects][ANIM_NUM] = ANIM_STD_FACE_NORTH; + break; + case DIR_WEST: + sShopData->viewportObjects[numObjects][ANIM_NUM] = ANIM_STD_FACE_WEST; + break; + case DIR_EAST: + default: + sShopData->viewportObjects[numObjects][ANIM_NUM] = ANIM_STD_FACE_EAST; + break; } - r8++; + numObjects++; } } } @@ -867,13 +927,9 @@ static void BuyMenuDrawObjectEvents(void) static bool8 BuyMenuCheckIfObjectEventOverlapsMenuBg(s16 *object) { if (!BuyMenuCheckForOverlapWithMenuBg(object[X_COORD], object[Y_COORD] + 2) && object[LAYER_TYPE] != METATILE_LAYER_TYPE_COVERED) - { return TRUE; - } else - { return FALSE; - } } static void BuyMenuCopyMenuBgToBg1TilemapBuffer(void) @@ -885,9 +941,7 @@ static void BuyMenuCopyMenuBgToBg1TilemapBuffer(void) for (i = 0; i < 1024; i++) { if (src[i] != 0) - { dest[i] = src[i] + 0xC3E3; - } } } @@ -901,9 +955,7 @@ static bool8 BuyMenuCheckForOverlapWithMenuBg(int x, int y) metatile[offset2 + offset1 + 32] == 0 && metatile[offset2 + offset1 + 1] == 0 && metatile[offset2 + offset1 + 33] == 0) - { return TRUE; - } return FALSE; } @@ -928,18 +980,14 @@ static void Task_BuyMenu(u8 taskId) default: PlaySE(SE_SELECT); tItemId = itemId; - ClearWindowTilemap(2); + ClearWindowTilemap(WIN_ITEM_DESCRIPTION); BuyMenuRemoveScrollIndicatorArrows(); - BuyMenuPrintCursor(tListTaskId, 2); + BuyMenuPrintCursor(tListTaskId, COLORID_GRAY_CURSOR); if (sMartInfo.martType == MART_TYPE_NORMAL) - { sShopData->totalCost = (ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)); - } else - { sShopData->totalCost = gDecorations[itemId].price; - } if (!IsEnoughMoney(&gSaveBlock1Ptr->money, sShopData->totalCost)) { @@ -985,25 +1033,21 @@ static void Task_BuyHowManyDialogueInit(u8 taskId) u16 quantityInBag = CountTotalItemQuantityInBag(tItemId); u16 maxQuantity; - DrawStdFrameWithCustomTileAndPalette(3, FALSE, 1, 13); + DrawStdFrameWithCustomTileAndPalette(WIN_QUANTITY_IN_BAG, FALSE, 1, 13); ConvertIntToDecimalStringN(gStringVar1, quantityInBag, STR_CONV_MODE_RIGHT_ALIGN, MAX_ITEM_DIGITS + 1); StringExpandPlaceholders(gStringVar4, gText_InBagVar1); - BuyMenuPrint(3, gStringVar4, 0, 1, 0, 0); + BuyMenuPrint(WIN_QUANTITY_IN_BAG, gStringVar4, 0, 1, 0, COLORID_NORMAL); tItemCount = 1; - DrawStdFrameWithCustomTileAndPalette(4, FALSE, 1, 13); + DrawStdFrameWithCustomTileAndPalette(WIN_QUANTITY_PRICE, FALSE, 1, 13); BuyMenuPrintItemQuantityAndPrice(taskId); ScheduleBgCopyTilemapToVram(0); maxQuantity = GetMoney(&gSaveBlock1Ptr->money) / sShopData->totalCost; if (maxQuantity > MAX_BAG_ITEM_CAPACITY) - { sShopData->maxQuantity = MAX_BAG_ITEM_CAPACITY; - } else - { sShopData->maxQuantity = maxQuantity; - } gTasks[taskId].func = Task_BuyHowManyDialogueHandleInput; } @@ -1022,11 +1066,11 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - ClearStdWindowAndFrameToTransparent(4, FALSE); - ClearStdWindowAndFrameToTransparent(3, FALSE); - ClearWindowTilemap(4); - ClearWindowTilemap(3); - PutWindowTilemap(1); + ClearStdWindowAndFrameToTransparent(WIN_QUANTITY_PRICE, FALSE); + ClearStdWindowAndFrameToTransparent(WIN_QUANTITY_IN_BAG, FALSE); + ClearWindowTilemap(WIN_QUANTITY_PRICE); + ClearWindowTilemap(WIN_QUANTITY_IN_BAG); + PutWindowTilemap(WIN_ITEM_LIST); CopyItemName(tItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, BAG_ITEM_CAPACITY_DIGITS); ConvertIntToDecimalStringN(gStringVar3, sShopData->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6); @@ -1035,10 +1079,10 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - ClearStdWindowAndFrameToTransparent(4, FALSE); - ClearStdWindowAndFrameToTransparent(3, FALSE); - ClearWindowTilemap(4); - ClearWindowTilemap(3); + ClearStdWindowAndFrameToTransparent(WIN_QUANTITY_PRICE, FALSE); + ClearStdWindowAndFrameToTransparent(WIN_QUANTITY_IN_BAG, FALSE); + ClearWindowTilemap(WIN_QUANTITY_PRICE); + ClearWindowTilemap(WIN_QUANTITY_IN_BAG); BuyMenuReturnToItemList(taskId); } } @@ -1053,7 +1097,7 @@ static void BuyMenuTryMakePurchase(u8 taskId) { s16 *data = gTasks[taskId].data; - PutWindowTilemap(1); + PutWindowTilemap(WIN_ITEM_LIST); if (sMartInfo.martType == MART_TYPE_NORMAL) { @@ -1088,16 +1132,12 @@ static void BuyMenuSubtractMoney(u8 taskId) IncrementGameStat(GAME_STAT_SHOPPED); RemoveMoney(&gSaveBlock1Ptr->money, sShopData->totalCost); PlaySE(SE_SHOP); - PrintMoneyAmountInMoneyBox(0, GetMoney(&gSaveBlock1Ptr->money), 0); + PrintMoneyAmountInMoneyBox(WIN_MONEY, GetMoney(&gSaveBlock1Ptr->money), 0); if (sMartInfo.martType == MART_TYPE_NORMAL) - { gTasks[taskId].func = Task_ReturnToItemListAfterItemPurchase; - } else - { gTasks[taskId].func = Task_ReturnToItemListAfterDecorationPurchase; - } } static void Task_ReturnToItemListAfterItemPurchase(u8 taskId) @@ -1107,14 +1147,12 @@ static void Task_ReturnToItemListAfterItemPurchase(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON)) { PlaySE(SE_SELECT); - if (tItemId == ITEM_POKE_BALL && tItemCount > 9 && AddBagItem(ITEM_PREMIER_BALL, 1) == TRUE) - { + + // Purchasing 10+ Poke Balls gets the player a Premier Ball + if (tItemId == ITEM_POKE_BALL && tItemCount >= 10 && AddBagItem(ITEM_PREMIER_BALL, 1) == TRUE) BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBall, BuyMenuReturnToItemList); - } else - { BuyMenuReturnToItemList(taskId); - } } } @@ -1131,10 +1169,10 @@ static void BuyMenuReturnToItemList(u8 taskId) { s16 *data = gTasks[taskId].data; - ClearDialogWindowAndFrameToTransparent(5, FALSE); - BuyMenuPrintCursor(tListTaskId, 1); - PutWindowTilemap(1); - PutWindowTilemap(2); + ClearDialogWindowAndFrameToTransparent(WIN_MESSAGE, FALSE); + BuyMenuPrintCursor(tListTaskId, COLORID_ITEM_LIST); + PutWindowTilemap(WIN_ITEM_LIST); + PutWindowTilemap(WIN_ITEM_DESCRIPTION); ScheduleBgCopyTilemapToVram(0); BuyMenuAddScrollIndicatorArrows(); gTasks[taskId].func = Task_BuyMenu; @@ -1144,11 +1182,11 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) { s16 *data = gTasks[taskId].data; - FillWindowPixelBuffer(4, PIXEL_FILL(1)); - PrintMoneyAmount(4, 38, 1, sShopData->totalCost, TEXT_SKIP_DRAW); + FillWindowPixelBuffer(WIN_QUANTITY_PRICE, PIXEL_FILL(1)); + PrintMoneyAmount(WIN_QUANTITY_PRICE, 38, 1, sShopData->totalCost, TEXT_SKIP_DRAW); ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, BAG_ITEM_CAPACITY_DIGITS); StringExpandPlaceholders(gStringVar4, gText_xVar1); - BuyMenuPrint(4, gStringVar4, 0, 1, 0, 0); + BuyMenuPrint(WIN_QUANTITY_PRICE, gStringVar4, 0, 1, 0, COLORID_NORMAL); } static void ExitBuyMenu(u8 taskId) @@ -1204,6 +1242,8 @@ static void RecordItemPurchase(u8 taskId) #undef tItemCount #undef tItemId #undef tListTaskId +#undef tCallbackHi +#undef tCallbackLo void CreatePokemartMenu(const u16 *itemsForSale) { From 7e112b0f0ddcc05fcbe08855114e6fea810fc3a6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 22 Sep 2022 21:43:33 -0300 Subject: [PATCH 22/47] Added missing uses of JOY_xx macros --- src/intro.c | 2 +- src/list_menu.c | 8 ++++---- src/main.c | 6 +++--- src/title_screen.c | 4 ++-- src/union_room_chat.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/intro.c b/src/intro.c index b067891429..bc81bcbb6f 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1039,7 +1039,7 @@ static void MainCB2_Intro(void) AnimateSprites(); BuildOamBuffer(); UpdatePaletteFade(); - if (gMain.newKeys && !gPaletteFade.active) + if (gMain.newKeys != 0 && !gPaletteFade.active) SetMainCallback2(MainCB2_EndIntro); else if (gIntroFrameCounter != -1) gIntroFrameCounter++; diff --git a/src/list_menu.c b/src/list_menu.c index 64692ce1f6..112fca7530 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -440,13 +440,13 @@ s32 ListMenu_ProcessInput(u8 listTaskId) break; case LIST_MULTIPLE_SCROLL_DPAD: // note: JOY_REPEAT won't match here - leftButton = gMain.newAndRepeatedKeys & DPAD_LEFT; - rightButton = gMain.newAndRepeatedKeys & DPAD_RIGHT; + leftButton = JOY_REPEAT(DPAD_LEFT); + rightButton = JOY_REPEAT(DPAD_RIGHT); break; case LIST_MULTIPLE_SCROLL_L_R: // same as above - leftButton = gMain.newAndRepeatedKeys & L_BUTTON; - rightButton = gMain.newAndRepeatedKeys & R_BUTTON; + leftButton = JOY_REPEAT(L_BUTTON); + rightButton = JOY_REPEAT(R_BUTTON); break; } diff --git a/src/main.c b/src/main.c index 5fd236447b..29494043fb 100644 --- a/src/main.c +++ b/src/main.c @@ -124,8 +124,8 @@ void AgbMain() ReadKeys(); if (gSoftResetDisabled == FALSE - && (gMain.heldKeysRaw & A_BUTTON) - && (gMain.heldKeysRaw & B_START_SELECT) == B_START_SELECT) + && JOY_HELD_RAW(A_BUTTON) + && JOY_HELD_RAW(B_START_SELECT) == B_START_SELECT) { rfu_REQ_stopMode(); rfu_waitREQComplete(); @@ -278,7 +278,7 @@ static void ReadKeys(void) gMain.heldKeys |= A_BUTTON; } - if (gMain.newKeys & gMain.watchedKeysMask) + if (JOY_NEW(gMain.watchedKeysMask)) gMain.watchedKeysPressed = TRUE; } diff --git a/src/title_screen.c b/src/title_screen.c index 25a1d60d05..689c96863d 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -634,7 +634,7 @@ static void MainCB2(void) static void Task_TitleScreenPhase1(u8 taskId) { // Skip to next phase when A, B, Start, or Select is pressed - if ((gMain.newKeys & A_B_START_SELECT) || gTasks[taskId].data[1] != 0) + if (JOY_NEW(A_B_START_SELECT) || gTasks[taskId].data[1] != 0) { gTasks[taskId].tSkipToNext = TRUE; gTasks[taskId].tCounter = 0; @@ -681,7 +681,7 @@ static void Task_TitleScreenPhase2(u8 taskId) u32 yPos; // Skip to next phase when A, B, Start, or Select is pressed - if ((gMain.newKeys & A_B_START_SELECT) || gTasks[taskId].tSkipToNext) + if (JOY_NEW(A_B_START_SELECT) || gTasks[taskId].tSkipToNext) { gTasks[taskId].tSkipToNext = TRUE; gTasks[taskId].tCounter = 0; diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 5c26d1ea36..e1ca7c0b0d 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -1044,7 +1044,7 @@ static void Chat_HandleInput(void) { SetChatFunction(CHAT_FUNC_SWITCH); } - else if (gMain.newAndRepeatedKeys & B_BUTTON) + else if (JOY_REPEAT(B_BUTTON)) { if (sChat->bufferCursorPos) { From 44a5a8d31e5920c7f2eab588f772dd13ff7ff5f1 Mon Sep 17 00:00:00 2001 From: sbird Date: Fri, 23 Sep 2022 03:22:57 +0200 Subject: [PATCH 23/47] [debug] fix AGBAssert for AGBPrintf debug block --- include/gba/isagbprint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index abe7fb2107..2fb860be92 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -39,7 +39,7 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP void AGBPrintInit(void); #define DebugPrintf(pBuf, ...) AGBPrintf(const char *pBuf, ...) #define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 1) -#define AGB_WARNING(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, 0) +#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 0) // Not used in this configuration #define MgbaOpen() From 22329d3318cde3f07ed5401226c0df2b5d951957 Mon Sep 17 00:00:00 2001 From: sbird Date: Fri, 23 Sep 2022 03:23:44 +0200 Subject: [PATCH 24/47] [debug] use boolean constants for nStopProgram --- include/gba/isagbprint.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index 2fb860be92..37e2bb0809 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -17,8 +17,8 @@ void MgbaClose(void); void MgbaPrintf(const char *pBuf, ...); void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram); #define DebugPrintf(pBuf, ...) MgbaPrintf(pBuf, __VA_ARGS__) -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, 1) -#define AGB_WARNING(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, 0) +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, TRUE) +#define AGB_WARNING(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, FALSE) // Not used in this configuration #define AGBPrintfInit() @@ -26,8 +26,8 @@ void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nS void NoCashGBAPrintf(const char *pBuf, ...) void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram) #define DebugPrintf(pBuf, ...) NoCashGBAPrintf(pBuf, __VA_ARGS__) -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, 1); -#define AGB_WARNING(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, 0) +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, TRUE); +#define AGB_WARNING(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, FALSE) // Not used in this configuration #define MgbaOpen() @@ -38,8 +38,8 @@ void AGBPrintf(const char *pBuf, ...); void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); void AGBPrintInit(void); #define DebugPrintf(pBuf, ...) AGBPrintf(const char *pBuf, ...) -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 1) -#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 0) +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, TRUE) +#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, FALSE) // Not used in this configuration #define MgbaOpen() From 12670e8e3ee0ca49dd88d36e83ec698bfc7b227f Mon Sep 17 00:00:00 2001 From: sbird Date: Fri, 23 Sep 2022 03:48:58 +0200 Subject: [PATCH 25/47] [debug] simplify macros, add EX versions --- include/gba/isagbprint.h | 60 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index 37e2bb0809..59518ecdf7 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -7,52 +7,52 @@ #define DebugPrintf(pBuf, ...) #define MgbaOpen() #define MgbaClose() -#define AGB_ASSERT(exp) -#define AGB_WARNING(exp) #define AGBPrintInit() +#define DebugAssert(pFile, nLine, pExpression, nStopProgram) #else -#if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) + bool32 MgbaOpen(void); void MgbaClose(void); void MgbaPrintf(const char *pBuf, ...); void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram); -#define DebugPrintf(pBuf, ...) MgbaPrintf(pBuf, __VA_ARGS__) -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, TRUE) -#define AGB_WARNING(exp) (exp) ? ((void*)0) : MgbaAssert(__FILE__, __LINE__, #exp, FALSE) - -// Not used in this configuration -#define AGBPrintfInit() -#elif (LOG_HANDLER == LOG_HANDLER_NOCASH_PRINT) -void NoCashGBAPrintf(const char *pBuf, ...) -void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram) -#define DebugPrintf(pBuf, ...) NoCashGBAPrintf(pBuf, __VA_ARGS__) -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, TRUE); -#define AGB_WARNING(exp) (exp) ? ((void*)0) : NoCashGBAAssert(__FILE__, __LINE__, #exp, FALSE) - -// Not used in this configuration -#define MgbaOpen() -#define MgbaClose() -#define AGBPrintInit() -#else // Default to AGBPrint +void NoCashGBAPrintf(const char *pBuf, ...); +void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram); void AGBPrintf(const char *pBuf, ...); void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); void AGBPrintInit(void); + +#if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) + +#define DebugPrintf(pBuf, ...) MgbaPrintf(pBuf, __VA_ARGS__) +#define DebugAssert(pFile, nLine, pExpression, nStopProgram) MgbaAssert(pFile, nLine, pExpression, nStopProgram) + +#elif (LOG_HANDLER == LOG_HANDLER_NOCASH_PRINT) + +#define DebugPrintf(pBuf, ...) NoCashGBAPrintf(pBuf, __VA_ARGS__) +#define DebugAssert(pFile, nLine, pExpression, nStopProgram) NoCashGBAAssert(pFile, nLine, pExpression, nStopProgram) + +#else // Default to AGBPrint + #define DebugPrintf(pBuf, ...) AGBPrintf(const char *pBuf, ...) -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, TRUE) -#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, FALSE) +#define DebugAssert(pFile, nLine, pExpression, nStopProgram) AGBAssert(pFile, nLine, pExpression, nStopProgram) -// Not used in this configuration -#define MgbaOpen() -#define MgbaClose() #endif #endif -// for matching purposes - #ifdef NDEBUG -#define AGB_ASSERT_EX(exp, file, line) + +#define AGB_ASSERT(exp) +#define AGB_WARNING(exp) +#define AGB_ASSERT_EX(exp, file, line) +#define AGB_WARNING_EX(exp, file, line) + #else -#define AGB_ASSERT_EX(exp, file, line) AGB_ASSERT(exp); + +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : DebugAssert(__FILE__, __LINE__, #exp, TRUE) +#define AGB_WARNING(exp) (exp) ? ((void*)0) : DebugAssert(__FILE__, __LINE__, #exp, FALSE) + +#define AGB_WARNING_EX(exp, file, line) (exp) ? ((void *)0) : DebugAssert(file, line, #exp, FALSE); +#define AGB_ASSERT_EX(exp, file, line) (exp) ? ((void *)0) : DebugAssert(file, line, #exp, TRUE); #endif #endif // GUARD_GBA_ISAGBPRINT_H From 343d7f7d269be96fbc82be6b421bdc657fa79979 Mon Sep 17 00:00:00 2001 From: sbird Date: Fri, 23 Sep 2022 04:02:30 +0200 Subject: [PATCH 26/47] [debug] do not use heap allocation for MgbaPrintf --- include/gba/isagbprint.h | 10 ++++++-- src/libisagbprn.c | 50 +++------------------------------------- 2 files changed, 11 insertions(+), 49 deletions(-) diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index 59518ecdf7..91aa9f214e 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -3,6 +3,12 @@ #include "gba/types.h" +#define MGBA_LOG_FATAL (0) +#define MGBA_LOG_ERROR (1) +#define MGBA_LOG_WARN (2) +#define MGBA_LOG_INFO (3) +#define MGBA_LOG_DEBUG (4) + #ifdef NDEBUG #define DebugPrintf(pBuf, ...) #define MgbaOpen() @@ -13,7 +19,7 @@ bool32 MgbaOpen(void); void MgbaClose(void); -void MgbaPrintf(const char *pBuf, ...); +void MgbaPrintf(s32 level, const char *pBuf, ...); void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram); void NoCashGBAPrintf(const char *pBuf, ...); void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram); @@ -23,7 +29,7 @@ void AGBPrintInit(void); #if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) -#define DebugPrintf(pBuf, ...) MgbaPrintf(pBuf, __VA_ARGS__) +#define DebugPrintf(pBuf, ...) MgbaPrintf(MGBA_LOG_INFO, pBuf, __VA_ARGS__) #define DebugAssert(pFile, nLine, pExpression, nStopProgram) MgbaAssert(pFile, nLine, pExpression, nStopProgram) #elif (LOG_HANDLER == LOG_HANDLER_NOCASH_PRINT) diff --git a/src/libisagbprn.c b/src/libisagbprn.c index 0dbaec157d..fab9b5990b 100644 --- a/src/libisagbprn.c +++ b/src/libisagbprn.c @@ -211,14 +211,6 @@ void NoCashGBAAssert(const char *pFile, s32 nLine, const char *pExpression, bool // mgba print functions #if (LOG_HANDLER == LOG_HANDLER_MGBA_PRINT) -#define MGBA_PRINTF_BUFFER_SIZE (4096) - -#define MGBA_LOG_FATAL (0) -#define MGBA_LOG_ERROR (1) -#define MGBA_LOG_WARN (2) -#define MGBA_LOG_INFO (3) -#define MGBA_LOG_DEBUG (4) - #define MGBA_REG_DEBUG_MAX (256) bool32 MgbaOpen(void) @@ -232,7 +224,7 @@ void MgbaClose(void) *REG_DEBUG_ENABLE = 0; } -static void MgbaPrintfBounded(s32 level, const char* ptr, ...) +void MgbaPrintf(s32 level, const char* ptr, ...) { va_list args; @@ -249,52 +241,16 @@ static void MgbaPrintfBounded(s32 level, const char* ptr, ...) *REG_DEBUG_FLAGS = level | 0x100; } -void MgbaPrintf(const char* ptr, ...) -{ - va_list args; - u32 offset = 0; - u32 n = 0; - u32 i; - char *buffer = Alloc(MGBA_PRINTF_BUFFER_SIZE); - AGB_ASSERT(buffer != NULL); - - va_start(args, ptr); - #if (PRETTY_PRINT_HANDLER == PRETTY_PRINT_MINI_PRINTF) - n = mini_vsnprintf(buffer, MGBA_PRINTF_BUFFER_SIZE, ptr, args); - #elif (PRETTY_PRINT_HANDLER == PRETTY_PRINT_LIBC) - n = vsnprintf(buffer, MGBA_PRINTF_BUFFER_SIZE, ptr, args); - #else - #error "unspecified pretty printing handler." - #endif - va_end(args); - - AGB_ASSERT(n < MGBA_PRINTF_BUFFER_SIZE); - - do - { - for (i = 0; i < MGBA_REG_DEBUG_MAX; ++i) - { - REG_DEBUG_STRING[i] = buffer[offset + i]; - if (buffer[offset + i] == 0) - break; - } - offset += i; - *REG_DEBUG_FLAGS = MGBA_LOG_INFO | 0x100; - } while ((i == MGBA_REG_DEBUG_MAX) && (buffer[offset] != '\0')); - - Free(buffer); -} - void MgbaAssert(const char *pFile, s32 nLine, const char *pExpression, bool32 nStopProgram) { if (nStopProgram) { - MgbaPrintfBounded(MGBA_LOG_ERROR, "ASSERTION FAILED FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); + MgbaPrintf(MGBA_LOG_ERROR, "ASSERTION FAILED FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); asm(".hword 0xEFFF"); } else { - MgbaPrintfBounded(MGBA_LOG_WARN, "WARING FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); + MgbaPrintf(MGBA_LOG_WARN, "WARING FILE=[%s] LINE=[%d] EXP=[%s]", pFile, nLine, pExpression); } } #endif From d8b391906383186ff1b05d1cf7167577527ef8d2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Sep 2022 18:27:53 -0400 Subject: [PATCH 27/47] Ignore Porymap's prefabs file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cac4a07e61..8d9502ae83 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ build/ *.ddump .idea/ porymap.project.cfg +prefabs.json .vscode/ *.a .fuse_hidden* From 0f35f080ecb8a59d3941817c6a4e236d6600cabb Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sat, 24 Sep 2022 23:48:24 -0300 Subject: [PATCH 28/47] =?UTF-8?q?Gender=20icon=20in=20naming=20screen=20ba?= =?UTF-8?q?sed=20on=20Pok=C3=A9mon=20name=20length?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/naming_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/naming_screen.c b/src/naming_screen.c index b4007b2658..a05e501c2b 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1771,7 +1771,7 @@ static void DrawGenderIcon(void) StringCopy(text, gText_FemaleSymbol); isFemale = TRUE; } - AddTextPrinterParameterized3(sNamingScreen->windows[WIN_TEXT_ENTRY], FONT_NORMAL, 0x68, 1, sGenderColors[isFemale], TEXT_SKIP_DRAW, text); + AddTextPrinterParameterized3(sNamingScreen->windows[WIN_TEXT_ENTRY], FONT_NORMAL, (POKEMON_NAME_LENGTH * 4) + 64, 1, sGenderColors[isFemale], TEXT_SKIP_DRAW, text); } } From 057f76bfe651e0385243f82c227b271498bd5ebb Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 25 Sep 2022 13:05:18 -0300 Subject: [PATCH 29/47] Cleaned up missing JOY macros --- src/battle_controller_player.c | 10 +- src/battle_debug.c | 28 ++-- src/debug.c | 264 ++++++++++++++++----------------- 3 files changed, 151 insertions(+), 151 deletions(-) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 6e9cdcc25a..4be3426402 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -331,7 +331,7 @@ static void HandleInputChooseAction(void) SwapHpBarsWithHpText(); } #if B_ENABLE_DEBUG == TRUE - else if (gMain.newKeys & SELECT_BUTTON) + else if (JOY_NEW(SELECT_BUTTON)) { BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_DEBUG, 0); PlayerBufferExecCompleted(); @@ -543,7 +543,7 @@ static void HandleInputShowEntireFieldTargets(void) HideMegaTriggerSprite(); PlayerBufferExecCompleted(); } - else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59) + else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) { PlaySE(SE_SELECT); HideAllTargets(); @@ -572,7 +572,7 @@ static void HandleInputShowTargets(void) TryHideLastUsedBall(); PlayerBufferExecCompleted(); } - else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59) + else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) { PlaySE(SE_SELECT); HideShownTargets(); @@ -597,12 +597,12 @@ static void HandleInputChooseMove(void) u32 canSelectTarget = 0; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); - if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) + if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) gPlayerDpadHoldFrames++; else gPlayerDpadHoldFrames = 0; - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_CURSE) diff --git a/src/battle_debug.c b/src/battle_debug.c index 2657a58616..4450fe0cba 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -813,7 +813,7 @@ static void Task_ShowAiPoints(u8 taskId) break; // Input case 2: - if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON)) + if (JOY_NEW(SELECT_BUTTON | B_BUTTON)) { SwitchToDebugView(taskId); HideBg(1); @@ -969,7 +969,7 @@ static void Task_ShowAiKnowledge(u8 taskId) break; // Input case 2: - if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON)) + if (JOY_NEW(SELECT_BUTTON | B_BUTTON)) { SwitchToDebugView(taskId); HideBg(1); @@ -1031,7 +1031,7 @@ static void Task_ShowAiParty(u8 taskId) break; // Input case 2: - if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON)) + if (JOY_NEW(SELECT_BUTTON | B_BUTTON)) { SwitchToDebugViewFromAiParty(taskId); HideBg(1); @@ -1106,7 +1106,7 @@ static void Task_DebugMenuProcessInput(u8 taskId) struct BattleDebugMenu *data = GetStructPtr(taskId); // Exit the menu. - if (gMain.newKeys & SELECT_BUTTON) + if (JOY_NEW(SELECT_BUTTON)) { BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); gTasks[taskId].func = Task_DebugMenuFadeOut; @@ -1114,13 +1114,13 @@ static void Task_DebugMenuProcessInput(u8 taskId) } // Try changing active battler. - if (gMain.newKeys & R_BUTTON) + if (JOY_NEW(R_BUTTON)) { if (data->battlerId++ == gBattlersCount - 1) data->battlerId = 0; UpdateWindowsOnChangedBattler(data); } - else if (gMain.newKeys & L_BUTTON) + else if (JOY_NEW(L_BUTTON)) { if (data->battlerId-- == 0) data->battlerId = gBattlersCount - 1; @@ -1133,17 +1133,17 @@ static void Task_DebugMenuProcessInput(u8 taskId) listItemId = ListMenu_ProcessInput(data->mainListTaskId); if (listItemId != LIST_CANCEL && listItemId != LIST_NOTHING_CHOSEN && listItemId < LIST_ITEM_COUNT) { - if (listItemId == LIST_ITEM_AI_MOVES_PTS && gMain.newKeys & A_BUTTON) + if (listItemId == LIST_ITEM_AI_MOVES_PTS && JOY_NEW(A_BUTTON)) { SwitchToAiPointsView(taskId); return; } - else if (listItemId == LIST_ITEM_AI_INFO && gMain.newKeys & A_BUTTON) + else if (listItemId == LIST_ITEM_AI_INFO && JOY_NEW(A_BUTTON)) { SwitchToAiInfoView(taskId); return; } - else if (listItemId == LIST_ITEM_AI_PARTY && gMain.newKeys & A_BUTTON) + else if (listItemId == LIST_ITEM_AI_PARTY && JOY_NEW(A_BUTTON)) { SwitchToAiPartyView(taskId); return; @@ -1182,14 +1182,14 @@ static void Task_DebugMenuProcessInput(u8 taskId) // Handle value modifying. else if (data->activeWindow == ACTIVE_WIN_MODIFY) { - if (gMain.newKeys & (B_BUTTON | A_BUTTON)) + if (JOY_NEW(B_BUTTON | A_BUTTON)) { ClearStdWindowAndFrameToTransparent(data->modifyWindowId, TRUE); RemoveWindow(data->modifyWindowId); DestroyModifyArrows(data); data->activeWindow = ACTIVE_WIN_SECONDARY; } - else if (gMain.newKeys & DPAD_RIGHT) + else if (JOY_NEW(DPAD_RIGHT)) { if (data->modifyArrows.currentDigit != (data->modifyArrows.maxDigits - 1)) { @@ -1198,7 +1198,7 @@ static void Task_DebugMenuProcessInput(u8 taskId) gSprites[data->modifyArrows.arrowSpriteId[1]].x2 += 6; } } - else if (gMain.newKeys & DPAD_LEFT) + else if (JOY_NEW(DPAD_LEFT)) { if (data->modifyArrows.currentDigit != 0) { @@ -1207,7 +1207,7 @@ static void Task_DebugMenuProcessInput(u8 taskId) gSprites[data->modifyArrows.arrowSpriteId[1]].x2 -= 6; } } - else if (gMain.newKeys & DPAD_UP) + else if (JOY_NEW(DPAD_UP)) { if (TryMoveDigit(&data->modifyArrows, TRUE)) { @@ -1216,7 +1216,7 @@ static void Task_DebugMenuProcessInput(u8 taskId) PrintSecondaryEntries(data); } } - else if (gMain.newKeys & DPAD_DOWN) + else if (JOY_NEW(DPAD_DOWN)) { if (TryMoveDigit(&data->modifyArrows, FALSE)) { diff --git a/src/debug.c b/src/debug.c index 2d96c8c0c9..aaf5a81316 100644 --- a/src/debug.c +++ b/src/debug.c @@ -755,13 +755,13 @@ static void DebugTask_HandleMenuInput_Main(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Main[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu_Full(taskId); @@ -773,13 +773,13 @@ static void DebugTask_HandleMenuInput_Utilities(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Utilities[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); @@ -791,13 +791,13 @@ static void DebugTask_HandleMenuInput_Scripts(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Scripts[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); @@ -809,13 +809,13 @@ static void DebugTask_HandleMenuInput_Flags(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Flags[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); @@ -827,13 +827,13 @@ static void DebugTask_HandleMenuInput_Vars(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Vars[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); @@ -845,13 +845,13 @@ static void DebugTask_HandleMenuInput_Give(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Give[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); @@ -863,13 +863,13 @@ static void DebugTask_HandleMenuInput_Sound(u8 taskId) void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Sound[input]) != NULL) func(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); @@ -975,27 +975,27 @@ static void DebugAction_Util_Warp_Warp(u8 taskId) } static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > MAP_GROUPS_COUNT - 1) gTasks[taskId].data[3] = MAP_GROUPS_COUNT - 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; @@ -1009,7 +1009,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { gTasks[taskId].data[5] = gTasks[taskId].data[3]; gTasks[taskId].data[3] = 0; @@ -1025,7 +1025,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) gTasks[taskId].func = DebugAction_Util_Warp_SelectMap; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -1035,27 +1035,27 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) { u8 max_value = MAP_GROUP_COUNT[gTasks[taskId].data[5]]; //maps in the selected map group - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > max_value - 1) gTasks[taskId].data[3] = max_value - 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; @@ -1070,7 +1070,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { gTasks[taskId].data[6] = gTasks[taskId].data[3]; gTasks[taskId].data[3] = 0; @@ -1082,7 +1082,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectWarp; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -1090,16 +1090,16 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) } static void DebugAction_Util_Warp_SelectWarp(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > 10) gTasks[taskId].data[3] = 10; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) @@ -1112,7 +1112,7 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { gTasks[taskId].data[7] = gTasks[taskId].data[3]; //WARP @@ -1122,7 +1122,7 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) ResetInitialPlayerAvatarState(); DebugAction_DestroyExtraWindow(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -1222,28 +1222,28 @@ static void DebugAction_Util_Weather(u8 taskId) } static void DebugAction_Util_Weather_SelectId(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > WEATHER_ROUTE123_CYCLE) gTasks[taskId].data[3] = WEATHER_ROUTE123_CYCLE; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < WEATHER_NONE) gTasks[taskId].data[3] = WEATHER_NONE; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; @@ -1261,7 +1261,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { if (gTasks[taskId].data[3] <= 14 || gTasks[taskId].data[3] >= 20) { @@ -1269,7 +1269,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) SetWeather(gTasks[taskId].data[5]); } } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -1402,16 +1402,16 @@ static void DebugAction_Flags_Flags(u8 taskId) } static void DebugAction_Flags_FlagsSelect(u8 taskId) { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) FlagToggle(gTasks[taskId].data[3]); - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); return; } - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { PlaySE(SE_SELECT); gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; @@ -1419,7 +1419,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) gTasks[taskId].data[3] = FLAGS_COUNT - 1; } } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { PlaySE(SE_SELECT); gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; @@ -1427,7 +1427,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) gTasks[taskId].data[3] = 1; } } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { PlaySE(SE_SELECT); gTasks[taskId].data[4] -= 1; @@ -1436,7 +1436,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) gTasks[taskId].data[4] = 0; } } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { PlaySE(SE_SELECT); gTasks[taskId].data[4] += 1; @@ -1446,7 +1446,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) } } - if (gMain.newKeys & DPAD_ANY || gMain.newKeys & A_BUTTON) + if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON)) { ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); @@ -1660,32 +1660,32 @@ static void DebugAction_Vars_Vars(u8 taskId) static void DebugAction_Vars_Select(u8 taskId) { - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > VARS_END) gTasks[taskId].data[3] = VARS_END; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < VARS_START) gTasks[taskId].data[3] = VARS_START; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { gTasks[taskId].data[4] -= 1; if (gTasks[taskId].data[4] < 0) gTasks[taskId].data[4] = 0; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { gTasks[taskId].data[4] += 1; if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_VARIABLES - 1) gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES - 1; } - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); @@ -1704,7 +1704,7 @@ static void DebugAction_Vars_Select(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { gTasks[taskId].data[4] = 0; @@ -1726,7 +1726,7 @@ static void DebugAction_Vars_Select(u8 taskId) gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector gTasks[taskId].func = DebugAction_Vars_SetValue; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -1735,7 +1735,7 @@ static void DebugAction_Vars_Select(u8 taskId) } static void DebugAction_Vars_SetValue(u8 taskId) { - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000) gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; @@ -1745,14 +1745,14 @@ static void DebugAction_Vars_SetValue(u8 taskId) if (gTasks[taskId].data[6] >= 32000) gTasks[taskId].data[6] = 32000 - 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[6] < 0){ gTasks[taskId].data[6] = 0; } } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { gTasks[taskId].data[4] -= 1; if (gTasks[taskId].data[4] < 0) @@ -1760,7 +1760,7 @@ static void DebugAction_Vars_SetValue(u8 taskId) gTasks[taskId].data[4] = 0; } } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { gTasks[taskId].data[4] += 1; if (gTasks[taskId].data[4] > 4) @@ -1769,19 +1769,19 @@ static void DebugAction_Vars_SetValue(u8 taskId) } } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); VarSet(gTasks[taskId].data[3], gTasks[taskId].data[6]); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); return; } - if (gMain.newKeys & DPAD_ANY || gMain.newKeys & A_BUTTON) + if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); @@ -1834,28 +1834,28 @@ static void DebugAction_Give_Item(u8 taskId) } static void DebugAction_Give_Item_SelectId(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] >= ITEMS_COUNT) gTasks[taskId].data[3] = ITEMS_COUNT - 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; @@ -1878,7 +1878,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) gSprites[gTasks[taskId].data[6]].oam.priority = 0; } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { gTasks[taskId].data[5] = gTasks[taskId].data[3]; gTasks[taskId].data[3] = 1; @@ -1892,7 +1892,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon @@ -1905,28 +1905,28 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) } static void DebugAction_Give_Item_SelectQuantity(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] >= 100) gTasks[taskId].data[3] = 99; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; @@ -1939,7 +1939,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon @@ -1950,7 +1950,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) AddBagItem(gTasks[taskId].data[5], gTasks[taskId].data[3]); DebugAction_DestroyExtraWindow(taskId); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon @@ -2070,28 +2070,28 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) static void DebugAction_Give_Pokemon_SelectId(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] >= NUM_SPECIES) gTasks[taskId].data[3] = NUM_SPECIES - 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; @@ -2111,7 +2111,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) gSprites[gTasks[taskId].data[6]].oam.priority = 0; } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { sDebugMonData->mon_speciesId = gTasks[taskId].data[3]; //Species ID gTasks[taskId].data[3] = 1; @@ -2125,7 +2125,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_SelectLevel; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2136,28 +2136,28 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) } static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > 100) gTasks[taskId].data[3] = 100; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; @@ -2170,7 +2170,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite @@ -2196,7 +2196,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_SelectShiny; } } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2208,17 +2208,17 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) //If complex static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > 1) gTasks[taskId].data[3] = 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) @@ -2235,7 +2235,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { sDebugMonData->isShiny = gTasks[taskId].data[3]; //isShiny gTasks[taskId].data[3] = 0; @@ -2250,7 +2250,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_SelectNature; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2259,17 +2259,17 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) } static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > NUM_NATURES-1) gTasks[taskId].data[3] = NUM_NATURES-1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) @@ -2284,7 +2284,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { u8 abilityId; sDebugMonData->mon_natureId = gTasks[taskId].data[3]; //NatureId @@ -2301,7 +2301,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2314,17 +2314,17 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) u8 abilityCount = NUM_ABILITY_SLOTS - 1; //-1 for proper iteration u8 i = 0; - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > abilityCount) gTasks[taskId].data[3] = abilityCount; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) @@ -2344,7 +2344,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { sDebugMonData->mon_abilityNum = gTasks[taskId].data[3] - i; //AbilityNum gTasks[taskId].data[3] = 0; @@ -2358,7 +2358,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2367,28 +2367,28 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) } static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > 31) gTasks[taskId].data[3] = 31; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; @@ -2422,7 +2422,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) } //If A or B button - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { switch (gTasks[taskId].data[7]) { @@ -2497,7 +2497,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_Move; } } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2506,28 +2506,28 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) } static void DebugAction_Give_Pokemon_Move(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] >= MOVES_COUNT) gTasks[taskId].data[3] = MOVES_COUNT - 1; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < 3) gTasks[taskId].data[4] += 1; @@ -2555,7 +2555,7 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { //If MOVE_NONE selected, stop asking for additional moves if (gTasks[taskId].data[3] == 0) @@ -2617,7 +2617,7 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon; } } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Free(sDebugMonData); //Frees EWRAM of MonData Struct @@ -2845,26 +2845,26 @@ static void DebugAction_Sound_SE(u8 taskId) } static void DebugAction_Sound_SE_SelectId(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > END_SE) gTasks[taskId].data[3] = END_SE; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; @@ -2877,13 +2877,13 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { m4aSongNumStop(gTasks[taskId].data[5]); gTasks[taskId].data[5] = gTasks[taskId].data[3]; m4aSongNumStart(gTasks[taskId].data[3]); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); m4aSongNumStop(gTasks[taskId].data[5]); @@ -2922,26 +2922,26 @@ static void DebugAction_Sound_MUS(u8 taskId) } static void DebugAction_Sound_MUS_SelectId(u8 taskId) { - if (gMain.newKeys & DPAD_ANY) + if (JOY_NEW(DPAD_ANY)) { - if (gMain.newKeys & DPAD_UP) + if (JOY_NEW(DPAD_UP)) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] > END_MUS) gTasks[taskId].data[3] = END_MUS; } - if (gMain.newKeys & DPAD_DOWN) + if (JOY_NEW(DPAD_DOWN)) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < START_MUS) gTasks[taskId].data[3] = START_MUS; } - if (gMain.newKeys & DPAD_LEFT) + if (JOY_NEW(DPAD_LEFT)) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if (gMain.newKeys & DPAD_RIGHT) + if (JOY_NEW(DPAD_RIGHT)) { if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; @@ -2954,13 +2954,13 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { m4aSongNumStop(gTasks[taskId].data[5]); gTasks[taskId].data[5] = gTasks[taskId].data[3]; m4aSongNumStart(gTasks[taskId].data[3]); } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); // m4aSongNumStop(gTasks[taskId].data[5]); //Uncomment if music should stop after leaving menu From f695ddd1ba3a9d9a882bf35cde4d18c09b386432 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 25 Sep 2022 18:34:07 -0400 Subject: [PATCH 30/47] Ignore new Porymap config --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8d9502ae83..082430d794 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ build/ .DS_Store *.ddump .idea/ -porymap.project.cfg +porymap.*.cfg prefabs.json .vscode/ *.a From 5054cf35862326278bdb73827be4c075b483aa14 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 25 Sep 2022 21:33:20 -0300 Subject: [PATCH 31/47] Documented unk40EF in Summary Screen --- include/pokemon_summary_screen.h | 2 +- src/pokemon_storage_system.c | 2 +- src/pokemon_summary_screen.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 3996c8e15f..b026baa533 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -10,7 +10,7 @@ extern const u8 *const gNatureNamePointers[]; void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove); -void ShowPokemonSummaryScreenSet40EF(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); +void ShowPokemonSummaryScreenHandleDeoxys(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); u8 GetMoveSlotToReplace(void); void SummaryScreen_SetAnimDelayTaskId(u8 taskId); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 32069153e6..4d4879d241 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -3755,7 +3755,7 @@ static void Task_ChangeScreen(u8 taskId) mode = sStorage->summaryScreenMode; FreePokeStorageData(); if (mode == SUMMARY_MODE_NORMAL && boxMons == &sSavedMovingMon.box) - ShowPokemonSummaryScreenSet40EF(mode, boxMons, monIndex, maxMonIndex, CB2_ReturnToPokeStorage); + ShowPokemonSummaryScreenHandleDeoxys(mode, boxMons, monIndex, maxMonIndex, CB2_ReturnToPokeStorage); else ShowPokemonSummaryScreen(mode, boxMons, monIndex, maxMonIndex, CB2_ReturnToPokeStorage); break; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 74e1da2cc6..9806a75dc2 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -182,7 +182,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData u8 filler40CA; u8 windowIds[8]; u8 spriteIds[SPRITE_ARR_ID_COUNT]; - bool8 unk40EF; + bool8 handleDeoxys; s16 switchCounter; // Used for various switch statement cases that decompress/load graphics or pokemon data u8 unk_filler4[6]; } *sMonSummaryScreen = NULL; @@ -1122,10 +1122,10 @@ void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 ma sMonSummaryScreen->newMove = newMove; } -void ShowPokemonSummaryScreenSet40EF(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)) +void ShowPokemonSummaryScreenHandleDeoxys(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)) { ShowPokemonSummaryScreen(mode, mons, monIndex, maxMonIndex, callback); - sMonSummaryScreen->unk40EF = TRUE; + sMonSummaryScreen->handleDeoxys = TRUE; } static void MainCB2(void) @@ -1406,7 +1406,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *mon) sum->ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); break; case 2: - if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) + if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->handleDeoxys == TRUE) { sum->nature = GetNature(mon); sum->currentHP = GetMonData(mon, MON_DATA_HP); @@ -3888,7 +3888,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) { if (gMonSpritesGfxPtr != NULL) { - if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) + if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->handleDeoxys == TRUE) HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], summary->species2, @@ -3901,7 +3901,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) } else { - if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) + if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->handleDeoxys == TRUE) HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], MonSpritesGfxManager_GetSpritePtr(MON_SPR_GFX_MANAGER_A, B_POSITION_OPPONENT_LEFT), summary->species2, From e515e52abb8f477df32b1bb050ffee5ba149954b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 26 Sep 2022 12:22:27 -0400 Subject: [PATCH 32/47] Add DISPLAY_TILE_* constants --- include/gba/defines.h | 3 +++ src/berry_blender.c | 4 ++-- src/contest_util.c | 18 +++++++++--------- src/credits.c | 2 +- src/dodrio_berry_picking.c | 14 +++++++------- src/field_screen_effect.c | 2 +- src/frontier_pass.c | 12 ++++++------ src/link.c | 6 +++--- src/mail.c | 4 ++-- src/main_menu.c | 2 +- src/mystery_event_menu.c | 2 +- src/mystery_gift_menu.c | 4 ++-- src/mystery_gift_view.c | 36 ++++++++++++++++++------------------ src/naming_screen.c | 2 +- src/party_menu.c | 4 ++-- src/trade.c | 6 +++--- src/union_room.c | 4 ++-- src/union_room_battle.c | 2 +- 18 files changed, 65 insertions(+), 62 deletions(-) diff --git a/include/gba/defines.h b/include/gba/defines.h index c52d7ef4f9..6d96e9a9e7 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -67,6 +67,9 @@ #define DISPLAY_WIDTH 240 #define DISPLAY_HEIGHT 160 +#define DISPLAY_TILE_WIDTH (DISPLAY_WIDTH / 8) +#define DISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / 8) + #define TILE_SIZE_4BPP 32 #define TILE_SIZE_8BPP 64 diff --git a/src/berry_blender.c b/src/berry_blender.c index d099a14ba2..140d1042eb 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1008,7 +1008,7 @@ static bool8 LoadBerryBlenderGfx(void) static void DrawBlenderBg(void) { - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); ShowBg(0); ShowBg(1); @@ -1029,7 +1029,7 @@ static void InitBerryBlenderWindows(void) for (i = 0; i < 5; i++) FillWindowPixelBuffer(i, PIXEL_FILL(0)); - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); Menu_LoadStdPalAt(0xE0); } } diff --git a/src/contest_util.c b/src/contest_util.c index d44b47373c..9a38251760 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -1167,24 +1167,24 @@ static void TryCreateWirelessSprites(void) static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) { u16 windowId; - int origWidth; + int tileWidth; int strWidth; u8 *spriteTilePtrs[4]; u8 *dst; struct WindowTemplate windowTemplate; memset(&windowTemplate, 0, sizeof(windowTemplate)); - windowTemplate.width = 30; + windowTemplate.width = DISPLAY_TILE_WIDTH; windowTemplate.height = 2; windowId = AddWindow(&windowTemplate); FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); - origWidth = GetStringWidth(FONT_NORMAL, text, 0); - strWidth = (origWidth + 9) / 8; - if (strWidth > 30) - strWidth = 30; + strWidth = GetStringWidth(FONT_NORMAL, text, 0); + tileWidth = (strWidth + 9) / 8; + if (tileWidth > DISPLAY_TILE_WIDTH) + tileWidth = DISPLAY_TILE_WIDTH; - AddTextPrinterParameterized3(windowId, FONT_NORMAL, (strWidth * 8 - origWidth) / 2, 1, sContestLinkTextColors, TEXT_SKIP_DRAW, text); + AddTextPrinterParameterized3(windowId, FONT_NORMAL, (tileWidth * 8 - strWidth) / 2, 1, sContestLinkTextColors, TEXT_SKIP_DRAW, text); { s32 i; struct Sprite *sprite; @@ -1207,7 +1207,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) CpuCopy32(src + 128, dst + 0x200, 0x20); CpuCopy32(src + 64, dst + 0x300, 0x20); - for (i = 0; i < strWidth; i++) + for (i = 0; i < tileWidth; i++) { dst = &spriteTilePtrs[(i + 1) / 8][((i + 1) % 8) * 32]; CpuCopy32(src + 192, dst, 0x20); @@ -1225,7 +1225,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) } RemoveWindow(windowId); - return (DISPLAY_WIDTH - (strWidth + 2) * 8) / 2; + return (DISPLAY_WIDTH - (tileWidth + 2) * 8) / 2; } static void CreateResultsTextWindowSprites(void) diff --git a/src/credits.c b/src/credits.c index c318595999..4156e45ba4 100644 --- a/src/credits.c +++ b/src/credits.c @@ -183,7 +183,7 @@ static const struct WindowTemplate sWindowTemplates[] = .bg = 0, .tilemapLeft = 0, .tilemapTop = 9, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 12, .paletteNum = 8, .baseBlock = 1 diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index a3710e04fb..268b930ae8 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -4675,7 +4675,7 @@ static void ShowNames(void) ClearWindowTilemap(sGfx->windowIds[i]); RemoveWindow(sGfx->windowIds[i]); } - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(BG_INTERFACE); sGfx->finished = TRUE; } @@ -4859,7 +4859,7 @@ static void ShowResults(void) sGfx->state++; } - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 5, 30, 15); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 5, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT - 5); RemoveWindow(sGfx->windowIds[1]); sGfx->windowIds[1] = AddWindow(&sWindowTemplate_Prize); ClearWindowTilemap(sGfx->windowIds[1]); @@ -4917,7 +4917,7 @@ static void ShowResults(void) ClearWindowTilemap(sGfx->windowIds[1]); RemoveWindow(sGfx->windowIds[0]); RemoveWindow(sGfx->windowIds[1]); - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(BG_INTERFACE); sGfx->finished = TRUE; break; @@ -5012,7 +5012,7 @@ static void Msg_WantToPlayAgain(void) ClearWindowTilemap(sGfx->windowIds[WIN_YES_NO]); RemoveWindow(sGfx->windowIds[WIN_PLAY_AGAIN]); RemoveWindow(sGfx->windowIds[WIN_YES_NO]); - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(BG_INTERFACE); sGfx->finished = TRUE; break; @@ -5044,7 +5044,7 @@ static void Msg_SavingDontTurnOff(void) sGfx->state++; break; default: - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(BG_INTERFACE); sGfx->finished = TRUE; break; @@ -5083,7 +5083,7 @@ static void EraseMessage(void) { ClearWindowTilemap(sGfx->windowIds[0]); RemoveWindow(sGfx->windowIds[0]); - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(BG_INTERFACE); sGfx->finished = TRUE; } @@ -5121,7 +5121,7 @@ static void Msg_SomeoneDroppedOut(void) sGfx->playAgainState = PLAY_AGAIN_DROPPED; ClearWindowTilemap(sGfx->windowIds[0]); RemoveWindow(sGfx->windowIds[0]); - FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(BG_INTERFACE, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(BG_INTERFACE); sGfx->finished = TRUE; break; diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 948d812e81..57f8cc52e4 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1136,7 +1136,7 @@ static void Task_OrbEffect(u8 taskId) SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 7)); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); - SetBgTilemapPalette(0, 0, 0, 0x1E, 0x14, 0xF); + SetBgTilemapPalette(0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 0xF); ScheduleBgCopyTilemapToVram(0); SetOrbFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], tCenterX, tCenterY, 1); CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index b143587415..d25cb34cff 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -760,9 +760,9 @@ static bool32 InitFrontierPass(void) case 7: if (FreeTempTileDataBuffersIfPossible()) return FALSE; - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); @@ -1396,9 +1396,9 @@ static bool32 InitFrontierMap(void) SetBgTilemapBuffer(0, sMapData->tilemapBuff0); SetBgTilemapBuffer(1, sMapData->tilemapBuff1); SetBgTilemapBuffer(2, sMapData->tilemapBuff2); - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); diff --git a/src/link.c b/src/link.c index b01be9d890..06907005fe 100644 --- a/src/link.c +++ b/src/link.c @@ -198,7 +198,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 5, .paletteNum = 15, .baseBlock = 0x002 @@ -206,7 +206,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 6, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 7, .paletteNum = 15, .baseBlock = 0x098 @@ -214,7 +214,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 7, .paletteNum = 15, .baseBlock = 0x16A diff --git a/src/mail.c b/src/mail.c index f1e4fbedf3..63553f172b 100644 --- a/src/mail.c +++ b/src/mail.c @@ -556,8 +556,8 @@ static bool8 MailReadBuildGraphics(void) } break; case 10: - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 1, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 1, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyToBgTilemapBuffer(1, sMailGraphics[sMailRead->mailType].tileMap, 0, 0); break; case 11: diff --git a/src/main_menu.c b/src/main_menu.c index b8abffda57..5b18e440a6 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1121,7 +1121,7 @@ static void Task_DisplayMainMenuInvalidActionError(u8 taskId) switch (gTasks[taskId].tCurrItem) { case 0: - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); switch (gTasks[taskId].tMenuType) { case 0: diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index b6610a6403..0af051ab77 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -90,7 +90,7 @@ void CB2_InitMysteryEventMenu(void) for (i = 0; i < 2; i++) FillWindowPixelBuffer(i, PIXEL_FILL(0)); - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); LoadUserWindowBorderGfx(0, 1u, 0xD0u); Menu_LoadStdPalAt(0xE0); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON); diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index 9e4796bb20..a6fb542b8b 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -102,7 +102,7 @@ static const struct WindowTemplate sMainWindows[] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 2, .paletteNum = 12, .baseBlock = 0x0013 @@ -118,7 +118,7 @@ static const struct WindowTemplate sMainWindows[] = { .bg = 0, .tilemapLeft = 0, .tilemapTop = 15, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 5, .paletteNum = 13, .baseBlock = 0x004f diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index b059b183c8..728605a901 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -226,9 +226,9 @@ s32 WonderCard_Enter(void) return 0; break; case 2: - FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); @@ -244,7 +244,7 @@ s32 WonderCard_Enter(void) gPaletteFade.bufferTransferDisabled = TRUE; LoadPalette(sWonderCardData->gfx->pal, 0x10, 0x20); LZ77UnCompWram(sWonderCardData->gfx->map, sWonderCardData->bgTilemapBuffer); - CopyRectToBgTilemapBufferRect(2, sWonderCardData->bgTilemapBuffer, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0); + CopyRectToBgTilemapBufferRect(2, sWonderCardData->bgTilemapBuffer, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 1, 0x008, 0); CopyBgTilemapBufferToVram(2); break; case 4: @@ -291,9 +291,9 @@ s32 WonderCard_Exit(bool32 useCancel) return 0; break; case 2: - FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); @@ -595,7 +595,7 @@ static const struct WindowTemplate sNews_WindowTemplates[] = { .tilemapLeft = 1, .tilemapTop = 3, .width = 28, - .height = 20, + .height = DISPLAY_TILE_HEIGHT, .paletteNum = 2, .baseBlock = 0x07C } @@ -688,10 +688,10 @@ s32 WonderNews_Enter(void) SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); break; case 2: - FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); @@ -707,8 +707,8 @@ s32 WonderNews_Enter(void) gPaletteFade.bufferTransferDisabled = TRUE; LoadPalette(sWonderNewsData->gfx->pal, 0x10, 0x20); LZ77UnCompWram(sWonderNewsData->gfx->map, sWonderNewsData->bgTilemapBuffer); - CopyRectToBgTilemapBufferRect(1, sWonderNewsData->bgTilemapBuffer, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0); - CopyRectToBgTilemapBufferRect(3, sWonderNewsData->bgTilemapBuffer, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0); + CopyRectToBgTilemapBufferRect(1, sWonderNewsData->bgTilemapBuffer, 0, 0, DISPLAY_TILE_WIDTH, 3, 0, 0, DISPLAY_TILE_WIDTH, 3, 1, 8, 0); + CopyRectToBgTilemapBufferRect(3, sWonderNewsData->bgTilemapBuffer, 0, 3, DISPLAY_TILE_WIDTH, 3 + DISPLAY_TILE_HEIGHT, 0, 3, DISPLAY_TILE_WIDTH, 3 + DISPLAY_TILE_HEIGHT, 1, 8, 0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(3); break; @@ -760,10 +760,10 @@ s32 WonderNews_Exit(bool32 useCancel) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); break; case 2: - FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20); - FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 24); - FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, 30, 24); + FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); + FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT + 4); + FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT + 4); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); diff --git a/src/naming_screen.c b/src/naming_screen.c index a05e501c2b..82cb359bd9 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -267,7 +267,7 @@ static const struct WindowTemplate sWindowTemplates[WIN_COUNT + 1] = .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, - .width = 30, + .width = DISPLAY_TILE_WIDTH, .height = 2, .paletteNum = 11, .baseBlock = 0x074 diff --git a/src/party_menu.c b/src/party_menu.c index 8c9b09f523..7330075cc4 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2866,7 +2866,7 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW { if (x + width < 0) return FALSE; - if (x > 31) + if (x >= 32) return FALSE; if (x < 0) @@ -2879,7 +2879,7 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW { *leftMove = 0; *newX = x; - if (x + width > 31) + if (x + width >= 32) *newWidth = 32 - x; else *newWidth = width; diff --git a/src/trade.c b/src/trade.c index ba18e8d32c..9c8fb2e8e9 100644 --- a/src/trade.c +++ b/src/trade.c @@ -351,7 +351,7 @@ static void InitTradeMenu(void) FillWindowPixelBuffer(i, PIXEL_FILL(0)); } - FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 15); + FillBgTilemapBufferRect(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 15); LoadUserWindowBorderGfx_(0, 20, 0xC0); LoadUserWindowBorderGfx(2, 1, 0xE0); LoadMonIconPalettes(); @@ -2064,13 +2064,13 @@ static void RedrawTradeMenuParty(u8 whichParty) static void Task_DrawSelectionSummary(u8 taskId) { - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); } static void Task_DrawSelectionTrade(u8 taskId) { - FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT); CopyBgTilemapBufferToVram(0); } diff --git a/src/union_room.c b/src/union_room.c index b47ddb41c0..229ea31643 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -3680,8 +3680,8 @@ static s32 ListMenuHandler_AllItemsAvailable(u8 *state, u8 *windowId, u8 *listMe if (winTemplateCopy.width > maxWidth) winTemplateCopy.width = maxWidth; - if (winTemplateCopy.tilemapLeft + winTemplateCopy.width > 29) - winTemplateCopy.tilemapLeft = max(29 - winTemplateCopy.width, 0); + if (winTemplateCopy.tilemapLeft + winTemplateCopy.width >= DISPLAY_TILE_WIDTH) + winTemplateCopy.tilemapLeft = max(DISPLAY_TILE_WIDTH - 1 - winTemplateCopy.width, 0); *windowId = AddWindow(&winTemplateCopy); DrawStdWindowFrame(*windowId, FALSE); diff --git a/src/union_room_battle.c b/src/union_room_battle.c index 1ec8be77b5..2e1e5621df 100644 --- a/src/union_room_battle.c +++ b/src/union_room_battle.c @@ -129,7 +129,7 @@ void CB2_UnionRoomBattle(void) ClearWindowTilemap(0); FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(0, PIXEL_FILL(1)); - FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF); + FillBgTilemapBufferRect(0, 0, 0, 0, DISPLAY_TILE_WIDTH, DISPLAY_TILE_HEIGHT, 0xF); LoadUserWindowBorderGfx(0, 1, 0xD0); LoadUserWindowBorderGfx_(0, 1, 0xD0); Menu_LoadStdPal(); From 5ca1b927e62ac2b03e609d6e9f4d81e55aa5eda6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 27 Sep 2022 08:13:32 -0300 Subject: [PATCH 33/47] Added missing Bide exception to Battle Arena Mind Points --- src/battle_arena.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_arena.c b/src/battle_arena.c index d741ed9ef7..7fb8b6e599 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -372,7 +372,8 @@ void BattleArena_AddMindPoints(u8 battler) else if (gBattleMoves[gCurrentMove].power != 0 && gBattleMoves[gCurrentMove].effect != EFFECT_COUNTER && gBattleMoves[gCurrentMove].effect != EFFECT_MIRROR_COAT - && gBattleMoves[gCurrentMove].effect != EFFECT_METAL_BURST) + && gBattleMoves[gCurrentMove].effect != EFFECT_METAL_BURST + && gBattleMoves[gCurrentMove].effect != EFFECT_BIDE) { gBattleStruct->arenaMindPoints[battler]++; } From fb9105f8ac7fe2eea17499ada670095265130689 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 27 Sep 2022 10:21:26 -0300 Subject: [PATCH 34/47] Added Mega Evolution flag --- include/constants/pokemon.h | 17 +++++----- src/data/pokemon/base_stats.h | 62 ++++++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), 20 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index c8337c722e..5167f5f55f 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -342,14 +342,15 @@ // Species Flags #define SPECIES_FLAG_LEGENDARY (1 << 0) #define SPECIES_FLAG_MYTHICAL (1 << 1) -#define SPECIES_FLAG_ULTRA_BEAST (1 << 2) -#define SPECIES_FLAG_ALOLAN_FORM (1 << 3) -#define SPECIES_FLAG_GALARIAN_FORM (1 << 4) -#define SPECIES_FLAG_HISUIAN_FORM (1 << 5) -#define SPECIES_FLAG_GENDER_DIFFERENCE (1 << 6) -#define SPECIES_FLAG_ALL_PERFECT_IVS (1 << 7) -#define SPECIES_FLAG_SHINY_LOCKED (1 << 8) -#define SPECIES_FLAG_CANNOT_BE_TRADED (1 << 9) +#define SPECIES_FLAG_MEGA_EVOLUTION (1 << 2) +#define SPECIES_FLAG_ULTRA_BEAST (1 << 3) +#define SPECIES_FLAG_ALOLAN_FORM (1 << 4) +#define SPECIES_FLAG_GALARIAN_FORM (1 << 5) +#define SPECIES_FLAG_HISUIAN_FORM (1 << 6) +#define SPECIES_FLAG_GENDER_DIFFERENCE (1 << 7) +#define SPECIES_FLAG_ALL_PERFECT_IVS (1 << 8) +#define SPECIES_FLAG_SHINY_LOCKED (1 << 9) +#define SPECIES_FLAG_CANNOT_BE_TRADED (1 << 10) #define LEGENDARY_PERFECT_IV_COUNT 3 diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 6cc51ccb52..d91c4cc4d2 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -22878,6 +22878,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_THICK_FAT, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_CHARIZARD_MEGA_X] = @@ -22902,6 +22903,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_CHARIZARD_MEGA_Y] = @@ -22926,6 +22928,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DROUGHT, ABILITY_DROUGHT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_BLASTOISE_MEGA] = @@ -22950,6 +22953,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_MEGA_LAUNCHER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_BEEDRILL_MEGA] = @@ -22976,6 +22980,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_ADAPTABILITY, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_PIDGEOT_MEGA] = @@ -23000,6 +23005,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NO_GUARD, ABILITY_NO_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_ALAKAZAM_MEGA] = @@ -23029,6 +23035,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TRACE, ABILITY_TRACE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SLOWBRO_MEGA] = @@ -23054,6 +23061,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SHELL_ARMOR, ABILITY_SHELL_ARMOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_GENGAR_MEGA] = @@ -23078,6 +23086,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SHADOW_TAG, ABILITY_SHADOW_TAG}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_KANGASKHAN_MEGA] = @@ -23102,6 +23111,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PARENTAL_BOND, ABILITY_PARENTAL_BOND}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_PINSIR_MEGA] = @@ -23126,6 +23136,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AERILATE, ABILITY_AERILATE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_GYARADOS_MEGA] = @@ -23150,6 +23161,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MOLD_BREAKER, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_AERODACTYL_MEGA] = @@ -23174,6 +23186,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_MEWTWO_MEGA_X] = @@ -23198,7 +23211,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STEADFAST, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_MEWTWO_MEGA_Y] = @@ -23223,7 +23236,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INSOMNIA, ABILITY_INSOMNIA}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_AMPHAROS_MEGA] = @@ -23248,6 +23261,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MOLD_BREAKER, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_STEELIX_MEGA] = @@ -23273,6 +23287,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_FORCE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SCIZOR_MEGA] = @@ -23297,6 +23312,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TECHNICIAN, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_HERACROSS_MEGA] = @@ -23321,6 +23337,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SKILL_LINK, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_HOUNDOOM_MEGA] = @@ -23345,6 +23362,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SOLAR_POWER, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_TYRANITAR_MEGA] = @@ -23369,6 +23387,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_STREAM, ABILITY_SAND_STREAM}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SCEPTILE_MEGA] = @@ -23393,6 +23412,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_LIGHTNING_ROD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_BLAZIKEN_MEGA] = @@ -23417,6 +23437,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SPEED_BOOST, ABILITY_SPEED_BOOST}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SWAMPERT_MEGA] = @@ -23441,6 +23462,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SWIFT_SWIM}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_GARDEVOIR_MEGA] = @@ -23465,6 +23487,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PIXILATE, ABILITY_PIXILATE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SABLEYE_MEGA] = @@ -23490,6 +23513,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_MAWILE_MEGA] = @@ -23515,6 +23539,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HUGE_POWER, ABILITY_HUGE_POWER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_AGGRON_MEGA] = @@ -23540,6 +23565,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FILTER, ABILITY_FILTER}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_MEDICHAM_MEGA] = @@ -23564,6 +23590,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PURE_POWER, ABILITY_PURE_POWER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_MANECTRIC_MEGA] = @@ -23588,6 +23615,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_INTIMIDATE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SHARPEDO_MEGA] = @@ -23613,6 +23641,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STRONG_JAW, ABILITY_STRONG_JAW}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_CAMERUPT_MEGA] = @@ -23638,6 +23667,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SHEER_FORCE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_ALTARIA_MEGA] = @@ -23662,6 +23692,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PIXILATE, ABILITY_PIXILATE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_BANETTE_MEGA] = @@ -23687,6 +23718,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRANKSTER, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_ABSOL_MEGA] = @@ -23711,6 +23743,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_GLALIE_MEGA] = @@ -23735,6 +23768,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_REFRIGERATE, ABILITY_REFRIGERATE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_SALAMENCE_MEGA] = @@ -23760,6 +23794,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AERILATE, ABILITY_AERILATE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_METAGROSS_MEGA] = @@ -23785,6 +23820,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_LATIAS_MEGA] = @@ -23809,7 +23845,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_LATIOS_MEGA] = @@ -23834,7 +23870,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_LOPUNNY_MEGA] = @@ -23859,6 +23895,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SCRAPPY, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_GARCHOMP_MEGA] = @@ -23883,6 +23920,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SAND_FORCE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_LUCARIO_MEGA] = @@ -23908,6 +23946,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_ADAPTABILITY, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_ABOMASNOW_MEGA] = @@ -23934,6 +23973,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SNOW_WARNING, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_GALLADE_MEGA] = @@ -23958,6 +23998,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_AUDINO_MEGA] = @@ -23984,6 +24025,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_HEALER, ABILITY_HEALER}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_DIANCIE_MEGA] = @@ -24009,7 +24051,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, - .flags = SPECIES_FLAG_MYTHICAL, + .flags = SPECIES_FLAG_MYTHICAL | SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_RAYQUAZA_MEGA] = @@ -24035,7 +24077,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DELTA_STREAM, ABILITY_DELTA_STREAM}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_LEGENDARY, + .flags = SPECIES_FLAG_LEGENDARY | SPECIES_FLAG_MEGA_EVOLUTION, }, [SPECIES_KYOGRE_PRIMAL] = @@ -25243,9 +25285,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 168, .evYield_Attack = 2, - #ifdef ITEM_EXPANSION - .itemRare = ITEM_ABSORB_BULB, - #endif + .itemRare = ITEM_ABSORB_BULB, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, @@ -25346,9 +25386,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 158, .evYield_SpDefense = 2, - #ifdef ITEM_EXPANSION - .itemRare = ITEM_SHED_SHELL, - #endif + .itemRare = ITEM_SHED_SHELL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, From d24899369fe8c25fa75d1f8b6df37e2a696673d8 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 28 Sep 2022 09:04:31 -0300 Subject: [PATCH 35/47] Special handling for Mew's Teachable moveset --- src/data/pokemon/teachable_learnsets.h | 69 +------------------------- src/pokemon.c | 32 ++++++++++++ 2 files changed, 33 insertions(+), 68 deletions(-) diff --git a/src/data/pokemon/teachable_learnsets.h b/src/data/pokemon/teachable_learnsets.h index 30405b0441..5854e19e0e 100644 --- a/src/data/pokemon/teachable_learnsets.h +++ b/src/data/pokemon/teachable_learnsets.h @@ -6137,75 +6137,8 @@ static const u16 sDragoniteTeachableLearnset[] = { MOVE_UNAVAILABLE, }; +// Instead of reading this array for Mew, it checks for exceptions in CanLearnTeachableMove instead. static const u16 sMewtwoTeachableLearnset[] = { - MOVE_AERIAL_ACE, - MOVE_BLIZZARD, - MOVE_BRICK_BREAK, - MOVE_BULK_UP, - MOVE_CALM_MIND, - MOVE_DIVE, - MOVE_DOUBLE_TEAM, - MOVE_EARTHQUAKE, - MOVE_FACADE, - MOVE_FIRE_BLAST, - MOVE_FLAMETHROWER, - MOVE_FLASH, - MOVE_FOCUS_PUNCH, - MOVE_FRUSTRATION, - MOVE_HAIL, - MOVE_HIDDEN_POWER, - MOVE_HYPER_BEAM, - MOVE_ICE_BEAM, - MOVE_IRON_TAIL, - MOVE_LIGHT_SCREEN, - MOVE_PROTECT, - MOVE_PSYCHIC, - MOVE_RAIN_DANCE, - MOVE_REFLECT, - MOVE_REST, - MOVE_RETURN, - MOVE_ROCK_SMASH, - MOVE_ROCK_TOMB, - MOVE_SAFEGUARD, - MOVE_SANDSTORM, - MOVE_SECRET_POWER, - MOVE_SHADOW_BALL, - MOVE_SHOCK_WAVE, - MOVE_SKILL_SWAP, - MOVE_SNATCH, - MOVE_SOLAR_BEAM, - MOVE_STRENGTH, - MOVE_SUNNY_DAY, - MOVE_TAUNT, - MOVE_THUNDER, - MOVE_THUNDERBOLT, - MOVE_TORMENT, - MOVE_TOXIC, - MOVE_WATER_PULSE, - MOVE_BODY_SLAM, - MOVE_COUNTER, - MOVE_DOUBLE_EDGE, - MOVE_DREAM_EATER, - MOVE_DYNAMIC_PUNCH, - MOVE_ENDURE, - MOVE_FIRE_PUNCH, - MOVE_ICE_PUNCH, - MOVE_ICY_WIND, - MOVE_MEGA_KICK, - MOVE_MEGA_PUNCH, - MOVE_METRONOME, - MOVE_MIMIC, - MOVE_MUD_SLAP, - MOVE_PSYCH_UP, - MOVE_ROCK_SLIDE, - MOVE_SEISMIC_TOSS, - MOVE_SLEEP_TALK, - MOVE_SNORE, - MOVE_SUBSTITUTE, - MOVE_SWAGGER, - MOVE_SWIFT, - MOVE_THUNDER_PUNCH, - MOVE_THUNDER_WAVE, MOVE_UNAVAILABLE, }; diff --git a/src/pokemon.c b/src/pokemon.c index a4fcc6b389..031d1aa672 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -7301,6 +7301,38 @@ u8 CanLearnTeachableMove(u16 species, u16 move) { return FALSE; } + else if (species == SPECIES_MEW) + { + switch (move) + { + case MOVE_BADDY_BAD: + case MOVE_BLAST_BURN: + case MOVE_BOUNCY_BUBBLE: + case MOVE_BUZZY_BUZZ: + case MOVE_DRACO_METEOR: + case MOVE_DRAGON_ASCENT: + case MOVE_FIRE_PLEDGE: + case MOVE_FLOATY_FALL: + case MOVE_FREEZY_FROST: + case MOVE_FRENZY_PLANT: + case MOVE_GLITZY_GLOW: + case MOVE_GRASS_PLEDGE: + case MOVE_HYDRO_CANNON: + case MOVE_RELIC_SONG: + case MOVE_SAPPY_SEED: + case MOVE_SECRET_SWORD: + case MOVE_SIZZLY_SLIDE: + case MOVE_SPARKLY_SWIRL: + case MOVE_SPLISHY_SPLASH: + case MOVE_STEEL_BEAM: + case MOVE_VOLT_TACKLE: + case MOVE_WATER_PLEDGE: + case MOVE_ZIPPY_ZAP: + return FALSE; + default: + return TRUE; + } + } else { u8 i; From 90ad11278dbc11ae507b6fc41fa5093f02ae4ad1 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 28 Sep 2022 09:17:10 -0300 Subject: [PATCH 36/47] Sorry Mewtwo ^^; --- src/data/pokemon/teachable_learnsets.h | 30 +++++--------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/data/pokemon/teachable_learnsets.h b/src/data/pokemon/teachable_learnsets.h index 5854e19e0e..b3bd97f4ae 100644 --- a/src/data/pokemon/teachable_learnsets.h +++ b/src/data/pokemon/teachable_learnsets.h @@ -6137,47 +6137,33 @@ static const u16 sDragoniteTeachableLearnset[] = { MOVE_UNAVAILABLE, }; -// Instead of reading this array for Mew, it checks for exceptions in CanLearnTeachableMove instead. static const u16 sMewtwoTeachableLearnset[] = { - MOVE_UNAVAILABLE, -}; - -static const u16 sMewTeachableLearnset[] = { MOVE_AERIAL_ACE, - MOVE_ATTRACT, MOVE_BLIZZARD, MOVE_BRICK_BREAK, MOVE_BULK_UP, - MOVE_BULLET_SEED, MOVE_CALM_MIND, - MOVE_CUT, - MOVE_DIG, MOVE_DIVE, MOVE_DOUBLE_TEAM, - MOVE_DRAGON_CLAW, MOVE_EARTHQUAKE, MOVE_FACADE, MOVE_FIRE_BLAST, MOVE_FLAMETHROWER, MOVE_FLASH, - MOVE_FLY, MOVE_FOCUS_PUNCH, MOVE_FRUSTRATION, - MOVE_GIGA_DRAIN, MOVE_HAIL, MOVE_HIDDEN_POWER, MOVE_HYPER_BEAM, MOVE_ICE_BEAM, MOVE_IRON_TAIL, MOVE_LIGHT_SCREEN, - MOVE_OVERHEAT, MOVE_PROTECT, MOVE_PSYCHIC, MOVE_RAIN_DANCE, MOVE_REFLECT, MOVE_REST, MOVE_RETURN, - MOVE_ROAR, MOVE_ROCK_SMASH, MOVE_ROCK_TOMB, MOVE_SAFEGUARD, @@ -6186,31 +6172,23 @@ static const u16 sMewTeachableLearnset[] = { MOVE_SHADOW_BALL, MOVE_SHOCK_WAVE, MOVE_SKILL_SWAP, - MOVE_SLUDGE_BOMB, MOVE_SNATCH, MOVE_SOLAR_BEAM, - MOVE_STEEL_WING, MOVE_STRENGTH, MOVE_SUNNY_DAY, - MOVE_SURF, MOVE_TAUNT, - MOVE_THIEF, MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_TORMENT, MOVE_TOXIC, - MOVE_WATERFALL, MOVE_WATER_PULSE, MOVE_BODY_SLAM, MOVE_COUNTER, - MOVE_DEFENSE_CURL, MOVE_DOUBLE_EDGE, MOVE_DREAM_EATER, MOVE_DYNAMIC_PUNCH, MOVE_ENDURE, - MOVE_EXPLOSION, MOVE_FIRE_PUNCH, - MOVE_FURY_CUTTER, MOVE_ICE_PUNCH, MOVE_ICY_WIND, MOVE_MEGA_KICK, @@ -6220,20 +6198,22 @@ static const u16 sMewTeachableLearnset[] = { MOVE_MUD_SLAP, MOVE_PSYCH_UP, MOVE_ROCK_SLIDE, - MOVE_ROLLOUT, MOVE_SEISMIC_TOSS, MOVE_SLEEP_TALK, MOVE_SNORE, - MOVE_SOFT_BOILED, MOVE_SUBSTITUTE, MOVE_SWAGGER, MOVE_SWIFT, - MOVE_SWORDS_DANCE, MOVE_THUNDER_PUNCH, MOVE_THUNDER_WAVE, MOVE_UNAVAILABLE, }; +// Instead of reading this array for Mew, it checks for exceptions in CanLearnTeachableMove instead. +static const u16 sMewTeachableLearnset[] = { + MOVE_UNAVAILABLE, +}; + static const u16 sChikoritaTeachableLearnset[] = { MOVE_ATTRACT, MOVE_BULLET_SEED, From 8dad7cc64990b0b130ec67abbf56bb4dcaea67df Mon Sep 17 00:00:00 2001 From: sbird Date: Thu, 29 Sep 2022 17:33:39 +0200 Subject: [PATCH 37/47] [doc] clean up casts in decompress.c --- src/decompress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decompress.c b/src/decompress.c index 6e94a54759..c16c2cdb31 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -268,7 +268,7 @@ bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet *src struct SpriteSheet dest; void *buffer; - buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8); + buffer = AllocZeroed(src->data[0] >> 8); LZ77UnCompWram(src->data, buffer); dest.data = buffer; @@ -285,7 +285,7 @@ bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette struct SpritePalette dest; void *buffer; - buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8); + buffer = AllocZeroed(src->data[0] >> 8); LZ77UnCompWram(src->data, buffer); dest.data = buffer; dest.tag = src->tag; From 79a34411ce339eca21f4c2e58236b348b89c928d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 29 Sep 2022 15:22:21 -0400 Subject: [PATCH 38/47] Add additional DISPLAY_TILE_WIDTH usage --- src/mystery_gift_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index a6fb542b8b..4b81c81a3b 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -640,8 +640,8 @@ static u32 MysteryGift_HandleThreeOptionMenu(u8 * unused0, u16 * unused1, u8 whi width++; windowTemplate.width = width; - if (width < 30) - windowTemplate.tilemapLeft = (30 - width) / 2; + if (width < DISPLAY_TILE_WIDTH) + windowTemplate.tilemapLeft = (DISPLAY_TILE_WIDTH - width) / 2; else windowTemplate.tilemapLeft = 0; From 764bed65801a175058caf3599e6734086a7c91d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Augusto=20Vianna?= Date: Sat, 1 Oct 2022 20:50:55 -0300 Subject: [PATCH 39/47] Fixed berserk not activating if mon falls to exactly half HP. --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index 64c2e75570..181fb20125 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5209,7 +5209,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && TARGET_TURN_DAMAGED && IsBattlerAlive(battler) // Had more than half of hp before, now has less - && gBattleStruct->hpBefore[battler] > gBattleMons[battler].maxHP / 2 + && gBattleStruct->hpBefore[battler] >= gBattleMons[battler].maxHP / 2 && gBattleMons[battler].hp < gBattleMons[battler].maxHP / 2 && (gMultiHitCounter == 0 || gMultiHitCounter == 1) && !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove)) From e8ed0bd9f21a9eca85579c68fede099e798126c9 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 4 Oct 2022 20:39:45 -0300 Subject: [PATCH 40/47] Changed ballMultiplier to account for future Hisuian ball multipliers --- src/battle_script_commands.c | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index bb3fc1c0f4..fdcebd47b0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -13880,7 +13880,7 @@ u8 GetCatchingBattler(void) static void Cmd_handleballthrow(void) { - u8 ballMultiplier = 10; + u16 ballMultiplier = 100; s8 ballAddition = 0; if (gBattleControllerExecFlags) @@ -13915,30 +13915,30 @@ static void Cmd_handleballthrow(void) if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & FLAG_ULTRA_BEAST) { if (gLastUsedItem == ITEM_BEAST_BALL) - ballMultiplier = 50; + ballMultiplier = 500; else - ballMultiplier = 1; + ballMultiplier = 10; } else { switch (gLastUsedItem) { case ITEM_ULTRA_BALL: - ballMultiplier = 20; + ballMultiplier = 200; break; #if B_SPORT_BALL_MODIFIER <= GEN_7 case ITEM_SPORT_BALL: #endif case ITEM_GREAT_BALL: case ITEM_SAFARI_BALL: - ballMultiplier = 15; + ballMultiplier = 150; break; case ITEM_NET_BALL: if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG)) #if B_NET_BALL_MODIFIER >= GEN_7 - ballMultiplier = 35; + ballMultiplier = 350; #else - ballMultiplier = 30; + ballMultiplier = 300; #endif break; case ITEM_DIVE_BALL: @@ -13947,75 +13947,75 @@ static void Cmd_handleballthrow(void) || gIsFishingEncounter || gIsSurfingEncounter #endif ) - ballMultiplier = 35; + ballMultiplier = 350; break; case ITEM_NEST_BALL: #if B_NEST_BALL_MODIFIER >= GEN_6 //((41 - Pokémon's level) ÷ 10)× if Pokémon's level is between 1 and 29, 1× otherwise. if (gBattleMons[gBattlerTarget].level < 30) - ballMultiplier = 41 - gBattleMons[gBattlerTarget].level; + ballMultiplier = 410 - (gBattleMons[gBattlerTarget].level * 10); #elif B_NEST_BALL_MODIFIER == GEN_5 //((41 - Pokémon's level) ÷ 10)×, minimum 1× if (gBattleMons[gBattlerTarget].level < 31) - ballMultiplier = 41 - gBattleMons[gBattlerTarget].level; + ballMultiplier = 410 - (gBattleMons[gBattlerTarget].level * 10); #else //((40 - Pokémon's level) ÷ 10)×, minimum 1× if (gBattleMons[gBattlerTarget].level < 40) { - ballMultiplier = 40 - gBattleMons[gBattlerTarget].level; - if (ballMultiplier <= 9) - ballMultiplier = 10; + ballMultiplier = 400 - (gBattleMons[gBattlerTarget].level * 10); + if (ballMultiplier <= 90) + ballMultiplier = 100; } #endif break; case ITEM_REPEAT_BALL: if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT)) #if B_REPEAT_BALL_MODIFIER >= GEN_7 - ballMultiplier = 35; + ballMultiplier = 350; #else - ballMultiplier = 30; + ballMultiplier = 300; #endif break; case ITEM_TIMER_BALL: #if B_TIMER_BALL_MODIFIER >= GEN_5 - ballMultiplier = (gBattleResults.battleTurnCounter * 3) + 10; + ballMultiplier = (gBattleResults.battleTurnCounter * 30) + 100; #else - ballMultiplier = gBattleResults.battleTurnCounter + 10; + ballMultiplier = (gBattleResults.battleTurnCounter * 10) + 100; #endif - if (ballMultiplier > 40) - ballMultiplier = 40; + if (ballMultiplier > 400) + ballMultiplier = 400; break; case ITEM_DUSK_BALL: RtcCalcLocalTime(); if ((gLocalTime.hours >= 20 && gLocalTime.hours <= 3) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND) #if B_DUSK_BALL_MODIFIER >= GEN_7 - ballMultiplier = 30; + ballMultiplier = 300; #else - ballMultiplier = 35; + ballMultiplier = 350; #endif break; case ITEM_QUICK_BALL: if (gBattleResults.battleTurnCounter == 0) #if B_QUICK_BALL_MODIFIER >= GEN_5 - ballMultiplier = 50; + ballMultiplier = 500; #else - ballMultiplier = 40; + ballMultiplier = 400; #endif break; case ITEM_LEVEL_BALL: if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level) - ballMultiplier = 80; + ballMultiplier = 800; else if (gBattleMons[gBattlerAttacker].level > 2 * gBattleMons[gBattlerTarget].level) - ballMultiplier = 40; + ballMultiplier = 400; else if (gBattleMons[gBattlerAttacker].level > gBattleMons[gBattlerTarget].level) - ballMultiplier = 20; + ballMultiplier = 200; break; case ITEM_LURE_BALL: if (gIsFishingEncounter) #if B_LURE_BALL_MODIFIER >= GEN_7 - ballMultiplier = 50; + ballMultiplier = 500; #else - ballMultiplier = 30; + ballMultiplier = 300; #endif break; case ITEM_MOON_BALL: @@ -14023,7 +14023,7 @@ static void Cmd_handleballthrow(void) { if (gEvolutionTable[gBattleMons[gBattlerTarget].species][i].method == EVO_ITEM && gEvolutionTable[gBattleMons[gBattlerTarget].species][i].param == ITEM_MOON_STONE) - ballMultiplier = 40; + ballMultiplier = 400; } break; case ITEM_LOVE_BALL: @@ -14033,12 +14033,12 @@ static void Cmd_handleballthrow(void) u8 gender2 = GetMonGender(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]); if (gender1 != gender2 && gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS) - ballMultiplier = 80; + ballMultiplier = 800; } break; case ITEM_FAST_BALL: if (gBaseStats[gBattleMons[gBattlerTarget].species].baseSpeed >= 100) - ballMultiplier = 40; + ballMultiplier = 400; break; case ITEM_HEAVY_BALL: i = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1); @@ -14076,13 +14076,13 @@ static void Cmd_handleballthrow(void) case ITEM_DREAM_BALL: #if B_DREAM_BALL_MODIFIER >= GEN_8 if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE) - ballMultiplier = 40; + ballMultiplier = 400; #else - ballMultiplier = 10; + ballMultiplier = 100; #endif break; case ITEM_BEAST_BALL: - ballMultiplier = 1; + ballMultiplier = 10; break; } } @@ -14093,7 +14093,7 @@ static void Cmd_handleballthrow(void) else catchRate = catchRate + ballAddition; - odds = (catchRate * ballMultiplier / 10) + odds = (catchRate * ballMultiplier / 100) * (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2) / (3 * gBattleMons[gBattlerTarget].maxHP); From a20334f79a48fcf03744ea8a6f779a0a20661a13 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 4 Oct 2022 22:06:07 -0300 Subject: [PATCH 41/47] Removed unused functions in item header --- include/item.h | 2 -- src/item.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/item.h b/include/item.h index bcd9178e54..c964e7628a 100644 --- a/include/item.h +++ b/include/item.h @@ -62,13 +62,11 @@ u16 CountTotalItemQuantityInBag(u16 itemId); bool8 AddPyramidBagItem(u16 itemId, u16 count); bool8 RemovePyramidBagItem(u16 itemId, u16 count); const u8 *ItemId_GetName(u16 itemId); -u16 ItemId_GetId(u16 itemId); u16 ItemId_GetPrice(u16 itemId); u8 ItemId_GetHoldEffect(u16 itemId); u8 ItemId_GetHoldEffectParam(u16 itemId); const u8 *ItemId_GetDescription(u16 itemId); u8 ItemId_GetImportance(u16 itemId); -u8 ItemId_GetRegistrability(u16 itemId); u8 ItemId_GetPocket(u16 itemId); u8 ItemId_GetType(u16 itemId); ItemUseFunc ItemId_GetFieldFunc(u16 itemId); diff --git a/src/item.c b/src/item.c index acb00acc75..8b375df844 100644 --- a/src/item.c +++ b/src/item.c @@ -880,6 +880,7 @@ const u8 *ItemId_GetName(u16 itemId) return gItems[SanitizeItemId(itemId)].name; } +// Unused u16 ItemId_GetId(u16 itemId) { return gItems[SanitizeItemId(itemId)].itemId; @@ -910,7 +911,7 @@ u8 ItemId_GetImportance(u16 itemId) return gItems[SanitizeItemId(itemId)].importance; } -// unused +// Unused u8 ItemId_GetRegistrability(u16 itemId) { return gItems[SanitizeItemId(itemId)].registrability; From f3bddd1ea61dc19eba13a8a53e84594ca5d42980 Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Thu, 6 Oct 2022 19:36:01 -0400 Subject: [PATCH 42/47] Fix typo --- src/naming_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/naming_screen.c b/src/naming_screen.c index fe858b8795..0a0085058e 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -2280,7 +2280,7 @@ static const struct Subsprite sSubsprites_PageSwapText[] = /* [0_____][] <-1 40x24 [2_____][] <-3 -[3___+_][] <-5/Origin +[4___+_][] <-5/Origin */ static const struct Subsprite sSubsprites_Button[] = { From ea168d1a6b9e6cf6a3581e9cf18f3dd124d08a19 Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Thu, 6 Oct 2022 20:34:46 -0400 Subject: [PATCH 43/47] Fix typo 2: revelations --- src/naming_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/naming_screen.c b/src/naming_screen.c index 0a0085058e..901c83fdc8 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -2182,8 +2182,8 @@ static const struct OamData sOam_32x16 = /* [0_____][] <-1 40x32 [2_____][] <-3 -[3___+_][] <-5/Origin -[4 ][] <-7 +[4___+_][] <-5/Origin +[6 ][] <-7 */ static const struct Subsprite sSubsprites_PageSwapFrame[] = { From 50ca188cb24e507c21be34859a5186d6d6f36d44 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 7 Oct 2022 12:25:12 -0300 Subject: [PATCH 44/47] Replaced didMegaEvo with a shiny new species flag --- include/battle.h | 1 - src/battle_script_commands.c | 1 - src/battle_util.c | 3 ++- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/battle.h b/include/battle.h index 29cc79d36b..b328b46bb2 100644 --- a/include/battle.h +++ b/include/battle.h @@ -479,7 +479,6 @@ struct MegaEvolutionData bool8 playerSelect; u8 triggerSpriteId; bool8 isWishMegaEvo; - bool32 didMegaEvo[PARTY_SIZE][2]; // For each party member and side. }; struct Illusion diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1232775fd0..eaa7bbde1a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8840,7 +8840,6 @@ static void Cmd_various(void) gBattleMons[gActiveBattler].species = megaSpecies; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); - gBattleStruct->mega.didMegaEvo[gActiveBattler][GetBattlerSide(gActiveBattler)] = TRUE; BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], sizeof(gBattleMons[gActiveBattler].species), &gBattleMons[gActiveBattler].species); MarkBattlerForControllerExec(gActiveBattler); diff --git a/src/battle_util.c b/src/battle_util.c index 0b0ab3a040..94fb078dac 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2110,10 +2110,11 @@ u32 GetBattlerFriendshipScore(u8 battlerId) struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct *)(&gBattleResources->bufferA[battlerId][4]))->mega); u8 side = GetBattlerSide(battlerId); struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; + u16 species = GetMonData(&party[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); if (side != B_SIDE_PLAYER) return FRIENDSHIP_NONE; - else if (gBattleStruct->mega.didMegaEvo[battlerId][side] + else if (gBaseStats[species].flags & SPECIES_FLAG_MEGA_EVOLUTION || (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK From 2a8048b677ce0075bd75cc6065670d79a4b762a9 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 7 Oct 2022 14:53:58 -0300 Subject: [PATCH 45/47] Removed ItemId_GetId like in upstream --- include/item.h | 1 - src/battle_anim_new.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/item.h b/include/item.h index 27383c6c14..e02aeb6828 100644 --- a/include/item.h +++ b/include/item.h @@ -64,7 +64,6 @@ u16 CountTotalItemQuantityInBag(u16 itemId); bool8 AddPyramidBagItem(u16 itemId, u16 count); bool8 RemovePyramidBagItem(u16 itemId, u16 count); const u8 *ItemId_GetName(u16 itemId); -u16 ItemId_GetId(u16 itemId); u16 ItemId_GetPrice(u16 itemId); u8 ItemId_GetHoldEffect(u16 itemId); u8 ItemId_GetHoldEffectParam(u16 itemId); diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 2134a8914d..e236e26bf5 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -7856,8 +7856,8 @@ static void SpriteCB_TwinkleOnBattler(struct Sprite *sprite) void AnimTask_PrimalReversion(u8 taskId) { - if (ItemId_GetId(gBattleMons[gBattleAnimAttacker].item) == ITEM_RED_ORB) - gBattleAnimArgs[0] = ItemId_GetId(gBattleMons[gBattleAnimAttacker].item); + if (gBattleMons[gBattleAnimAttacker].item == ITEM_RED_ORB) + gBattleAnimArgs[0] = gBattleMons[gBattleAnimAttacker].item; else gBattleAnimArgs[0] = 0; DestroyAnimVisualTask(taskId); From 8ea060044abafa4d12627802f1be096dbb75d7c1 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 7 Oct 2022 17:22:29 -0300 Subject: [PATCH 46/47] Battle text pauses config --- include/constants/battle.h | 8 ++++---- include/constants/battle_config.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index e2ea128c25..a5af07d98c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -401,10 +401,10 @@ #define BATTLE_TERRAIN_COUNT 22 -#define B_WAIT_TIME_LONG 64 -#define B_WAIT_TIME_MED 48 -#define B_WAIT_TIME_SHORT 32 -#define B_WAIT_TIME_SHORTEST 16 +#define B_WAIT_TIME_LONG (B_WAIT_TIME_MULTIPLIER * 4) +#define B_WAIT_TIME_MED (B_WAIT_TIME_MULTIPLIER * 3) +#define B_WAIT_TIME_SHORT (B_WAIT_TIME_MULTIPLIER * 2) +#define B_WAIT_TIME_SHORTEST (B_WAIT_TIME_MULTIPLIER) #define CHERRIM_OVERCAST 0 #define CHERRIM_SUNSHINE 1 diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 0a7ba2303f..ebdd7dfc8e 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -160,6 +160,7 @@ #define B_SHOW_SPLIT_ICON TRUE // If set to TRUE, it will show an icon in the summary showing the move's category split. #define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations. #define B_EXPANDED_MOVE_NAMES FALSE // If set to TRUE, move names are increased from 12 characters to 16 characters. +#define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles. // Catching settings #define B_SEMI_INVULNERABLE_CATCH GEN_LATEST // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) From 589c969e89f4979eec7097013f7d2c025e26b0a0 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 7 Oct 2022 18:20:00 -0300 Subject: [PATCH 47/47] Removed unused access to struct MegaEvolutionData in GetBattlerFriendshipScore --- src/battle_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index 94fb078dac..6cfb1801cf 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2107,7 +2107,6 @@ void TryToRevertMimicry(void) u32 GetBattlerFriendshipScore(u8 battlerId) { - struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct *)(&gBattleResources->bufferA[battlerId][4]))->mega); u8 side = GetBattlerSide(battlerId); struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; u16 species = GetMonData(&party[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES);