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

Fixed: composite output y is now incremented upon the start of retrace, that causing it to have different values at either edge of scans.

This commit is contained in:
Thomas Harte 2016-04-18 21:49:45 -04:00
parent 9580dde3ad
commit cf55a0c423
2 changed files with 3 additions and 6 deletions

View File

@ -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();

View File

@ -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));" //
"}"