1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Double flash rate.

This commit is contained in:
Thomas Harte 2024-02-28 22:13:22 -05:00
parent cd21b39f44
commit 0f691766ee

View File

@ -310,7 +310,14 @@ template <typename TimeUnit> class VideoSwitches {
bool annunciator_3 = false; bool annunciator_3 = false;
} external_, internal_; } 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; int flash_ = 0;
uint8_t flash_mask() const { uint8_t flash_mask() const {
return uint8_t((flash_ / flash_length) * 0xff); return uint8_t((flash_ / flash_length) * 0xff);