Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inclusion of the tx_debug_system #2277

Merged
merged 76 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
6456009
Implementation if Pyredrid and AsparagusEduardo debug menu plus huge …
TheXaman Sep 25, 2020
e6ab312
Merge branch 'tx_debug_system_public' of https://github.com/TheXaman/…
TheXaman Oct 20, 2020
c031099
removed ability
TheXaman Oct 21, 2020
6988864
Fixed the wrong palettes for the mon icons with the help of Nadia and…
TheXaman Oct 26, 2020
b807a6d
Merge branch 'tx_debug_system_public' of https://github.com/TheXaman/…
TheXaman Oct 26, 2020
d380932
Fixed forgotten PokemonSimple, thx to AsparagusEduardo
TheXaman Oct 27, 2020
6422164
Added moves, trainer edits and fixed abilities, now only possible one…
TheXaman Nov 16, 2020
549381f
Add debug makefile targets (#2)
ExpoSeed Nov 17, 2020
174867c
added individual IVs and reworked how data is stored to a struct
TheXaman Nov 27, 2020
5bb92ef
now closes debug windows after giving all TMs
TheXaman Nov 27, 2020
edc476f
fixed heal party bug, thanks to jaizu for poitning it out
TheXaman Nov 30, 2020
c15138f
Fixed problems with changed Deoxys handling in RHH's pokeexpansion, t…
TheXaman Jan 29, 2021
27a9932
WIP reset makefile to new default
TheXaman Feb 4, 2021
965bcfa
Added newest Makefile and fixed making from clean
TheXaman Feb 4, 2021
40ebd66
Fixed setting vars not working, thanks to AmbientDinosaur and BSBob f…
TheXaman Mar 25, 2021
c8c81e4
Fixed "new trainer id" option, thanks to Lunos and Deokishisu
TheXaman May 7, 2021
19cf846
Added:
TheXaman May 7, 2021
822a6c4
Formatting
TheXaman May 7, 2021
c92c345
Fixed bug not beeing able to select last species, thanks to Lunos for…
TheXaman May 24, 2021
4e98c26
Small change to hidden ability (#3)
Jaizu Jun 9, 2021
20ca83b
Added menu to run custom scripts easily, credit: @Jaizu
TheXaman Jun 20, 2021
9708ee0
fixed credit link
TheXaman Jun 20, 2021
defd7d9
Added Sound menu for SE and MUS
TheXaman Jun 22, 2021
81d7986
added SE and MUS names
TheXaman Jun 22, 2021
010c1b5
fixed some songs not properly stopping and overlapping others, thanks…
TheXaman Jun 22, 2021
45012a6
fixes PlaySE overwriting some "music tracks" like MUS_MOVE_DELETED
TheXaman Jun 22, 2021
a663742
fixed a bug not showing hidden abilities (POKEMON_EXPANSION) if the s…
TheXaman Jun 30, 2021
af355fc
added Debug to StartMenu via DEBUG_MENU option
TheXaman Jul 2, 2021
5104293
Changed to TX_DEBUGGING define instead of makefile DEBUGGING option
TheXaman Nov 18, 2021
2f8896f
Merge branch 'master' of https://github.com/pret/pokeemerald into tx_…
TheXaman Nov 18, 2021
5780560
fixed some bugs, thanks to cbt
TheXaman Nov 28, 2021
df8dfd9
added #ifdef TX_DEBUGGING for wild encounter, bag use and catching flags
TheXaman Nov 28, 2021
224b9a1
Fixed softlock when pressing the start button while in link room
AsparagusEduardo Feb 21, 2022
3e2cb0f
Merge pull request #14 from AsparagusEduardo/PR_debugMenu_softlock
TheXaman Feb 22, 2022
e088552
Fixed going out of bounds when choosing a move for detailed Give Mon
AsparagusEduardo Mar 8, 2022
fd30b85
Merge pull request #16 from AsparagusEduardo/PR_tx_debugFix
TheXaman Mar 8, 2022
315813d
Update debug.c
LOuroboros Mar 16, 2022
f4448d0
Merge pull request #17 from LOuroboros/patch-4
TheXaman Mar 17, 2022
0036a4d
pc acccess
Mar 18, 2022
350c474
Merge pull request #18 from ghoulslash/xaman_debug
TheXaman Mar 18, 2022
192969c
small fix
TheXaman Mar 18, 2022
c54bf21
Merge branch 'master' of https://github.com/pret/pokeemerald into tx_…
TheXaman Apr 16, 2022
cbe8f30
added FLAG_ADVENTURE_STARTED to cheat start
TheXaman May 21, 2022
94183b4
Added options for ttoggling battle frontier pass and giving max BPs
TheXaman Aug 29, 2022
006d28f
tiny fix for wrong "give pokemon" window
TheXaman Aug 29, 2022
8c9a59e
Merge branch 'tx_debug_system' of https://github.com/TheXaman/pokeeme…
TheXaman Aug 29, 2022
bed5639
Changed preproc defines to TRUE/FALSE, small cleanup
TheXaman Aug 29, 2022
8cf2933
added preproc directive to main debug.c code
TheXaman Aug 29, 2022
61c9542
Update src/event_object_movement.c
TheXaman Aug 30, 2022
cc921c6
Update src/field_control_avatar.c
TheXaman Aug 30, 2022
79c4fa5
Update src/start_menu.c
TheXaman Aug 30, 2022
155465a
Update src/pokemon_storage_system.c
TheXaman Aug 30, 2022
725a910
Update src/new_game.c
TheXaman Aug 30, 2022
2f61407
Update src/field_control_avatar.c
TheXaman Aug 30, 2022
5fed45e
Update src/item_use.c
TheXaman Aug 30, 2022
d9bd272
removed the entries ld_script as per pret#1738, added newline to debug.h
TheXaman Aug 30, 2022
e09ba65
imrpoved code formatting in field_control_avatar as per suggestion
TheXaman Aug 30, 2022
04c4067
Changed the way debug flags are handled, now in constants/battle_conf…
TheXaman Aug 30, 2022
3debf04
changed the locations of tx_debug_system related #defines to its own …
TheXaman Aug 30, 2022
c13561e
simplified filed controls code for debug menu
TheXaman Aug 30, 2022
ad57551
removed unnecessary script, cheat start now with national dex, revert…
TheXaman Sep 2, 2022
367b128
changed debug_config.h to overworld_config.h,
TheXaman Sep 2, 2022
b4b3e84
removed default flags and added ingame warning if a function that req…
TheXaman Sep 2, 2022
13cc640
whitspace changes, removed wrong comment
TheXaman Sep 2, 2022
4017fc3
Apply style suggestions from code review
AsparagusEduardo Sep 4, 2022
1287c3d
Fixed call to ItemIdToBattleMoveId
AsparagusEduardo Sep 4, 2022
6cab795
Update include/constants/overworld_config.h
TheXaman Sep 5, 2022
0b3eddc
Update src/field_control_avatar.c
TheXaman Sep 5, 2022
57296dd
Update src/field_control_avatar.c
TheXaman Sep 5, 2022
7696a78
Update src/trainer_see.c
TheXaman Sep 5, 2022
40e3379
removed music expansion songs, added newline, removed all weekday rem…
TheXaman Sep 5, 2022
f6d111d
Update src/debug.c
TheXaman Sep 5, 2022
b249399
changed 'B_FLAG_NO_CATCHING' to be evaluated by 'GetBallThrowableStat…
TheXaman Sep 6, 2022
94995c5
fix?
TheXaman Sep 6, 2022
6062cf4
Merge branch 'master' into tx_debug_system_rhh
TheXaman Sep 6, 2022
4a6d3d1
Whitespace
AsparagusEduardo Sep 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ gStdScripts_End::
.include "data/scripts/new_game.inc"
.include "data/scripts/hall_of_fame.inc"

.include "data/scripts/debug.inc"

EventScript_WhiteOut::
call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour
goto EventScript_ResetMrBriney
Expand Down
79 changes: 79 additions & 0 deletions data/scripts/debug.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Debug_ShowFieldMessageStringVar4::
special ShowFieldMessageStringVar4
waitmessage
waitbuttonpress
releaseall
end

Debug_CheatStart::
lockall
setflag FLAG_SYS_POKEMON_GET
setflag FLAG_RESCUED_BIRCH
setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE
setflag FLAG_ADVENTURE_STARTED
clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH
setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG
setvar VAR_BIRCH_LAB_STATE, 2
setvar VAR_ROUTE101_STATE, 3
givemon SPECIES_TREECKO, 20, ITEM_NONE
givemon SPECIES_TORCHIC, 20, ITEM_NONE
givemon SPECIES_MUDKIP, 20, ITEM_NONE
setflag FLAG_SYS_POKEDEX_GET
special SetUnlockedPokedexFlags
setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH
setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 1
setflag FLAG_SYS_NATIONAL_DEX
special EnableNationalPokedex
setflag FLAG_RECEIVED_RUNNING_SHOES
setflag FLAG_SYS_B_DASH
setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes
setvar VAR_LITTLEROOT_INTRO_STATE, 7 @ 7: Told to go meet rival
setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 2 @ 2: Met Rival's Mom (and is corresponding gender)
setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender)
setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex
setflag FLAG_RECEIVED_BIKE
additem ITEM_ACRO_BIKE
setvar VAR_BRINEY_HOUSE_STATE, 1
setvar VAR_ROUTE116_STATE, 2
setflag FLAG_HIDE_ROUTE_116_MR_BRINEY
clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY
clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO
release
end

Debug_FlagsNotSetMessage::
lockall
message Debug_FlagsNotSetMessage_Text
waitmessage
waitbuttonpress
releaseall
end

Debug_FlagsNotSetMessage_Text:
.string "Feature unavailable!\n"
.string "Please define a usable flag in:\l"
.string "'include/constants/debug{UNDERSCORE}config.h'!$"
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved

Debug_Script_1::
end

Debug_Script_2::
end

Debug_Script_3::
end

Debug_Script_4::
end

Debug_Script_5::
end

Debug_Script_6::
end

Debug_Script_7::
end

Debug_Script_8::
end
2 changes: 2 additions & 0 deletions include/constants/battle_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
#define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water.
#define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles.
#define B_SMART_WILD_AI_FLAG 0 // If not 0, you can set this flag in a script to enable smart wild pokemon
#define B_FLAG_NO_BAG_USE 0 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used.
#define B_FLAG_NO_CATCHING 0 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used.
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved

// Var Settings
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.
Expand Down
1 change: 1 addition & 0 deletions include/constants/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define GUARD_CONSTANTS_GLOBAL_H

#include "constants/battle_config.h"
#include "constants/overworld_config.h"

// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.
Expand Down
14 changes: 14 additions & 0 deletions include/constants/overworld_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef GUARD_CONSTANTS_OVERWORLD_CONFIG_H
#define GUARD_CONSTANTS_OVERWORLD_CONFIG_H

// Debug options
#define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START.
#define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry).

// Replace the used flags with others or disable with a 0
#define DEBUG_FLAG_NO_COLLISION 0 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used.
#define DEBUG_FLAG_NO_ENCOUNTER 0 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used.
#define DEBUG_FLAG_NO_TRAINER_SEE 0 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used.
#define DEBUG_FLAG_PC_FROM_DEBUG_MENU 0 // If this flag is set, the debug function in debug menu to access the player PC works.

#endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H
TheXaman marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions include/constants/songs.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@
#define SE_PIKE_CURTAIN_CLOSE 267 // SE_CURTAIN
#define SE_PIKE_CURTAIN_OPEN 268 // SE_CURTAIN1
#define SE_SUDOWOODO_SHAKE 269 // SE_USSOKI
#define END_SE SE_SUDOWOODO_SHAKE

// Music
#define START_MUS 350
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13
#define MUS_CAUGHT 352 // MUS_KACHI22
Expand Down Expand Up @@ -488,6 +490,7 @@
#define MUS_RG_TRAINER_TOWER 556 // MUS_RG_T_TOWER
#define MUS_RG_SLOW_PALLET 557 // MUS_RG_SLOWMASARA
#define MUS_RG_TEACHY_TV_MENU 558 // MUS_RG_TVNOIZE
#define END_MUS MUS_RG_TEACHY_TV_MENU

#define PH_TRAP_BLEND 559
#define PH_TRAP_HELD 560
Expand Down
8 changes: 8 additions & 0 deletions include/debug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef GUARD_DEBUG_H
#define GUARD_DEBUG_H

#include "constants/overworld_config.h"

void Debug_ShowMainMenu(void);

#endif // GUARD_DEBUG_H
2 changes: 2 additions & 0 deletions include/event_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ void EnableResetRTC(void);
bool32 CanResetRTC(void);
u16 *GetVarPointer(u16 id);
u16 VarGet(u16 id);
u16 VarGetIfExist(u16 id);
bool8 VarSet(u16 id, u16 value);
u8 VarGetObjectEventGraphicsId(u8 id);
u8 *GetFlagPointer(u16 id);
u8 FlagSet(u16 id);
u8 FlagToggle(u16 id);
u8 FlagClear(u16 id);
bool8 FlagGet(u16 id);

Expand Down
1 change: 1 addition & 0 deletions include/main_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@

void CB2_InitMainMenu(void);
void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum);
void NewGameBirchSpeech_SetDefaultPlayerName(u8);

