yuI4140 / Kou-os

a os written in rust
3 stars 0 forks source link

In vga_buffer.rs #1

Open yuI4140 opened 1 year ago

yuI4140 commented 1 year ago

there are functions that are missing and variables that are not in the scope

yuI4140 commented 1 year ago

New func (it's a placeholder) :

impl Writer {
    fn new_line(&mut self) {
        // Move cursor to the next line
        self.column_position = 0;
        if self.row == BUFFER_HEIGHT - 1 {
            // Scroll the buffer if the cursor is at the bottom of the screen
            for row in 1..BUFFER_HEIGHT {
                for col in 0..BUFFER_WIDTH {
                    let character = self.buffer.chars[row][col].read();
                    self.buffer.chars[row - 1][col].write(character);
                }
            }
            // Clear the last row
            self.clear_row(BUFFER_HEIGHT - 1);
        } else {
            self.row += 1;
        }
    }
}