From: kub Date: Mon, 17 May 2021 21:13:27 +0000 (+0200) Subject: mcd, optimizations for polling detection X-Git-Tag: v2.00~527 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efaa5e0b0446e52356b0ca8692a174e11d4a9cd6;p=picodrive.git mcd, optimizations for polling detection --- diff --git a/pico/cd/mcd.c b/pico/cd/mcd.c index 602b6eb4..732a4299 100644 --- a/pico/cd/mcd.c +++ b/pico/cd/mcd.c @@ -342,7 +342,7 @@ void pcd_run_cpus_normal(int m68k_cycles) Pico_mcd->m.m68k_poll_cnt = 0; #ifdef USE_POLL_DETECT - if (Pico_mcd->m.m68k_poll_cnt >= 32) { + if (Pico_mcd->m.m68k_poll_cnt >= 16) { int s68k_left; // main CPU is polling, (wake and) run sub only if (SekIsStoppedS68k()) diff --git a/pico/cd/memory.c b/pico/cd/memory.c index a47d6a37..05ee3e13 100644 --- a/pico/cd/memory.c +++ b/pico/cd/memory.c @@ -63,7 +63,7 @@ static void remap_prg_window(u32 r1, u32 r3); static void remap_word_ram(u32 r3); // poller detection -#define POLL_LIMIT 32 +#define POLL_LIMIT 16 #define POLL_CYCLES 64 void m68k_comm_check(u32 a) @@ -78,13 +78,15 @@ void m68k_comm_check(u32 a) Pico_mcd->m.need_sync = 1; } Pico_mcd->m.m68k_poll_clk = cycles; - if (SekNotPolling || a != Pico_mcd->m.m68k_poll_a || clkdiff > POLL_CYCLES) { + if (SekNotPolling || a != Pico_mcd->m.m68k_poll_a || clkdiff > POLL_CYCLES || clkdiff <= 16) { Pico_mcd->m.m68k_poll_a = a; Pico_mcd->m.m68k_poll_cnt = 0; SekNotPolling = 0; return; } Pico_mcd->m.m68k_poll_cnt++; + if(Pico_mcd->m.m68k_poll_cnt == POLL_LIMIT) + SekEndRun(0); } #ifndef _ASM_CD_MEMORY_C