From 86017de1fb6b5b0e647cbe99279774d1cfa9f4bf Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 11 Feb 2016 22:12:37 -0500 Subject: [PATCH] Fixed field timing. It's 312.5 lines now, closer to the PAL standard. --- Machines/Electron/Electron.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 86150efd2..ad15d5a2a 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -14,7 +14,7 @@ using namespace Electron; static const unsigned int cycles_per_line = 128; -static const unsigned int cycles_per_frame = 312*cycles_per_line; +static const unsigned int cycles_per_frame = 312*cycles_per_line + 64; static const unsigned int crt_cycles_multiplier = 8; static const unsigned int crt_cycles_per_line = crt_cycles_multiplier * cycles_per_line; @@ -468,7 +468,7 @@ inline void Machine::update_display() case 1: case 4: case 6: newDivider = 2; break; case 2: case 5: newDivider = 4; break; } - if(newDivider != _currentOutputDivider) + if(newDivider != _currentOutputDivider && _currentLine) { _crt.output_data((unsigned int)((_writePointer - _currentLine) * _currentOutputDivider * crt_cycles_multiplier), _currentOutputDivider); _currentOutputDivider = newDivider; @@ -570,6 +570,7 @@ inline void Machine::update_display() else _crt.output_data(80 * crt_cycles_multiplier, _currentOutputDivider); _currentLine = nullptr; + _writePointer = nullptr; } } }