diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index d646ff4ac..a79f4c5e3 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -258,9 +258,12 @@ void Processor(); \ + operand_flags_ = InstructionSet::M68k::operand_flags(); + +#define StdCASE(x, y) \ + CASE(x) \ y; \ \ if constexpr (InstructionSet::M68k::operand_size() == InstructionSet::M68k::DataSize::LongWord) { \ @@ -276,7 +279,7 @@ void Processor> 12].l : \ + int16_t(registers_[prefetch_.w >> 12].w)) + \ + int8_t(prefetch_.b); + + // + // AddressRegisterIndirectWithIndex8bitDisplacement + // + BeginState(FetchAddressRegisterIndirectWithIndex8bitDisplacement_bw): + effective_address_[next_operand_] = d8Xn(registers_[8 + instruction_.reg(next_operand_)].l); + SetDataAddress(effective_address_[next_operand_]); + + IdleBus(1); // n + Prefetch(); // np + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_bw); + + BeginState(FetchAddressRegisterIndirectWithIndex8bitDisplacement_l): + effective_address_[next_operand_] = d8Xn(registers_[8 + instruction_.reg(next_operand_)].l); + SetDataAddress(effective_address_[next_operand_]); + + IdleBus(1); // n + Prefetch(); // np + Access(operand_[next_operand_].high); // nR + effective_address_[next_operand_] += 2; + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_l); + + // + // ProgramCounterIndirectWithIndex8bitDisplacement + // + BeginState(FetchProgramCounterIndirectWithIndex8bitDisplacement_bw): + effective_address_[next_operand_] = d8Xn(instruction_address_ + 2); + SetDataAddress(effective_address_[next_operand_]); + + IdleBus(1); // n + Prefetch(); // np + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_bw); + + BeginState(FetchProgramCounterIndirectWithIndex8bitDisplacement_l): + effective_address_[next_operand_] = d8Xn(instruction_address_ + 2);; + SetDataAddress(effective_address_[next_operand_]); + + IdleBus(1); // n + Prefetch(); // np + Access(operand_[next_operand_].high); // nR + effective_address_[next_operand_] += 2; + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_l); + +#undef d8Xn + + // + // AbsoluteShort + // + BeginState(FetchAbsoluteShort_bw): + effective_address_[next_operand_] = int16_t(prefetch_.w); + SetDataAddress(effective_address_[next_operand_]); + + Prefetch(); // np + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_bw); + + BeginState(FetchAbsoluteShort_l): + effective_address_[next_operand_] = int16_t(prefetch_.w); + SetDataAddress(effective_address_[next_operand_]); + + Prefetch(); // np + Access(operand_[next_operand_].high); // nR + effective_address_[next_operand_] += 2; + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_l); + + // + // AbsoluteLong + // + BeginState(FetchAbsoluteLong_bw): + Prefetch(); // np + + effective_address_[next_operand_] = prefetch_.l; + SetDataAddress(effective_address_[next_operand_]); + + Prefetch(); // np + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_bw); + + BeginState(FetchAbsoluteLong_l): + Prefetch(); // np + + effective_address_[next_operand_] = prefetch_.l; + SetDataAddress(effective_address_[next_operand_]); + + Prefetch(); // np + Access(operand_[next_operand_].high); // nR + effective_address_[next_operand_] += 2; + Access(operand_[next_operand_].low); // nr + MoveToNextOperand(FetchOperand_l); + + // + // ImmediateData + // + BeginState(FetchImmediateData_bw): + operand_[next_operand_].w = prefetch_.w; + Prefetch(); // np + MoveToNextOperand(FetchOperand_bw); + + BeginState(FetchImmediateData_l): + Prefetch(); // np + operand_[next_operand_].l = prefetch_.l; + Prefetch(); // np + MoveToNextOperand(FetchOperand_l); + // MARK: - Store. // Store operand is a lot simpler: only one operand is ever stored, and its address @@ -563,25 +782,7 @@ void Processor void did_mulu(IntT) {} template void did_muls(IntT) {} void did_chk(bool, bool) {}