From 51b7f2777d6d390edf704d7440a1c7ae58dd346c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 29 Jul 2019 17:17:04 -0400 Subject: [PATCH] Adds a route to not bumping time. --- ClockReceiver/JustInTime.hpp | 10 ++++++++++ Machines/MasterSystem/MasterSystem.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ClockReceiver/JustInTime.hpp b/ClockReceiver/JustInTime.hpp index e5f9a5ef6..96df1e102 100644 --- a/ClockReceiver/JustInTime.hpp +++ b/ClockReceiver/JustInTime.hpp @@ -38,6 +38,11 @@ template return &object_; } + /// Returns a pointer to the included object without flushing time. + inline T *last_valid() { + return *object_; + } + /// Flushes all accumulated time. inline void flush() { if(!is_flushed_) object_.run_for(time_since_update_.template flush()); @@ -80,6 +85,11 @@ template return &object_; } + /// Returns a pointer to the included object without flushing time. + inline T *last_valid() { + return *object_; + } + /// Flushes all accumulated time. inline void flush() { if(!is_flushed_) { diff --git a/Machines/MasterSystem/MasterSystem.cpp b/Machines/MasterSystem/MasterSystem.cpp index 63468faa2..7aff87195 100644 --- a/Machines/MasterSystem/MasterSystem.cpp +++ b/Machines/MasterSystem/MasterSystem.cpp @@ -237,7 +237,7 @@ class ConcreteMachine: *cycle.value = vdp_->get_current_line(); break; case 0x41: - *cycle.value = vdp_->get_latched_horizontal_counter(); + *cycle.value = vdp_.last_valid()->get_latched_horizontal_counter(); break; case 0x80: case 0x81: *cycle.value = vdp_->get_register(address);