vgabios: Unify code to generate the vbe mode list.
[seabios.git] / vgasrc / stdvga.h
index 0a99d3711f95970ee7434755ec6d63f1bf63e234..033a711604b7c0adf29e7a0075e479ea5d99db55 100644 (file)
@@ -2,6 +2,7 @@
 #define __STDVGA_H
 
 #include "types.h" // u8
+#include "vgabios.h" // struct vgamode_s
 
 // VGA registers
 #define VGAREG_ACTL_ADDRESS            0x3c0
 #define SEG_CTEXT 0xB800
 #define SEG_MTEXT 0xB000
 
-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;
@@ -87,6 +82,10 @@ struct saveDACcolors {
     u8 color_select;
 };
 
+// vgatables.c
+struct vgamode_s *stdvga_find_mode(int mode);
+
+// stdvga.c
 void stdvga_set_border_color(u8 color);
 void stdvga_set_overscan_border_color(u8 color);
 u8 stdvga_get_overscan_border_color(void);
@@ -120,6 +119,7 @@ void stdvga_save_state(u16 seg, struct saveVideoHardware *info);
 void stdvga_restore_state(u16 seg, struct saveVideoHardware *info);
 int stdvga_set_mode(int mode, int flags);
 void stdvga_enable_video_addressing(u8 disable);
+void stdvga_list_modes(u16 seg, u16 *dest, u16 *last);
 int stdvga_init(void);
 
 #endif // stdvga.h