From 9ff09a45bee3974cb494b9585b4112da0d9ed2bb Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 28 Oct 2025 21:32:09 -0400 Subject: [PATCH] Allow is-1mhz decision to observe shortened addresses. --- Machines/Acorn/BBCMicro/BBCMicro.cpp | 6 +++--- Processors/6502Mk2/6502Mk2.hpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Machines/Acorn/BBCMicro/BBCMicro.cpp b/Machines/Acorn/BBCMicro/BBCMicro.cpp index aa91895dc..65bfb9da7 100644 --- a/Machines/Acorn/BBCMicro/BBCMicro.cpp +++ b/Machines/Acorn/BBCMicro/BBCMicro.cpp @@ -769,7 +769,7 @@ public: template Cycles perform(const AddressT address, CPU::MOS6502Mk2::data_t value) { // Returns @c true if @c address is a device on the 1Mhz bus; @c false otherwise. - static constexpr auto is_1mhz = [](const uint16_t address) { + const auto is_1mhz = [&] { // Fast exit if outside the IO space. if(address < 0xfc00) return false; if(address >= 0xff00) return false; @@ -788,10 +788,10 @@ public: // Otherwise: in IO space, but not a 1Mhz device. return false; - }; + }(); // Determine whether this access hits the 1Mhz bus; if so then apply appropriate penalty, and update phase. - const auto duration = Cycles(is_1mhz(address) ? 2 + (phase_&1) : 1); + const auto duration = Cycles(is_1mhz ? 2 + (phase_&1) : 1); if(typer_) typer_->run_for(duration); phase_ += duration.as(); diff --git a/Processors/6502Mk2/6502Mk2.hpp b/Processors/6502Mk2/6502Mk2.hpp index 99a5aeee8..14b6cb974 100644 --- a/Processors/6502Mk2/6502Mk2.hpp +++ b/Processors/6502Mk2/6502Mk2.hpp @@ -126,6 +126,7 @@ public: private: uint8_t result_; + #ifndef NDEBUG bool did_write_ = false; #endif