[3/3]Add VGA memory mode information & Window addresses

Jeremiah Flerchinger jeremiah.flerchinger at gmail.com
Mon Feb 2 23:26:02 CST 2009


---
 dlls/winedos/int10.c |   14 +++++---
 dlls/winedos/vga.c   |   92 +++++++++++++++++++++++++-------------------------
 dlls/winedos/vga.h   |    3 +-
 3 files changed, 57 insertions(+), 52 deletions(-)

diff --git a/dlls/winedos/int10.c b/dlls/winedos/int10.c
index 7fbf93d..01a753a 100644
--- a/dlls/winedos/int10.c
+++ b/dlls/winedos/int10.c
@@ -344,7 +344,14 @@ static BOOL INT10_FillModeInformation( struct _ModeInfoBlock *mib, WORD mode )
     mib->YCharSize = ptr->CharHeight;
 
     /* 24 - BYTE: number of memory planes */
-    mib->NumberOfPlanes = 1; /* FIXME */
+    if (ptr->ModeType == PLANAR_4)
+    {
+        mib->NumberOfPlanes = 4;
+    }
+    else
+    {
+        mib->NumberOfPlanes = 1;
+    }
 
     /* 25 - BYTE: number of bits per pixel */
     mib->BitsPerPixel = ptr->Depth; /* FIXME: text modes? reserved bits? */
@@ -366,10 +373,7 @@ static BOOL INT10_FillModeInformation( struct _ModeInfoBlock *mib, WORD mode )
      * 08-0F - Reserved for VESA.
      * 10-FF - OEM memory models.
      */
-    if (ptr->ModeType == TEXT)
-        mib->MemoryModel = 0; /* text mode */
-    else
-        mib->MemoryModel = 3; /* FIXME */
+    mib->MemoryModel = ptr->ModeType;
 
     /* 28 - BYTE: size of bank in KB */
     mib->BankSize = 0; /* FIXME */
diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c
index 725fecf..9553f7e 100644
--- a/dlls/winedos/vga.c
+++ b/dlls/winedos/vga.c
@@ -158,56 +158,56 @@ static WORD VGA_CurrentMode;
 static BOOL CGA_ColorComposite = FALSE;  /* behave like composite monitor */
 static const VGA_MODE VGA_modelist[] =
 {
-    /* Mode, ModeType, TextCols, TextRows, CharWidth, CharHeight, Width, Height, Depth, Colors, ScreenPages, Supported*/
+    /* Mode, ModeType, WindowAddress, TextCols, TextRows, CharWidth, CharHeight, Width, Height, BitDepth, Colors, ScreenPages, Supported*/
     /* VGA modes */
-    {0x0000,    TEXT, 40, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 0 */
-    {0x0001,    TEXT, 40, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 1 */
-    {0x0002,    TEXT, 80, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 2 */
-    {0x0003,    TEXT, 80, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 3 */
-    {0x0004, GRAPHIC, 40, 25,  8,  8,  320,  200,  2,   4, 1, TRUE},   /* VGA/CGA graphics mode 4 */
-    {0x0005, GRAPHIC, 40, 25,  8,  8,  320,  200,  2,   4, 1, TRUE},   /* VGA/CGA graphics mode 5 */
-    {0x0006, GRAPHIC, 80, 25,  8,  8,  640,  200,  1,   2, 1, TRUE},   /* VGA/CGA graphics mode 6 */
-    {0x0007,    TEXT, 80, 25,  9, 16,  720,  400,  0,   0, 8, FALSE},   /* VGA text mode 7 - FIXME bad default address */
-    {0x000d, GRAPHIC, 40, 25,  8,  8,  320,  200,  4,  16, 8, FALSE},   /* VGA graphics mode 13 */
-    {0x000e, GRAPHIC, 80, 25,  8,  8,  640,  200,  4,  16, 4, FALSE},   /* VGA graphics mode 14 */
-    {0x000f, GRAPHIC, 80, 25,  8, 14,  640,  350,  0,   0, 2, FALSE},   /* VGA graphics mode 15 */
-    {0x0010, GRAPHIC, 80, 25,  8, 14,  640,  350,  4,  16, 2, FALSE},   /* VGA graphics mode 16 */
-    {0x0012, GRAPHIC, 80, 30,  8, 16,  640,  480,  1,   2, 1, FALSE},   /* VGA graphics mode 17 */
-    {0x0012, GRAPHIC, 80, 30,  8, 16,  640,  480,  4,  16, 1, FALSE},   /* VGA graphics mode 18 */
-    {0x0013, GRAPHIC, 40, 25,  8,  8,  320,  200,  8, 256, 1, TRUE},   /* VGA graphics mode 19 */
+    {0x0000,         TEXT, 0xb8000, 40, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 0 */
+    {0x0001,         TEXT, 0xb8000, 40, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 1 */
+    {0x0002,         TEXT, 0xb8000, 80, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 2 */
+    {0x0003,         TEXT, 0xb8000, 80, 25,  9, 16,  360,  400,  0,  16, 8, TRUE},   /* VGA/CGA text mode 3 */
+    {0x0004,          CGA, 0xa0000, 40, 25,  8,  8,  320,  200,  2,   4, 1, TRUE},   /* VGA/CGA graphics mode 4 */
+    {0x0005,          CGA, 0xa0000, 40, 25,  8,  8,  320,  200,  2,   4, 1, TRUE},   /* VGA/CGA graphics mode 5 */
+    {0x0006,          CGA, 0xa0000, 80, 25,  8,  8,  640,  200,  1,   2, 1, TRUE},   /* VGA/CGA graphics mode 6 */
+    {0x0007,         TEXT, 0xb0000, 80, 25,  9, 16,  720,  400,  0,   0, 8, TRUE},   /* VGA text mode 7 - FIXME bad default address */
+    {0x000d,     PLANAR_4, 0xa0000, 40, 25,  8,  8,  320,  200,  4,  16, 8, FALSE},   /* VGA graphics mode 13 */
+    {0x000e,     PLANAR_4, 0xa0000, 80, 25,  8,  8,  640,  200,  4,  16, 4, FALSE},   /* VGA graphics mode 14 */
+    {0x000f, PACKED_PIXEL, 0xa0000, 80, 25,  8, 14,  640,  350,  0,   0, 2, TRUE},   /* VGA graphics mode 15 */
+    {0x0010,     PLANAR_4, 0xa0000, 80, 25,  8, 14,  640,  350,  4,  16, 2, FALSE},   /* VGA graphics mode 16 */
+    {0x0012, PACKED_PIXEL, 0xa0000, 80, 30,  8, 16,  640,  480,  1,   2, 1, TRUE},   /* VGA graphics mode 17 */
+    {0x0012,     PLANAR_4, 0xa0000, 80, 30,  8, 16,  640,  480,  4,  16, 1, FALSE},   /* VGA graphics mode 18 */
+    {0x0013, PACKED_PIXEL, 0xa0000, 40, 25,  8,  8,  320,  200,  8, 256, 1, TRUE},   /* VGA graphics mode 19 */
     /* VESA 7-bit modes */
-    {0x006a, GRAPHIC,  0,  0,  0,  0,  800,  600,  4,  16, 1, TRUE},   /* VESA graphics mode, same as 0x102 */
+    {0x006a,     PLANAR_4, 0xa0000, 0,  0,  0,  0,  800,  600,  4,  16, 1, FALSE},   /* VESA graphics mode, same as 0x102 */
     /* VESA 15-bit modes */
-    {0x0100, GRAPHIC,  0,  0,  0,  0,  640,  400,  8, 256, 1, TRUE},   /* VESA graphics mode */
-    {0x0101, GRAPHIC,  0,  0,  0,  0,  640,  480,  8, 256, 1, TRUE},   /* VESA graphics mode */
-    {0x0102, GRAPHIC,  0,  0,  0,  0,  800,  600,  4,  16, 1, TRUE},   /* VESA graphics mode */
-    {0x0103, GRAPHIC,  0,  0,  0,  0,  800,  600,  8, 256, 1, TRUE},   /* VESA graphics mode */
-    {0x0104, GRAPHIC,  0,  0,  0,  0, 1024,  768,  4,  16, 1, TRUE},   /* VESA graphics mode */
-    {0x0105, GRAPHIC,  0,  0,  0,  0, 1024,  768,  8, 256, 1, TRUE},   /* VESA graphics mode */
-    {0x0106, GRAPHIC,  0,  0,  0,  0, 1280, 1024,  4,  16, 1, TRUE},   /* VESA graphics mode */
-    {0x0107, GRAPHIC,  0,  0,  0,  0, 1280, 1024,  8, 256, 1, TRUE},   /* VESA graphics mode */
-    {0x0108,    TEXT,  0,  0,  0,  0,   80,   60,  0,   0, 1, TRUE},   /* VESA text mode */
-    {0x0109,    TEXT,  0,  0,  0,  0,  132,   25,  0,   0, 1, TRUE},   /* VESA text mode */
-    {0x010a,    TEXT,  0,  0,  0,  0,  132,   43,  0,   0, 1, TRUE},   /* VESA text mode */
-    {0x010b,    TEXT,  0,  0,  0,  0,  132,   50,  0,   0, 1, TRUE},   /* VESA text mode */
-    {0x010c,    TEXT,  0,  0,  0,  0,  132,   60,  0,   0, 1, TRUE},   /* VESA text mode */
+    {0x0100, PACKED_PIXEL, 0xa0000, 0,  0,  0,  0,  640,  400,  8, 256, 1, TRUE},   /* VESA graphics mode */
+    {0x0101, PACKED_PIXEL, 0xa0000, 0,  0,  0,  0,  640,  480,  8, 256, 1, TRUE},   /* VESA graphics mode */
+    {0x0102,     PLANAR_4, 0xa0000, 0,  0,  0,  0,  800,  600,  4,  16, 1, FALSE},   /* VESA graphics mode */
+    {0x0103, PACKED_PIXEL, 0xa0000, 0,  0,  0,  0,  800,  600,  8, 256, 1, TRUE},   /* VESA graphics mode */
+    {0x0104,     PLANAR_4, 0xa0000, 0,  0,  0,  0, 1024,  768,  4,  16, 1, FALSE},   /* VESA graphics mode */
+    {0x0105, PACKED_PIXEL, 0xa0000, 0,  0,  0,  0, 1024,  768,  8, 256, 1, TRUE},   /* VESA graphics mode */
+    {0x0106,     PLANAR_4, 0xa0000, 0,  0,  0,  0, 1280, 1024,  4,  16, 1, FALSE},   /* VESA graphics mode */
+    {0x0107, PACKED_PIXEL, 0xa0000, 0,  0,  0,  0, 1280, 1024,  8, 256, 1, TRUE},   /* VESA graphics mode */
+    {0x0108,         TEXT, 0xb8000, 0,  0,  0,  0,   80,   60,  0,   0, 1, TRUE},   /* VESA text mode */
+    {0x0109,         TEXT, 0xb8000, 0,  0,  0,  0,  132,   25,  0,   0, 1, TRUE},   /* VESA text mode */
+    {0x010a,         TEXT, 0xb8000, 0,  0,  0,  0,  132,   43,  0,   0, 1, TRUE},   /* VESA text mode */
+    {0x010b,         TEXT, 0xb8000, 0,  0,  0,  0,  132,   50,  0,   0, 1, TRUE},   /* VESA text mode */
+    {0x010c,         TEXT, 0xb8000, 0,  0,  0,  0,  132,   60,  0,   0, 1, TRUE},   /* VESA text mode */
     /* VESA 1.2 modes */
-    {0x010d, GRAPHIC,  0,  0,  0,  0,  320,  200, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
-    {0x010e, GRAPHIC,  0,  0,  0,  0,  320,  200, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
-    {0x010f, GRAPHIC,  0,  0,  0,  0,  320,  200, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
-    {0x0110, GRAPHIC,  0,  0,  0,  0,  640,  480, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
-    {0x0111, GRAPHIC,  0,  0,  0,  0,  640,  480, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
-    {0x0112, GRAPHIC,  0,  0,  0,  0,  640,  480, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
-    {0x0113, GRAPHIC,  0,  0,  0,  0,  800,  600, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
-    {0x0114, GRAPHIC,  0,  0,  0,  0,  800,  600, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
-    {0x0115, GRAPHIC,  0,  0,  0,  0,  800,  600, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
-    {0x0116, GRAPHIC,  0,  0,  0,  0, 1024,  768, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
-    {0x0117, GRAPHIC,  0,  0,  0,  0, 1024,  768, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
-    {0x0118, GRAPHIC,  0,  0,  0,  0, 1024,  768, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
-    {0x0119, GRAPHIC,  0,  0,  0,  0, 1280, 1024, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
-    {0x011a, GRAPHIC,  0,  0,  0,  0, 1280, 1024, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
-    {0x011b, GRAPHIC,  0,  0,  0,  0, 1280, 1024, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
-    {0xffff,    TEXT,  0,  0,  0,  0,    0,    0,  0,   0, 1, FALSE}
+    {0x010d, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  320,  200, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
+    {0x010e, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  320,  200, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
+    {0x010f, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  320,  200, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
+    {0x0110, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  640,  480, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
+    {0x0111, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  640,  480, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
+    {0x0112, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  640,  480, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
+    {0x0113, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  800,  600, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
+    {0x0114, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  800,  600, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
+    {0x0115, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0,  800,  600, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
+    {0x0116, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0, 1024,  768, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
+    {0x0117, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0, 1024,  768, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
+    {0x0118, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0, 1024,  768, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
+    {0x0119, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0, 1280, 1024, 15,   0, 1, TRUE},   /* VESA graphics mode, 32K colors */
+    {0x011a, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0, 1280, 1024, 16,   0, 1, TRUE},   /* VESA graphics mode, 64K colors */
+    {0x011b, DIRECT_COLOR, 0xa0000, 0,  0,  0,  0, 1280, 1024, 24,   0, 1, TRUE},   /* VESA graphics mode, 16.8 Million colors */
+    {0xffff,         TEXT, 0xb8000, 0,  0,  0,  0,    0,    0,  0,   0, 1, FALSE}
 };
 
 /*
diff --git a/dlls/winedos/vga.h b/dlls/winedos/vga.h
index dc9fb1b..8378caa 100644
--- a/dlls/winedos/vga.h
+++ b/dlls/winedos/vga.h
@@ -31,11 +31,12 @@
  * VGA VESA definitions
  */
 /* mode descriptor */
-enum modetype {TEXT=0, GRAPHIC=1};
+enum modetype {TEXT=0, CGA=1, HERCULES=2, PLANAR_4=3, PACKED_PIXEL=4, UNCHAINED_256=5, DIRECT_COLOR=6, YUV_COLOR=7};
 /* Wine internal information about video modes */
 typedef struct {
     WORD Mode;
     BOOL ModeType;
+    WORD WindowAddress;  /* address for display buffer */
     WORD TextCols;  /* columns of text in display */
     WORD TextRows;  /* rows of text in display */
     WORD CharWidth;
-- 
1.5.6.3




More information about the wine-patches mailing list