From: kub Date: Wed, 18 Nov 2020 23:05:22 +0000 (+0100) Subject: mcd, tentative fix for hanging X-Git-Tag: v2.00~657 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a95ce340b00ea3aec059c11d9fc2beee5ef31b5;p=picodrive.git mcd, tentative fix for hanging --- diff --git a/pico/cd/memory.c b/pico/cd/memory.c index 27925b58..e970b266 100644 --- a/pico/cd/memory.c +++ b/pico/cd/memory.c @@ -230,6 +230,13 @@ write_comm: pcd_sync_s68k(SekCyclesDone(), 0); Pico_mcd->s68k_regs[a] = d; + if (a == 0x03) { + // There are cases when master checks for successful switching of RAM to + // slave. This can produce race conditions where slave switches RAM back to + // master while master is delayed by interrupt before the check executes. + // Delay slave a bit to make sure master can check before slave changes. + SekCycleCntS68k += 24; + } if (Pico_mcd->m.s68k_poll_a == (a & ~1)) { if (Pico_mcd->m.s68k_poll_cnt > POLL_LIMIT) {