1 /* ----------------------------------------------------------------------- *
3 * Copyright 2006 H. Peter Anvin - All Rights Reserved
5 * Permission is hereby granted, free of charge, to any person
6 * obtaining a copy of this software and associated documentation
7 * files (the "Software"), to deal in the Software without
8 * restriction, including without limitation the rights to use,
9 * copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom
11 * the Software is furnished to do so, subject to the following
14 * The above copyright notice and this permission notice shall
15 * be included in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
26 * ----------------------------------------------------------------------- */
28 #ifndef LIB_SYS_VESA_VIDEO_H
29 #define LIB_SYS_VESA_VIDEO_H
31 #define FONT_MAX_CHARS 256
32 #define FONT_MAX_HEIGHT 32
35 #define VIDEO_X_SIZE 640
36 #define VIDEO_Y_SIZE 480
38 #define VIDEO_BORDER 8
39 #define TEXT_PIXEL_ROWS (VIDEO_Y_SIZE-2*VIDEO_BORDER)
40 #define TEXT_PIXEL_COLS (VIDEO_X_SIZE-2*VIDEO_BORDER)
44 #define SHADOW_NORMAL 2
45 #define SHADOW_REVERSE 3
48 uint8_t ch
; /* Character */
49 uint8_t attr
; /* PC-style graphics attribute */
50 uint8_t sha
; /* Shadow attributes */
51 uint8_t pad
; /* Currently unused */
54 extern struct vesa_char
*__vesacon_text_display
;
56 extern int __vesacon_font_height
, __vesacon_text_rows
;
57 extern uint8_t __vesacon_graphics_font
[FONT_MAX_CHARS
][FONT_MAX_HEIGHT
];
58 extern uint32_t __vesacon_background
[VIDEO_Y_SIZE
][VIDEO_X_SIZE
];
59 extern uint32_t __vesacon_shadowfb
[VIDEO_Y_SIZE
][VIDEO_X_SIZE
];
61 extern unsigned char __vesacon_alpha_tbl
[256][4];
63 int __vesacon_init_background(void);
64 int vesacon_load_background(const char *);
65 int __vesacon_init(void);
66 void __vesacon_erase(int, int, int, int, uint8_t, int);
67 void __vesacon_scroll_up(int, uint8_t, int);
68 void __vesacon_write_at(int, int, const char *, uint8_t, int);
69 void __vesacon_write_char(int, int, char, uint8_t, int);
71 #endif /* LIB_SYS_VESA_VIDEO_H */