diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp index fe2c727e..26e98533 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp @@ -37,6 +37,7 @@ #ifdef SHEEPSHAVER #include "main.h" +#include "prefs.h" #endif #if ENABLE_MON @@ -54,6 +55,14 @@ void powerpc_cpu::execute_illegal(uint32 opcode) { fprintf(stderr, "Illegal instruction at %08x, opcode = %08x\n", pc(), opcode); + +#ifdef SHEEPSHAVER + if (PrefsFindBool("ignoreillegal")) { + increment_pc(4); + return; + } +#endif + #if ENABLE_MON disass_ppc(stdout, pc(), opcode); diff --git a/SheepShaver/src/prefs_items.cpp b/SheepShaver/src/prefs_items.cpp index bf03be28..1d4758dc 100644 --- a/SheepShaver/src/prefs_items.cpp +++ b/SheepShaver/src/prefs_items.cpp @@ -54,6 +54,7 @@ prefs_desc common_prefs_items[] = { {"nogui", TYPE_BOOLEAN, false, "disable GUI"}, {"noclipconversion", TYPE_BOOLEAN, false, "don't convert clipboard contents"}, {"ignoresegv", TYPE_BOOLEAN, false, "ignore illegal memory accesses"}, + {"ignoreillegal", TYPE_BOOLEAN, false, "ignore illegal instructions"}, {"jit", TYPE_BOOLEAN, false, "enable JIT compiler"}, {"jit68k", TYPE_BOOLEAN, false, "enable 68k DR emulator"}, {"keyboardtype", TYPE_INT32, false, "hardware keyboard type"}, @@ -80,6 +81,7 @@ void AddPrefsDefaults(void) PrefsAddBool("nogui", false); PrefsAddBool("noclipconversion", false); PrefsAddBool("ignoresegv", false); + PrefsAddBool("ignoreillegal", false); #if USE_JIT // JIT compiler specific options @@ -89,5 +91,5 @@ void AddPrefsDefaults(void) #endif PrefsAddBool("jit68k", false); - PrefsAddInt32("keyboardtype", 5); + PrefsAddInt32("keyboardtype", 5); }