mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-21 06:31:06 +00:00
Add a colour burst.
This commit is contained in:
parent
51c8396e32
commit
b7f069e1bd
@ -124,7 +124,11 @@ uint8_t VideoOutput::run_for(const Cycles cycles) {
|
||||
if(vsync_int_ || hsync_int_) {
|
||||
stage = OutputStage::Sync;
|
||||
} else if(in_blank()) {
|
||||
stage = OutputStage::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_);
|
||||
@ -132,8 +136,9 @@ uint8_t VideoOutput::run_for(const Cycles cycles) {
|
||||
|
||||
if(stage != output_ || screen_pitch != screen_pitch_) {
|
||||
switch(output_) {
|
||||
case OutputStage::Sync: crt_.output_sync(output_length_); break;
|
||||
case OutputStage::Blank: crt_.output_blank(output_length_); break;
|
||||
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(
|
||||
|
@ -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).
|
||||
|
Loading…
Reference in New Issue
Block a user