summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dos/vga.c
diff options
context:
space:
mode:
authorDaniel Borca <[email protected]>2006-03-31 20:53:12 +0000
committerDaniel Borca <[email protected]>2006-03-31 20:53:12 +0000
commit3a3e63dc4fc8b34de7e61607d0d69cf3a77255ca (patch)
tree907e32056413613aabf43ffd2a9ef03a2b5fdb7b /src/mesa/drivers/dos/vga.c
parent3a46dff27d797f5ce067a305880ef1816e4a76d4 (diff)
DMesa now uses OSMesa as a back-end.
Diffstat (limited to 'src/mesa/drivers/dos/vga.c')
-rw-r--r--src/mesa/drivers/dos/vga.c67
1 files changed, 53 insertions, 14 deletions
diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c
index 27758f14d25..5a6447dd87b 100644
--- a/src/mesa/drivers/dos/vga.c
+++ b/src/mesa/drivers/dos/vga.c
@@ -23,9 +23,9 @@
*/
/*
- * DOS/DJGPP device driver v1.7 for Mesa
+ * DOS/DJGPP device driver for Mesa
*
- * Copyright (C) 2002 - Borca Daniel
+ * Author: Daniel Borca
* Web : http://www.geocities.com/dborca
*/
@@ -123,6 +123,41 @@ vga_fini (void)
}
+/* Desc: Attempts to choose a suitable blitter.
+ *
+ * In : ptr to mode structure, software framebuffer bits
+ * Out : blitter funciton, or NULL
+ *
+ * Note: -
+ */
+static BLTFUNC
+_choose_blitter (vl_mode *p, int fbbits)
+{
+ BLTFUNC blitter;
+
+ switch (fbbits) {
+ case 8:
+ blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual;
+ break;
+ case 16:
+ blitter = vesa_l_dump_16_to_8;
+ break;
+ case 24:
+ blitter = vesa_l_dump_24_to_8;
+ break;
+ case 32:
+ blitter = vesa_l_dump_32_to_8;
+ break;
+ default:
+ return NULL;
+ }
+
+ return blitter;
+
+ (void)p;
+}
+
+
/* Desc: Attempts to enter specified video mode.
*
* In : ptr to mode structure, refresh rate
@@ -131,27 +166,31 @@ vga_fini (void)
* Note: -
*/
static int
-vga_entermode (vl_mode *p, int refresh)
+vga_entermode (vl_mode *p, int refresh, int fbbits)
{
- if (!(p->mode & 0x4000)) {
- return -1;
- }
- VGA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual;
+ if (!(p->mode & 0x4000)) {
+ return -1;
+ }
- if (oldmode == -1) {
- __asm("\n\
+ VGA.blit = _choose_blitter(p, fbbits);
+ if (VGA.blit == NULL) {
+ return !0;
+ }
+
+ if (oldmode == -1) {
+ __asm("\n\
movb $0x0f, %%ah \n\
int $0x10 \n\
andl $0xff, %%eax \n\
movl %%eax, %0 \n\
- ":"=g"(oldmode)::"%eax", "%ebx");
- }
+ ":"=g"(oldmode)::"%eax", "%ebx");
+ }
- __asm("int $0x10"::"a"(p->mode&0xff));
+ __asm("int $0x10"::"a"(p->mode&0xff));
- return 0;
+ return 0;
- (void)refresh; /* silence compiler warning */
+ (void)refresh; /* silence compiler warning */
}