From a5b7ef54985d2432a3d27201b354b50425028db6 Mon Sep 17 00:00:00 2001 From: Thomas Harte <thomas.harte@gmail.com> Date: Thu, 30 Jun 2022 08:31:51 -0400 Subject: [PATCH] Further compact list of potential switch targets. --- .../Implementation/68000Mk2Implementation.hpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index 969cc501c..f6d15c328 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -216,7 +216,7 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor // Check whether all remaining time has been expended; if so then exit, having set this line up as // the next resumption point. -#define ConsiderExit() if(time_remaining_ < HalfCycles(0)) { state_ = ExecutionState::Max+__COUNTER__+1; return; } [[fallthrough]]; case ExecutionState::Max+__COUNTER__: +#define ConsiderExit() if(time_remaining_ < HalfCycles(0)) { state_ = ExecutionState::Max + ((__COUNTER__+1) >> 1); return; } [[fallthrough]]; case ExecutionState::Max + (__COUNTER__ >> 1): // Subtracts `n` half-cycles from `time_remaining_`; if permit_overrun is false, also ConsiderExit() #define Spend(n) time_remaining_ -= (n); if constexpr (!permit_overrun) ConsiderExit() @@ -294,15 +294,15 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor // Spin until DTACK, VPA or BERR is asserted (unless DTACK is implicit), // holding the bus cycle provided. -#define WaitForDTACK(x) \ - if constexpr (!dtack_is_implicit && !dtack_ && !vpa_ && !berr_) { \ - awaiting_dtack = x; \ - awaiting_dtack.length = HalfCycles(2); \ - post_dtack_state_ = ExecutionState::Max+__COUNTER__+1; \ - state_ = ExecutionState::WaitForDTACK; \ - break; \ - } \ - [[fallthrough]]; case ExecutionState::Max+__COUNTER__: +#define WaitForDTACK(x) \ + if constexpr (!dtack_is_implicit && !dtack_ && !vpa_ && !berr_) { \ + awaiting_dtack = x; \ + awaiting_dtack.length = HalfCycles(2); \ + post_dtack_state_ = ExecutionState::Max + ((__COUNTER__ + 1) >> 1); \ + state_ = ExecutionState::WaitForDTACK; \ + break; \ + } \ + [[fallthrough]]; case ExecutionState::Max + (__COUNTER__ >> 1): // Performs the bus operation provided, which will be one with a // SelectWord or SelectByte operation, stretching it to match the E