#endif // GUARD_MAIN_MENU_H
1 change: 1 addition & 0 deletions include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg);
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
void CopyMon(void *dest, void *src, size_t size);
u8 GiveMonToPlayer(struct Pokemon *mon);
u8 SendMonToPC(struct Pokemon* mon);
u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void);
u8 GetMonsStateToDoubles(void);
Expand Down
2 changes: 2 additions & 0 deletions include/pokemon_storage_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ u8 *GetWaldaPhrasePtr(void);
void SetWaldaPhrase(const u8 *src);
bool32 IsWaldaPhraseEmpty(void);

void EnterPokeStorage(u8 boxOption);

#endif // GUARD_POKEMON_STORAGE_SYSTEM_H
11 changes: 11 additions & 0 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "berry.h"
#include "bg.h"
#include "data.h"
#include "debug.h"
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved
#include "decompress.h"
#include "dma3.h"
#include "event_data.h"
Expand Down Expand Up @@ -4000,6 +4001,16 @@ static void HandleTurnActionSelectionState(void)
}
break;
case B_ACTION_USE_ITEM:
if (FlagGet(B_FLAG_NO_BAG_USE))
{
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed;
gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT;
*(gBattleStruct->selectionScriptFinished + gActiveBattler) = FALSE;
*(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_BEFORE_ACTION_CHOSEN;
return;
}

if ((gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_FRONTIER_NO_PYRAMID
| BATTLE_TYPE_EREADER_TRAINER
Expand Down
Loading