From 4985bad0fb1e3d2eb88aaf8ee0e47ec8bf750044 Mon Sep 17 00:00:00 2001 From: kub Date: Sat, 27 Apr 2024 09:53:33 +0200 Subject: [PATCH] mcd, add poll detection for gfx busy --- pico/cd/gfx.c | 4 ++++ pico/cd/memory.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pico/cd/gfx.c b/pico/cd/gfx.c index 84c4f43c..4df1c34f 100644 --- a/pico/cd/gfx.c +++ b/pico/cd/gfx.c @@ -409,6 +409,8 @@ void gfx_start(uint32 base) /* start graphics operation */ Pico_mcd->s68k_regs[0x58] = 0x80; + Pico_mcd->m.state_flags &= ~PCD_ST_S68K_POLL; + Pico_mcd->m.s68k_poll_cnt = 0; gfx_schedule(); } @@ -451,6 +453,8 @@ void gfx_update(unsigned int cycles) Pico_mcd->s68k_regs[0x64] = Pico_mcd->s68k_regs[0x65] = 0; + Pico_mcd->m.state_flags &= ~PCD_ST_S68K_POLL; + Pico_mcd->m.s68k_poll_cnt = 0; if (Pico_mcd->s68k_regs[0x33] & PCDS_IEN1) { elprintf(EL_INTS|EL_CD, "s68k: gfx_cd irq 1"); pcd_irq_s68k(1, 1); diff --git a/pico/cd/memory.c b/pico/cd/memory.c index 17abd049..d6cf1273 100644 --- a/pico/cd/memory.c +++ b/pico/cd/memory.c @@ -366,8 +366,8 @@ u32 s68k_reg_read16(u32 a) d = (Pico_mcd->s68k_regs[a]<<8) | Pico_mcd->s68k_regs[a+1]; - if (a >= 0x0e && a < 0x30) - return s68k_poll_detect(a, d); + if ((a >= 0x0e && a < 0x30) || a == 0x58) + d = s68k_poll_detect(a, d); end: return d; @@ -995,7 +995,7 @@ static u32 PicoReadS68k8_pr(u32 a) a &= 0x1ff; if (a >= 0x0e && a < 0x30) { d = Pico_mcd->s68k_regs[a]; - s68k_poll_detect(a & ~1, d); + d = s68k_poll_detect(a & ~1, d); goto regs_done; } d = s68k_reg_read16(a & ~1); -- 2.39.5