Skip to content

Instantly share code, notes, and snippets.

Add a debug menu to pokeemerald

During development it's common for your game to be partially complete; even if it isn't, you probably don't want to spend a whole bunch of time playing through the game to get to the bit you need to test. As such, it's useful to have a debug menu with a collection of tools defined in code to do useful things for you which you don't expose to the players. However, pokeemerald reproduces the commercial release of Pokémon Emerald, so there's no debug functionality at all. Fortunately we're programmers, so we can fix that.

I assume a reasonable familiarity with C, so I won't be explaining things like preprocessor directives, include guards, what a structure or its fields are, or the like. If you want or need to look these things up, you now know what to search for.

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,