-#if 1\r
- static char dstr[1024];\r
- struct PicoVideo *pv=&Pico.video;\r
- unsigned char *reg=pv->reg, r;\r
- char *dstrp;\r
-\r
- dstrp = dstr;\r
- sprintf(dstrp, "mode set 1: %02x\n", (r=reg[0])); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "display_disable: %i, M3: %i, palette: %i, ?, hints: %i\n", bit(r,0), bit(r,1), bit(r,2), bit(r,4));\r
- dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "mode set 2: %02x\n", (r=reg[1])); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "SMS/gen: %i, pal: %i, dma: %i, vints: %i, disp: %i, TMS: %i\n", bit(r,2), bit(r,3), bit(r,4),\r
- bit(r,5), bit(r,6), bit(r,7)); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "mode set 3: %02x\n", (r=reg[0xB])); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "LSCR: %i, HSCR: %i, 2cell vscroll: %i, IE2: %i\n", bit(r,0), bit(r,1), bit(r,2), bit(r,3)); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "mode set 4: %02x\n", (r=reg[0xC])); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "interlace: %i%i, cells: %i, shadow: %i\n", bit(r,2), bit(r,1), (r&0x80) ? 40 : 32, bit(r,3));\r
- dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "scroll size: w: %i, h: %i SRAM: %i; eeprom: %i (%i)\n", reg[0x10]&3, (reg[0x10]&0x30)>>4,\r
- bit(Pico.m.sram_reg, 4), bit(Pico.m.sram_reg, 2), SRam.eeprom_type); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "sram range: %06x-%06x, reg: %02x\n", SRam.start, SRam.end, Pico.m.sram_reg); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "pend int: v:%i, h:%i, vdp status: %04x\n", bit(pv->pending_ints,5), bit(pv->pending_ints,4), pv->status);\r
- dstrp+=strlen(dstrp);\r
-#if defined(EMU_C68K)\r
- sprintf(dstrp, "M68k: PC: %06x, st_flg: %x, cycles: %u\n", SekPc, PicoCpu.state_flags, SekCyclesDoneT());\r
- dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "d0=%08x, a0=%08x, osp=%08x, irql=%i\n", PicoCpu.d[0], PicoCpu.a[0], PicoCpu.osp, PicoCpu.irq); dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "d1=%08x, a1=%08x, sr=%04x\n", PicoCpu.d[1], PicoCpu.a[1], CycloneGetSr(&PicoCpu)); dstrp+=strlen(dstrp);\r
- for(r=2; r < 8; r++) {\r
- sprintf(dstrp, "d%i=%08x, a%i=%08x\n", r, PicoCpu.d[r], r, PicoCpu.a[r]); dstrp+=strlen(dstrp);\r
- }\r
-#elif defined(EMU_M68K)\r
- sprintf(dstrp, "M68k: PC: %06x, cycles: %u, irql: %i\n", SekPc, SekCyclesDoneT(), PicoM68kCPU.int_level>>8); dstrp+=strlen(dstrp);\r
-#elif defined(EMU_F68K)\r
- sprintf(dstrp, "M68k: PC: %06x, cycles: %u, irql: %i\n", SekPc, SekCyclesDoneT(), PicoCpuM68k.interrupts[0]); dstrp+=strlen(dstrp);\r
-#endif\r
- sprintf(dstrp, "z80Run: %i, pal: %i, frame#: %i\n", Pico.m.z80Run, Pico.m.pal, Pico.m.frame_count); dstrp+=strlen(dstrp);\r
- z80_debug(dstrp); dstrp+=strlen(dstrp);\r
- if (strlen(dstr) > sizeof(dstr))\r
- printf("warning: debug buffer overflow (%i/%i)\n", strlen(dstr), sizeof(dstr));\r
-\r
-#else\r
- struct PicoVideo *pvid=&Pico.video;\r
- int table=0;\r
- int i,u,n,link=0;\r
- static char dstr[1024*8];\r
- dstr[0] = 0;\r
-\r
- table=pvid->reg[5]&0x7f;\r
- if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode\r
- table<<=8; // Get sprite table address/2\r
-\r
- for (i=u=n=0; u < 80 && n < 20; u++)\r