From 786200f8da23250fb30239e291bd03988ef78fef Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 6 Jun 2016 18:46:29 +0300 Subject: [PATCH] Fixed 68060 unimplemented instruction enable/disable. --- newcpu.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/newcpu.cpp b/newcpu.cpp index 4f9ffa5e..c017c445 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -1354,12 +1354,18 @@ static void build_cpufunctbl (void) /* unimplemented opcode? */ if (table->unimpclev > 0 && lvl >= table->unimpclev) { if (currprefs.cpu_model == 68060) { - // unimpclev == 5: not implemented in 68060. + // remove unimplemented integer instructions + // unimpclev == 5: not implemented in 68060, + // generates unimplemented instruction exception. if (currprefs.int_no_unimplemented && table->unimpclev == 5) { cpufunctbl[opcode] = op_unimpl_1; continue; } - if (!currprefs.int_no_unimplemented || table->unimpclev != 5) { + // remove unimplemented instruction that were removed in previous models, + // generates normal illegal instruction exception. + // unimplclev < 5: instruction was removed in 68040 or previous model. + // clev=4: implemented in 68040 or later. unimpclev=5: not in 68060 + if (table->unimpclev < 5 || (table->clev == 4 && table->unimpclev == 5)) { cpufunctbl[opcode] = op_illg_1; continue; } -- 2.47.3