From 21491514b3642a321ce65f2a07428f63c4d9feb5 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 8 Nov 2020 11:11:49 -0500 Subject: manual viewer, "swap colors" system call --- src/kernel/vga.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/kernel/vga.c') diff --git a/src/kernel/vga.c b/src/kernel/vga.c index 42da312..6ae1588 100644 --- a/src/kernel/vga.c +++ b/src/kernel/vga.c @@ -12,6 +12,11 @@ void vga_set_color(uint8_t new_color) { mask = new_color << 8; } +void vga_swap_color(uint16_t pos) { + uint8_t *color_byte = (uint8_t *)(VGA_START + (pos >> 8) * VGA_COLUMNS + (pos & 0xff)) + 1; + *color_byte = (*color_byte << 4) + (*color_byte >> 4); +} + static void vga_scroll() { for (uint32_t *i = (uint32_t *)VGA_START; i < (uint32_t *)(VGA_END - VGA_COLUMNS); ++i) *i = *(i + VGA_COLUMNS / 2); -- cgit v1.2.3