{\r
struct PicoVideo *pvid=&Pico.video;\r
\r
- //if (Pico.m.scanline < 224)\r
- // elprintf(EL_STATUS, "PicoVideoWrite [%06x] %04x", a, d);\r
- a&=0x1c;\r
+ //elprintf(EL_STATUS, "PicoVideoWrite [%06x] %04x [%u] @ %06x",\r
+ // a, d, SekCyclesDone(), SekPc);\r
\r
+ a &= 0x1c;\r
switch (a)\r
{\r
case 0x00: // Data port 0 or 2\r
pvid->lwrite_cnt -= use;\r
if (pvid->lwrite_cnt < 0)\r
SekCyclesLeft = 0;\r
- elprintf(EL_ASVDP, "VDP data write: %04x [%06x] {%i} #%i @ %06x", d, Pico.video.addr,\r
- Pico.video.type, pvid->lwrite_cnt, SekPc);\r
+ elprintf(EL_ASVDP, "VDP data write: [%04x] %04x [%u] {%i} #%i @ %06x",\r
+ Pico.video.addr, d, SekCyclesDone(), Pico.video.type, pvid->lwrite_cnt, SekPc);\r
}\r
VideoWrite(d);\r
\r
// update IRQ level\r
if (!SekShouldInterrupt()) // hack\r
{\r
- int lines, pints, irq=0;\r
+ int lines, pints, irq = 0;\r
lines = (pvid->reg[1] & 0x20) | (pvid->reg[0] & 0x10);\r
- pints = (pvid->pending_ints&lines);\r
+ pints = pvid->pending_ints & lines;\r
if (pints & 0x20) irq = 6;\r
else if (pints & 0x10) irq = 4;\r
SekInterrupt(irq); // update line\r
\r
- if (irq) SekEndRun(24); // make it delayed\r
+ // this is broken because cost of current insn isn't known here\r
+ if (irq) SekEndRun(21); // make it delayed\r
}\r
#endif\r
}\r
\r
pv->pending = 0; // ctrl port reads clear write-pending flag (Charles MacDonald)\r
\r
- elprintf(EL_SR, "SR read: %04x @ %06x", d, SekPc);\r
+ elprintf(EL_SR, "SR read: %04x [%u] @ %06x", d, SekCyclesDone(), SekPc);\r
return d;\r
}\r
\r