don't crash on bad timing
[picodrive.git] / pico / debug.c
index 79f201b..2370bfa 100644 (file)
@@ -1,5 +1,10 @@
-// some debug code, just for fun of it
-// (c) Copyright 2008 notaz, All rights reserved.
+/*
+ * debug stuff
+ * (C) notaz, 2006-2009
+ *
+ * This work is licensed under the terms of MAME license.
+ * See COPYING file in the top-level directory.
+ */
 
 #include "pico_int.h"
 #include "sound/ym2612.h"
@@ -56,6 +61,7 @@ char *PDebugMain(void)
 
 char *PDebug32x(void)
 {
+#ifndef NO_32X
   char *dstrp = dstr;
   unsigned short *r;
   int i;
@@ -85,6 +91,9 @@ char *PDebug32x(void)
   sprintf(dstrp, "gb,vb %08x,%08x %08x,%08x\n", sh2_gbr(0), sh2_vbr(0), sh2_gbr(1), sh2_vbr(1)); MVP;
   sprintf(dstrp, "IRQs/mask:        %02x/%02x             %02x/%02x\n",
     Pico32x.sh2irqi[0], Pico32x.sh2irq_mask[0], Pico32x.sh2irqi[1], Pico32x.sh2irq_mask[1]); MVP;
+#else
+  dstr[0] = 0;
+#endif
 
   return dstr;
 }
@@ -329,6 +338,7 @@ void PDebugDumpMem(void)
     dump_ram_noswab(Pico_mcd->bram,   "dumps/bram.bin");
   }
 
+#ifndef NO_32X
   if (PicoAHW & PAHW_32X)
   {
     dump_ram(Pico32xMem->sdram, "dumps/sdram.bin");
@@ -338,6 +348,7 @@ void PDebugDumpMem(void)
     dump_ram(Pico32xMem->data_array[0], "dumps/data_array0.bin");
     dump_ram(Pico32xMem->data_array[1], "dumps/data_array1.bin");
   }
+#endif
 }
 
 void PDebugZ80Frame(void)