aboutsummaryrefslogtreecommitdiff
path: root/vgasrc/vbe.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-01-27 20:37:45 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-01 20:39:03 -0500
commitd61fc53a6037125183bec6ca4f3976d2396486be (patch)
tree5907196c7464d9c003e66e0e692a597adcaa203a /vgasrc/vbe.c
parent3876b531222c53124b0eb154fb331c0c662f5e09 (diff)
downloadseabios-hppa-d61fc53a6037125183bec6ca4f3976d2396486be.zip
seabios-hppa-d61fc53a6037125183bec6ca4f3976d2396486be.tar.gz
seabios-hppa-d61fc53a6037125183bec6ca4f3976d2396486be.tar.bz2
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.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c
index 68d2025..9e1fe1c 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