MCPcopy Create free account
hub / github.com/Infinity-OS/infinity / write_byte

Method write_byte

src/vga_buffer.rs:79–99  ·  view source on GitHub ↗

Write a byte to the console. # Arguments `byte` - Byte to be writen

(&mut self, byte: u8)

Source from the content-addressed store, hash-verified

77 ///
78 /// * `byte` - Byte to be writen
79 pub fn write_byte(&mut self, byte: u8) {
80 match byte {
81 b'\n' => self.new_line(),
82 b'\t' => for i in 0..2 { self.write_byte(b' ') },
83 byte => {
84 if self.column_position >= BUFFER_WIDTH {
85 self.new_line();
86 }
87 let row = self.row_positon;
88 let col = self.column_position;
89
90 let color_code = self.color_code;
91
92 self.buffer().chars[row][col].write(ScreenChar {
93 ascii_character: byte,
94 color_code: color_code,
95 });
96 self.column_position += 1;
97 }
98 }
99 }
100
101 /// Gets a mutable reference to the console Buffer.
102 fn buffer(&mut self) -> &mut Buffer {

Callers 1

write_strMethod · 0.80

Calls 3

new_lineMethod · 0.80
bufferMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected