blob: df09bab8628f72d03d145f3ddd7e3caaafeb0c88 [file] [log] [blame]
Kevin O'Connored68e5b2011-12-31 04:15:12 -05001#ifndef __STDVGA_H
2#define __STDVGA_H
3
4#include "types.h" // u8
5
6// VGA registers
7#define VGAREG_ACTL_ADDRESS 0x3c0
8#define VGAREG_ACTL_WRITE_DATA 0x3c0
9#define VGAREG_ACTL_READ_DATA 0x3c1
10
11#define VGAREG_INPUT_STATUS 0x3c2
12#define VGAREG_WRITE_MISC_OUTPUT 0x3c2
13#define VGAREG_VIDEO_ENABLE 0x3c3
14#define VGAREG_SEQU_ADDRESS 0x3c4
15#define VGAREG_SEQU_DATA 0x3c5
16
17#define VGAREG_PEL_MASK 0x3c6
18#define VGAREG_DAC_STATE 0x3c7
19#define VGAREG_DAC_READ_ADDRESS 0x3c7
20#define VGAREG_DAC_WRITE_ADDRESS 0x3c8
21#define VGAREG_DAC_DATA 0x3c9
22
23#define VGAREG_READ_FEATURE_CTL 0x3ca
24#define VGAREG_READ_MISC_OUTPUT 0x3cc
25
26#define VGAREG_GRDC_ADDRESS 0x3ce
27#define VGAREG_GRDC_DATA 0x3cf
28
29#define VGAREG_MDA_CRTC_ADDRESS 0x3b4
30#define VGAREG_MDA_CRTC_DATA 0x3b5
31#define VGAREG_VGA_CRTC_ADDRESS 0x3d4
32#define VGAREG_VGA_CRTC_DATA 0x3d5
33
34#define VGAREG_MDA_WRITE_FEATURE_CTL 0x3ba
35#define VGAREG_VGA_WRITE_FEATURE_CTL 0x3da
36#define VGAREG_ACTL_RESET 0x3da
37
38#define VGAREG_MDA_MODECTL 0x3b8
39#define VGAREG_CGA_MODECTL 0x3d8
40#define VGAREG_CGA_PALETTE 0x3d9
41
42/* Video memory */
43#define SEG_GRAPH 0xA000
44#define SEG_CTEXT 0xB800
45#define SEG_MTEXT 0xB000
46
Kevin O'Connor4ad2d102012-01-14 23:20:05 -050047// stdvgamodes.c
Kevin O'Connor10dff3d2012-01-09 19:19:44 -050048struct vgamode_s *stdvga_find_mode(int mode);
Kevin O'Connorf98bbf02012-01-27 23:09:02 -050049void stdvga_list_modes(u16 seg, u16 *dest, u16 *last);
Kevin O'Connoraad3b692012-01-14 23:15:40 -050050void stdvga_build_video_param(void);
Kevin O'Connor69b01cb2012-01-14 23:25:24 -050051void stdvga_override_crtc(int mode, u8 *crtc);
Kevin O'Connorf98bbf02012-01-27 23:09:02 -050052int stdvga_set_mode(struct vgamode_s *vmode_g, int flags);
Kevin O'Connor5b6936e2013-11-29 18:43:35 -050053void stdvga_set_packed_palette(void);
Kevin O'Connor10dff3d2012-01-09 19:19:44 -050054
Kevin O'Connor3471fdb2012-01-14 19:02:43 -050055// stdvgaio.c
56u8 stdvga_pelmask_read(void);
57void stdvga_pelmask_write(u8 val);
58u8 stdvga_misc_read(void);
59void stdvga_misc_write(u8 value);
60void stdvga_misc_mask(u8 off, u8 on);
61u8 stdvga_sequ_read(u8 index);
62void stdvga_sequ_write(u8 index, u8 value);
63void stdvga_sequ_mask(u8 index, u8 off, u8 on);
64u8 stdvga_grdc_read(u8 index);
65void stdvga_grdc_write(u8 index, u8 value);
66void stdvga_grdc_mask(u8 index, u8 off, u8 on);
67u8 stdvga_crtc_read(u16 crtc_addr, u8 index);
68void stdvga_crtc_write(u16 crtc_addr, u8 index, u8 value);
69void stdvga_crtc_mask(u16 crtc_addr, u8 index, u8 off, u8 on);
70u8 stdvga_attr_read(u8 index);
71void stdvga_attr_write(u8 index, u8 value);
72void stdvga_attr_mask(u8 index, u8 off, u8 on);
73u8 stdvga_attrindex_read(void);
74void stdvga_attrindex_write(u8 value);
75void stdvga_dac_read(u16 seg, u8 *data_far, u8 start, int count);
76void stdvga_dac_write(u16 seg, u8 *data_far, u8 start, int count);
77
Kevin O'Connor10dff3d2012-01-09 19:19:44 -050078// stdvga.c
Kevin O'Connor88ca7412011-12-31 04:24:20 -050079void stdvga_set_border_color(u8 color);
80void stdvga_set_overscan_border_color(u8 color);
81u8 stdvga_get_overscan_border_color(void);
82void stdvga_set_palette(u8 palid);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050083void stdvga_set_all_palette_reg(u16 seg, u8 *data_far);
84void stdvga_get_all_palette_reg(u16 seg, u8 *data_far);
85void stdvga_toggle_intensity(u8 flag);
86void stdvga_select_video_dac_color_page(u8 flag, u8 data);
87void stdvga_read_video_dac_state(u8 *pmode, u8 *curpage);
Kevin O'Connor821d6b42011-12-31 18:19:22 -050088void stdvga_perform_gray_scale_summing(u16 start, u16 count);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050089void stdvga_set_text_block_specifier(u8 spec);
Kevin O'Connor160d34a2012-01-16 18:48:26 -050090void stdvga_planar4_plane(int plane);
Kevin O'Connor2bec7d62011-12-31 04:31:16 -050091void stdvga_load_font(u16 seg, void *src_far, u16 count
92 , u16 start, u8 destflags, u8 fontsize);
Kevin O'Connorc990f272011-12-31 16:00:54 -050093u16 stdvga_get_crtc(void);
Kevin O'Connor68f56aa2013-09-10 10:41:33 -040094int stdvga_vram_ratio(struct vgamode_s *vmode_g);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050095void stdvga_set_cursor_shape(u8 start, u8 end);
Kevin O'Connor16920072012-01-27 22:59:46 -050096void stdvga_set_cursor_pos(int address);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050097void stdvga_set_scan_lines(u8 lines);
98u16 stdvga_get_vde(void);
Kevin O'Connor9961f992012-01-21 11:53:44 -050099int stdvga_get_window(struct vgamode_s *vmode_g, int window);
100int stdvga_set_window(struct vgamode_s *vmode_g, int window, int val);
Kevin O'Connor3876b532012-01-24 00:07:44 -0500101int stdvga_get_linelength(struct vgamode_s *vmode_g);
102int stdvga_set_linelength(struct vgamode_s *vmode_g, int val);
Kevin O'Connord61fc532012-01-27 20:37:45 -0500103int stdvga_get_displaystart(struct vgamode_s *vmode_g);
104int stdvga_set_displaystart(struct vgamode_s *vmode_g, int val);
Kevin O'Connore737b172012-02-04 11:08:39 -0500105int stdvga_get_dacformat(struct vgamode_s *vmode_g);
106int stdvga_set_dacformat(struct vgamode_s *vmode_g, int val);
Kevin O'Connor20dc4192014-02-05 20:52:25 -0500107int stdvga_save_restore(int cmd, u16 seg, void *data);
Kevin O'Connor88ca7412011-12-31 04:24:20 -0500108void stdvga_enable_video_addressing(u8 disable);
Kevin O'Connord83c87b2013-01-21 01:14:12 -0500109int stdvga_setup(void);
Kevin O'Connored68e5b2011-12-31 04:15:12 -0500110
111#endif // stdvga.h