From: kub Date: Thu, 11 May 2023 22:17:37 +0000 (+0000) Subject: mcd, regression fix X-Git-Tag: v2.00~229 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a55f64a5dc58592429aba776f08efd9a4e1f573;p=picodrive.git mcd, regression fix yikes... --- diff --git a/pico/cd/mcd.c b/pico/cd/mcd.c index 22838878..13ada8b7 100644 --- a/pico/cd/mcd.c +++ b/pico/cd/mcd.c @@ -322,8 +322,10 @@ void pcd_run_cpus_normal(int m68k_cycles) if (Pico_mcd->m.state_flags & (PCD_ST_M68K_POLL|PCD_ST_M68K_SLEEP)) { int s68k_left; // main CPU is polling, (wake and) run sub only - Pico_mcd->m.state_flags &= ~(PCD_ST_S68K_POLL|PCD_ST_S68K_SLEEP); - Pico_mcd->m.s68k_poll_cnt = 0; + if (Pico_mcd->m.state_flags & (PCD_ST_S68K_POLL|PCD_ST_S68K_SLEEP)) { + Pico_mcd->m.state_flags &= ~(PCD_ST_S68K_POLL|PCD_ST_S68K_SLEEP); + Pico_mcd->m.s68k_poll_cnt = 0; + } s68k_left = pcd_sync_s68k(Pico.t.m68c_aim, 1); Pico.t.m68c_cnt = Pico.t.m68c_aim; diff --git a/pico/cd/memory.c b/pico/cd/memory.c index ae764513..2fbf8816 100644 --- a/pico/cd/memory.c +++ b/pico/cd/memory.c @@ -249,7 +249,7 @@ write_comm: // Delay slave a bit to make sure master can check before slave changes. SekCycleCntS68k += 24; // Silpheed } - if ((Pico_mcd->m.s68k_poll_a ^ a) & ~1) { + if (!((Pico_mcd->m.s68k_poll_a ^ a) & ~1)) { if (Pico_mcd->m.state_flags & PCD_ST_S68K_POLL) elprintf(EL_CDPOLL, "s68k poll release, a=%02x", a); Pico_mcd->m.state_flags &= ~PCD_ST_S68K_POLL; @@ -498,7 +498,7 @@ write_comm: return; Pico_mcd->s68k_regs[a] = (u8) d; - if ((Pico_mcd->m.m68k_poll_a ^ a) & ~1) { + if (!((Pico_mcd->m.m68k_poll_a ^ a) & ~1)) { SekEndRunS68k(8); Pico_mcd->m.state_flags &= ~PCD_ST_M68K_POLL; Pico_mcd->m.m68k_poll_cnt = 0; @@ -565,7 +565,7 @@ write_comm: r[a] = d >> 8; r[a + 1] = d; - if ((Pico_mcd->m.m68k_poll_a ^ a) & ~1) { + if (!((Pico_mcd->m.m68k_poll_a ^ a) & ~1)) { SekEndRunS68k(8); Pico_mcd->m.state_flags &= ~PCD_ST_M68K_POLL; Pico_mcd->m.m68k_poll_cnt = 0;