Permalink
Browse files

GBA: Add more debug checks

  • Loading branch information...
endrift committed Dec 30, 2017
1 parent 0131a19 commit d0277a7125981d4dbe3f2f74b0367dbb4e0b21c7
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/gba/gba.c
View
@@ -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

0 comments on commit d0277a7

Please sign in to comment.