mirror of
https://github.com/iceHtwoO/novaOS.git
synced 2026-04-17 04:32:27 +00:00
Write letters
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user