From 91a3d42919de990e309f8cff660de30c2cc4d87e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 12 Feb 2020 23:23:42 -0500 Subject: [PATCH] Ensures no DMA clocking whatsoever when asleep. --- Machines/Atari/ST/AtariST.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Machines/Atari/ST/AtariST.cpp b/Machines/Atari/ST/AtariST.cpp index f1ed580bc..9e65aa52c 100644 --- a/Machines/Atari/ST/AtariST.cpp +++ b/Machines/Atari/ST/AtariST.cpp @@ -441,7 +441,8 @@ class ConcreteMachine: // Advance the relevant counters. cycles_since_audio_update_ += length; mfp_ += length; - dma_ += length; + if(dma_clocking_preference_ != ClockingHint::Preference::None) + dma_ += length; keyboard_acia_ += length; midi_acia_ += length; bus_phase_ += length; @@ -462,7 +463,7 @@ class ConcreteMachine: mfp_.flush(); } - if(dma_is_realtime_) { + if(dma_clocking_preference_ == ClockingHint::Preference::RealTime) { dma_.flush(); } @@ -531,7 +532,7 @@ class ConcreteMachine: bool may_defer_acias_ = true; bool keyboard_needs_clock_ = false; bool mfp_is_realtime_ = false; - bool dma_is_realtime_ = false; + ClockingHint::Preference dma_clocking_preference_ = ClockingHint::Preference::None; void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference clocking) final { // This is being called by one of the components; avoid any time flushing here as that's // already dealt with (and, just to be absolutely sure, to avoid recursive mania). @@ -540,7 +541,7 @@ class ConcreteMachine: (midi_acia_.last_valid()->preferred_clocking() != ClockingHint::Preference::RealTime); keyboard_needs_clock_ = ikbd_.preferred_clocking() != ClockingHint::Preference::None; mfp_is_realtime_ = mfp_.last_valid()->preferred_clocking() == ClockingHint::Preference::RealTime; - dma_is_realtime_ = dma_.last_valid()->preferred_clocking() == ClockingHint::Preference::RealTime; + dma_clocking_preference_ = dma_.last_valid()->preferred_clocking(); } // MARK: - GPIP input.