From 98e9fb3d86be6ce30f036c84952c92de3cd08f6c Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Tue, 31 Mar 2020 20:33:06 -0400 Subject: [PATCH] Allow any character for fill_screen --- src/writers/mod.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/writers/mod.rs b/src/writers/mod.rs index 1759a29..d47a2a8 100644 --- a/src/writers/mod.rs +++ b/src/writers/mod.rs @@ -78,21 +78,12 @@ pub trait TextWriter: Screen { /// a background color of `Color16::Black` and a foreground /// color of `Color16::Yellow`. fn clear_screen(&self) { - let (_vga, frame_buffer) = self.get_frame_buffer(); - for i in 0..Self::SIZE { - unsafe { - frame_buffer.add(i).write_volatile(BLANK_CHARACTER); - } - } + self.fill_screen(BLANK_CHARACTER); } - /// Fills the screen by setting all cells to `b' '` with the given color. - fn fill_screen(&self, color: TextModeColor) { + /// Fills the screen by setting all cells to the given screen character. + fn fill_screen(&self, character: ScreenCharacter) { let (_vga, frame_buffer) = self.get_frame_buffer(); - let character = ScreenCharacter { - character: b' ', - color, - }; for i in 0..Self::SIZE { unsafe { frame_buffer.add(i).write_volatile(character);