mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-15 05:31:30 +00:00
Ensures updates even when the event queue is empty.
This commit is contained in:
parent
9ab49065cd
commit
e095a622d3
@ -16,6 +16,10 @@ void Line::set_writer_clock_rate(int clock_rate) {
|
|||||||
|
|
||||||
void Line::advance_writer(int cycles) {
|
void Line::advance_writer(int cycles) {
|
||||||
remaining_delays_ = std::max(remaining_delays_ - cycles, 0);
|
remaining_delays_ = std::max(remaining_delays_ - cycles, 0);
|
||||||
|
if(events_.empty()) {
|
||||||
|
write_cycles_since_delegate_call_ += cycles;
|
||||||
|
if(write_cycles_since_delegate_call_ > 256) update_delegate(level_);
|
||||||
|
} else {
|
||||||
while(!events_.empty()) {
|
while(!events_.empty()) {
|
||||||
if(events_.front().delay < cycles) {
|
if(events_.front().delay < cycles) {
|
||||||
cycles -= events_.front().delay;
|
cycles -= events_.front().delay;
|
||||||
@ -38,8 +42,7 @@ void Line::advance_writer(int cycles) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// TODO: some sort of ongoing update_delegate() ?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Line::write(bool level) {
|
void Line::write(bool level) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user