1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Adopted flush widely.

This commit is contained in:
Thomas Harte 2017-07-25 20:42:51 -04:00
parent 75d67ee770
commit 296c7cec05
3 changed files with 6 additions and 12 deletions

View File

@ -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());
}
};

View File

@ -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());
}
}

View File

@ -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));
}