From 0ab4cab877f45833fd5f17199879ad1ca4cf92df Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Sat, 12 Jun 2021 15:36:15 +0200 Subject: Updated Add a debug menu (markdown) --- Add-a-debug-menu.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Add-a-debug-menu.md b/Add-a-debug-menu.md index ed50f81..fc403bc 100644 --- a/Add-a-debug-menu.md +++ b/Add-a-debug-menu.md @@ -121,7 +121,24 @@ If you search you'll find that there is no `debug.h` in the `pokeemerald` codeba ## Step 2: Add the menu itself -You're done editing Game Freak code; now you get to write some of your own. Create a header file `include/debug.h` and populate it as follows. +You're done editing Game Freak code; now you get to write some of your own. Before we create the new files, we have to add them to the `ld_script.txt`, first one around line 102: +```diff +src/util.o(.text); +src/daycare.o(.text); ++src/debug.o(.text); +src/egg_hatch.o(.text); +src/battle_interface.o(.text); +``` +Second one in `ld_script.txt` around line 486: +```diff +src/util.o(.rodata); +src/daycare.o(.rodata); ++src/debug.o(.rodata); +src/egg_hatch.o(.rodata); +src/battle_gfx_sfx_util.o(.rodata); +``` + +Now create a header file `include/debug.h` and populate it as follows. ```c #ifndef GUARD_DEBUG_H -- cgit v1.2.3