X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2FMemory.c;h=fc25081eb58296ac577a0757fb00453233001b0b;hb=89fa852dce08d9aab0f19458a4afa246e9839e9e;hp=fdbf3166f62363d91f5a8ee9944de609f91afb1a;hpb=7a1f6e45c9f6a11152f62303b0203475a9fd431a;p=picodrive.git diff --git a/Pico/cd/Memory.c b/Pico/cd/Memory.c index fdbf316..fc25081 100644 --- a/Pico/cd/Memory.c +++ b/Pico/cd/Memory.c @@ -34,7 +34,6 @@ typedef unsigned int u32; // ----------------------------------------------------------------- // poller detection -#define USE_POLL_DETECT #define POLL_LIMIT 16 #define POLL_CYCLES 124 // int m68k_poll_addr, m68k_poll_cnt; @@ -53,7 +52,7 @@ static u32 m68k_reg_read16(u32 a) goto end; case 2: d = (Pico_mcd->s68k_regs[a]<<8) | (Pico_mcd->s68k_regs[a+1]&0xc7); - dprintf("m68k_regs r3: %02x @%06x", (u8)d, SekPcS68k); + dprintf("m68k_regs r3: %02x @%06x", (u8)d, SekPc); goto end; case 4: d = Pico_mcd->s68k_regs[4]<<8; @@ -129,7 +128,14 @@ void m68k_reg_write8(u32 a, u32 d) d ^= 2; // writing 0 to DMNA actually sets it, 1 does nothing } else { //dold &= ~2; // ?? +#if 1 + if ((d & 2) && !(dold & 2)) { + Pico_mcd->m.state_flags |= 2; // we must delay setting DMNA bit (needed for Silpheed) + d &= ~2; + } +#else if (d & 2) dold &= ~1; // return word RAM to s68k in 2M mode +#endif } Pico_mcd->s68k_regs[3] = d | dold; // really use s68k side register #ifdef USE_POLL_DETECT @@ -273,7 +279,7 @@ void s68k_reg_write8(u32 a, u32 d) return; // only m68k can change WP case 3: { int dold = Pico_mcd->s68k_regs[3]; - dprintf("s68k_regs w3: %02x @%06x", (u8)d, SekPc); + dprintf("s68k_regs w3: %02x @%06x", (u8)d, SekPcS68k); d &= 0x1d; d |= dold&0xc2; if (d&4) {