diff options
author | NatrixAeria <upezu@student.kit.edu> | 2021-04-16 21:13:21 +0200 |
---|---|---|
committer | NatrixAeria <upezu@student.kit.edu> | 2021-04-16 21:13:21 +0200 |
commit | 114baa01288642ae6d489029283736fd2fd26565 (patch) | |
tree | a09f2f73e77def953bd813ec07a8abc4039bf8fe | |
parent | db5f26fe55527521a0ae8ca7cad01f0ba8eb0c49 (diff) |
Fix VgaChar's byte and color state setterbetter-terminal
-rw-r--r-- | kernel/src/io/vga_text.rs | 10 |
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); } } |