Files
nub-os/src/vga.h
nub31 336b4e1152 ...
2025-08-24 00:29:04 +02:00

38 lines
827 B
C

#pragma once
#include "stdint.h"
#define VGA_BLACK 0
#define VGA_BLUE 1
#define VGA_GREEN 2
#define VGA_CYAN 3
#define VGA_RED 4
#define VGA_MAGENTA 5
#define VGA_BROWN 6
#define VGA_LIGHT_GRAY 7
#define VGA_DARK_GRAY 8
#define VGA_LIGHT_BLUE 9
#define VGA_LIGHT_GREEN 10
#define VGA_LIGHT_CYAN 11
#define VGA_LIGHT_RED 12
#define VGA_LIGHT_MAGENTA 13
#define VGA_YELLOW 14
#define VGA_WHITE 15
typedef uint8_t vga_color_t;
void vga_reset(void);
void vga_set_cursor_position(uint8_t row, uint8_t col);
void vga_print_colored(const char* string, vga_color_t color);
void vga_print(const char* string);
static inline vga_color_t vga_color(vga_color_t fg_color, vga_color_t bg_color)
{
return fg_color | bg_color << 4;
}
static inline vga_color_t vga_default_color()
{
return vga_color(VGA_LIGHT_GRAY, VGA_BLACK);
}