update sizes for new font size
This commit is contained in:
parent
8c67690099
commit
13e0c9697c
1 changed files with 7 additions and 7 deletions
|
|
@ -1,9 +1,9 @@
|
|||
use crate::dev::framebuffer::{fb_clear_area, fb_clearscreen, fb_write_char_array};
|
||||
use crate::dev::framebuffer::{fb_clear_area, fb_clearscreen, fb_write_char_array, CHAR_SIZE};
|
||||
use crate::spinlock::Spinlock;
|
||||
use crate::trafficcontrol::TrafficControl;
|
||||
|
||||
pub struct FramebufferConsole {
|
||||
pub buffer: [[char; 20]; 15], // our font is 16x16, 320x240 is the standard res, so 20x15
|
||||
pub buffer: [[char; 26]; 20], // our font is 16x16, 320x240 is the standard res, so 20x15
|
||||
pub cursor: (usize, usize), // (x, y)
|
||||
pub need_screen_clear: bool,
|
||||
pub need_line_clear: bool,
|
||||
|
|
@ -14,7 +14,7 @@ pub static FBCONSOLE: Spinlock<FramebufferConsole> = Spinlock::new(FramebufferCo
|
|||
impl FramebufferConsole {
|
||||
pub const fn empty() -> Self {
|
||||
Self {
|
||||
buffer: [[' '; 20]; 15],
|
||||
buffer: [[' '; 26]; 20],
|
||||
cursor: (0, 0),
|
||||
need_screen_clear: true,
|
||||
need_line_clear: false,
|
||||
|
|
@ -27,14 +27,14 @@ impl FramebufferConsole {
|
|||
let copy_from = self.buffer[line_num + 1];
|
||||
self.buffer[line_num] = copy_from;
|
||||
}
|
||||
self.buffer[self.buffer.len() - 1] = [' '; 20];
|
||||
self.buffer[self.buffer.len() - 1] = [' '; 26];
|
||||
self.need_screen_clear = true;
|
||||
}
|
||||
|
||||
// DOES send a framebuffer update!
|
||||
pub fn clear_terminal(&mut self, tc: &mut TrafficControl) {
|
||||
self.need_screen_clear = true;
|
||||
self.buffer = [[' '; 20]; 15];
|
||||
self.buffer = [[' '; 26]; 20];
|
||||
self.cursor = (0, 0);
|
||||
self.render(tc, true);
|
||||
}
|
||||
|
|
@ -90,12 +90,12 @@ impl FramebufferConsole {
|
|||
self.need_screen_clear = false;
|
||||
}
|
||||
if self.need_line_clear {
|
||||
fb_clear_area(tc, 0, self.cursor.1 * 16, 320, 16, refresh_whole_screen);
|
||||
fb_clear_area(tc, 0, self.cursor.1 * CHAR_SIZE, 320, CHAR_SIZE, refresh_whole_screen);
|
||||
self.need_line_clear = false;
|
||||
}
|
||||
|
||||
for (y, line) in self.buffer.iter().enumerate() {
|
||||
fb_write_char_array(tc, 0, y * 16, line);
|
||||
fb_write_char_array(tc, 0, y * CHAR_SIZE, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue