1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 02:17:08 +00:00

Adjust vertical sync test.

This commit is contained in:
Thomas Harte
2025-10-09 22:16:43 -04:00
parent 087d3535f6
commit fc50af0e17
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -400,7 +400,7 @@ void CRT::posit(Display::Rect rect) {
rect.size.width < 0.95 * scan_target_modals_.output_scale.x &&
rect.size.height < 0.95 * scan_target_modals_.output_scale.y
) {
rect.scale(1.02f, 1.02f);
rect.scale(1.01f, 1.01f);
}
// Scale and push a rect.
+1 -1
View File
@@ -111,7 +111,7 @@ struct Flywheel {
}
bool was_stable() const {
return std::abs(last_adjustment_) < 10; // TODO: don't hard code this nonsense.
return std::abs(last_adjustment_) < (sync_error_window_ / 250);
}
/*!
+6 -2
View File
@@ -27,8 +27,12 @@ struct RectAccumulator {
}
std::optional<Display::Rect> first_reading() const {
if(candidates_.pushes() != 2) return std::nullopt;
return candidates_.join(2);
// Wait for two fields and return the union of those; that'll ensure that
// interlaced video is boxed correctly.
if(candidates_.pushes() == 2) {
return candidates_.join(2);
}
return std::nullopt;
}
private: