1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Merge pull request #1058 from TomHarte/ContinuousLabels

Further compact list of potential switch targets.
This commit is contained in:
Thomas Harte 2022-06-30 10:12:12 -04:00 committed by GitHub
commit c85ca09236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 // Check whether all remaining time has been expended; if so then exit, having set this line up as
// the next resumption point. // 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() // 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() #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), // Spin until DTACK, VPA or BERR is asserted (unless DTACK is implicit),
// holding the bus cycle provided. // holding the bus cycle provided.
#define WaitForDTACK(x) \ #define WaitForDTACK(x) \
if constexpr (!dtack_is_implicit && !dtack_ && !vpa_ && !berr_) { \ if constexpr (!dtack_is_implicit && !dtack_ && !vpa_ && !berr_) { \
awaiting_dtack = x; \ awaiting_dtack = x; \
awaiting_dtack.length = HalfCycles(2); \ awaiting_dtack.length = HalfCycles(2); \
post_dtack_state_ = ExecutionState::Max+__COUNTER__+1; \ post_dtack_state_ = ExecutionState::Max + ((__COUNTER__ + 1) >> 1); \
state_ = ExecutionState::WaitForDTACK; \ state_ = ExecutionState::WaitForDTACK; \
break; \ break; \
} \ } \
[[fallthrough]]; case ExecutionState::Max+__COUNTER__: [[fallthrough]]; case ExecutionState::Max + (__COUNTER__ >> 1):
// Performs the bus operation provided, which will be one with a // Performs the bus operation provided, which will be one with a
// SelectWord or SelectByte operation, stretching it to match the E // SelectWord or SelectByte operation, stretching it to match the E