GBA: Add more debug checks
Vicki Pfau vi@endrift.com
Sat, 30 Dec 2017 12:49:15 -0500
1 files changed,
10 insertions(+),
0 deletions(-)
jump to
M
src/gba/gba.c
→
src/gba/gba.c
@@ -255,6 +255,11 @@ }
#endif nextEvent = cycles; do { +#ifndef NDEBUG + if (cpu->cycles) { + mLOG(GBA, FATAL, "Cycles passed inexplicably: %i", cpu->cycles); + } +#endif nextEvent = mTimingTick(&gba->timing, nextEvent); } while (gba->cpuBlocked);@@ -276,6 +281,11 @@ mLOG(GBA, FATAL, "Negative cycles will pass: %i", nextEvent);
} #endif } +#ifndef NDEBUG + if (gba->cpuBlocked) { + mLOG(GBA, FATAL, "CPU is blocked!"); + } +#endif } #ifdef USE_DEBUGGERS