diff --git a/ClockReceiver/DeferredQueue.hpp b/ClockReceiver/DeferredQueue.hpp index 5dfbfd0ea..c639ea411 100644 --- a/ClockReceiver/DeferredQueue.hpp +++ b/ClockReceiver/DeferredQueue.hpp @@ -73,6 +73,11 @@ template class DeferredQueue { } } + /// @returns @c true if no actions are enqueued; @c false otherwise. + bool empty() const { + return pending_actions_.empty(); + } + private: // The list of deferred actions. struct DeferredAction { diff --git a/Machines/Apple/AppleII/AppleII.cpp b/Machines/Apple/AppleII/AppleII.cpp index 210e592be..c56a3d4a1 100644 --- a/Machines/Apple/AppleII/AppleII.cpp +++ b/Machines/Apple/AppleII/AppleII.cpp @@ -742,6 +742,9 @@ template // actor, but this will actually be the result most of the time so it's not // too terrible. if(isReadOperation(operation) && address != 0xc000) { + if(video_.has_deferred_actions()) { + update_video(); + } *value = video_.get_last_read_value(cycles_since_video_update_); } @@ -851,7 +854,7 @@ template case 0xc050: case 0xc051: update_video(); - video_.set_text(!!(address&1)); + video_.set_text(address&1); break; case 0xc052: update_video(); video_.set_mixed(false); break; case 0xc053: update_video(); video_.set_mixed(true); break; diff --git a/Machines/Apple/AppleII/Video.hpp b/Machines/Apple/AppleII/Video.hpp index 26e230b1d..ce0814a3b 100644 --- a/Machines/Apple/AppleII/Video.hpp +++ b/Machines/Apple/AppleII/Video.hpp @@ -10,7 +10,6 @@ #include "../../../Outputs/CRT/CRT.hpp" #include "../../../ClockReceiver/ClockReceiver.hpp" -#include "../../../ClockReceiver/DeferredQueue.hpp" #include "VideoSwitches.hpp" diff --git a/Machines/Apple/AppleII/VideoSwitches.hpp b/Machines/Apple/AppleII/VideoSwitches.hpp index 159cd0491..6763d642b 100644 --- a/Machines/Apple/AppleII/VideoSwitches.hpp +++ b/Machines/Apple/AppleII/VideoSwitches.hpp @@ -247,6 +247,10 @@ template class VideoSwitches { } } + bool has_deferred_actions() const { + return !deferrer_.empty(); + } + protected: GraphicsMode graphics_mode(int row) const { if( diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme index 19b54b90e..474fa352e 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme +++ b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme @@ -62,7 +62,7 @@