all repos — mgba @ 69d188668d45e21f71bea3f4694501b86716d628

mGBA Game Boy Advance Emulator

Fix debugging shim to work even if there is no GBA struct at the moment
Jeffrey Pfau jeffrey@endrift.com
Sat, 01 Feb 2014 16:27:27 -0800
commit

69d188668d45e21f71bea3f4694501b86716d628

parent

b9f895589012429af30b8a7f85f8f3404ec6d86d

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M src/gba/gba.csrc/gba/gba.c

@@ -536,7 +536,10 @@ va_end(args);

} void GBADebuggerLogShim(struct ARMDebugger* debugger, enum DebuggerLogLevel level, const char* format, ...) { - struct GBABoard* gbaBoard = (struct GBABoard*) debugger->cpu->board; + struct GBABoard* gbaBoard = 0; + if (debugger->cpu && debugger->cpu->board) { + gbaBoard = (struct GBABoard*) debugger->cpu->board; + } enum GBALogLevel gbaLevel; switch (level) {

@@ -555,7 +558,7 @@ break;

} va_list args; va_start(args, format); - _GBAVLog(gbaBoard->p, gbaLevel, format, args); + _GBAVLog(gbaBoard ? gbaBoard->p : 0, gbaLevel, format, args); va_end(args); }