68k, fix idle loop detection crash on 64 bit platforms

This commit is contained in:
kub 2021-06-08 23:11:17 +02:00
parent df18e715ac
commit 4c2b81a012

View file

@ -398,7 +398,7 @@ int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx)
// XXX: probably shouldn't patch RAM too
v = m68k_read16_map[pc >> M68K_MEM_SHIFT];
if (!(v & 0x80000000))
if (~v & ~((uptr)-1LL >> 1)) // MSB clear?
target = (u16 *)((v << 1) + pc);
else {
if (++idledet_bads > 128)