diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 89134daf9..0b610211c 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -194,6 +194,14 @@ #define B_NEW_IMPACT_PALETTE FALSE // If set to TRUE, it updates the basic 'hit' palette. #define B_NEW_SURF_PARTICLE_PALETTE FALSE // If set to TRUE, it updates Surf's wave palette. +// Debugging, Replace the used flags with others or disable with a 0 #define B_ENABLE_DEBUG TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. +#define TX_DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. +#define TX_DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. +#define TX_DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. +#define TX_DEBUG_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. +#define TX_DEBUG_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. +#define TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. + #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/include/constants/flags.h b/include/constants/flags.h index 9b101c77e..ac8de43dc 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -40,13 +40,13 @@ #define FLAG_TEMP_1E (TEMP_FLAGS_START + 0x1E) #define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F) #define TEMP_FLAGS_END FLAG_TEMP_1F - -#define FLAG_SYS_NO_COLLISION 0x20 // Unused Flag //DEBUG -#define FLAG_SYS_NO_ENCOUNTER 0x21 // Unused Flag //DEBUG -#define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG -#define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG -#define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG -#define FLAG_SYS_PC_FROM_DEBUG_MENU 0x25 // Unused Flag //DEBUG + +#define FLAG_UNUSED_0x020 0x20 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x021 0x21 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x022 0x22 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x023 0x23 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x024 0x24 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x025 0x25 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" #define FLAG_UNUSED_0x026 0x26 // Unused Flag #define FLAG_UNUSED_0x027 0x27 // Unused Flag #define FLAG_UNUSED_0x028 0x28 // Unused Flag diff --git a/src/battle_main.c b/src/battle_main.c index 029578ceb..20ebc05c6 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4002,7 +4002,7 @@ static void HandleTurnActionSelectionState(void) break; case B_ACTION_USE_ITEM: #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_BAG_USE)) + if (FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) { RecordedBattle_ClearBattlerAction(gActiveBattler, 1); gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; diff --git a/src/debug.c b/src/debug.c index b27142abe..283361b38 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1447,56 +1447,56 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) } static void DebugAction_Flags_CollisionOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_COLLISION)) + if(FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) { - FlagClear(FLAG_SYS_NO_COLLISION); + FlagClear(TX_DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_COLLISION); + FlagSet(TX_DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_EncounterOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_ENCOUNTER)) + if(FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) { - FlagClear(FLAG_SYS_NO_ENCOUNTER); + FlagClear(TX_DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_ENCOUNTER); + FlagSet(TX_DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + if(FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) { - FlagClear(FLAG_SYS_NO_TRAINER_SEE); + FlagClear(TX_DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_TRAINER_SEE); + FlagSet(TX_DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_BagUseOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_BAG_USE)) + if(FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) { - FlagClear(FLAG_SYS_NO_BAG_USE); + FlagClear(TX_DEBUG_FLAG_NO_BAG_USE); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_BAG_USE); + FlagSet(TX_DEBUG_FLAG_NO_BAG_USE); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_CatchingOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_CATCHING)) + if(FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) { - FlagClear(FLAG_SYS_NO_CATCHING); + FlagClear(TX_DEBUG_FLAG_NO_CATCHING); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_CATCHING); + FlagSet(TX_DEBUG_FLAG_NO_CATCHING); PlaySE(SE_PC_LOGIN); } } @@ -2723,7 +2723,7 @@ static void Task_WaitFadeAccessPC(u8 taskId) if (!gPaletteFade.active) { DestroyTask(taskId); - FlagSet(FLAG_SYS_PC_FROM_DEBUG_MENU); + FlagSet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU); EnterPokeStorage(2); } } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 2c80e7948..fbcb6ed79 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4631,7 +4631,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) u8 direction = dir; #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_COLLISION)) + if (FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) return COLLISION_NONE; #endif diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6f5460f58..5f8712980 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -708,7 +708,7 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) + if (FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) return FALSE; #endif diff --git a/src/item_use.c b/src/item_use.c index 63599d1e2..5cca3aee3 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -983,7 +983,7 @@ static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a b void ItemUseInBattle_PokeBall(u8 taskId) { #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_CATCHING)) + if (FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) { static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index df822f245..437458d75 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1669,7 +1669,7 @@ static void FieldTask_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) + if (!FlagGet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU)) { taskId = CreateTask(Task_PCMainMenu, 80); gTasks[taskId].tState = 0; @@ -1678,7 +1678,7 @@ static void FieldTask_ReturnToPcMenu(void) } else { - FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU); + FlagClear(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU); ScriptContext_Enable(); } SetVBlankCallback(vblankCb); diff --git a/src/trainer_see.c b/src/trainer_see.c index 81b040a3b..596b7456d 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -194,7 +194,7 @@ bool8 CheckForTrainersWantingBattle(void) u8 i; #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + if (FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) return FALSE; #endif