1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Delay bitplane installation until end of slot.

This commit is contained in:
Thomas Harte 2021-11-01 14:18:58 -07:00
parent 4e66017205
commit 42145a5b8a
2 changed files with 26 additions and 16 deletions

View File

@ -272,16 +272,28 @@ template <int cycle> void Chipset::output() {
if(cycle == line_length_ - 1) {
flush_output();
}
// Update all active pixel shifters.
bitplane_pixels_.shift(is_high_res_);
sprite_shifters_[0].shift();
sprite_shifters_[1].shift();
sprite_shifters_[2].shift();
sprite_shifters_[3].shift();
}
}
// Update all active pixel shifters.
bitplane_pixels_.shift(is_high_res_);
sprite_shifters_[0].shift();
sprite_shifters_[1].shift();
sprite_shifters_[2].shift();
sprite_shifters_[3].shift();
// Reload if anything is pending.
if(has_next_bitplanes_) {
has_next_bitplanes_ = false;
bitplane_pixels_.set(
previous_bitplanes_,
next_bitplanes_,
odd_delay_,
even_delay_
);
previous_bitplanes_ = next_bitplanes_;
}
#undef LINK
}
@ -510,14 +522,11 @@ template <bool stop_on_cpu> Chipset::Changes Chipset::run(HalfCycles length) {
}
void Chipset::post_bitplanes(const BitplaneData &data) {
// Expand this
bitplane_pixels_.set(
previous_bitplanes_,
data,
odd_delay_,
even_delay_
);
previous_bitplanes_ = data;
// Posted bitplanes should be received at the end of the
// current memory slot. So put them aside for now, and
// deal with them momentarily.
has_next_bitplanes_ = true;
next_bitplanes_ = data;
}
void Chipset::BitplaneShifter::set(const BitplaneData &previous, const BitplaneData &next, int odd_delay, int even_delay) {

View File

@ -245,7 +245,8 @@ class Chipset: private ClockingHint::Observer {
} bitplanes_;
void post_bitplanes(const BitplaneData &data);
BitplaneData previous_bitplanes_;
BitplaneData next_bitplanes_, previous_bitplanes_;
bool has_next_bitplanes_ = false;
class BitplaneShifter {
public: