aboutsummaryrefslogtreecommitdiff
path: root/vgasrc/vbe.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2011-12-31 19:13:45 -0500
committerKevin O'Connor <kevin@koconnor.net>2011-12-31 19:21:23 -0500
commit5108c69c47e18244206593c0c7918711311d8ef3 (patch)
tree1a64a1ac0ab43a3acfe89ed8a55e2c895f25ee5b /vgasrc/vbe.c
parent6f775088925a9b1ed3ded58e05d7ee276366166f (diff)
downloadseabios-5108c69c47e18244206593c0c7918711311d8ef3.zip
seabios-5108c69c47e18244206593c0c7918711311d8ef3.tar.gz
seabios-5108c69c47e18244206593c0c7918711311d8ef3.tar.bz2
vgabios: Unify X_set_mode() functions.
Use the same function signature for cirrus, bochsvga, and stdvga set_mode code. Make both the int1000 interface and the VBE 104f02 interface use the same set_mode function. Where clext and bochsvga need to fallback to the standard vga mode switching, have them call vgastd_mode_switch directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/vbe.c')
-rw-r--r--vgasrc/vbe.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c
index df95148..8256cae 100644
--- a/vgasrc/vbe.c
+++ b/vgasrc/vbe.c
@@ -11,8 +11,8 @@
#include "vbe.h" // struct vbe_info
#include "util.h" // dprintf
#include "biosvar.h" // get_global_set
-#include "bochsvga.h" // bochsvga_set_mode
-#include "stdvga.h" // stdvga_set_mode
+#include "bochsvga.h" // bochsvga_hires_enabled
+#include "vgahw.h" // vgahw_set_mode
static void
vbe_104f00(struct bregs *regs)
@@ -178,40 +178,14 @@ vbe_104f01(struct bregs *regs)
static void
vbe_104f02(struct bregs *regs)
{
- //u16 seg = regs->es;
- //struct vbe_crtc_info *crtc_info = (void*)(regs->di+0);
- u16 mode = regs->bx;
- struct vbe_modeinfo modeinfo;
- int rc;
+ dprintf(1, "VBE mode set: %x\n", regs->bx);
- dprintf(1, "VBE mode set: %x\n", mode);
-
- if (mode < 0x100) { /* VGA */
- dprintf(1, "set VGA mode %x\n", mode);
-
- bochsvga_hires_enable(0);
- stdvga_set_mode(mode, 0);
- } else { /* VBE */
- rc = bochsvga_mode_info(mode & 0x1ff, &modeinfo);
- if (rc) {
- dprintf(1, "VBE mode %x not found\n", mode & 0x1ff);
- regs->ax = 0x100;
- return;
- }
- bochsvga_hires_enable(1);
- bochsvga_set_mode(mode & 0x1ff, &modeinfo);
-
- if (mode & 0x4000) {
- /* Linear frame buffer */
- /* XXX: ??? */
- }
- if (!(mode & 0x8000)) {
- bochsvga_clear_scr();
- }
- }
+ int mode = regs->bx & 0x1ff;
+ int flags = regs->bx & (MF_CUSTOMCRTC|MF_LINEARFB|MF_NOCLEARMEM);
+ int ret = vgahw_set_mode(mode, flags);
- regs->al = regs->ah; /* 0x4F, Function supported */
- regs->ah = 0x0; /* 0x0, Function call successful */
+ regs->ah = ret;
+ regs->al = 0x4f;
}
static void