From 02ad080bb87a9a4f001941e6aeff9d072fa88ac1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 3 Nov 2025 13:20:51 -0500 Subject: [PATCH] Apply clock multiplier. --- Machines/Acorn/Tube/Tube6502.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Machines/Acorn/Tube/Tube6502.hpp b/Machines/Acorn/Tube/Tube6502.hpp index 2d6ddb8c3..36a6f16db 100644 --- a/Machines/Acorn/Tube/Tube6502.hpp +++ b/Machines/Acorn/Tube/Tube6502.hpp @@ -19,8 +19,10 @@ public: Tube6502() : m6502_(*this) {} // By convention, these are cycles relative to the host's 2Mhz bus. + // Multiply by 3/2 to turn that into the tube 6502's usual 3Mhz bus. void run_for(const Cycles cycles) { - m6502_.run_for(cycles); // TODO: multiply by 1.5. Or more. + cycles_modulo_ += cycles * 3; + m6502_.run_for(cycles_modulo_.divide(Cycles(2))); } template @@ -45,6 +47,7 @@ public: private: uint8_t ram_[65536]; + Cycles cycles_modulo_; struct M6502Traits { static constexpr auto uses_ready_line = false;