1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 01:31:42 +00:00

Merge pull request #512 from TomHarte/80Text

Extends correct text handling to 80-column mode.
This commit is contained in:
Thomas Harte 2018-08-04 22:28:59 -04:00 committed by GitHub
commit f7ce86fef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,15 +292,19 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
case GraphicsMode::DoubleText: { case GraphicsMode::DoubleText: {
const uint8_t inverses[] = { const uint8_t inverses[] = {
0xff, 0xff,
static_cast<uint8_t>((flash_ / flash_length) * 0xff), alternative_character_set_ ? static_cast<uint8_t>(0xff) : static_cast<uint8_t>((flash_ / flash_length) * 0xff),
0x00, 0x00,
0x00 0x00
}; };
const uint8_t masks[] = {
alternative_character_set_ ? static_cast<uint8_t>(0x7f) : static_cast<uint8_t>(0x3f),
is_iie ? 0x7f : 0x3f,
};
for(int c = column_; c < pixel_end; ++c) { for(int c = column_; c < pixel_end; ++c) {
const uint16_t characters = bus_handler_.perform_aux_read(static_cast<uint16_t>(text_address + c)); const uint16_t characters = bus_handler_.perform_aux_read(static_cast<uint16_t>(text_address + c));
const std::size_t character_addresses[2] = { const std::size_t character_addresses[2] = {
static_cast<std::size_t>((((characters >> 8) & 0x3f) << 3) + pixel_row), static_cast<std::size_t>((((characters >> 8) & masks[characters >> 15]) << 3) + pixel_row),
static_cast<std::size_t>(((characters & 0x3f) << 3) + pixel_row), static_cast<std::size_t>(((characters & masks[(characters >> 7)&1]) << 3) + pixel_row),
}; };
const uint8_t character_patterns[2] = { const uint8_t character_patterns[2] = {