if (((Pico.m.z80Run & 1) || Pico.m.z80_reset) && !(PicoIn.quirks & PQUIRK_NO_Z80_BUS_LOCK)) {\r
elprintf(EL_ANOMALY, "68k z80 read with no bus! [%06x] @ %06x", a, SekPc);\r
// open bus. Pulled down if MegaCD2 is attached.\r
- return 0;\r
+ return (PicoIn.AHW & PAHW_MCD ? 0 : d);\r
}\r
\r
if ((a & 0x4000) == 0x0000) {\r
d ^= d << 6;\r
\r
if ((a & 0xfc00) == 0x1000) {\r
- // bit8 seems to be readable in this range\r
- if (!(a & 1))\r
- d &= ~0x01;\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 [%u] @%06x", d, SekCyclesDone(), SekPc);\r
+ // bit8 seems to be readable in this range\r
+ if (!(a & 1)) {\r
+ d &= ~0x01;\r
+ d |= (Pico.m.z80Run | Pico.m.z80_reset) & 1;\r
+ elprintf(EL_BUSREQ, "get_zrun: %02x [%u] @%06x", d, SekCyclesDone(), SekPc);\r
+ }\r
}\r
goto end;\r
}\r
\r
// bit8 seems to be readable in this range\r
if ((a & 0xfc00) == 0x1000) {\r
- d &= ~0x0100;\r
-\r
if ((a & 0xff00) == 0x1100) { // z80 busreq\r
+ d &= ~0x0100;\r
d |= ((Pico.m.z80Run | Pico.m.z80_reset) & 1) << 8;\r
elprintf(EL_BUSREQ, "get_zrun: %04x [%u] @%06x", d, SekCyclesDone(), SekPc);\r
}\r
// TODO: verify if lower byte goes to PSG on word writes\r
u32 PicoRead8_vdp(u32 a)\r
{\r
+ u32 d = 0;\r
if ((a & 0x00f0) == 0x0000) {\r
switch (a & 0x0d)\r
{\r
- case 0x00: return PicoVideoRead8DataH(0);\r
- case 0x01: return PicoVideoRead8DataL(0);\r
- case 0x04: return PicoVideoRead8CtlH(0);\r
- case 0x05: return PicoVideoRead8CtlL(0);\r
+ case 0x00: d = PicoVideoRead8DataH(0); break;\r
+ case 0x01: d = PicoVideoRead8DataL(0); break;\r
+ case 0x04: d = PicoVideoRead8CtlH(0); break;\r
+ case 0x05: d = PicoVideoRead8CtlL(0); break;\r
case 0x08:\r
- case 0x0c: return PicoVideoRead8HV_H(0);\r
+ case 0x0c: d = PicoVideoRead8HV_H(0); break;\r
case 0x09:\r
- case 0x0d: return PicoVideoRead8HV_L(0);\r
+ case 0x0d: d = PicoVideoRead8HV_L(0); break;\r
}\r
- }\r
-\r
- elprintf(EL_UIO|EL_ANOMALY, "68k bad read [%06x] @%06x", a, SekPc);\r
- return 0;\r
+ } else\r
+ elprintf(EL_UIO|EL_ANOMALY, "68k bad read [%06x] @%06x", a, SekPc);\r
+ return d;\r
}\r
\r
static u32 PicoRead16_vdp(u32 a)\r
SekInterrupt(6);
}
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
+ // assert Z80 interrupt for one scanline even in busrq hold (Teddy Blues)
+ if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
elprintf(EL_INTS, "zint");
- z80_int();
+ z80_int_assert(1);
}
// Run scanline:
if (PicoLineHook) PicoLineHook();
pevt_log_m68k_o(EVT_NEXT_LINE);
+ if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80))
+ PicoSyncZ80(Pico.t.m68c_aim);
+ z80_int_assert(0);
+
// === VBLANK ===
lines = Pico.m.pal ? 313 : 262;
for (y++; y < lines - 1; y++)