mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 02:17:08 +00:00
Switched vertical sync detection method, at least for now. They never happen automatically (I need to fix that) and just always take effect if detected in the lower half of the display. PAL/NTSC is determined just by looking at the refresh rate.
This commit is contained in:
+8
-8
@@ -28,7 +28,7 @@ void CRT::set_new_timing(unsigned int cycles_per_line, unsigned int height_of_di
|
||||
height_of_display += (height_of_display / 20); // this is the overrun area we'll use to
|
||||
|
||||
// store fundamental display configuration properties
|
||||
_height_of_display = height_of_display + 10;
|
||||
_height_of_display = height_of_display;
|
||||
_cycles_per_line = cycles_per_line * _time_multiplier;
|
||||
|
||||
// generate timing values implied by the given arbuments
|
||||
@@ -103,7 +103,7 @@ CRT::SyncEvent CRT::get_next_vertical_sync_event(bool vsync_is_requested, unsign
|
||||
|
||||
// will an acceptable vertical sync be triggered?
|
||||
if (vsync_is_requested && !_is_in_vsync) {
|
||||
if (_sync_capacitor_charge_level >= _sync_capacitor_charge_threshold){// && _rasterPosition.y >= (kCRTFixedPointRange * 7) >> 3) {
|
||||
if (_sync_capacitor_charge_level >= _sync_capacitor_charge_threshold && _rasterPosition.y >= (kCRTFixedPointRange >> 1)) {
|
||||
proposedSyncTime = 0;
|
||||
proposedEvent = SyncEvent::StartVSync;
|
||||
_did_detect_vsync = true;
|
||||
@@ -112,12 +112,12 @@ CRT::SyncEvent CRT::get_next_vertical_sync_event(bool vsync_is_requested, unsign
|
||||
|
||||
// have we overrun the maximum permitted number of horizontal syncs for this frame?
|
||||
if (!_is_in_vsync) {
|
||||
unsigned int time_until_end_of_frame = (kCRTFixedPointRange - _rasterPosition.y) / _scanSpeed[0].y;
|
||||
|
||||
if(time_until_end_of_frame < proposedSyncTime) {
|
||||
proposedSyncTime = time_until_end_of_frame;
|
||||
proposedEvent = SyncEvent::StartVSync;
|
||||
}
|
||||
// unsigned int time_until_end_of_frame = (kCRTFixedPointRange - _rasterPosition.y) / _scanSpeed[0].y;
|
||||
//
|
||||
// if(time_until_end_of_frame < proposedSyncTime) {
|
||||
// proposedSyncTime = time_until_end_of_frame;
|
||||
// proposedEvent = SyncEvent::StartVSync;
|
||||
// }
|
||||
} else {
|
||||
unsigned int time_until_start_of_frame = _rasterPosition.y / (uint32_t)(-_scanSpeed[kRetraceYMask].y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user