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

Fixed sync response in composite scan output generation and stored texture coordinates.

This commit is contained in:
Thomas Harte 2016-03-05 21:52:22 -05:00
parent 6cddb4c9c8
commit eefd17ed4c
2 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,7 @@ Machine::Machine() :
"float texValue = texture(texID, coordinate).r;"
"return vec3(step(4.0/256.0, mod(texValue, 8.0/256.0)), step(2.0/256.0, mod(texValue, 4.0/256.0)), step(1.0/256.0, mod(texValue, 2.0/256.0)));"
"}");
_crt->set_output_device(Outputs::CRT::Monitor);
_crt->set_output_device(Outputs::CRT::Television);
// _crt->set_visible_area(Outputs::Rect(0.23108f, 0.0f, 0.8125f, 0.98f)); //1875
memset(_key_states, 0, sizeof(_key_states));

View File

@ -249,7 +249,9 @@ void CRT::advance_cycles(unsigned int number_of_cycles, unsigned int source_divi
// if this is horizontal retrace then advance the output line counter and bookend an output run
if(_output_device == CRT::Television)
{
Flywheel::SyncEvent honoured_event = (next_run_length == time_until_vertical_sync_event) ? next_vertical_sync_event : next_horizontal_sync_event;
Flywheel::SyncEvent honoured_event = Flywheel::SyncEvent::None;
if(next_run_length == time_until_vertical_sync_event && next_vertical_sync_event != Flywheel::SyncEvent::None) honoured_event = next_vertical_sync_event;
if(next_run_length == time_until_horizontal_sync_event && next_horizontal_sync_event != Flywheel::SyncEvent::None) honoured_event = next_horizontal_sync_event;
bool needs_endpoint =
(honoured_event == Flywheel::SyncEvent::StartRetrace && _is_writing_composite_run) ||
(honoured_event == Flywheel::SyncEvent::EndRetrace && !_horizontal_flywheel->is_in_retrace() && !_vertical_flywheel->is_in_retrace());
@ -261,8 +263,8 @@ void CRT::advance_cycles(unsigned int number_of_cycles, unsigned int source_divi
output_position_x(0) = output_position_x(1) = output_position_x(2) = (uint16_t)_horizontal_flywheel->get_current_output_position();
output_position_y(0) = output_position_y(1) = output_position_y(2) = (uint16_t)(_vertical_flywheel->get_current_output_position() / _vertical_flywheel_output_divider);
output_timestamp(0) = output_timestamp(1) = output_timestamp(2) = _run_builders[_run_write_pointer]->duration;
output_tex_x(0) = output_tex_x(1) = output_tex_x(2) = tex_x;
output_tex_y(0) = output_tex_y(1) = output_tex_y(2) = tex_y;
output_tex_x(0) = output_tex_x(1) = output_tex_x(2) = (uint16_t)_horizontal_flywheel->get_current_output_position();
output_tex_y(0) = output_tex_y(1) = output_tex_y(2) = _composite_src_output_y;
output_lateral(0) = 0;
output_lateral(1) = _is_writing_composite_run ? 1 : 0;
output_lateral(2) = 1;