From d0277a7125981d4dbe3f2f74b0367dbb4e0b21c7 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 30 Dec 2017 12:49:15 -0500 Subject: [PATCH] GBA: Add more debug checks --- src/gba/gba.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gba/gba.c b/src/gba/gba.c index dd65f4ef2..f19c2588c 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -255,6 +255,11 @@ static void GBAProcessEvents(struct ARMCore* cpu) { #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 @@ static void GBAProcessEvents(struct ARMCore* cpu) { } #endif } +#ifndef NDEBUG + if (gba->cpuBlocked) { + mLOG(GBA, FATAL, "CPU is blocked!"); + } +#endif } #ifdef USE_DEBUGGERS