debug menu unified, more debug tools
[picodrive.git] / Pico / Draw.c
index d3d80ff..8635d79 100644 (file)
@@ -36,7 +36,6 @@ static int  HighCacheA[41+1];   // caches for high layers
 static int  HighCacheB[41+1];\r
 int  HighPreSpr[80*2+1]; // slightly preprocessed sprites\r
 \r
-#define MAX_LINE_SPRITES 29\r
 #define SPRL_HAVE_HI     0x80 // have hi priority sprites\r
 #define SPRL_HAVE_LO     0x40 // *lo*\r
 #define SPRL_MAY_HAVE_OP 0x20 // may have operator sprites on the line\r
@@ -1465,95 +1464,3 @@ void PicoDrawSetColorFormat(int which)
 #endif\r
 }\r
 \r
-/* debug and fun */\r
-#define GREEN1  0x0700\r
-#ifdef USE_BGR555\r
- #define YELLOW1 0x071c\r
- #define BLUE1   0xf000\r
- #define RED1    0x001e\r
-#else\r
- #define YELLOW1 0xe700\r
- #define BLUE1   0x001e\r
- #define RED1    0xf000\r
-#endif\r
-\r
-static void set16(unsigned short *p, unsigned short d, int cnt)\r
-{\r
-  while (cnt-- > 0)\r
-    *p++ = d;\r
-}\r
-\r
-void PicoDrawShowSpriteStats(unsigned short *screen, int stride)\r
-{\r
-  int lines, i, u, step;\r
-  unsigned short *dest;\r
-  unsigned char *p;\r
-\r
-  step = (320-4*4-1) / MAX_LINE_SPRITES;\r
-  lines = 240;\r
-  if (!Pico.m.pal || !(Pico.video.reg[1]&8))\r
-    lines = 224, screen += stride*8;\r
-\r
-  for (i = 0; i < lines; i++)\r
-  {\r
-    dest = screen + stride*i;\r
-    p = &HighLnSpr[i][0];\r
-\r
-    // sprite graphs\r
-    for (u = 0; u < (p[0] & 0x7f); u++) {\r
-      set16(dest, (p[3+u] & 0x80) ? YELLOW1 : GREEN1, step);\r
-      dest += step;\r
-    }\r
-\r
-    // flags\r
-    dest = screen + stride*i + 320-4*4;\r
-    if (p[1] & SPRL_HAVE_LO)     set16(dest+4*0, GREEN1,  4);\r
-    if (p[1] & SPRL_HAVE_HI)     set16(dest+4*1, YELLOW1, 4);\r
-    if (p[1] & SPRL_MAY_HAVE_OP) set16(dest+4*2, BLUE1,   4);\r
-    if (p[1] & SPRL_LO_ABOVE_HI) set16(dest+4*3, RED1,    4);\r
-  }\r
-\r
-  // draw grid\r
-  for (i = step*5; i <= 320-4*4-1; i += step*5) {\r
-    for (u = 0; u < lines; u++)\r
-      screen[i + u*stride] = 0x182;\r
-  }\r
-}\r
-\r
-void PicoDrawShowPalette(unsigned short *screen, int stride)\r
-{\r
-  unsigned int *spal=(void *)Pico.cram;\r
-  unsigned int *dpal=(void *)HighPal;\r
-  int x, y, i;\r
-\r
-  for (i = 0x3f/2; i >= 0; i--)\r
-#ifdef USE_BGR555\r
-    dpal[i] = ((spal[i]&0x000f000f)<< 1)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)<<4);\r
-#else\r
-    dpal[i] = ((spal[i]&0x000f000f)<<12)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)>>7);\r
-#endif\r
-  for (i = 0x3f; i >= 0; i--)\r
-    HighPal[0x40|i] = (unsigned short)((HighPal[i]>>1)&0x738e);\r
-  for (i = 0x3f; i >= 0; i--) {\r
-    int t=HighPal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c;\r
-    HighPal[0x80|i] = (unsigned short)t;\r
-  }\r
-\r
-  screen += 16*stride+8;\r
-  for (y = 0; y < 8*4; y++)\r
-    for (x = 0; x < 8*16; x++)\r
-      screen[x + y*stride] = HighPal[x/8 + (y/8)*16];\r
-\r
-  screen += 160;\r
-  for (y = 0; y < 8*4; y++)\r
-    for (x = 0; x < 8*16; x++)\r
-      screen[x + y*stride] = HighPal[(x/8 + (y/8)*16) | 0x40];\r
-\r
-  screen += stride*48;\r
-  for (y = 0; y < 8*4; y++)\r
-    for (x = 0; x < 8*16; x++)\r
-      screen[x + y*stride] = HighPal[(x/8 + (y/8)*16) | 0x80];\r
-\r
-  Pico.m.dirtyPal = 1;\r
-}\r
-\r