From 334d9fb6543169acca1969b08f78d91870f4d22c Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 23 Sep 2013 00:45:33 +0300 Subject: [PATCH] cd: fix copy-paste bug, comm issue --- pico/cd/mcd.c | 4 +++- pico/cd/memory.c | 13 +++++++------ pico/cd/memory_arm.s | 1 + platform/libpicofe | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pico/cd/mcd.c b/pico/cd/mcd.c index 6a978f8c..3f6afa57 100644 --- a/pico/cd/mcd.c +++ b/pico/cd/mcd.c @@ -345,7 +345,9 @@ void pcd_state_loaded(void) if (Pico_mcd->scd.Status_CDC & 0x08) Update_CDC_TRansfer(Pico_mcd->s68k_regs[4] & 7); } - if (Pico_mcd->pcm.update_cycles == 0) + + diff = cycles - Pico_mcd->pcm.update_cycles; + if ((unsigned int)diff > 12500000/50) Pico_mcd->pcm.update_cycles = cycles; // reschedule diff --git a/pico/cd/memory.c b/pico/cd/memory.c index 2c53b330..b0f5e4a8 100644 --- a/pico/cd/memory.c +++ b/pico/cd/memory.c @@ -222,12 +222,13 @@ write_comm: pcd_sync_s68k(SekCyclesDone(), 0); Pico_mcd->s68k_regs[a] = d; - if (Pico_mcd->m.s68k_poll_a == (a & ~1) - && Pico_mcd->m.s68k_poll_cnt > POLL_LIMIT) + if (Pico_mcd->m.s68k_poll_a == (a & ~1)) { - SekSetStopS68k(0); + if (Pico_mcd->m.s68k_poll_cnt > POLL_LIMIT) { + elprintf(EL_CDPOLL, "s68k poll release, a=%02x", a); + SekSetStopS68k(0); + } Pico_mcd->m.s68k_poll_a = 0; - elprintf(EL_CDPOLL, "s68k poll release, a=%02x", a); } } @@ -662,7 +663,7 @@ void PicoWrite8_mcd_io(u32 a, u32 d) return; } - PicoWrite16_io(a, d); + PicoWrite8_io(a, d); } void PicoWrite16_mcd_io(u32 a, u32 d) @@ -671,7 +672,7 @@ void PicoWrite16_mcd_io(u32 a, u32 d) elprintf(EL_CDREGS, "m68k_regs w16: [%02x] %04x @%06x", a & 0x3f, d, SekPc); - m68k_reg_write8(a, d >> 8); + m68k_reg_write8(a, d >> 8); if ((a & 0x3e) != 0x0e) // special case m68k_reg_write8(a + 1, d & 0xff); return; diff --git a/pico/cd/memory_arm.s b/pico/cd/memory_arm.s index b54d9959..e19c5613 100644 --- a/pico/cd/memory_arm.s +++ b/pico/cd/memory_arm.s @@ -433,6 +433,7 @@ m_s68k_read8_comm: ldr r1, [r1] add r1, r1, #0x110000 ldrb r1, [r1, r0] + bic r0, r0, #1 b s68k_poll_detect diff --git a/platform/libpicofe b/platform/libpicofe index 9028744c..18306c32 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit 9028744c193c011a7a0b1ed2e069208f57ffa2fa +Subproject commit 18306c325f0d24fc7232dff055e814432e06d5d1 -- 2.39.5