Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Macros | Enumerations | Functions | Variables
debug.c File Reference
#include <ultra64.h>
#include "sm64.h"
#include "engine/behavior_script.h"
#include "object_helpers.h"
#include "audio/external.h"
#include "print.h"
#include "engine/surface_collision.h"
#include "mario.h"
#include "game.h"
#include "main.h"
#include "debug.h"
#include "object_list_processor.h"
#include "room.h"

Macros

#define DEBUG_INFO_NOFLAGS   (0 << 0)
 
#define DEBUG_INFO_FLAG_DPRINT   (1 << 0)
 
#define DEBUG_INFO_FLAG_LSELECT   (1 << 1)
 
#define DEBUG_INFO_FLAG_ALL   0xFF
 
#define DEBUG_PAGE_MIN   DEBUG_PAGE_OBJECTINFO
 
#define DEBUG_PAGE_MAX   DEBUG_PAGE_ENEMYINFO
 

Enumerations

enum  DebugPrintStateInfo {
  DEBUG_PSTATE_DISABLED, DEBUG_PSTATE_X_CURSOR, DEBUG_PSTATE_Y_CURSOR, DEBUG_PSTATE_MIN_Y_CURSOR,
  DEBUG_PSTATE_MAX_X_CURSOR, DEBUG_PSTATE_LINE_Y_OFFSET
}
 

Functions

void Stub802C9890 (void)
 
void Stub802C98A0 (void)
 
void Stub802C98B0 (void)
 
void Stub802C98C0 (void)
 
s64 get_current_clock (void)
 
s64 get_clock_difference (UNUSED s64 arg0)
 
void set_print_state_info (s16 *printState, s16 xCursor, s16 yCursor, s16 minYCursor, s16 maxXCursor, s16 lineYOffset)
 
void print_text_array_info (s16 *printState, const char *str, s32 number)
 
void set_text_array_x_y (s32 xOffset, s32 yOffset)
 
void print_debug_bottom_up (const char *str, s32 number)
 
void print_debug_top_down_objectinfo (const char *str, s32 number)
 
void print_debug_top_down_mapinfo (const char *str, s32 number)
 
void print_debug_top_down_normal (const char *str, s32 number)
 
void print_mapinfo (void)
 
void print_checkinfo (void)
 
void print_surfaceinfo (void)
 
void print_stageinfo (void)
 
void print_string_array_info (const char **strArr)
 
void print_effectinfo (void)
 
void print_enemyinfo (void)
 
void update_debug_dpadmask (void)
 
void debug_unknown_level_select_check (void)
 
void reset_debug_objectinfo (void)
 
static void check_debug_button_seq (void)
 
static void try_change_debug_page (void)
 
static void try_modify_debug_controls (void)
 
void stub_802CA5D0 (void)
 
void try_print_debug_mario_object_info (void)
 
void try_print_debug_mario_level_info (void)
 
void try_do_mario_debug_object_spawn (void)
 
static void Unknown802CA8B4 (void)
 
void Unknown802CAA84 (s16 *enemyArr)
 

Variables

s16 gDebugPrintState1 [6]
 
s16 gDebugPrintState2 [6]
 
u8 bhvKoopaShell []
 
u8 bhvJumpingBox []
 
u8 bhvKoopaShellUnderwater []
 
const charsDebugEffectStringInfo []
 
const charsDebugEnemyStringInfo []
 
s32 sDebugInfoDPadMask = 0
 
s32 sDebugInfoDPadUpdID = 0
 
s8 sDebugLvSelectCheckFlag = FALSE
 
s8 sDebugPage = DEBUG_PAGE_MIN
 
s8 sNoExtraDebug = FALSE
 
s8 sDebugStringArrPrinted = FALSE
 
s8 sDebugSysCursor = 0
 
s8 sDebugInfoButtonSeqID = 0
 
s16 sDebugInfoButtonSeq [] = { U_CBUTTONS, L_CBUTTONS, D_CBUTTONS, R_CBUTTONS, -1 }
 

Macro Definition Documentation

◆ DEBUG_INFO_FLAG_ALL

#define DEBUG_INFO_FLAG_ALL   0xFF

◆ DEBUG_INFO_FLAG_DPRINT

#define DEBUG_INFO_FLAG_DPRINT   (1 << 0)

◆ DEBUG_INFO_FLAG_LSELECT

#define DEBUG_INFO_FLAG_LSELECT   (1 << 1)

◆ DEBUG_INFO_NOFLAGS

#define DEBUG_INFO_NOFLAGS   (0 << 0)

◆ DEBUG_PAGE_MAX

#define DEBUG_PAGE_MAX   DEBUG_PAGE_ENEMYINFO

◆ DEBUG_PAGE_MIN

#define DEBUG_PAGE_MIN   DEBUG_PAGE_OBJECTINFO

Enumeration Type Documentation

◆ DebugPrintStateInfo

