From: notaz Date: Wed, 20 Sep 2017 20:39:20 +0000 (+0300) Subject: workaround idledet breaking op test X-Git-Tag: v1.92~40 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=2b15cea82e68d32f5e926ab065ac233b89cfc200;hp=c6e1e9779a5652b58ae638e40f4b01ccb223b0d0;p=picodrive.git workaround idledet breaking op test --- diff --git a/cpu/fame/famec_opcodes.h b/cpu/fame/famec_opcodes.h index 99ba3791..3ba72751 100644 --- a/cpu/fame/famec_opcodes.h +++ b/cpu/fame/famec_opcodes.h @@ -18574,6 +18574,10 @@ RET(8) // ILLEGAL OPCODE(0x4AFC) { +#ifdef PICODRIVE_HACK + extern void SekFinishIdleDet(void); + SekFinishIdleDet(); +#endif SET_PC(execute_exception(M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR)); RET(0) } diff --git a/pico/sek.c b/pico/sek.c index 4525c7c9..8bf0341b 100644 --- a/pico/sek.c +++ b/pico/sek.c @@ -60,6 +60,8 @@ static int SekUnrecognizedOpcode() PicoCpuCM68k.state_flags |= 1; return 1; } + // happened once - may happen again + SekFinishIdleDet(); #ifdef EMU_M68K // debugging cyclone { extern int have_illegal; @@ -421,6 +423,8 @@ int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx) void SekFinishIdleDet(void) { + if (idledet_count < 0) + return; #ifdef EMU_C68K CycloneFinishIdle(); #endif @@ -439,6 +443,7 @@ void SekFinishIdleDet(void) else elprintf(EL_STATUS|EL_IDLE, "idle: don't know how to restore %04x", *op); } + idledet_count = -1; }