From 4211389ac77030979beb11e83f739d9c6875c1d5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 6 Jul 2017 21:29:08 -0400 Subject: [PATCH] Connected machine-supplied colour burst amplitude to shader, discarding hard-coded value. Net effect: the colour component is now discarded for the ZX80 and 81. --- Outputs/CRT/CRT.cpp | 2 +- Outputs/CRT/Internals/Shaders/IntermediateShader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 5b4cf0cdc..c5ba7ee68 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -113,7 +113,7 @@ Flywheel::SyncEvent CRT::get_next_horizontal_sync_event(bool hsync_is_requested, #define source_output_position_y() (*(uint16_t *)&next_run[SourceVertexOffsetOfOutputStart + 2]) #define source_output_position_x2() (*(uint16_t *)&next_run[SourceVertexOffsetOfEnds + 2]) #define source_phase() next_run[SourceVertexOffsetOfPhaseTimeAndAmplitude + 0] -#define source_amplitude() next_run[SourceVertexOffsetOfPhaseTimeAndAmplitude + 2] +#define source_amplitude() next_run[SourceVertexOffsetOfPhaseTimeAndAmplitude + 1] void CRT::advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bool vsync_requested, const Scan::Type type) { std::unique_lock output_lock = openGL_output_builder_.get_output_lock(); diff --git a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp index 72e1fc6dc..239e948ff 100644 --- a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp +++ b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp @@ -97,7 +97,7 @@ std::unique_ptr IntermediateShader::make_shader(const std::s // setup phaseAndAmplitudeVarying.y as colour burst amplitude; // setup phaseAndAmplitudeVarying.z as 1 / (colour burst amplitude), or 0.0 if amplitude is 0.0; "phaseAndAmplitudeVarying.x = (extendedOutputPosition.x + (phaseTimeAndAmplitude.x / 64.0)) * 0.5 * 3.141592654;" - "phaseAndAmplitudeVarying.y = 0.33;" // TODO: reinstate connection with phaseTimeAndAmplitude.y / 255.0;" + "phaseAndAmplitudeVarying.y = phaseTimeAndAmplitude.y / 255.0;" "phaseAndAmplitudeVarying.z = (phaseAndAmplitudeVarying.y > 0.0) ? 1.0 / phaseAndAmplitudeVarying.y : 0.0;" // determine output position by scaling the output position according to the texture size