all repos — mgba @ d0277a7125981d4dbe3f2f74b0367dbb4e0b21c7

mGBA Game Boy Advance Emulator

GBA: Add more debug checks
Vicki Pfau vi@endrift.com
Sat, 30 Dec 2017 12:49:15 -0500
commit

d0277a7125981d4dbe3f2f74b0367dbb4e0b21c7

parent

0131a196d17494abcabf22dd6d07f6c582b6d806

1 files changed, 10 insertions(+), 0 deletions(-)

jump to
M src/gba/gba.csrc/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