wm: teppich

ref: 3ffef0f58e132850684dad253b11ba73cfa959c1
dir: /include/vga.h/

View raw version
#pragma once
#include <u.h>

#define VGA_MEM 0xB8000

static const uint8 VGA_WIDTH = 80; /* x */
static const uint8 VGA_HEIGHT = 25; /* y */

uint8 vga_row;
uint8 vga_col;

uint8 vga_color;
uint16* vga_buf;

enum {
	BLACK = 0,
	BLUE,
	GREEN,
	CYAN,
	RED,
	MAGENTA,
	BROWN,
	LIGHT_GREY,
	DARK_GREY,
	LIGHT_BLUE,
	LIGHT_GREEN,
	LIGHT_CYAN,
	LIGHT_RED,
	LIGHT_MAGENTA,
	LIGHT_BROWN,
	WHITE,
};

static uint8 vga_gencolor(int fg, int bg);
static uint16 vga_char(unsigned char c, uint8 color);
void vga_clear(char c);
void vga_init(void);
void vga_writeto(char c, uint8 color, int x, int y);
void vga_scroll(int lines);
void vga_nl(void);
void vga_putc(char c);
void vga_puts(char *s);