1 /*
2  * Copyright (c) 2009 Corey Tabaka
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #pragma once
9 
10 #include <lk/compiler.h>
11 
12 __BEGIN_CDECLS
13 
14 void platform_init_console(void);
15 
16 void set_visual_page(int page);
17 void set_active_page(int page);
18 
19 int get_visual_page(void);
20 int get_active_page(void);
21 
22 void place(int x,int y);
23 void cursor(int start, int end);
24 
25 void _clear(char c, char attr, int x1, int y1, int x2, int y2);
26 void clear(void);
27 
28 void _scroll(char attr, int x1, int y1, int x2, int y2);
29 void scroll(void);
30 
31 void curr_save(void);
32 void curr_restore(void);
33 
34 void cputc(char c);
35 void cputs(char *s);
36 
37 void window(int x1, int y1, int x2, int y2);
38 
39 void putc_xy(int x, int y, char attr, char c);
40 void puts_xy(int x, int y, char attr, char *s);
41 
42 int printf_xy(int x, int y, char attr, char *fmt, ...) __PRINTFLIKE(4, 5);
43 
44 #define CURSOR_BLOCK()  cursor(0, 15);
45 #define CURSOR_OFF()    cursor(16, 16);
46 #define CURSOR_STD()    cursor(14, 15);
47 
48 /* text colors */
49 #define BLACK           0
50 #define BLUE            1
51 #define GREEN           2
52 #define CYAN            3
53 #define RED             4
54 #define MAGENTA         5
55 #define BROWN           6
56 #define LIGHTGRAY       7
57 #define DARKGRAY        8
58 #define LIGHTBLUE       9
59 #define LIGHTGREEN      10
60 #define LIGHTCYAN       11
61 #define LIGHTRED        12
62 #define LIGHTMAGENTA    13
63 #define YELLOW          14
64 #define WHITE           15
65 
66 __END_CDECLS
67 
68