From: kub Date: Tue, 8 Jun 2021 21:11:17 +0000 (+0200) Subject: 68k, fix idle loop detection crash on 64 bit platforms X-Git-Tag: v2.00~513 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c2b81a012956c4bed3a3b076598a49a9d44dfec;p=picodrive.git 68k, fix idle loop detection crash on 64 bit platforms --- diff --git a/pico/sek.c b/pico/sek.c index bd8f70f5..ccbddb8e 100644 --- a/pico/sek.c +++ b/pico/sek.c @@ -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)