Write letters

This commit is contained in:
2025-07-27 21:06:17 +02:00
parent a4250898c0
commit e6899097fc
4 changed files with 153 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
use core::ptr::write_volatile;
mod bitmaps;
use bitmaps::BASIC_LEGACY;
use crate::{
mailbox::{read_mailbox, write_mailbox},
peripherals::uart::{print, print_u32, print_u32_hex},
@@ -196,6 +200,22 @@ impl FrameBuffer {
}
}
}
pub fn draw_letter(&self, x: u32, y: u32, scale: u32) {
for (y_offset, row) in (&BASIC_LEGACY[0x70]).iter().enumerate() {
for bit in 0..8 {
match row & (1 << bit) {
0 => {}
_ => self.draw_square_fill(
x + (bit * scale),
y + (y_offset as u32 * scale),
x + ((bit + 1) * scale),
y + ((y_offset + 1) as u32 * scale),
),
}
}
}
}
}
pub fn print_display_resolution() {