1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00

Sought to ensure that communicating a colour burst in multiple parts doesn't ruin the phase.

This commit is contained in:
Thomas Harte 2017-02-06 18:27:44 -05:00
parent 6bcf95042c
commit fcf8cafb5d

View File

@ -222,6 +222,7 @@ void CRT::advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bo
(*(uint16_t *)&input_buffer[position + SourceVertexOffsetOfOutputStart + 2]) = output_y;
}
});
colour_burst_amplitude_ = 0;
}
is_writing_composite_run_ ^= true;
}
@ -284,7 +285,7 @@ void CRT::output_scan(const Scan *const scan)
// simplified colour burst logic: if it's within the back porch we'll take it
if(scan->type == Scan::Type::ColourBurst)
{
if(horizontal_flywheel_->get_current_time() < (horizontal_flywheel_->get_standard_period() * 12) >> 6)
if(!colour_burst_amplitude_ && horizontal_flywheel_->get_current_time() < (horizontal_flywheel_->get_standard_period() * 12) >> 6)
{
unsigned int position_phase = (horizontal_flywheel_->get_current_time() * colour_cycle_numerator_ * 256) / phase_denominator_;
colour_burst_phase_ = (position_phase + scan->phase) & 255;