4 #include "types.h" // u8
11 #define VGAREG_ACTL_ADDRESS 0x3c0
12 #define VGAREG_ACTL_WRITE_DATA 0x3c0
13 #define VGAREG_ACTL_READ_DATA 0x3c1
15 #define VGAREG_INPUT_STATUS 0x3c2
16 #define VGAREG_WRITE_MISC_OUTPUT 0x3c2
17 #define VGAREG_VIDEO_ENABLE 0x3c3
18 #define VGAREG_SEQU_ADDRESS 0x3c4
19 #define VGAREG_SEQU_DATA 0x3c5
21 #define VGAREG_PEL_MASK 0x3c6
22 #define VGAREG_DAC_STATE 0x3c7
23 #define VGAREG_DAC_READ_ADDRESS 0x3c7
24 #define VGAREG_DAC_WRITE_ADDRESS 0x3c8
25 #define VGAREG_DAC_DATA 0x3c9
27 #define VGAREG_READ_FEATURE_CTL 0x3ca
28 #define VGAREG_READ_MISC_OUTPUT 0x3cc
30 #define VGAREG_GRDC_ADDRESS 0x3ce
31 #define VGAREG_GRDC_DATA 0x3cf
33 #define VGAREG_MDA_CRTC_ADDRESS 0x3b4
34 #define VGAREG_MDA_CRTC_DATA 0x3b5
35 #define VGAREG_VGA_CRTC_ADDRESS 0x3d4
36 #define VGAREG_VGA_CRTC_DATA 0x3d5
38 #define VGAREG_MDA_WRITE_FEATURE_CTL 0x3ba
39 #define VGAREG_VGA_WRITE_FEATURE_CTL 0x3da
40 #define VGAREG_ACTL_RESET 0x3da
42 #define VGAREG_MDA_MODECTL 0x3b8
43 #define VGAREG_CGA_MODECTL 0x3d8
44 #define VGAREG_CGA_PALETTE 0x3d9
47 #define SEG_GRAPH 0xA000
48 #define SEG_CTEXT 0xB800
49 #define SEG_MTEXT 0xB000
53 * Tables of default values for each mode
77 #define SCREEN_SIZE(x,y) (((x*y*2)|0x00ff)+1)
78 #define SCREEN_MEM_START(x,y,p) ((((x*y*2)|0x00ff)+1)*p)
79 #define SCREEN_IO_START(x,y,p) ((((x*y)|0x00ff)+1)*p)
81 /* standard BIOS Video Parameter Table */
96 struct VideoParam_s *vparam;
97 u8 class; /* TEXT, GRAPH */
98 u8 memmodel; /* CTEXT,MTEXT,CGA,PL1,PL2,PL4,P8,P15,P16,P24,P32 */
106 struct saveVideoHardware {
121 struct saveBDAstate {
142 struct saveDACcolors {
151 struct vgamode_s *find_vga_entry(u8 mode);
152 extern u16 video_save_pointer_table[];
153 extern struct VideoParam_s video_param_table[];
154 extern u8 static_functionality[];
157 extern u8 vgafont8[];
158 extern u8 vgafont14[];
159 extern u8 vgafont16[];
160 extern u8 vgafont14alt[];
161 extern u8 vgafont16alt[];
171 struct cursorpos get_cursor_pos(u8 page);
174 void clear_screen(struct vgamode_s *vmode_g);
175 void biosfn_scroll(u8 nblines, u8 attr, u8 rul, u8 cul, u8 rlr, u8 clr
177 void vgafb_write_char(u8 page, struct carattr ca, u16 count);
178 struct carattr vgafb_read_char(u8 page);
179 void biosfn_write_pixel(u8 BH, u8 AL, u16 CX, u16 DX);
180 void biosfn_read_pixel(u8 BH, u16 CX, u16 DX, u16 *AX);
181 void vgafb_load_font(u16 seg, void *src_far, u16 count
182 , u16 start, u8 destflags, u8 fontsize);
185 void vgahw_screen_disable();
186 void vgahw_screen_enable();
187 void vgahw_set_border_color(u8 color);
188 void vgahw_set_overscan_border_color(u8 color);
189 u8 vgahw_get_overscan_border_color();
190 void vgahw_set_palette(u8 palid);
191 void vgahw_set_single_palette_reg(u8 reg, u8 val);
192 u8 vgahw_get_single_palette_reg(u8 reg);
193 void vgahw_set_all_palette_reg(u16 seg, u8 *data_far);
194 void vgahw_get_all_palette_reg(u16 seg, u8 *data_far);
195 void vgahw_toggle_intensity(u8 flag);
196 void vgahw_select_video_dac_color_page(u8 flag, u8 data);
197 void vgahw_read_video_dac_state(u8 *pmode, u8 *curpage);
198 void vgahw_set_dac_regs(u16 seg, u8 *data_far, u8 start, int count);
199 void vgahw_get_dac_regs(u16 seg, u8 *data_far, u8 start, int count);
200 void vgahw_set_pel_mask(u8 val);
201 u8 vgahw_get_pel_mask();
202 void vgahw_save_dac_state(u16 seg, struct saveDACcolors *info);
203 void vgahw_restore_dac_state(u16 seg, struct saveDACcolors *info);
204 void vgahw_set_text_block_specifier(u8 spec);
205 void get_font_access();
206 void release_font_access();
207 void vgahw_set_cursor_shape(u8 start, u8 end);
208 void vgahw_set_active_page(u16 address);
209 void vgahw_set_cursor_pos(u16 address);
210 void vgahw_set_scan_lines(u8 lines);
212 void vgahw_save_state(u16 seg, struct saveVideoHardware *info);
213 void vgahw_restore_state(u16 seg, struct saveVideoHardware *info);
214 void vgahw_set_mode(struct VideoParam_s *vparam_g);
215 void vgahw_enable_video_addressing(u8 disable);
219 void cirrus_set_video_mode(u8 mode);
222 // vbe.c -- not implemented yet.
223 #define VBE_DISPI_DISABLED 0x00
224 void dispi_set_enable(int enable);
226 int vbe_has_vbe_display();
228 #endif // vgatables.h