From d77ddaf4fa2e3118708f8620b4435587153e5cb4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 4 Apr 2021 17:33:49 -0400 Subject: [PATCH] Switches the Electron to JustInTimeActor video. Also reorders template parameters; I think that specifying a different time base is likely to be more common than using a divider. --- ClockReceiver/JustInTime.hpp | 8 +-- Machines/Apple/AppleIIgs/AppleIIgs.cpp | 6 +-- Machines/Atari/ST/AtariST.cpp | 6 +-- Machines/ColecoVision/ColecoVision.cpp | 2 +- Machines/Electron/Electron.cpp | 59 ++++++++------------- Machines/Electron/Video.cpp | 46 +++++++++------- Machines/Electron/Video.hpp | 18 +++---- Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp | 2 +- 8 files changed, 69 insertions(+), 78 deletions(-) diff --git a/ClockReceiver/JustInTime.hpp b/ClockReceiver/JustInTime.hpp index 0391515ad..35edfae7f 100644 --- a/ClockReceiver/JustInTime.hpp +++ b/ClockReceiver/JustInTime.hpp @@ -32,7 +32,7 @@ TODO: incorporate and codify AsyncJustInTimeActor. */ -template class JustInTimeActor: +template class JustInTimeActor: public ClockingHint::Observer { private: /*! @@ -47,7 +47,7 @@ template *actor) noexcept + explicit SequencePointAwareDeleter(JustInTimeActor *actor) noexcept : actor_(actor) {} forceinline void operator ()(const T *const) const { @@ -57,7 +57,7 @@ template *const actor_; + JustInTimeActor *const actor_; }; // This block of SFINAE determines whether objects of type T accepts Cycles or HalfCycles. @@ -126,7 +126,7 @@ template () const { - auto non_const_this = const_cast *>(this); + auto non_const_this = const_cast *>(this); non_const_this->flush(); return std::unique_ptr(&object_, SequencePointAwareDeleter(non_const_this)); } diff --git a/Machines/Apple/AppleIIgs/AppleIIgs.cpp b/Machines/Apple/AppleIIgs/AppleIIgs.cpp index 7c0d8ccc5..218da7d9e 100644 --- a/Machines/Apple/AppleIIgs/AppleIIgs.cpp +++ b/Machines/Apple/AppleIIgs/AppleIIgs.cpp @@ -1093,10 +1093,10 @@ class ConcreteMachine: // MARK: - Other components. Apple::Clock::ParallelClock clock_; - JustInTimeActor video_; // i.e. run video at 7Mhz. - JustInTimeActor adb_glu_; // i.e. 3,579,545Mhz. + JustInTimeActor video_; // i.e. run video at 7Mhz. + JustInTimeActor adb_glu_; // i.e. 3,579,545Mhz. Zilog::SCC::z8530 scc_; - JustInTimeActor iwm_; + JustInTimeActor iwm_; Cycles cycles_since_clock_tick_; Apple::Macintosh::DoubleDensityDrive drives35_[2]; Apple::Disk::DiskIIDrive drives525_[2]; diff --git a/Machines/Atari/ST/AtariST.cpp b/Machines/Atari/ST/AtariST.cpp index 17800a525..1c3f496e0 100644 --- a/Machines/Atari/ST/AtariST.cpp +++ b/Machines/Atari/ST/AtariST.cpp @@ -479,9 +479,9 @@ class ConcreteMachine: JustInTimeActor