mirror of
https://github.com/decompals/wibo.git
synced 2025-12-16 08:27:07 +00:00
Improve logging
This commit is contained in:
12
main.cpp
12
main.cpp
@@ -9,11 +9,13 @@
|
||||
uint32_t wibo::lastError = 0;
|
||||
char *wibo::commandLine;
|
||||
wibo::Executable *wibo::mainModule = 0;
|
||||
bool wibo::debugEnabled = false;
|
||||
|
||||
void wibo::debug_log(const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vprintf(fmt, args);
|
||||
if (wibo::debugEnabled)
|
||||
vprintf(fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
@@ -24,8 +26,8 @@ static char stubFuncNames[0x100][0x100];
|
||||
static void stubBase(int index) {
|
||||
// should go through all the functions imported by mwcceppc.exe
|
||||
// and create template stubs for them, at least...
|
||||
DEBUG_LOG("Unhandled function %s (%s)\n", stubFuncNames[index], stubDlls[index]);
|
||||
exit(0);
|
||||
printf("Unhandled function %s (%s)\n", stubFuncNames[index], stubDlls[index]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void (*stubFuncs[0x100])(void) = {
|
||||
@@ -112,6 +114,10 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (getenv("WIBO_DEBUG")) {
|
||||
wibo::debugEnabled = true;
|
||||
}
|
||||
|
||||
// Create TIB
|
||||
TIB tib;
|
||||
tib.tib = &tib;
|
||||
|
||||
Reference in New Issue
Block a user