From d157819c4913731f76649795d914e90cf54feef9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 20 May 2022 14:29:14 -0400 Subject: [PATCH] Implement the various to-[SR/CCR] actions, which do a 'repeat' prefetch. (which isn't exactly a repeat, at least in the SR cases, because the function code might have changed) --- .../68000ComparativeTests.mm | 2 +- .../Implementation/68000Mk2Implementation.hpp | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 8e726ec61..b1939e76d 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -156,7 +156,7 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { // To limit tests run to a subset of files and/or of tests, uncomment and fill in below. _fileSet = [NSSet setWithArray:@[ -// @"btst_bchg_bclr_bset.json", + @"btst_bchg_bclr_bset.json", // Below this line are passing tests. @"abcd_sbcd.json", diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index d87f3eb3d..b2c66b981 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -106,6 +106,8 @@ enum ExecutionState: int { MOVEPtoM_l, MOVEPtoR_w, MOVEPtoR_l, + + LogicalToSR, }; // MARK: - The state machine. @@ -597,6 +599,12 @@ void Processor( + instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + + // Recede the program counter and prefetch twice. + program_counter_.l -= 2; + Prefetch(); + Prefetch(); + MoveToState(Decode); + // // Various states TODO. //