void m68k_comm_check(u32 a)\r
{\r
pcd_sync_s68k(SekCyclesDone(), 0);\r
+ if (a >= 0x0e && !Pico_mcd->m.need_sync) {\r
+ // there are cases when slave updates comm and only switches RAM\r
+ // over after that (mcd1b), so there must be a resync..\r
+ SekEndRun(64);\r
+ Pico_mcd->m.need_sync = 1;\r
+ }\r
if (SekNotPolling || a != Pico_mcd->m.m68k_poll_a) {\r
Pico_mcd->m.m68k_poll_a = a;\r
Pico_mcd->m.m68k_poll_cnt = 0;\r
elprintf(EL_CDREGS|EL_CD, "s68k irq mask: %02x", d);\r
d &= 0x7e;\r
if ((d ^ Pico_mcd->s68k_regs[0x33]) & d & PCDS_IEN4) {\r
- if (Pico_mcd->s68k_regs[0x37] & 4)\r
- CDD_Export_Status();\r
+ // XXX: emulate pending irq instead?\r
+ if (Pico_mcd->s68k_regs[0x37] & 4) {\r
+ elprintf(EL_INTS, "cdd export irq 4 (unmask)");\r
+ SekInterruptS68k(4);\r
+ }\r
}\r
break;\r
case 0x34: // fader\r
return; // d/m bit is unsetable\r
case 0x37: {\r
u32 d_old = Pico_mcd->s68k_regs[0x37];\r
- Pico_mcd->s68k_regs[0x37] = d&7;\r
+ Pico_mcd->s68k_regs[0x37] = d & 7;\r
if ((d&4) && !(d_old&4)) {\r
- CDD_Export_Status();\r
+ // ??\r
+ pcd_event_schedule_s68k(PCD_EVENT_CDC, 12500000/75);\r
+\r
+ if (Pico_mcd->s68k_regs[0x33] & PCDS_IEN4) {\r
+ elprintf(EL_INTS, "cdd export irq 4");\r
+ SekInterruptS68k(4);\r
+ }\r
}\r
return;\r
}\r
case 0x4b:\r
- Pico_mcd->s68k_regs[a] = (u8) d;\r
- CDD_Import_Command();\r
+ Pico_mcd->s68k_regs[a] = 0; // (u8) d; ?\r
+ cdd_process();\r
+ {\r
+ static const char *nm[] =\r
+ { "stat", "stop", "read_toc", "play",\r
+ "seek", "???", "pause", "resume",\r
+ "ff", "fr", "tjump", "???",\r
+ "close","open", "???", "???" };\r
+ u8 *c = &Pico_mcd->s68k_regs[0x42];\r
+ u8 *s = &Pico_mcd->s68k_regs[0x38];\r
+ elprintf(EL_CD,\r
+ "CDD command: %02x %02x %02x %02x %02x %02x %02x %02x %12s",\r
+ c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], nm[c[0] & 0x0f]);\r
+ elprintf(EL_CD,\r
+ "CDD status: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",\r
+ s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9]);\r
+ }\r
return;\r
case 0x58:\r
return;\r