vgabios: Add support for VBE get/set display start function.
[seabios.git] / vgasrc / stdvga.c
index a310167aca13ee38a4dfbd2f657c7db9c68d0428..13334ed47513ef5d3db23b7b6831d1df2ba16c32 100644 (file)
@@ -253,14 +253,6 @@ stdvga_set_cursor_shape(u8 start, u8 end)
     stdvga_crtc_write(crtc_addr, 0x0b, end);
 }
 
-void
-stdvga_set_active_page(u16 address)
-{
-    u16 crtc_addr = stdvga_get_crtc();
-    stdvga_crtc_write(crtc_addr, 0x0c, address >> 8);
-    stdvga_crtc_write(crtc_addr, 0x0d, address);
-}
-
 void
 stdvga_set_cursor_pos(u16 address)
 {
@@ -313,6 +305,25 @@ stdvga_set_linelength(struct vgamode_s *vmode_g, int val)
     return 0;
 }
 
+int
+stdvga_get_displaystart(struct vgamode_s *vmode_g)
+{
+    u16 crtc_addr = stdvga_get_crtc();
+    int addr = (stdvga_crtc_read(crtc_addr, 0x0c) << 8
+                | stdvga_crtc_read(crtc_addr, 0x0d));
+    return addr * stdvga_bpp_factor(vmode_g);
+}
+
+int
+stdvga_set_displaystart(struct vgamode_s *vmode_g, int val)
+{
+    u16 crtc_addr = stdvga_get_crtc();
+    val /= stdvga_bpp_factor(vmode_g);
+    stdvga_crtc_write(crtc_addr, 0x0c, val >> 8);
+    stdvga_crtc_write(crtc_addr, 0x0d, val);
+    return 0;
+}
+
 
 /****************************************************************
  * Save/Restore/Set state