summaryrefslogtreecommitdiff
path: root/video/console.h
blob: 71c3c72141559bfbfa45bb535a8f343f6382c210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef CONSOLEINT_H
#define CONSOLEINT_H
// 80 x 24 
// TODO: implement VT100

#include <stdint.h>

#define SCR_VIDEOMEM 0xb8000

#define SCR_REAL_WIDTH 80

#define SCR_WIDTH 78
#define SCR_HEIGHT 24

#define SCR_CTRL 0x3D4
#define SCR_DATA 0x3D5

// colors
#define SCR_BLACK   0x0
#define SCR_BLUE    0x1
#define SCR_GREEN   0x2
#define SCR_CYAN    0x3
#define SCR_RED	    0x4
#define SCR_VIOLET  0x5
#define SCR_BROWN   0x6
#define SCR_GRAY1   0x7
#define SCR_GRAY2   0x8
#define SCR_LBLUE   0x9
#define SCR_LGREEN  0xa
#define SCR_LCYAN   0xb
#define SCR_LRED    0xc
#define SCR_PINK    0xd
#define SCR_YELLOW  0xe
#define SCR_WHITE   0xf

//autoscroll
void scr_clear();
void scr_nextline();
void scr_backspace();
void scr_put_char(char ch,char col);
void scr_put_string(char *str);
void scr_put_string_nl(char *str);
void scr_put_hex(uint16_t val);

#endif