UIQ3 bugfixes, SVP drc indirect jumps, stuff
[picodrive.git] / Pico / Debug.c
index 3783ac5..b2efa4d 100644 (file)
@@ -53,7 +53,7 @@ char *PDebugMain(void)
   sprintf(dstrp, "z80Run: %i, z80_reset: %i, z80_bnk: %06x\n", Pico.m.z80Run, Pico.m.z80_reset, Pico.m.z80_bank68k<<15); MVP;
   z80_debug(dstrp); MVP;
   if (strlen(dstr) > sizeof(dstr))
-    printf("warning: debug buffer overflow (%i/%i)\n", strlen(dstr), sizeof(dstr));
+    elprintf(EL_STATUS, "warning: debug buffer overflow (%i/%i)\n", strlen(dstr), sizeof(dstr));
 
   return dstr;
 }
@@ -219,9 +219,9 @@ void PDebugShowSprite(unsigned short *screen, int stride, int which)
     sprite=(int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite
 
     link=(sprite[0]>>16)&0x7f;
-    if(!link) return; // End of sprites
+    if (!link) break; // End of sprites
   }
-  if (u == max_sprites) return;
+  if (u >= max_sprites) return;
 
   fsprite = (int *)(Pico.vram+(table&0x7ffc));
   oldsprite[0] = fsprite[0];
@@ -239,7 +239,7 @@ void PDebugShowSprite(unsigned short *screen, int stride, int which)
   {
     unsigned char *ps = PicoDraw2FB + DRAW2_LINE_WIDTH*y + 8;
     for (x = 0; x < 8*4; x++)
-      if (ps[x]) screen[x] = HighPal[ps[x]];
+      if (ps[x]) screen[x] = HighPal[ps[x]], ps[x] = 0;
     screen += stride;
   }