1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Merge pull request #1297 from TomHarte/InverseText

Fix Apple II inverse text errors.
This commit is contained in:
Thomas Harte 2024-01-01 22:18:11 -05:00 committed by GitHub
commit 8a85ef8426
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ template <typename TimeUnit> class VideoSwitches {
set of potential flashing characters and alternate video modes. set of potential flashing characters and alternate video modes.
*/ */
VideoSwitches(bool is_iie, TimeUnit delay, std::function<void(TimeUnit)> &&target) : delay_(delay), deferrer_(std::move(target)) { VideoSwitches(bool is_iie, TimeUnit delay, std::function<void(TimeUnit)> &&target) : delay_(delay), deferrer_(std::move(target)) {
character_zones_[0].xor_mask = 0; character_zones_[0].xor_mask = 0xff;
character_zones_[0].address_mask = 0x3f; character_zones_[0].address_mask = 0x3f;
character_zones_[1].xor_mask = 0; character_zones_[1].xor_mask = 0;
character_zones_[1].address_mask = 0x3f; character_zones_[1].address_mask = 0x3f;
@ -49,7 +49,7 @@ template <typename TimeUnit> class VideoSwitches {
character_zones_[3].address_mask = 0x3f; character_zones_[3].address_mask = 0x3f;
if(is_iie) { if(is_iie) {
character_zones_[0].xor_mask = character_zones_[1].xor_mask =
character_zones_[2].xor_mask = character_zones_[2].xor_mask =
character_zones_[3].xor_mask = 0xff; character_zones_[3].xor_mask = 0xff;
character_zones_[2].address_mask = character_zones_[2].address_mask =
@ -88,7 +88,7 @@ template <typename TimeUnit> class VideoSwitches {
if(alternative_character_set) { if(alternative_character_set) {
character_zones_[1].address_mask = 0xff; character_zones_[1].address_mask = 0xff;
character_zones_[1].xor_mask = 0; character_zones_[1].xor_mask = 0xff;
} else { } else {
character_zones_[1].address_mask = 0x3f; character_zones_[1].address_mask = 0x3f;
character_zones_[1].xor_mask = flash_mask(); character_zones_[1].xor_mask = flash_mask();
@ -286,7 +286,9 @@ template <typename TimeUnit> class VideoSwitches {
// Update character set flashing; flashing is applied only when the alternative // Update character set flashing; flashing is applied only when the alternative
// character set is not selected. // character set is not selected.
flash_ = (flash_ + 1) % (2 * flash_length); flash_ = (flash_ + 1) % (2 * flash_length);
character_zones_[1].xor_mask = flash_mask() * !internal_.alternative_character_set; if(!internal_.alternative_character_set) {
character_zones_[1].xor_mask = flash_mask();
}
} }
private: private: