blob: 4184c6004b994dacfdbd3ea017ccc61791c8fc66 [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'Connor10dff3d2012-01-09 19:19:44 -050047// stdvga.c
Kevin O'Connor88ca7412011-12-31 04:24:20 -050048void stdvga_set_border_color(u8 color);
49void stdvga_set_overscan_border_color(u8 color);
50u8 stdvga_get_overscan_border_color(void);
51void stdvga_set_palette(u8 palid);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050052void stdvga_set_all_palette_reg(u16 seg, u8 *data_far);
53void stdvga_get_all_palette_reg(u16 seg, u8 *data_far);
54void stdvga_toggle_intensity(u8 flag);
55void stdvga_select_video_dac_color_page(u8 flag, u8 data);
56void stdvga_read_video_dac_state(u8 *pmode, u8 *curpage);
Kevin O'Connor821d6b42011-12-31 18:19:22 -050057void stdvga_perform_gray_scale_summing(u16 start, u16 count);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050058void stdvga_set_text_block_specifier(u8 spec);
Kevin O'Connor160d34a2012-01-16 18:48:26 -050059void stdvga_planar4_plane(int plane);
Kevin O'Connor2bec7d62011-12-31 04:31:16 -050060void stdvga_load_font(u16 seg, void *src_far, u16 count
61 , u16 start, u8 destflags, u8 fontsize);
Kevin O'Connorc990f272011-12-31 16:00:54 -050062u16 stdvga_get_crtc(void);
Kevin O'Connorc682ffe2016-08-05 11:48:20 -040063struct vgamode_s;
Kevin O'Connor68f56aa2013-09-10 10:41:33 -040064int stdvga_vram_ratio(struct vgamode_s *vmode_g);
Kevin O'Connorc9aecfc2014-10-22 20:57:37 -040065void stdvga_set_cursor_shape(u16 cursor_type);
Kevin O'Connor16920072012-01-27 22:59:46 -050066void stdvga_set_cursor_pos(int address);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050067void stdvga_set_scan_lines(u8 lines);
68u16 stdvga_get_vde(void);
Kevin O'Connor9961f992012-01-21 11:53:44 -050069int stdvga_get_window(struct vgamode_s *vmode_g, int window);
70int stdvga_set_window(struct vgamode_s *vmode_g, int window, int val);
Kevin O'Connor3876b532012-01-24 00:07:44 -050071int stdvga_get_linelength(struct vgamode_s *vmode_g);
72int stdvga_set_linelength(struct vgamode_s *vmode_g, int val);
Kevin O'Connord61fc532012-01-27 20:37:45 -050073int stdvga_get_displaystart(struct vgamode_s *vmode_g);
74int stdvga_set_displaystart(struct vgamode_s *vmode_g, int val);
Kevin O'Connore737b172012-02-04 11:08:39 -050075int stdvga_get_dacformat(struct vgamode_s *vmode_g);
76int stdvga_set_dacformat(struct vgamode_s *vmode_g, int val);
Kevin O'Connor20dc4192014-02-05 20:52:25 -050077int stdvga_save_restore(int cmd, u16 seg, void *data);
Kevin O'Connor88ca7412011-12-31 04:24:20 -050078void stdvga_enable_video_addressing(u8 disable);
Kevin O'Connord83c87b2013-01-21 01:14:12 -050079int stdvga_setup(void);
Kevin O'Connored68e5b2011-12-31 04:15:12 -050080
81#endif // stdvga.h