[Teton] Fix offset in console to write correct character.

This commit is contained in:
Drew Galbraith 2023-11-25 19:56:08 -08:00
parent 1b7d2b9085
commit aecae8e41f
1 changed files with 5 additions and 5 deletions

View File

@ -19,12 +19,12 @@ void Console::WriteChar(char c) {
uint8_t* glyph = psf_.glyph(c); uint8_t* glyph = psf_.glyph(c);
for (uint32_t r = fb_row; r < fb_row + psf_.height(); r++) { for (uint32_t r = fb_row; r < fb_row + psf_.height(); r++) {
for (uint32_t c = fb_col; c < fb_col + psf_.width(); c++) { for (uint32_t j = fb_col; j < fb_col + psf_.width(); j++) {
uint8_t glyph_offset = psf_.width() - (c - fb_col) - 1; uint8_t glyph_offset = psf_.width() - (j - fb_col) - 1;
if ((glyph[r] & (1 << glyph_offset))) { if ((glyph[r - fb_row] & (1 << glyph_offset))) {
framebuf_.DrawPixel(r, c, 0xFFFFFFF); framebuf_.DrawPixel(r, j, 0xFFFFFFF);
} else { } else {
framebuf_.DrawPixel(r, c, 0); framebuf_.DrawPixel(r, j, 0);
} }
} }
} }