diff options
author | TheXaman <48356183+TheXaman@users.noreply.github.com> | 2021-02-04 18:11:28 +0100 |
---|---|---|
committer | TheXaman <48356183+TheXaman@users.noreply.github.com> | 2021-02-04 18:11:28 +0100 |
commit | 229ba83eb4df666f7a57929f430f29ebc8207293 (patch) | |
tree | 3a0a6cdf16a5f3404136a10015e6133192e66887 | |
parent | 986ee5d4173a8415b18a6db7f9130a9e3273736a (diff) |
Updated Add a debug menu (markdown)
-rw-r--r-- | Add-a-debug-menu.md | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Add-a-debug-menu.md b/Add-a-debug-menu.md index fc6d646..ed50f81 100644 --- a/Add-a-debug-menu.md +++ b/Add-a-debug-menu.md @@ -4,7 +4,7 @@ I assume a reasonable familiarity with C, so I won't be explaining things like p ## Step 0: Add a compile flag -There's no reason to expose the debug menu to the players, so it's a good idea to keep it behind a compile flag just like Game Freak did. This is *technically* optional, since you can just tell people not to hold R when pressing Start or whatever, but it's really easy to do. If you do choose to skip it, be sure when following the remainder of the tutorial to watch out for and ignore any `#if DEBUG` and `#endif` pairs. +There's no reason to expose the debug menu to the players, so it's a good idea to keep it behind a compile flag just like Game Freak did. This is *technically* optional, since you can just tell people not to hold R when pressing Start or whatever, but it's really easy to do. If you do choose to skip it, be sure when following the remainder of the tutorial to watch out for and ignore any `#if DEBUGGING` and `#endif` pairs. Alter the `Makefile` like this. @@ -31,7 +31,7 @@ $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s ``` -From now on, when building your ROM hack *for yourself*, you'll want to run `make DDEBUG=1` (note the double D!) rather than just `make`. +From now on, when building your ROM hack *for yourself*, you'll want to run `make DDEBUGGING=1` (note the double D!) rather than just `make`. ## Step 1: Add a button combination @@ -74,7 +74,7 @@ Switch to the source file and alter the end of the function `FieldGetPlayerInput else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; -+#if DEBUG ++#if DEBUGGING + if ((heldKeys & R_BUTTON) && input->pressedStartButton) + { + input->input_field_1_2 = TRUE; @@ -92,7 +92,7 @@ Now scroll down and alter the end of the function `ProcessPlayerFieldInput` like if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; -+#if DEBUG ++#if DEBUGGING + if (input->input_field_1_2) + { + PlaySE(SE_WIN_OPEN); @@ -126,7 +126,7 @@ You're done editing Game Freak code; now you get to write some of your own. Cre ```c #ifndef GUARD_DEBUG_H #define GUARD_DEBUG_H -#if DEBUG +#if DEBUGGING void Debug_ShowMainMenu(void); @@ -137,7 +137,7 @@ void Debug_ShowMainMenu(void); Now create a source file `src/debug.c` and populate it as follows. ```c -#if DEBUG +#if DEBUGGING #include "global.h" #include "list_menu.h" @@ -449,13 +449,13 @@ Add and clone it into your repo: git remote add xaman https://github.com/TheXaman/pokeemerald/ git pull xaman tx_debug_system make clean -make DDEBUG=1 +make debugging ``` or check out the commits of the repo yourself [LINK](https://github.com/TheXaman/pokeemerald/tree/tx_debug_system). **Access ingame:** -From now one if you want the menu to show up you have to run your "make" command with the addition parameter: **DDEBUG=1** (yes 2 D's). +From now one if you want the menu to show up you have to run your "make" command with the addition parameter: **debugging** or **debugging_modern**, for example **make debugging -j8**. Those parameters already include **DINFO=1**. To access ingame press **R + Start**. @@ -471,4 +471,5 @@ Ketsuban Pyredrid AsparagusEduardo Ghoulslash +exposneed ```
\ No newline at end of file |