diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index fd139386e..62d4c39d4 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -274,14 +274,17 @@ void CRT::advance_cycles(unsigned int number_of_cycles, unsigned int source_divi #pragma mark - stream feeding methods -void CRT::output_scan(Scan *scan) +void CRT::output_scan(const Scan *const scan) { - bool this_is_sync = (scan->type == Scan::Type::Sync); - bool is_trailing_edge = (_is_receiving_sync && !this_is_sync); - bool hsync_requested = is_trailing_edge && (_sync_period < (_horizontal_flywheel->get_scan_period() >> 2)); - bool vsync_requested = is_trailing_edge && (_sync_capacitor_charge_level >= _sync_capacitor_charge_threshold); + const bool this_is_sync = (scan->type == Scan::Type::Sync); + const bool is_trailing_edge = (_is_receiving_sync && !this_is_sync); +// const bool is_leading_edge = (!_is_receiving_sync && this_is_sync); _is_receiving_sync = this_is_sync; +// const bool hsync_requested = is_leading_edge; + const bool hsync_requested = is_trailing_edge && (_sync_period < (_horizontal_flywheel->get_scan_period() >> 2)); + const bool vsync_requested = is_trailing_edge && (_sync_capacitor_charge_level >= _sync_capacitor_charge_threshold); + // simplified colour burst logic: if it's within the back porch we'll take it if(scan->type == Scan::Type::ColourBurst) { diff --git a/Outputs/CRT/CRT.hpp b/Outputs/CRT/CRT.hpp index 3ccc46c9d..3391fdc4f 100644 --- a/Outputs/CRT/CRT.hpp +++ b/Outputs/CRT/CRT.hpp @@ -61,7 +61,7 @@ class CRT { }; }; }; - void output_scan(Scan *scan); + void output_scan(const Scan *scan); uint8_t _colour_burst_phase, _colour_burst_amplitude; uint16_t _colour_burst_time;