}
impl Writer {
+ #[inline(always)]
pub fn write_byte(&mut self, byte: u8) {
match byte {
b'\n' => self.new_line(),
}
}
+ #[inline(always)]
pub fn write_string(&mut self, s: &str) {
for byte in s.bytes() {
match byte {
}
}
+ #[inline(always)]
fn new_line(&mut self) {
if self.row_position >= BUFFER_HEIGHT {
for row in 1..BUFFER_HEIGHT {
}
self.clear_row(BUFFER_HEIGHT.sub(1));
- self.column_position = 0;
}
+
+ self.row_position.add_assign(1);
+ self.column_position = 0;
}
fn clear_row(&mut self, row: usize) {
buffer: unsafe { &mut *(0xb8000 as *mut Buffer) },
};
- // writer.write_byte(b'A');
writer.write_string("Hello Stage2!");
- // writer.write_string("Hello Stage3!");
}