1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Ensures visible hsync end generates a sequence point.

This commit is contained in:
Thomas Harte 2019-12-29 17:51:50 -05:00
parent 5361ee2526
commit 47068ee081

View File

@ -412,9 +412,15 @@ HalfCycles Video::get_next_sequence_point() {
event_time = std::min(event_time, vsync_x_position);
}
// Test for beginning and end of horizontal sync.
if(x_ < line_length_ - hsync_start) event_time = std::min(line_length_ - hsync_start, event_time);
else if(x_ < line_length_ - hsync_end) event_time = std::min(line_length_ - hsync_end, event_time);
// Test for beginning and end of horizontal sync, and the times when those will actually be communicated.
if(x_ < line_length_ - hsync_start) {
event_time = std::min(line_length_ - hsync_start, event_time);
} else if(x_ < line_length_ - hsync_start + hsync_delay_period) {
event_time = std::min(line_length_ - hsync_start + hsync_delay_period, event_time);
} else if(x_ < line_length_ - hsync_end) {
event_time = std::min(line_length_ - hsync_end, event_time);
}
/* Assumed: hsync end will become visible at end of line. */
// It wasn't any of those, so as a temporary expedient, just supply end of line.
return HalfCycles(event_time - x_);