a15004_looping = 0;
if (!a15004_looping)
- elprintf(EL_SVP, "SVP r%i: [%06x] %04x @%06x", realsize, a, d, SekPc);
+ elprintf(EL_SVP, "SVP r: [%06x] %04x @%06x", a, d, SekPc);
if (a == 0xa15004 && !(d&1)) {
if (!a15004_looping)
#include "pico_int.h"
#include "sound/ym2612.h"
+#include "memory.h"
#include "debug.h"
#define bit(r, x) ((r>>x)&1)
!!(SRam.flags & SRF_ENABLED), !!(SRam.flags & SRF_EEPROM), SRam.eeprom_type); MVP;
sprintf(dstrp, "sram range: %06x-%06x, reg: %02x\n", SRam.start, SRam.end, Pico.m.sram_reg); MVP;
sprintf(dstrp, "pend int: v:%i, h:%i, vdp status: %04x\n", bit(pv->pending_ints,5), bit(pv->pending_ints,4), pv->status); MVP;
- sprintf(dstrp, "pal: %i, hw: %02x, frame#: %i, cycles: %i\n", Pico.m.pal, Pico.m.hardware, Pico.m.frame_count, SekCyclesDone()); MVP;
+ sprintf(dstrp, "pal: %i, hw: %02x, frame#: %i, cycles: %u\n", Pico.m.pal, Pico.m.hardware, Pico.m.frame_count, SekCyclesDone()); MVP;
sprintf(dstrp, "M68k: PC: %06x, SR: %04x, irql: %i\n", SekPc, SekSr, SekIrqLevel); MVP;
for (r = 0; r < 8; r++) {
sprintf(dstrp, "d%i=%08x, a%i=%08x\n", r, SekDar(r), r, SekDar(r+8)); MVP;
pvid->debug_p = olddbg;
}
-#define dump_ram(ram,fname) \
+#define dump_ram_m(ram,fname,mode) \
{ \
unsigned short *sram = (unsigned short *) ram; \
FILE *f; \
\
for (i = 0; i < sizeof(ram)/2; i++) \
sram[i] = (sram[i]<<8) | (sram[i]>>8); \
- f = fopen(fname, "wb"); \
+ f = fopen(fname, mode); \
if (f) { \
fwrite(ram, 1, sizeof(ram), f); \
fclose(f); \
sram[i] = (sram[i]<<8) | (sram[i]>>8); \
}
+#define dump_ram(ram,fname) \
+ dump_ram_m(ram,fname,"wb")
+
#define dump_ram_noswab(ram,fname) \
{ \
FILE *f; \
void PDebugDumpMem(void)
{
+#if 0
+ char buf[1 << M68K_MEM_SHIFT];
+ unsigned int a;
+ for (a = 0; ; a++) {
+ uptr v = m68k_read16_map[a];
+ if (map_flag_set(v))
+ break;
+ v <<= 1;
+ v += a << M68K_MEM_SHIFT;
+ memcpy(buf, (void *)v, sizeof(buf));
+ dump_ram_m(buf, "dumps/cart.bin", a ? "ab" : "wb");
+ }
+#endif
dump_ram_noswab(Pico.zram, "dumps/zram.bin");
dump_ram(Pico.cram, "dumps/cram.bin");
void NOINLINE ctl_write_z80busreq(u32 d)\r
{\r
d&=1; d^=1;\r
- elprintf(EL_BUSREQ, "set_zrun: %i->%i [%i] @%06x", Pico.m.z80Run, d, SekCyclesDone(), SekPc);\r
+ elprintf(EL_BUSREQ, "set_zrun: %i->%i [%u] @%06x", Pico.m.z80Run, d, SekCyclesDone(), SekPc);\r
if (d ^ Pico.m.z80Run)\r
{\r
if (d)\r
void NOINLINE ctl_write_z80reset(u32 d)\r
{\r
d&=1; d^=1;\r
- elprintf(EL_BUSREQ, "set_zreset: %i->%i [%i] @%06x", Pico.m.z80_reset, d, SekCyclesDone(), SekPc);\r
+ elprintf(EL_BUSREQ, "set_zreset: %i->%i [%u] @%06x", Pico.m.z80_reset, d, SekCyclesDone(), SekPc);\r
if (d ^ Pico.m.z80_reset)\r
{\r
if (d)\r
\r
if ((a & 0xff01) == 0x1100) { // z80 busreq (verified)\r
d |= (Pico.m.z80Run | Pico.m.z80_reset) & 1;\r
- elprintf(EL_BUSREQ, "get_zrun: %02x [%i] @%06x", d, SekCyclesDone(), SekPc);\r
+ elprintf(EL_BUSREQ, "get_zrun: %02x [%u] @%06x", d, SekCyclesDone(), SekPc);\r
}\r
goto end;\r
}\r
\r
if ((a & 0xff00) == 0x1100) { // z80 busreq\r
d |= ((Pico.m.z80Run | Pico.m.z80_reset) & 1) << 8;\r
- elprintf(EL_BUSREQ, "get_zrun: %04x [%i] @%06x", d, SekCyclesDone(), SekPc);\r
+ elprintf(EL_BUSREQ, "get_zrun: %04x [%u] @%06x", d, SekCyclesDone(), SekPc);\r
}\r
goto end;\r
}\r
static int SekIntAck(int level)\r
{\r
// try to emulate VDP's reaction to 68000 int ack\r
- if (level == 4) { Pico.video.pending_ints = 0; elprintf(EL_INTS, "hack: @ %06x [%i]", SekPc, SekCycleCnt); }\r
- else if(level == 6) { Pico.video.pending_ints &= ~0x20; elprintf(EL_INTS, "vack: @ %06x [%i]", SekPc, SekCycleCnt); }\r
+ if (level == 4) { Pico.video.pending_ints = 0; elprintf(EL_INTS, "hack: @ %06x [%u]", SekPc, SekCycleCnt); }\r
+ else if(level == 6) { Pico.video.pending_ints &= ~0x20; elprintf(EL_INTS, "vack: @ %06x [%u]", SekPc, SekCycleCnt); }\r
PicoCpuCM68k.irq = 0;\r
return CYCLONE_INT_ACK_AUTOVECTOR;\r
}\r
#ifdef EMU_M68K\r
static int SekIntAckM68K(int level)\r
{\r
- if (level == 4) { Pico.video.pending_ints = 0; elprintf(EL_INTS, "hack: @ %06x [%i]", SekPc, SekCycleCnt); }\r
- else if(level == 6) { Pico.video.pending_ints &= ~0x20; elprintf(EL_INTS, "vack: @ %06x [%i]", SekPc, SekCycleCnt); }\r
+ if (level == 4) { Pico.video.pending_ints = 0; elprintf(EL_INTS, "hack: @ %06x [%u]", SekPc, SekCycleCnt); }\r
+ else if(level == 6) { Pico.video.pending_ints &= ~0x20; elprintf(EL_INTS, "vack: @ %06x [%u]", SekPc, SekCycleCnt); }\r
CPU_INT_LEVEL = 0;\r
return M68K_INT_ACK_AUTOVECTOR;\r
}\r
{\r
if (level == 4) {\r
Pico.video.pending_ints = 0;\r
- elprintf(EL_INTS, "hack: @ %06x [%i]", SekPc, SekCyclesDone());\r
+ elprintf(EL_INTS, "hack: @ %06x [%u]", SekPc, SekCyclesDone());\r
}\r
else if(level == 6) {\r
Pico.video.pending_ints &= ~0x20;\r
- elprintf(EL_INTS, "vack: @ %06x [%i]", SekPc, SekCyclesDone());\r
+ elprintf(EL_INTS, "vack: @ %06x [%u]", SekPc, SekCyclesDone());\r
}\r
PicoCpuFM68k.interrupts[0] = 0;\r
}\r
unsigned char *vr = (unsigned char *) Pico.vram;\r
unsigned char inc=Pico.video.reg[0xf];\r
int source;\r
- elprintf(EL_VDPDMA, "DmaCopy len %i [%i]", len, SekCyclesDone());\r
+ elprintf(EL_VDPDMA, "DmaCopy len %i [%u]", len, SekCyclesDone());\r
\r
Pico.m.dma_xfers += len;\r
if (Pico.m.dma_xfers < len)\r
int len, l;\r
\r
len = GetDmaLength();\r
- elprintf(EL_VDPDMA, "DmaFill len %i inc %i [%i]", len, inc, SekCyclesDone());\r
+ elprintf(EL_VDPDMA, "DmaFill len %i inc %i [%u]", len, inc, SekCyclesDone());\r
\r
Pico.m.dma_xfers += len;\r
if (Pico.m.dma_xfers < len) // lame 16bit var\r
switch (num)\r
{\r
case 0x00:\r
- elprintf(EL_INTSW, "hint_onoff: %i->%i [%i] pend=%i @ %06x", (dold&0x10)>>4,\r
+ elprintf(EL_INTSW, "hint_onoff: %i->%i [%u] pend=%i @ %06x", (dold&0x10)>>4,\r
(d&0x10)>>4, SekCyclesDone(), (pvid->pending_ints&0x10)>>4, SekPc);\r
goto update_irq;\r
case 0x01:\r
- elprintf(EL_INTSW, "vint_onoff: %i->%i [%i] pend=%i @ %06x", (dold&0x20)>>5,\r
+ elprintf(EL_INTSW, "vint_onoff: %i->%i [%u] pend=%i @ %06x", (dold&0x20)>>5,\r
(d&0x20)>>5, SekCyclesDone(), (pvid->pending_ints&0x20)>>5, SekPc);\r
goto update_irq;\r
case 0x05:\r
d = hcounts_40[d];\r
else d = hcounts_32[d];\r
\r
- elprintf(EL_HVCNT, "hv: %02x %02x (%i) @ %06x", d, Pico.video.v_counter, SekCyclesDone(), SekPc);\r
+ elprintf(EL_HVCNT, "hv: %02x %02x [%u] @ %06x", d, Pico.video.v_counter, SekCyclesDone(), SekPc);\r
return d | (Pico.video.v_counter << 8);\r
}\r
\r
\r
unsigned char PicoVideoRead8HV_H(void)\r
{\r
- elprintf(EL_HVCNT, "vcounter: %02x (%i) @ %06x", Pico.video.v_counter, SekCyclesDone(), SekPc);\r
+ elprintf(EL_HVCNT, "vcounter: %02x [%u] @ %06x", Pico.video.v_counter, SekCyclesDone(), SekPc);\r
return Pico.video.v_counter;\r
}\r
\r
if (Pico.video.reg[12]&1)\r
d = hcounts_40[d];\r
else d = hcounts_32[d];\r
- elprintf(EL_HVCNT, "hcounter: %02x (%i) @ %06x", d, SekCyclesDone(), SekPc);\r
+ elprintf(EL_HVCNT, "hcounter: %02x [%u] @ %06x", d, SekCyclesDone(), SekPc);\r
return d;\r
}\r
\r