X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=vgasrc%2Fvgahw.h;h=494309b3d289b38fb308bc8b7e749592ad76b728;hb=3876b531222c53124b0eb154fb331c0c662f5e09;hp=55e3bc4cac9d5bf9078c28b5987e09652d6d7400;hpb=10dff3db247d07df8fcc83806f8e660ba2b3b6c2;p=seabios.git diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h index 55e3bc4..494309b 100644 --- a/vgasrc/vgahw.h +++ b/vgasrc/vgahw.h @@ -10,15 +10,28 @@ #include "geodevga.h" // geodevga_init static inline struct vgamode_s *vgahw_find_mode(int mode) { + if (CONFIG_VGA_CIRRUS) + return clext_find_mode(mode); + if (CONFIG_VGA_BOCHS) + return bochsvga_find_mode(mode); return stdvga_find_mode(mode); } -static inline int vgahw_set_mode(int mode, int flags) { +static inline int vgahw_set_mode(struct vgamode_s *vmode_g, int flags) { if (CONFIG_VGA_CIRRUS) - return clext_set_mode(mode, flags); + return clext_set_mode(vmode_g, flags); if (CONFIG_VGA_BOCHS) - return bochsvga_set_mode(mode, flags); - return stdvga_set_mode(mode, flags); + return bochsvga_set_mode(vmode_g, flags); + return stdvga_set_mode(vmode_g, flags); +} + +static inline void vgahw_list_modes(u16 seg, u16 *dest, u16 *last) { + if (CONFIG_VGA_CIRRUS) + clext_list_modes(seg, dest, last); + else if (CONFIG_VGA_BOCHS) + bochsvga_list_modes(seg, dest, last); + else + stdvga_list_modes(seg, dest, last); } static inline int vgahw_init(void) { @@ -31,4 +44,37 @@ static inline int vgahw_init(void) { return stdvga_init(); } +static inline int vgahw_get_window(struct vgamode_s *vmode_g, int window) { + if (CONFIG_VGA_CIRRUS) + return clext_get_window(vmode_g, window); + if (CONFIG_VGA_BOCHS) + return bochsvga_get_window(vmode_g, window); + return stdvga_get_window(vmode_g, window); +} + +static inline int vgahw_set_window(struct vgamode_s *vmode_g, int window + , int val) { + if (CONFIG_VGA_CIRRUS) + return clext_set_window(vmode_g, window, val); + if (CONFIG_VGA_BOCHS) + return bochsvga_set_window(vmode_g, window, val); + return stdvga_set_window(vmode_g, window, val); +} + +static inline int vgahw_get_linelength(struct vgamode_s *vmode_g) { + if (CONFIG_VGA_CIRRUS) + return clext_get_linelength(vmode_g); + if (CONFIG_VGA_BOCHS) + return bochsvga_get_linelength(vmode_g); + return stdvga_get_linelength(vmode_g); +} + +static inline int vgahw_set_linelength(struct vgamode_s *vmode_g, int val) { + if (CONFIG_VGA_CIRRUS) + return clext_set_linelength(vmode_g, val); + if (CONFIG_VGA_BOCHS) + return bochsvga_set_linelength(vmode_g, val); + return stdvga_set_linelength(vmode_g, val); +} + #endif // vgahw.h