aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/vbe.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-02-04 11:08:39 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-04 11:08:39 -0500
commite737b178e1232c4bec4bd5da721806a9dc176e15 (patch)
treec529134cefb8e5f593992d6d2ec388b79911a2a2 /vgasrc/vbe.c
parentcfd7ef9d8b38d9706671a4e88d40dcc4ac922b6a (diff)
downloadseabios-e737b178e1232c4bec4bd5da721806a9dc176e15.tar.gz
vgabios: Add support for VBE get/set dac palette format (func 08).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/vbe.c')
-rw-r--r--vgasrc/vbe.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c
index 77b09344..0ee69b4a 100644
--- a/vgasrc/vbe.c
+++ b/vgasrc/vbe.c
@@ -305,8 +305,29 @@ fail:
static void
vbe_104f08(struct bregs *regs)
{
- debug_stub(regs);
- regs->ax = 0x0100;
+ struct vgamode_s *vmode_g = get_current_mode();
+ if (! vmode_g)
+ goto fail;
+ u8 memmodel = GET_GLOBAL(vmode_g->memmodel);
+ if (memmodel == MM_DIRECT || memmodel == MM_YUV) {
+ regs->ax = 0x034f;
+ return;
+ }
+ if (regs->bl > 1)
+ goto fail;
+ if (regs->bl == 0) {
+ int ret = vgahw_set_dacformat(vmode_g, regs->bh);
+ if (ret < 0)
+ goto fail;
+ }
+ int ret = vgahw_get_dacformat(vmode_g);
+ if (ret < 0)
+ goto fail;
+ regs->bh = ret;
+ regs->ax = 0x004f;
+ return;
+fail:
+ regs->ax = 0x014f;
}
static void