vgabios: Rename vgaio.c to stdvga.c.
[seabios.git] / vgasrc / vgabios.h
1 #ifndef __VGABIOS_H
2 #define __VGABIOS_H
3
4 #include "types.h" // u8
5 #include "farptr.h" // struct segoff_s
6
7 #define SCREEN_IO_START(x,y,p) (((((x)*(y)) | 0x00ff) + 1) * (p))
8 #define SCREEN_MEM_START(x,y,p) SCREEN_IO_START(((x)*2),(y),(p))
9
10 struct saveBDAstate {
11     u8 video_mode;
12     u16 video_cols;
13     u16 video_pagesize;
14     u16 crtc_address;
15     u8 video_rows;
16     u16 char_height;
17     u8 video_ctl;
18     u8 video_switches;
19     u8 modeset_ctl;
20     u16 cursor_type;
21     u16 cursor_pos[8];
22     u16 video_pagestart;
23     u8 video_page;
24     /* current font */
25     struct segoff_s font0;
26     struct segoff_s font1;
27 };
28
29 // vgatables.c
30 struct vgamode_s;
31 struct vgamode_s *find_vga_entry(u8 mode);
32 void build_video_param(void);
33 extern struct VideoSavePointer_s video_save_pointer_table;
34 extern u8 static_functionality[];
35
36 // vgafonts.c
37 extern u8 vgafont8[];
38 extern u8 vgafont14[];
39 extern u8 vgafont16[];
40 extern u8 vgafont14alt[];
41 extern u8 vgafont16alt[];
42
43 // vgabios.c
44 #define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
45 struct carattr {
46     u8 car, attr, use_attr;
47 };
48 struct cursorpos {
49     u8 x, y, page;
50 };
51 void vga_set_mode(u8 mode, u8 noclearmem);
52
53 // vgafb.c
54 void clear_screen(struct vgamode_s *vmode_g);
55 void vgafb_scroll(int nblines, int attr
56                   , struct cursorpos ul, struct cursorpos lr);
57 void vgafb_write_char(struct cursorpos cp, struct carattr ca);
58 struct carattr vgafb_read_char(struct cursorpos cp);
59 void vgafb_write_pixel(u8 color, u16 x, u16 y);
60 u8 vgafb_read_pixel(u16 x, u16 y);
61 void vgafb_load_font(u16 seg, void *src_far, u16 count
62                      , u16 start, u8 destflags, u8 fontsize);
63
64 // clext.c
65 int cirrus_set_video_mode(u8 mode, u8 noclearmem);
66 void cirrus_init(void);
67
68 // vbe.c
69 #define VBE_OEM_STRING "SeaBIOS VBE(C) 2011"
70 #define VBE_VENDOR_STRING "SeaBIOS Developers"
71 #define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter"
72 #define VBE_REVISION_STRING "Rev. 1"
73
74 struct vbe_modeinfo
75 {
76     u16 width;
77     u16 height;
78     u8 depth;
79     u16 linesize;
80     u32 phys_base;
81     u32 vram_size;
82 };
83
84 struct bregs;
85 void handle_104f(struct bregs *regs);
86
87 #endif // vgabios.h