1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Attempted fully to reinstate proper timing.

This commit is contained in:
Thomas Harte 2016-12-15 18:52:16 -05:00
parent 0326316bb8
commit c1c70a767a

View File

@ -413,13 +413,23 @@ unsigned int VideoOutput::get_cycles_until_next_ram_availability(int from_time)
int position = output_position_ + from_time;
result += 1 + (position&1);
// if(screen_mode_ < 4)
// {
// const int current_line = graphics_line(position + (position&1));
// const int current_column = graphics_column(position + (position&1));
// if(current_line < 256 && current_column < 80 && !is_blank_line_)
// result += (unsigned int)(80 - current_column);
// }
if(screen_mode_ < 4)
{
const int current_column = graphics_column(position + (position&1));
int current_line = graphics_line(position);
if(current_line < 256)
{
if(screen_mode_ == 3)
{
int output_position_line = graphics_line(output_position_);
int implied_row = current_character_row_ + (current_line - output_position_line) % 10;
if(implied_row < 8)
result += (unsigned int)(80 - current_column);
}
else
result += (unsigned int)(80 - current_column);
}
}
return result;
}