mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Flaws remain, but acknowledge that pixel rate is double.
This commit is contained in:
parent
914b88d115
commit
0866caf934
@ -130,19 +130,16 @@ struct Video {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accumulate total phase.
|
|
||||||
++time_in_phase_;
|
|
||||||
|
|
||||||
// Grab some more pixels if appropriate.
|
// Grab some more pixels if appropriate.
|
||||||
const auto flush_pixels = [&]() {
|
const auto flush_pixels = [&]() {
|
||||||
const auto duration = static_cast<int>(time_in_phase_);
|
const auto duration = static_cast<int>(time_in_phase_);
|
||||||
crt_.output_data(duration, static_cast<size_t>(time_in_phase_));
|
crt_.output_data(duration, static_cast<size_t>(time_in_phase_) * 2);
|
||||||
time_in_phase_ = 0;
|
time_in_phase_ = 0;
|
||||||
pixels_ = nullptr;
|
pixels_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(phase_ == Phase::Display) {
|
if(phase_ == Phase::Display) {
|
||||||
if(pixels_ && time_in_phase_ == PixelBufferSize) {
|
if(pixels_ && time_in_phase_ == PixelBufferSize/2) {
|
||||||
flush_pixels();
|
flush_pixels();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,6 +239,9 @@ struct Video {
|
|||||||
++pixel_count_;
|
++pixel_count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Accumulate total phase.
|
||||||
|
++time_in_phase_;
|
||||||
|
|
||||||
// Determine current output phase.
|
// Determine current output phase.
|
||||||
Phase new_phase;
|
Phase new_phase;
|
||||||
switch(vertical_state_.phase()) {
|
switch(vertical_state_.phase()) {
|
||||||
@ -361,6 +361,8 @@ private:
|
|||||||
uint32_t time_in_phase_ = 0;
|
uint32_t time_in_phase_ = 0;
|
||||||
uint32_t pixel_count_ = 0;
|
uint32_t pixel_count_ = 0;
|
||||||
uint16_t *pixels_ = nullptr;
|
uint16_t *pixels_ = nullptr;
|
||||||
|
|
||||||
|
// It is elsewhere assumed that this size is a multiple of 8.
|
||||||
static constexpr size_t PixelBufferSize = 320;
|
static constexpr size_t PixelBufferSize = 320;
|
||||||
|
|
||||||
// Programmer-set addresses.
|
// Programmer-set addresses.
|
||||||
|
Loading…
Reference in New Issue
Block a user