diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index ef0041402..9994ca000 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -1233,6 +1233,18 @@ void Processor( \ + instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + +#define PerformSpecific(x) \ + InstructionSet::M68k::perform< \ + InstructionSet::M68k::Model::M68000, \ + ProcessorBase, \ + InstructionSet::M68k::Operation::x \ + >( \ + instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + // // Various generic forms of perform. // @@ -1241,21 +1253,18 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); Prefetch(); // np MoveToWritePhase(); BeginState(Perform_np_n): - InstructionSet::M68k::perform( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); Prefetch(); // np IdleBus(1); // n MoveToWritePhase(); BeginState(Perform_np_nn): - InstructionSet::M68k::perform( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); Prefetch(); // np IdleBus(2); // nn MoveToWritePhase(); @@ -1308,8 +1317,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); SetupDataAccess(0, select_flag_); Access(operand_[1].low); // nw @@ -1334,8 +1342,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); SetupDataAccess(0, Microcycle::SelectWord); @@ -1353,12 +1360,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformSpecific(CHK); // Proper next state will have been set by the flow controller // call-in; just allow dispatch to whatever it was. @@ -1385,12 +1387,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformSpecific(Scc); // Next state will be set by did_scc. break; @@ -1408,15 +1405,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); - - // Just do the write-back here. + PerformSpecific(DBcc); registers_[instruction_.reg(0)].w = operand_[0].w; // Next state was set by complete_dbcc. @@ -1452,18 +1441,14 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformSpecific(Bccb); // Next state was set by complete_bcc. break; BeginState(Bcc_w): operand_[0].w = prefetch_.w; - - InstructionSet::M68k::perform( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformSpecific(Bccw); // Next state was set by complete_bcc. break; @@ -1508,8 +1493,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); Prefetch(); // np Prefetch(); // np @@ -1540,8 +1524,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); Prefetch(); IdleBus(1 + dynamic_instruction_length_); @@ -1549,12 +1532,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformSpecific(BCLR); Prefetch(); IdleBus(2 + dynamic_instruction_length_); @@ -1653,8 +1631,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); // Recede the program counter and prefetch twice. program_counter_.l -= 2; @@ -1860,8 +1837,7 @@ void Processor( - instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + PerformDynamic(); // Delay the correct amount of time. IdleBus(dynamic_instruction_length_); @@ -1893,6 +1869,8 @@ void Processor