Allow any character for fill_screen

This commit is contained in:
Daniel Beckwith 2020-03-31 20:33:06 -04:00
parent 6bc387cdf6
commit 98e9fb3d86

View file

@ -78,21 +78,12 @@ pub trait TextWriter: Screen {
/// a background color of `Color16::Black` and a foreground /// a background color of `Color16::Black` and a foreground
/// color of `Color16::Yellow`. /// color of `Color16::Yellow`.
fn clear_screen(&self) { fn clear_screen(&self) {
let (_vga, frame_buffer) = self.get_frame_buffer(); self.fill_screen(BLANK_CHARACTER);
for i in 0..Self::SIZE {
unsafe {
frame_buffer.add(i).write_volatile(BLANK_CHARACTER);
}
}
} }
/// Fills the screen by setting all cells to `b' '` with the given color. /// Fills the screen by setting all cells to the given screen character.
fn fill_screen(&self, color: TextModeColor) { fn fill_screen(&self, character: ScreenCharacter) {
let (_vga, frame_buffer) = self.get_frame_buffer(); let (_vga, frame_buffer) = self.get_frame_buffer();
let character = ScreenCharacter {
character: b' ',
color,
};
for i in 0..Self::SIZE { for i in 0..Self::SIZE {
unsafe { unsafe {
frame_buffer.add(i).write_volatile(character); frame_buffer.add(i).write_volatile(character);