Add DEBUG_ASSERTIONS define and enable it by default (#730)

This commit is contained in:
Gregory Heskett
2023-12-11 01:58:30 -05:00
committed by GitHub
parent 72f8ea130f
commit 4f2c48c733
3 changed files with 21 additions and 4 deletions

View File

@@ -14,6 +14,10 @@
*/
// #define DISABLE_ALL
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Enables a comprehensive standalone profiler. Automatically enabled by PUPPYPRINT_DEBUG.
* If not using PUPPYPRINT_DEBUG, press L + D-Pad Up to toggle the profiler.
@@ -85,3 +89,8 @@
* Forces a crash when the game starts. Useful for debugging the crash screen.
*/
// #define DEBUG_FORCE_CRASH_ON_BOOT
/**
* Intentionally crash the game whenever a runtime assertion fails (also invoked by the DEBUG define in the Makefile).
*/
#define DEBUG_ASSERTIONS

View File

@@ -75,21 +75,26 @@
#ifdef DISABLE_ALL
#undef DEBUG_ALL
#undef USE_PROFILER
#undef TEST_LEVEL
#undef DEBUG_LEVEL_SELECT
#undef ENABLE_DEBUG_FREE_MOVE
#undef VANILLA_DEBUG
#undef VANILLA_STYLE_CUSTOM_DEBUG
#undef PUPPYPRINT_DEBUG
#undef PUPPYPRINT_DEBUG_CYCLES
#undef VANILLA_STYLE_CUSTOM_DEBUG
#undef VISUAL_DEBUG
#undef UNLOCK_ALL
#undef COMPLETE_SAVE_FILE
#undef UNLOCK_FPS
#undef VANILLA_DEBUG
#undef DEBUG_FORCE_CRASH_ON_BOOT
#undef USE_PROFILER
#undef DEBUG_ASSERTIONS
#endif // DISABLE_ALL
#ifdef DEBUG_ALL
#undef USE_PROFILER
#define USE_PROFILER
#undef DEBUG_LEVEL_SELECT
#define DEBUG_LEVEL_SELECT
@@ -110,6 +115,9 @@
#undef COMPLETE_SAVE_FILE
#define COMPLETE_SAVE_FILE
#undef DEBUG_ASSERTIONS
#define DEBUG_ASSERTIONS
#endif // DEBUG_ALL
#ifdef PUPPYPRINT_DEBUG

View File

@@ -62,7 +62,7 @@ extern void __n64Assert(char *fileName, u32 lineNum, char *message);
/**
* Will cause a crash if cond is not true, and DEBUG is defined (allows for quick removal of littered asserts)
*/
#ifdef DEBUG
#if defined(DEBUG) || defined(DEBUG_ASSERTIONS)
#define assert(cond, message) do {\
if ((cond) == FALSE) { \
error(message); \