From cf55a0c42337b55b00e1ccb435dac307cf4a47bc Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 18 Apr 2016 21:49:45 -0400 Subject: [PATCH] Fixed: composite output y is now incremented upon the start of retrace, that causing it to have different values at either edge of scans. --- Outputs/CRT/CRT.cpp | 5 +---- Outputs/CRT/Internals/CRTOpenGL.cpp | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 7ff10bce0..50ef7a3a1 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -237,14 +237,11 @@ void CRT::advance_cycles(unsigned int number_of_cycles, unsigned int source_divi output_lateral(2) = 1; output_frame_id(0) = output_frame_id(1) = output_frame_id(2) = (uint8_t)_openGL_output_builder->get_current_field(); -// printf("%d", _horizontal_flywheel->get_current_output_position()); -// if(_is_writing_composite_run) printf("\n"); else printf(" -> "); - _openGL_output_builder->complete_output_run(3); _is_writing_composite_run ^= true; } - if(next_run_length == time_until_horizontal_sync_event && next_horizontal_sync_event == Flywheel::SyncEvent::EndRetrace) + if(next_run_length == time_until_horizontal_sync_event && next_horizontal_sync_event == Flywheel::SyncEvent::StartRetrace) { _openGL_output_builder->increment_composite_output_y(); diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index 7d7cf6184..57dd765ec 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -268,7 +268,7 @@ void OpenGLOutputBuilder::perform_output_stage(unsigned int output_width, unsign // clear the buffer glClear(GL_COLOR_BUFFER_BIT); -// glEnable(GL_BLEND); + glEnable(GL_BLEND); // draw all sitting frames unsigned int run = (unsigned int)_run_write_pointer; @@ -509,7 +509,7 @@ char *OpenGLOutputBuilder::get_output_fragment_shader(const char *sampling_funct "void main(void)" "{" // "fragColour = vec4(srcCoordinatesVarying.rg, 0.0, 1.0);" // - "fragColour = texture(texID, srcCoordinatesVarying).rgba;" // + "fragColour = vec4(texture(texID, srcCoordinatesVarying).rgb, clamp(alpha, 0.0, 1.0)*sin(lateralVarying));" // // "fragColour = vec4(srcCoordinatesVarying.y / 4.0, 0.0, 0.0, 1.0);"//texture(texID, srcCoordinatesVarying).rgba;" // // "fragColour = vec4(rgb_sample(texID, srcCoordinatesVarying, iSrcCoordinatesVarying), clamp(alpha, 0.0, 1.0)*sin(lateralVarying));" // "}"