Kevin O'Connor | ed68e5b | 2011-12-31 04:15:12 -0500 | [diff] [blame] | 1 | #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'Connor | 4ad2d10 | 2012-01-14 23:20:05 -0500 | [diff] [blame] | 47 | // stdvgamodes.c |
Kevin O'Connor | 10dff3d | 2012-01-09 19:19:44 -0500 | [diff] [blame] | 48 | struct vgamode_s *stdvga_find_mode(int mode); |
Kevin O'Connor | f98bbf0 | 2012-01-27 23:09:02 -0500 | [diff] [blame] | 49 | void stdvga_list_modes(u16 seg, u16 *dest, u16 *last); |
Kevin O'Connor | aad3b69 | 2012-01-14 23:15:40 -0500 | [diff] [blame] | 50 | void stdvga_build_video_param(void); |
Kevin O'Connor | 69b01cb | 2012-01-14 23:25:24 -0500 | [diff] [blame] | 51 | void stdvga_override_crtc(int mode, u8 *crtc); |
Kevin O'Connor | f98bbf0 | 2012-01-27 23:09:02 -0500 | [diff] [blame] | 52 | int stdvga_set_mode(struct vgamode_s *vmode_g, int flags); |
Kevin O'Connor | 5b6936e | 2013-11-29 18:43:35 -0500 | [diff] [blame] | 53 | void stdvga_set_packed_palette(void); |
Kevin O'Connor | 10dff3d | 2012-01-09 19:19:44 -0500 | [diff] [blame] | 54 | |
Kevin O'Connor | 3471fdb | 2012-01-14 19:02:43 -0500 | [diff] [blame] | 55 | // stdvgaio.c |
| 56 | u8 stdvga_pelmask_read(void); |
| 57 | void stdvga_pelmask_write(u8 val); |
| 58 | u8 stdvga_misc_read(void); |
| 59 | void stdvga_misc_write(u8 value); |
| 60 | void stdvga_misc_mask(u8 off, u8 on); |
| 61 | u8 stdvga_sequ_read(u8 index); |
| 62 | void stdvga_sequ_write(u8 index, u8 value); |
| 63 | void stdvga_sequ_mask(u8 index, u8 off, u8 on); |
| 64 | u8 stdvga_grdc_read(u8 index); |
| 65 | void stdvga_grdc_write(u8 index, u8 value); |
| 66 | void stdvga_grdc_mask(u8 index, u8 off, u8 on); |
| 67 | u8 stdvga_crtc_read(u16 crtc_addr, u8 index); |
| 68 | void stdvga_crtc_write(u16 crtc_addr, u8 index, u8 value); |
| 69 | void stdvga_crtc_mask(u16 crtc_addr, u8 index, u8 off, u8 on); |
| 70 | u8 stdvga_attr_read(u8 index); |
| 71 | void stdvga_attr_write(u8 index, u8 value); |
| 72 | void stdvga_attr_mask(u8 index, u8 off, u8 on); |
| 73 | u8 stdvga_attrindex_read(void); |
| 74 | void stdvga_attrindex_write(u8 value); |
| 75 | void stdvga_dac_read(u16 seg, u8 *data_far, u8 start, int count); |
| 76 | void stdvga_dac_write(u16 seg, u8 *data_far, u8 start, int count); |
| 77 | |
Kevin O'Connor | 10dff3d | 2012-01-09 19:19:44 -0500 | [diff] [blame] | 78 | // stdvga.c |
Kevin O'Connor | 88ca741 | 2011-12-31 04:24:20 -0500 | [diff] [blame] | 79 | void stdvga_set_border_color(u8 color); |
| 80 | void stdvga_set_overscan_border_color(u8 color); |
| 81 | u8 stdvga_get_overscan_border_color(void); |
| 82 | void stdvga_set_palette(u8 palid); |
Kevin O'Connor | 88ca741 | 2011-12-31 04:24:20 -0500 | [diff] [blame] | 83 | void stdvga_set_all_palette_reg(u16 seg, u8 *data_far); |
| 84 | void stdvga_get_all_palette_reg(u16 seg, u8 *data_far); |
| 85 | void stdvga_toggle_intensity(u8 flag); |
| 86 | void stdvga_select_video_dac_color_page(u8 flag, u8 data); |
| 87 | void stdvga_read_video_dac_state(u8 *pmode, u8 *curpage); |
Kevin O'Connor | 821d6b4 | 2011-12-31 18:19:22 -0500 | [diff] [blame] | 88 | void stdvga_perform_gray_scale_summing(u16 start, u16 count); |
Kevin O'Connor | 88ca741 | 2011-12-31 04:24:20 -0500 | [diff] [blame] | 89 | void stdvga_set_text_block_specifier(u8 spec); |
Kevin O'Connor | 160d34a | 2012-01-16 18:48:26 -0500 | [diff] [blame] | 90 | void stdvga_planar4_plane(int plane); |
Kevin O'Connor | 2bec7d6 | 2011-12-31 04:31:16 -0500 | [diff] [blame] | 91 | void stdvga_load_font(u16 seg, void *src_far, u16 count |
| 92 | , u16 start, u8 destflags, u8 fontsize); |
Kevin O'Connor | c990f27 | 2011-12-31 16:00:54 -0500 | [diff] [blame] | 93 | u16 stdvga_get_crtc(void); |
Kevin O'Connor | 68f56aa | 2013-09-10 10:41:33 -0400 | [diff] [blame] | 94 | int stdvga_vram_ratio(struct vgamode_s *vmode_g); |
Kevin O'Connor | c9aecfc | 2014-10-22 20:57:37 -0400 | [diff] [blame] | 95 | void stdvga_set_cursor_shape(u16 cursor_type); |
Kevin O'Connor | 1692007 | 2012-01-27 22:59:46 -0500 | [diff] [blame] | 96 | void stdvga_set_cursor_pos(int address); |
Kevin O'Connor | 88ca741 | 2011-12-31 04:24:20 -0500 | [diff] [blame] | 97 | void stdvga_set_scan_lines(u8 lines); |
| 98 | u16 stdvga_get_vde(void); |
Kevin O'Connor | 9961f99 | 2012-01-21 11:53:44 -0500 | [diff] [blame] | 99 | int stdvga_get_window(struct vgamode_s *vmode_g, int window); |
| 100 | int stdvga_set_window(struct vgamode_s *vmode_g, int window, int val); |
Kevin O'Connor | 3876b53 | 2012-01-24 00:07:44 -0500 | [diff] [blame] | 101 | int stdvga_get_linelength(struct vgamode_s *vmode_g); |
| 102 | int stdvga_set_linelength(struct vgamode_s *vmode_g, int val); |
Kevin O'Connor | d61fc53 | 2012-01-27 20:37:45 -0500 | [diff] [blame] | 103 | int stdvga_get_displaystart(struct vgamode_s *vmode_g); |
| 104 | int stdvga_set_displaystart(struct vgamode_s *vmode_g, int val); |
Kevin O'Connor | e737b17 | 2012-02-04 11:08:39 -0500 | [diff] [blame] | 105 | int stdvga_get_dacformat(struct vgamode_s *vmode_g); |
| 106 | int stdvga_set_dacformat(struct vgamode_s *vmode_g, int val); |
Kevin O'Connor | 20dc419 | 2014-02-05 20:52:25 -0500 | [diff] [blame] | 107 | int stdvga_save_restore(int cmd, u16 seg, void *data); |
Kevin O'Connor | 88ca741 | 2011-12-31 04:24:20 -0500 | [diff] [blame] | 108 | void stdvga_enable_video_addressing(u8 disable); |
Kevin O'Connor | d83c87b | 2013-01-21 01:14:12 -0500 | [diff] [blame] | 109 | int stdvga_setup(void); |
Kevin O'Connor | ed68e5b | 2011-12-31 04:15:12 -0500 | [diff] [blame] | 110 | |
| 111 | #endif // stdvga.h |