GBA: Add more debug checks

This commit is contained in:
Vicki Pfau 2017-12-30 12:49:15 -05:00
parent 0131a196d1
commit d0277a7125
1 changed files with 10 additions and 0 deletions

View File

@ -255,6 +255,11 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
#endif #endif
nextEvent = cycles; nextEvent = cycles;
do { do {
#ifndef NDEBUG
if (cpu->cycles) {
mLOG(GBA, FATAL, "Cycles passed inexplicably: %i", cpu->cycles);
}
#endif
nextEvent = mTimingTick(&gba->timing, nextEvent); nextEvent = mTimingTick(&gba->timing, nextEvent);
} while (gba->cpuBlocked); } while (gba->cpuBlocked);
@ -276,6 +281,11 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
} }
#endif #endif
} }
#ifndef NDEBUG
if (gba->cpuBlocked) {
mLOG(GBA, FATAL, "CPU is blocked!");
}
#endif
} }
#ifdef USE_DEBUGGERS #ifdef USE_DEBUGGERS