diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2012-01-27 20:37:45 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-02-01 20:39:03 -0500 |
commit | d61fc53a6037125183bec6ca4f3976d2396486be (patch) | |
tree | 5907196c7464d9c003e66e0e692a597adcaa203a /vgasrc/vbe.c | |
parent | 3876b531222c53124b0eb154fb331c0c662f5e09 (diff) | |
download | seabios-d61fc53a6037125183bec6ca4f3976d2396486be.tar.gz |
vgabios: Add support for VBE get/set display start function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/vbe.c')
-rw-r--r-- | vgasrc/vbe.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c index 68d20259..9e1fe1c2 100644 --- a/vgasrc/vbe.c +++ b/vgasrc/vbe.c @@ -273,8 +273,37 @@ fail: static void vbe_104f07(struct bregs *regs) { - debug_stub(regs); - regs->ax = 0x0100; + struct vgamode_s *vmode_g = get_current_mode(); + if (! vmode_g) + goto fail; + int bpp = vga_bpp(vmode_g); + int linelength = vgahw_get_linelength(vmode_g); + if (linelength < 0) + goto fail; + + int ret; + switch (regs->bl) { + case 0x80: + case 0x00: + ret = vgahw_set_displaystart( + vmode_g, DIV_ROUND_UP(regs->cx * bpp, 8) + linelength * regs->dx); + if (ret) + goto fail; + break; + case 0x01: + ret = vgahw_get_displaystart(vmode_g); + if (ret < 0) + goto fail; + regs->dx = ret / linelength; + regs->cx = (ret % linelength) * 8 / bpp; + break; + default: + goto fail; + } + regs->ax = 0x004f; + return; +fail: + regs->ax = 0x014f; } static void |