From 296c7cec055c02568927e65734a16c497d070bb1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 25 Jul 2017 20:42:51 -0400 Subject: [PATCH] Adopted `flush` widely. --- Machines/Atari2600/Bus.hpp | 6 ++---- Machines/Electron/Electron.cpp | 3 +-- Machines/Oric/Oric.cpp | 9 +++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Machines/Atari2600/Bus.hpp b/Machines/Atari2600/Bus.hpp index e4c263655..e881e8bc7 100644 --- a/Machines/Atari2600/Bus.hpp +++ b/Machines/Atari2600/Bus.hpp @@ -45,15 +45,13 @@ class Bus { // video backlog accumulation counter Cycles cycles_since_video_update_; inline void update_video() { - tia_->run_for(cycles_since_video_update_); - cycles_since_video_update_ = 0; + tia_->run_for(cycles_since_video_update_.flush()); } // RIOT backlog accumulation counter Cycles cycles_since_6532_update_; inline void update_6532() { - mos6532_.run_for(cycles_since_6532_update_); - cycles_since_6532_update_ = 0; + mos6532_.run_for(cycles_since_6532_update_.flush()); } }; diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 40764fe8c..0109f614e 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -352,8 +352,7 @@ void Machine::flush() { inline void Machine::update_display() { if(cycles_since_display_update_) { - video_output_->run_for(cycles_since_display_update_); - cycles_since_display_update_ = 0; + video_output_->run_for(cycles_since_display_update_.flush()); } } diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 6217659cc..b5525f0fa 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -141,8 +141,7 @@ void Machine::flush() { } void Machine::update_video() { - video_output_->run_for(cycles_since_video_update_); - cycles_since_video_update_ = 0; + video_output_->run_for(cycles_since_video_update_.flush()); } void Machine::setup_output(float aspect_ratio) { @@ -233,9 +232,8 @@ uint8_t Machine::VIA::get_port_input(Port port) { } void Machine::VIA::flush() { - ay8910->run_for(cycles_since_ay_update_); + ay8910->run_for(cycles_since_ay_update_.flush()); ay8910->flush(); - cycles_since_ay_update_ = 0; } void Machine::VIA::run_for(const Cycles &cycles) { @@ -245,8 +243,7 @@ void Machine::VIA::run_for(const Cycles &cycles) { } void Machine::VIA::update_ay() { - ay8910->run_for(cycles_since_ay_update_); - cycles_since_ay_update_ = 0; + ay8910->run_for(cycles_since_ay_update_.flush()); ay8910->set_control_lines( (GI::AY38910::ControlLines)((ay_bdir_ ? GI::AY38910::BCDIR : 0) | (ay_bc1_ ? GI::AY38910::BC1 : 0) | GI::AY38910::BC2)); }