1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-11-04 00:16:26 +00:00

To simplify debugging, add non-constructing path.

This won't have any effect on generated code.
This commit is contained in:
Thomas Harte
2025-10-27 12:41:17 -04:00
parent 12d912b627
commit 3dd07b6ac1

View File

@@ -57,9 +57,13 @@ void Processor<model, Traits>::run_for(const Cycles cycles) {
} \ } \
\ \
if constexpr (is_read(type)) { \ if constexpr (is_read(type)) { \
Data::Writeable target; \ if constexpr (std::is_same_v<decltype(value), Data::Writeable>) { \
Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, target); \ Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, value); \
Data::WriteableReader::assign(value, target); \ } else { \
Data::Writeable target; \
Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, target); \
Data::WriteableReader::assign(value, target); \
} \
} else { \ } else { \
Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, value); \ Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, value); \
} \ } \
@@ -70,7 +74,7 @@ void Processor<model, Traits>::run_for(const Cycles cycles) {
using ResumePoint = Storage::ResumePoint; using ResumePoint = Storage::ResumePoint;
using InterruptRequest = Storage::Inputs::InterruptRequest; using InterruptRequest = Storage::Inputs::InterruptRequest;
auto &registers = Storage::registers_; auto &registers = Storage::registers_;
uint8_t throwaway = 0; Data::Writeable throwaway;
const auto index = [&] { const auto index = [&] {
return Storage::decoded_.index == Index::X ? registers.x : registers.y; return Storage::decoded_.index == Index::X ? registers.x : registers.y;
@@ -542,13 +546,10 @@ void Processor<model, Traits>::run_for(const Cycles cycles) {
if(Storage::cycles_ <= Cycles(0)) { if(Storage::cycles_ <= Cycles(0)) {
return; return;
} }
{ Storage::cycles_ -= Storage::bus_handler_.template perform<BusOperation::Read>(
Data::Writeable empty; Vector(0xff),
Storage::cycles_ -= Storage::bus_handler_.template perform<BusOperation::Read>( throwaway
Vector(0xff), );
empty
);
}
goto jammed; goto jammed;
// MARK: - Flow control (other than BRK). // MARK: - Flow control (other than BRK).