X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=vgasrc%2Fstdvga.h;h=ad496b5d814d3f8e200e89aff7c9eab50ddec796;hb=3876b531222c53124b0eb154fb331c0c662f5e09;hp=7fa612e171b423f3cab8452d85b14055748f9200;hpb=88ca74183a521e6868bdee65398f7d51d790490b;p=seabios.git diff --git a/vgasrc/stdvga.h b/vgasrc/stdvga.h index 7fa612e..ad496b5 100644 --- a/vgasrc/stdvga.h +++ b/vgasrc/stdvga.h @@ -2,6 +2,7 @@ #define __STDVGA_H #include "types.h" // u8 +#include "vgabios.h" // struct vgamode_s // VGA registers #define VGAREG_ACTL_ADDRESS 0x3c0 @@ -44,33 +45,9 @@ #define SEG_CTEXT 0xB800 #define SEG_MTEXT 0xB000 -/* - * Tables of default values for each mode - */ -#define TEXT 0x80 - -#define CTEXT (0x00 | TEXT) -#define MTEXT (0x01 | TEXT) -#define CGA 0x02 -#define PLANAR1 0x03 -#define PLANAR4 0x04 -#define LINEAR8 0x05 - -// for SVGA -#define LINEAR15 0x10 -#define LINEAR16 0x11 -#define LINEAR24 0x12 -#define LINEAR32 0x13 - -struct vgamode_s { - u8 svgamode; - u8 memmodel; /* CTEXT,MTEXT,CGA,PL1,PL2,PL4,P8,P15,P16,P24,P32 */ - u8 twidth; - u8 theight; - u8 cheight; - u8 pixbits; - u16 sstart; - u16 slength; +struct stdvga_mode_s { + u16 mode; + struct vgamode_s info; u8 pelmask; u8 *dac; @@ -105,39 +82,68 @@ struct saveDACcolors { u8 color_select; }; -void stdvga_screen_disable(void); -void stdvga_screen_enable(void); +// stdvgamodes.c +struct vgamode_s *stdvga_find_mode(int mode); +int stdvga_is_mode(struct vgamode_s *vmode_g); +void stdvga_build_video_param(void); +void stdvga_override_crtc(int mode, u8 *crtc); + +// stdvgaio.c +u8 stdvga_pelmask_read(void); +void stdvga_pelmask_write(u8 val); +u8 stdvga_misc_read(void); +void stdvga_misc_write(u8 value); +void stdvga_misc_mask(u8 off, u8 on); +u8 stdvga_sequ_read(u8 index); +void stdvga_sequ_write(u8 index, u8 value); +void stdvga_sequ_mask(u8 index, u8 off, u8 on); +u8 stdvga_grdc_read(u8 index); +void stdvga_grdc_write(u8 index, u8 value); +void stdvga_grdc_mask(u8 index, u8 off, u8 on); +u8 stdvga_crtc_read(u16 crtc_addr, u8 index); +void stdvga_crtc_write(u16 crtc_addr, u8 index, u8 value); +void stdvga_crtc_mask(u16 crtc_addr, u8 index, u8 off, u8 on); +u8 stdvga_attr_read(u8 index); +void stdvga_attr_write(u8 index, u8 value); +void stdvga_attr_mask(u8 index, u8 off, u8 on); +u8 stdvga_attrindex_read(void); +void stdvga_attrindex_write(u8 value); +void stdvga_dac_read(u16 seg, u8 *data_far, u8 start, int count); +void stdvga_dac_write(u16 seg, u8 *data_far, u8 start, int count); + +// stdvga.c void stdvga_set_border_color(u8 color); void stdvga_set_overscan_border_color(u8 color); u8 stdvga_get_overscan_border_color(void); void stdvga_set_palette(u8 palid); -void stdvga_set_single_palette_reg(u8 reg, u8 val); -u8 stdvga_get_single_palette_reg(u8 reg); void stdvga_set_all_palette_reg(u16 seg, u8 *data_far); void stdvga_get_all_palette_reg(u16 seg, u8 *data_far); void stdvga_toggle_intensity(u8 flag); void stdvga_select_video_dac_color_page(u8 flag, u8 data); void stdvga_read_video_dac_state(u8 *pmode, u8 *curpage); -void stdvga_set_dac_regs(u16 seg, u8 *data_far, u8 start, int count); -void stdvga_get_dac_regs(u16 seg, u8 *data_far, u8 start, int count); -void stdvga_set_pel_mask(u8 val); -u8 stdvga_get_pel_mask(void); void stdvga_save_dac_state(u16 seg, struct saveDACcolors *info); void stdvga_restore_dac_state(u16 seg, struct saveDACcolors *info); -void stdvga_sequ_write(u8 index, u8 value); -void stdvga_grdc_write(u8 index, u8 value); +void stdvga_perform_gray_scale_summing(u16 start, u16 count); void stdvga_set_text_block_specifier(u8 spec); -void get_font_access(void); -void release_font_access(void); +void stdvga_planar4_plane(int plane); +void stdvga_load_font(u16 seg, void *src_far, u16 count + , u16 start, u8 destflags, u8 fontsize); +u16 stdvga_get_crtc(void); +int stdvga_bpp_factor(struct vgamode_s *vmode_g); void stdvga_set_cursor_shape(u8 start, u8 end); void stdvga_set_active_page(u16 address); void stdvga_set_cursor_pos(u16 address); void stdvga_set_scan_lines(u8 lines); u16 stdvga_get_vde(void); +int stdvga_get_window(struct vgamode_s *vmode_g, int window); +int stdvga_set_window(struct vgamode_s *vmode_g, int window, int val); +int stdvga_get_linelength(struct vgamode_s *vmode_g); +int stdvga_set_linelength(struct vgamode_s *vmode_g, int val); void stdvga_save_state(u16 seg, struct saveVideoHardware *info); void stdvga_restore_state(u16 seg, struct saveVideoHardware *info); -void stdvga_set_mode(struct vgamode_s *vmode_g); +int stdvga_set_mode(struct vgamode_s *vmode_g, int flags); void stdvga_enable_video_addressing(u8 disable); -void stdvga_init(void); +void stdvga_list_modes(u16 seg, u16 *dest, u16 *last); +int stdvga_init(void); #endif // stdvga.h