menu: add reset hotkey
[picodrive.git] / cpu / debug.c
index 2811b43..a464413 100644 (file)
@@ -1,6 +1,9 @@
 /*
- * vim:shiftwidth=2:expandtab
  * PDB, the PicoDrive debugger
+ * (C) notaz, 2010
+ *
+ * This work is licensed under the terms of MAME license.
+ * See COPYING file in the top-level directory.
  */
 #define _GNU_SOURCE
 #include <stdio.h>
@@ -85,6 +88,8 @@ static int pdb_net_send(struct pdb_cpu *cpu, unsigned int pc)
     packet.header.len = 4 + rl + 4*2;
     sh2->pdb_io_csum[0] = sh2->pdb_io_csum[1] = 0;
   }
+  else
+    memset(&packet, 0, sizeof(packet));
 
   ret = send(pdb_net_sock, &packet, sizeof(packet.header) + packet.header.len, MSG_NOSIGNAL);
   if (ret != sizeof(packet.header) + packet.header.len) {
@@ -188,10 +193,11 @@ enum cmd_ret_e {
 
 static int do_print(struct pdb_cpu *cpu, const char *args)
 {
-  int i;
   elprintf(EL_STATUS, "cpu %d (%s)", cpu->id, cpu->name);
+#ifndef NO_32X
   if (cpu->type == PDBCT_SH2) {
     SH2 *sh2 = cpu->context;
+    int i;
     printf("PC,SR %08x,     %03x\n", sh2->pc, sh2->sr & 0x3ff);
     for (i = 0; i < 16/2; i++)
       printf("R%d,%2d %08x,%08x\n", i, i + 8, sh2->r[i], sh2->r[i + 8]);
@@ -200,6 +206,7 @@ static int do_print(struct pdb_cpu *cpu, const char *args)
       Pico32x.sh2irq_mask[sh2->is_slave]);
     printf("cycles %d/%d (%d)\n", sh2->cycles_done, sh2->cycles_aim, (signed int)sh2->sr >> 12);
   }
+#endif
   return CMDRET_DONE;
 }
 
@@ -405,3 +412,4 @@ void pdb_cleanup(void)
   pdb_cpu_count = 0;
 }
 
+// vim:shiftwidth=2:expandtab