summaryrefslogtreecommitdiff
path: root/kernel/src/io
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/io')
-rw-r--r--kernel/src/io/vga_text.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/src/io/vga_text.rs b/kernel/src/io/vga_text.rs
index e44d341..3d5b3fd 100644
--- a/kernel/src/io/vga_text.rs
+++ b/kernel/src/io/vga_text.rs
@@ -28,13 +28,13 @@ impl VgaChar {
}
pub fn set_byte(&mut self, byte: u8) {
- let byte = u16::to_ne_bytes(self.0)[0];
- self.0 = u16::from_ne_bytes([byte, byte]);
+ let color = u16::to_ne_bytes(self.0)[1];
+ *self = Self::from_byte_with_color_state(byte, color);
}
- pub fn set_color(&mut self, byte: u8) {
- let color = u16::to_ne_bytes(self.0)[1];
- self.0 = u16::from_ne_bytes([byte, color]);
+ pub fn set_color(&mut self, color: u8) {
+ let byte = u16::to_ne_bytes(self.0)[0];
+ *self = Self::from_byte_with_color_state(byte, color);
}
}