1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 03:29:45 +00:00

Merge pull request #1347 from TomHarte/AppleIIFlashRate

Double Apple II flash rate.
This commit is contained in:
Thomas Harte 2024-02-28 22:21:05 -05:00 committed by GitHub
commit 1449b2a2a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -310,7 +310,14 @@ template <typename TimeUnit> class VideoSwitches {
bool annunciator_3 = false;
} external_, internal_;
int flash_length = 8406;
// 8406 lines covers a complete on-off cycle, i.e. because the Apple II has a line
// rate of around 15734.26 lines/second, flashing has a frequency of roughly
// 15734.26 / 8406, or roughly 1.83Hz.
//
// Internally that's modelled by a counter that goes to **twice** the value of the
// constant specified below. Hence the divide by two.
static constexpr int flash_length = 8406 / 2;
int flash_ = 0;
uint8_t flash_mask() const {
return uint8_t((flash_ / flash_length) * 0xff);