1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-21 21:33:54 +00:00

Add a colour burst.

This commit is contained in:
Thomas Harte 2024-09-08 21:12:45 -04:00
parent 51c8396e32
commit b7f069e1bd
2 changed files with 12 additions and 4 deletions

View File

@ -124,7 +124,11 @@ uint8_t VideoOutput::run_for(const Cycles cycles) {
if(vsync_int_ || hsync_int_) {
stage = OutputStage::Sync;
} else if(in_blank()) {
if(h_count_ >= hburst_start && h_count_ < hburst_end) {
stage = OutputStage::ColourBurst;
} else {
stage = OutputStage::Blank;
}
} else {
stage = OutputStage::Pixels;
screen_pitch = (mode_40_ ? 320 : 640) / static_cast<int>(mode_bpp_);
@ -134,6 +138,7 @@ uint8_t VideoOutput::run_for(const Cycles cycles) {
switch(output_) {
case OutputStage::Sync: crt_.output_sync(output_length_); break;
case OutputStage::Blank: crt_.output_blank(output_length_); break;
case OutputStage::ColourBurst: crt_.output_default_colour_burst(output_length_); break;
case OutputStage::Pixels:
if(current_output_target_) {
crt_.output_data(

View File

@ -81,7 +81,7 @@ class VideoOutput {
// CRT output
enum class OutputStage {
Sync, Blank, Pixels
Sync, Blank, Pixels, ColourBurst,
};
OutputStage output_ = OutputStage::Blank;
int output_length_ = 0;
@ -148,7 +148,10 @@ class VideoOutput {
// _after_ position increment rather than before/instead.
// So it needs to be one higher. Which is baked into
// the constant to emphasise the all-divisible-by-8 property.
static constexpr int h_half = h_total / 2;
static constexpr int hburst_start = 856;
static constexpr int hburst_end = 896;
// Vertical timing parameters; all in terms of lines. As per the horizontal parameters above,
// lines begin with their first visible pixel (or the equivalent position).