Skip to content

How to use the DebugMenu

tustin2121 edited this page Apr 29, 2019 · 1 revision

TriHard Emerald has a debug menu built into the code. There's a tool called debugmenu in the tools folder which allows easy access to it. Here's how to use the tool.

Prerequisites

The debugmenu is written in node.js. In order to use the tool, the latest or LTS version of node.js must be installed on your system. In your favorite kind of terminal window, navigate to the trihard-emerald/tools/debugmenu/ folder and run the following:

npm install

This will download some required packages. If it says anything about npm audit, don't worry about it too much; the install also checks for vulnerabilities which we shouldn't need to worry about as it's running locally. Once it's installed, simply run the program with the following:

npm start

You should soon see a window appear that looks like an in-game menu, asking you how to connect. If you attempt to connect to a game that's not TriHard Emerald, it'll know and alert you because the bit of memory it's expecting to read isn't present.

Using BizHawk

If you are on a computer which can use M4's modified version of BizHawk which includes the BizHawk API, then simply click the menu option for connecting to BizHawk. It should connect immediately if you have the trihard emerald ROM loaded.

Using mGBA

If you are using mGBA because BizHawk is not available, then there's a couple extra steps.

First, make sure you have the trihard emerald ROM loaded and running. Then go to Tools > Start GDB server.... A window will appear asking for a local port and bind address. Do not change anything here, the default port of 2345 is what the debugmenu looks for. Click the start button to start the gdb server, and ensure the game is still running.

Now start the debugmenu tool if you haven't already. Click the menu item for connecting to mGBA.

If it works, the menu will change to show the debug options. If it doesn't work first try, try pausing and unpausing the mGBA emulator. It seemed to be very finicky, but once it's connected, it works fine.

Clone this wiki locally