Advertisement
Guest User

TTY terminal scroll function

a guest
Oct 27th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. void terminal_scroll()
  2. {
  3. size_t index = 0;
  4. size_t buffer_size = VGA_WIDTH * VGA_HEIGHT;
  5. while (terminal_buffer[index])
  6. {
  7. if (index + VGA_WIDTH < buffer_size)
  8. terminal_buffer[index] = terminal_buffer[index + VGA_WIDTH];
  9. else
  10. terminal_buffer[index] = vga_entry(' ', terminal_color);
  11. index++;
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement