diff options
| author | Jcw87 <Jcw87@users.noreply.github.com> | 2026-01-18 17:59:57 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-18 17:59:57 -0800 |
| commit | 87a3705039533b309a04baaaa0f99010b5d71c00 (patch) | |
| tree | 2dc2beb45a2b7b6a1738126a0c11c966c66a535c /src/m_Do/m_Do_printf.cpp | |
| parent | 52a1e1363a4b91bc49f7994a553d16b90d969619 (diff) | |
m_Do debug (#3052)
* m_Do debug
* m_Do wii data
Diffstat (limited to 'src/m_Do/m_Do_printf.cpp')
| -rw-r--r-- | src/m_Do/m_Do_printf.cpp | 84 |
1 files changed, 45 insertions, 39 deletions
diff --git a/src/m_Do/m_Do_printf.cpp b/src/m_Do/m_Do_printf.cpp index 1cca26b3a1..154d54c737 100644 --- a/src/m_Do/m_Do_printf.cpp +++ b/src/m_Do/m_Do_printf.cpp @@ -214,57 +214,63 @@ void OSReport_FatalError(const char* fmt, ...) { void OSReport_Error(const char* fmt, ...) { print_errors++; - if (!__OSReport_Error_disable) { - #if DEBUG - OSThread* thread = mDoExt_GetCurrentRunningThread(); - if (thread != NULL) { - OSLockMutex(&print_mutex); - } - #endif + if (__OSReport_Error_disable) { + return; + } - va_list args; - va_start(args, fmt); - OSReportForceEnableOn(); - my_PutString("\x1B[41;37m[ERROR]"); - OSVReport(fmt, args); - my_PutString("\x1B[m"); - OSReportForceEnableOff(); - fflush(stdout); - va_end(args); + #if DEBUG + OSThread* thread = mDoExt_GetCurrentRunningThread(); + if (thread != NULL) { + OSLockMutex(&print_mutex); + } + #endif - #if DEBUG - if (thread != NULL) { - OSUnlockMutex(&print_mutex); - } - #endif + va_list args; + va_start(args, fmt); + OSReportForceEnableOn(); + my_PutString("\x1B[41;37m[ERROR]"); + OSVReport(fmt, args); + my_PutString("\x1B[m"); + OSReportForceEnableOff(); + fflush(stdout); + va_end(args); + + #if DEBUG + if (thread != NULL) { + OSUnlockMutex(&print_mutex); } + #endif } void OSReport_Warning(const char* fmt, ...) { print_warings++; - if (!__OSReport_Warning_disable) { - va_list args; - va_start(args, fmt); - OSReportForceEnableOn(); - my_PutString("\x1B[43;30m[WARN]"); - OSVAttention(fmt, args); - my_PutString("\x1B[m"); - OSReportForceEnableOff(); - fflush(stdout); - va_end(args); + if (__OSReport_Warning_disable) { + return; } + + va_list args; + va_start(args, fmt); + OSReportForceEnableOn(); + my_PutString("\x1B[43;30m[WARN]"); + OSVAttention(fmt, args); + my_PutString("\x1B[m"); + OSReportForceEnableOff(); + fflush(stdout); + va_end(args); } void OSReport_System(const char* fmt, ...) { print_systems++; - if (!__OSReport_System_disable) { - va_list args; - va_start(args, fmt); - OSReportForceEnableOn(); - OSVAttention(fmt, args); - OSReportForceEnableOff(); - va_end(args); + if (__OSReport_System_disable) { + return; } + + va_list args; + va_start(args, fmt); + OSReportForceEnableOn(); + OSVAttention(fmt, args); + OSReportForceEnableOff(); + va_end(args); } void OSPanic(const char* file, int line, const char* fmt, ...) { @@ -286,6 +292,6 @@ void OSPanic(const char* file, int line, const char* fmt, ...) { // force a crash by writing to an invalid address tmp = (u32*)0x1234567; - *tmp = 0x1234567; + *tmp = (uintptr_t)tmp; PPCHalt(); } |
