1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +00:00

Fixed field timing. It's 312.5 lines now, closer to the PAL standard.

This commit is contained in:
Thomas Harte 2016-02-11 22:12:37 -05:00
parent a6574d1f96
commit 86017de1fb

View File

@ -14,7 +14,7 @@
using namespace Electron; using namespace Electron;
static const unsigned int cycles_per_line = 128; 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_multiplier = 8;
static const unsigned int crt_cycles_per_line = crt_cycles_multiplier * cycles_per_line; 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 1: case 4: case 6: newDivider = 2; break;
case 2: case 5: newDivider = 4; 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); _crt.output_data((unsigned int)((_writePointer - _currentLine) * _currentOutputDivider * crt_cycles_multiplier), _currentOutputDivider);
_currentOutputDivider = newDivider; _currentOutputDivider = newDivider;
@ -570,6 +570,7 @@ inline void Machine::update_display()
else else
_crt.output_data(80 * crt_cycles_multiplier, _currentOutputDivider); _crt.output_data(80 * crt_cycles_multiplier, _currentOutputDivider);
_currentLine = nullptr; _currentLine = nullptr;
_writePointer = nullptr;
} }
} }
} }