Enumerator
DEBUG_PSTATE_DISABLED 
DEBUG_PSTATE_X_CURSOR 
DEBUG_PSTATE_Y_CURSOR 
DEBUG_PSTATE_MIN_Y_CURSOR 
DEBUG_PSTATE_MAX_X_CURSOR 
DEBUG_PSTATE_LINE_Y_OFFSET 

Function Documentation

◆ check_debug_button_seq()

static void check_debug_button_seq ( void  )
static

◆ debug_unknown_level_select_check()

void debug_unknown_level_select_check ( void  )

◆ get_clock_difference()

s64 get_clock_difference ( UNUSED s64  arg0)

◆ get_current_clock()

s64 get_current_clock ( void  )

◆ print_checkinfo()

void print_checkinfo ( void  )

◆ print_debug_bottom_up()

void print_debug_bottom_up ( const char str,
s32  number 
)

◆ print_debug_top_down_mapinfo()

void print_debug_top_down_mapinfo ( const char str,
s32  number 
)

◆ print_debug_top_down_normal()

void print_debug_top_down_normal ( const char str,
s32  number 
)

◆ print_debug_top_down_objectinfo()

void print_debug_top_down_objectinfo ( const char str,
s32  number 
)

◆ print_effectinfo()

void print_effectinfo ( void  )

◆ print_enemyinfo()

void print_enemyinfo ( void  )

◆ print_mapinfo()

void print_mapinfo ( void  )

Fat finger: programmer hit tab instead of space. Japanese

◆ print_stageinfo()

void print_stageinfo ( void  )

◆ print_string_array_info()

void print_string_array_info ( const char **  strArr)

◆ print_surfaceinfo()

void print_surfaceinfo ( void  )

◆ print_text_array_info()

void print_text_array_info ( s16 printState,
const char str,
s32  number 
)

◆ reset_debug_objectinfo()

void reset_debug_objectinfo ( void  )

◆ set_print_state_info()

void set_print_state_info ( s16 printState,
s16  xCursor,
s16  yCursor,
s16  minYCursor,
s16  maxXCursor,
s16  lineYOffset 
)

◆ set_text_array_x_y()

void set_text_array_x_y ( s32  xOffset,
s32  yOffset 
)

◆ Stub802C9890()

void Stub802C9890 ( void  )

◆ Stub802C98A0()

void Stub802C98A0 ( void  )

◆ Stub802C98B0()

void Stub802C98B0 ( void  )

◆ Stub802C98C0()

void Stub802C98C0 ( void  )

◆ stub_802CA5D0()

void stub_802CA5D0 ( void  )

◆ try_change_debug_page()

static void try_change_debug_page ( void  )
static

◆ try_do_mario_debug_object_spawn()

void try_do_mario_debug_object_spawn ( void  )

◆ try_modify_debug_controls()

static void try_modify_debug_controls ( void  )
static

◆ try_print_debug_mario_level_info()

void try_print_debug_mario_level_info ( void  )

◆ try_print_debug_mario_object_info()

void try_print_debug_mario_object_info ( void  )

◆ Unknown802CA8B4()

static void Unknown802CA8B4 ( void  )
static

◆ Unknown802CAA84()

void Unknown802CAA84 ( s16 enemyArr)

◆ update_debug_dpadmask()

void update_debug_dpadmask ( void  )

Variable Documentation

◆ bhvJumpingBox

u8 bhvJumpingBox[]

◆ bhvKoopaShell

u8 bhvKoopaShell[]

◆ bhvKoopaShellUnderwater

u8 bhvKoopaShellUnderwater[]

◆ gDebugPrintState1

s16 gDebugPrintState1[6]

◆ gDebugPrintState2

s16 gDebugPrintState2[6]

◆ sDebugEffectStringInfo

const char* sDebugEffectStringInfo[]
Initial value:
= {
" a0 %d", " a1 %d", " a2 %d", " a3 %d", " a4 %d", " a5 %d", " a6 %d", " a7 %d",
"A"
}

◆ sDebugEnemyStringInfo

const char* sDebugEnemyStringInfo[]
Initial value:
= {
" b0 %d", " b1 %d", " b2 %d", " b3 %d", " b4 %d", " b5 %d", " b6 %d", " b7 %d",
"B"
}

◆ sDebugInfoButtonSeq

s16 sDebugInfoButtonSeq[] = { U_CBUTTONS, L_CBUTTONS, D_CBUTTONS, R_CBUTTONS, -1 }

◆ sDebugInfoButtonSeqID

s8 sDebugInfoButtonSeqID = 0

◆ sDebugInfoDPadMask

s32 sDebugInfoDPadMask = 0

◆ sDebugInfoDPadUpdID

s32 sDebugInfoDPadUpdID = 0

◆ sDebugLvSelectCheckFlag

s8 sDebugLvSelectCheckFlag = FALSE

◆ sDebugPage

s8 sDebugPage = DEBUG_PAGE_MIN

◆ sDebugStringArrPrinted

s8 sDebugStringArrPrinted = FALSE

◆ sDebugSysCursor

s8 sDebugSysCursor = 0

◆ sNoExtraDebug

s8 sNoExtraDebug = FALSE