summaryrefslogtreecommitdiff
path: root/src/kernel/vga.c
diff options
context:
space:
mode:
authorBenji Dial <Benji3.141@gmail.com>2020-11-08 11:11:49 -0500
committerBenji Dial <Benji3.141@gmail.com>2020-11-08 11:11:49 -0500
commit21491514b3642a321ce65f2a07428f63c4d9feb5 (patch)
treecf2384926e9d8e4cb0dcf2c9babd37fc7809c5da /src/kernel/vga.c
parent594aeeb09bc24de7064eb1bddf6e86c1a134838e (diff)
downloadportland-os-21491514b3642a321ce65f2a07428f63c4d9feb5.tar.gz
manual viewer, "swap colors" system call
Diffstat (limited to 'src/kernel/vga.c')
-rw-r--r--src/kernel/vga.c5
1 files changed, 5 insertions, 0 deletions
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);