Skip to content
tomas edited this page Aug 4, 2023 · 6 revisions

Debug mode

A couple more gEnableDebugMode conditions are unknown.

Set #define DEBUG_MODE FALSE to TRUE.

Set D_8018EDEF to 2 to open the start screen debug menu (it allows choosing a specific course).

Hotkeys

  • Press start to skip through menus
  • Toggle resource meters by holding R and tapping B. L must not be held.
  • Reset to start screen by holding A, B, R, and R.
  • View player direction and currentPathPoint in a single player race during staging tap L while holding A and B.
    • Turn off this UI by tapping R while holding A and B.
    • @bug This looks like it should work at any point in the race.
  • Set player 1 to the final lap by tapping D-pad up.
  • Set player 1 and player 2 to the final lap by tapping D-pad right.
  • Set player all players to the final lap by tapping D-pad down.
  • Immediately start the race if any controller presses Z.
  • As the ceremony cutscene starts hold a C or D-pad to switch characters.
    • C UP = LUIGI
    • C LEFT = YOSHI
    • C RIGHT = TOAD
    • C DOWN = DK
    • D-pad UP = WARIO
    • D-pad LEFT = PEACH
    • D-pad RIGHT = BOWSER
    • D-pad DOWN = MARIO

Debug Folder

The debug folder src/debug consists of debug code not present in the actual game.

How too

To utilize debug code, some steps are needed.

  • Make sure you run make clean to recompile the game with the added changes.
  • In include/debug.h set the appropriate macro described in the next section to 1.
  • Edit the appropriate variable in the #if block, in src/debug/debug.inc.c described in the next section
  • Set the makefile variable DEBUG to 1 make DEBUG=1, this will automatically set COMPARE to 0
  • Then compile the code.

Debug Code

Debug Variable Display List DVDL

The DVDL is a display list that display variables at all times during run time except for load times.

To enable it set the DVDL macro in include/debug.h to 1.

In src/debug/debug.inc.c edit the following structure array gMainVariableWatchList.

{
	"Global Timer: ",
	&gGlobalTimer,
	sizeof(gGlobalTimer), 
	DISPLAY_DECIMAL_NUMBER | DISPLAY_SIGNED_NUMBER,
	0, 0
},

The "Global Timer: " string is the name of the variable. It will be displayed behind the variable.

The &gGlobalTimer pointer cast is a pointer to the variable. It updates on the screen every vblank.

The sizeof(gGlobalTimer) decimal number is the size of the variable.

The DISPLAY_DECIMAL_NUMBER | DISPLAY_SIGNED_NUMBER flags effect how the variable is displayed. The flags macros can be found in include/debug.h, moreover if a invalid flag or flag combination is given NaN will be displayed instead of the variable.

The last two zeros should not be modified.

Clone this wiki locally