mcd, fix 68k interpreter idle detector for sub cpu

This commit is contained in:
kub 2022-01-06 22:19:40 +01:00
parent dfda34424a
commit 14ebd37838
2 changed files with 5 additions and 2 deletions

View file

@ -245,7 +245,7 @@ write_comm:
} }
if (Pico_mcd->m.s68k_poll_a == (a & ~1)) if (Pico_mcd->m.s68k_poll_a == (a & ~1))
{ {
if (Pico_mcd->m.s68k_poll_cnt > POLL_LIMIT) { if (SekIsStoppedS68k()) {
elprintf(EL_CDPOLL, "s68k poll release, a=%02x", a); elprintf(EL_CDPOLL, "s68k poll release, a=%02x", a);
SekSetStopS68k(0); SekSetStopS68k(0);
} }

View file

@ -404,7 +404,10 @@ int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx)
(newop&0x200)?'n':'y', is_main68k?'m':'s', idledet_count); (newop&0x200)?'n':'y', is_main68k?'m':'s', idledet_count);
// XXX: probably shouldn't patch RAM too // XXX: probably shouldn't patch RAM too
v = m68k_read16_map[pc >> M68K_MEM_SHIFT]; if (is_main68k)
v = m68k_read16_map[pc >> M68K_MEM_SHIFT];
else
v = s68k_read16_map[pc >> M68K_MEM_SHIFT];
if (~v & ~((uptr)-1LL >> 1)) // MSB clear? if (~v & ~((uptr)-1LL >> 1)) // MSB clear?
target = (u16 *)((v << 1) + pc); target = (u16 *)((v << 1) + pc);
else { else {