From 12f7e1b804ecc4b2d9ffeac152b3f42495046f83 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Jul 2017 23:35:14 -0400 Subject: [PATCH] Enshrined a default colour burst amplitude. Which now everybody relies on. The 102 figure is derived from the burst apparently being 40 IRE. --- Components/6560/6560.hpp | 2 +- Outputs/CRT/CRT.cpp | 10 ++-------- Outputs/CRT/CRT.hpp | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Components/6560/6560.hpp b/Components/6560/6560.hpp index 88ce2dbc2..829df3e7a 100644 --- a/Components/6560/6560.hpp +++ b/Components/6560/6560.hpp @@ -259,7 +259,7 @@ template class MOS6560 { if(this_state_ != output_state_) { switch(output_state_) { case State::Sync: crt_->output_sync(cycles_in_state_ * 4); break; - case State::ColourBurst: crt_->output_colour_burst(cycles_in_state_ * 4, (is_odd_frame_ || is_odd_line_) ? 128 : 0, 0); break; + case State::ColourBurst: crt_->output_colour_burst(cycles_in_state_ * 4, (is_odd_frame_ || is_odd_line_) ? 128 : 0); break; case State::Border: output_border(cycles_in_state_ * 4); break; case State::Pixels: crt_->output_data(cycles_in_state_ * 4, 1); break; } diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 88e658e93..85be1eefa 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -194,7 +194,7 @@ void CRT::advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bo output_x2() = (uint16_t)horizontal_flywheel_->get_current_output_position(); } openGL_output_builder_.array_builder.flush( - [output_y, this] (uint8_t *input_buffer, size_t input_size, uint8_t *output_buffer, size_t output_size) { + [=] (uint8_t *input_buffer, size_t input_size, uint8_t *output_buffer, size_t output_size) { openGL_output_builder_.texture_builder.flush( [=] (const std::vector &write_areas, size_t number_of_write_areas) { assert(number_of_write_areas * SourceVertexSize == input_size); @@ -333,13 +333,7 @@ void CRT::output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint } void CRT::output_default_colour_burst(unsigned int number_of_cycles) { - Scan scan { - .type = Scan::Type::ColourBurst, - .number_of_cycles = number_of_cycles, - .phase = (uint8_t)((phase_numerator_ * 256) / phase_denominator_ + (is_alernate_line_ ? 128 : 0)), - .amplitude = 32 - }; - output_scan(&scan); + output_colour_burst(number_of_cycles, (uint8_t)((phase_numerator_ * 256) / phase_denominator_ + (is_alernate_line_ ? 128 : 0))); } void CRT::output_data(unsigned int number_of_cycles, unsigned int source_divider) { diff --git a/Outputs/CRT/CRT.hpp b/Outputs/CRT/CRT.hpp index 3f3847cf8..49f6bb206 100644 --- a/Outputs/CRT/CRT.hpp +++ b/Outputs/CRT/CRT.hpp @@ -187,7 +187,7 @@ class CRT { @param amplitude The amplitude of the colour burst in 1/256ths of the amplitude of the positive portion of the wave. */ - void output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint8_t amplitude); + void output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint8_t amplitude = 102); /*! Outputs a colour burst exactly in phase with CRT expectations using the idiomatic amplitude.