1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-10 00:29:40 +00:00

Factor in x_scroll_.

This commit is contained in:
Thomas Harte 2024-12-18 22:14:57 -05:00
parent b08cc9cb49
commit c8ad8c79bd

View File

@ -295,11 +295,11 @@ public:
// Output pixels.
// TODO: properly. Accounting for mode, attributes, etc.
if(pixels_) {
const auto first_pixel = ((horizontal_counter_ + EndOfLine - Begin40Columns) - x_scroll_) % EndOfLine;
for(int c = 0; c < period; c++) {
const auto pixel = time_in_state_ + c;
const auto pixel = first_pixel + c;
const auto column = pixel >> 3;
const uint8_t glyph = bitmap_[column] ^ lines_[line_pointer_].attributes[column].cursor_mask;
pixels_[c] = glyph & (0x80 >> (pixel & 7)) ?
lines_[line_pointer_].attributes[pixel >> 3].colour :
background_[0];