X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=seabios.git;a=blobdiff_plain;f=vgasrc%2Fstdvga.c;h=13334ed47513ef5d3db23b7b6831d1df2ba16c32;hp=a310167aca13ee38a4dfbd2f657c7db9c68d0428;hb=d61fc53a6037125183bec6ca4f3976d2396486be;hpb=3876b531222c53124b0eb154fb331c0c662f5e09 diff --git a/vgasrc/stdvga.c b/vgasrc/stdvga.c index a310167..13334ed 100644 --- a/vgasrc/stdvga.c +++ b/vgasrc/stdvga.c @@ -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