Author: evb
Date: Tue Dec 14 03:27:51 2010
New Revision: 50027

URL: http://svn.reactos.org/svn/reactos?rev=50027&view=rev
Log:
- fix now palette.c for vga, by copy logPalVGA/VGALOGPALETTE from NT4 DDK VGA 
sample drv and turn off codes for allocate 256 color pallette, instead use fix 
16 color logPalVGA
- fix header of debug.c

Modified:
    trunk/reactos/drivers/video/displays/vga_new/debug.c
    trunk/reactos/drivers/video/displays/vga_new/palette.c

Modified: trunk/reactos/drivers/video/displays/vga_new/debug.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/vga_new/debug.c?rev=50027&r1=50026&r2=50027&view=diff
==============================================================================
--- trunk/reactos/drivers/video/displays/vga_new/debug.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/displays/vga_new/debug.c [iso-8859-1] Tue Dec 
14 03:27:51 2010
@@ -1,7 +1,7 @@
 /*
- * PROJECT:         ReactOS Framebuffer Display Driver
+ * PROJECT:         ReactOS VGA Display Driver
  * LICENSE:         Microsoft NT4 DDK Sample Code License
- * FILE:            boot/drivers/video/displays/framebuf/debug.c
+ * FILE:            boot/drivers/video/displays/vga/debug.c
  * PURPOSE:         Debug Support
  * PROGRAMMERS:     Copyright (c) 1992-1995 Microsoft Corporation
  */

Modified: trunk/reactos/drivers/video/displays/vga_new/palette.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/vga_new/palette.c?rev=50027&r1=50026&r2=50027&view=diff
==============================================================================
--- trunk/reactos/drivers/video/displays/vga_new/palette.c [iso-8859-1] 
(original)
+++ trunk/reactos/drivers/video/displays/vga_new/palette.c [iso-8859-1] Tue Dec 
14 03:27:51 2010
@@ -1,18 +1,36 @@
 /*
  * PROJECT:         ReactOS Framebuffer Display Driver
  * LICENSE:         Microsoft NT4 DDK Sample Code License
- * FILE:            boot/drivers/video/displays/framebuf/palette.c
+ * FILE:            boot/drivers/video/displays/vga/palette.c
  * PURPOSE:         Palette Support
  * PROGRAMMERS:     Copyright (c) 1992-1995 Microsoft Corporation
  */
 
 #include "driver.h"
 
-// Global Table defining the 20 Window Default Colors.        For 256 color
-// palettes the first 10 must be put at the beginning of the palette
-// and the last 10 at the end of the palette.
-
-const PALETTEENTRY BASEPALETTE[20] =
+// eVb: 4.1 [VGARISC Change] - Add static 16-color VGA palette from VGA NT4 
DDK Sample
+
+/******************************Public*Data*Struct*************************\
+* LOGPALETTE
+*
+* This is the palette for the VGA.
+*
+\**************************************************************************/
+
+// Little bit of hacking to get this to compile happily.
+
+typedef struct _VGALOGPALETTE
+{
+    USHORT ident;
+    USHORT NumEntries;
+    PALETTEENTRY palPalEntry[16];
+} VGALOGPALETTE;
+
+const VGALOGPALETTE logPalVGA =
+{
+
+0x400,  // driver version
+16,     // num entries
 {
     { 0,   0,   0,   0 },       // 0
     { 0x80,0,   0,   0 },       // 1
@@ -21,20 +39,19 @@
     { 0,   0,   0x80,0 },       // 4
     { 0x80,0,   0x80,0 },       // 5
     { 0,   0x80,0x80,0 },       // 6
-    { 0xC0,0xC0,0xC0,0 },       // 7
-    { 192, 220, 192, 0 },       // 8
-    { 166, 202, 240, 0 },       // 9
-    { 255, 251, 240, 0 },       // 10
-    { 160, 160, 164, 0 },       // 11
-    { 0x80,0x80,0x80,0 },       // 12
-    { 0xFF,0,   0   ,0 },       // 13
-    { 0,   0xFF,0   ,0 },       // 14
-    { 0xFF,0xFF,0   ,0 },       // 15
-    { 0   ,0,   0xFF,0 },       // 16
-    { 0xFF,0,   0xFF,0 },       // 17
-    { 0,   0xFF,0xFF,0 },       // 18
-    { 0xFF,0xFF,0xFF,0 },       // 19
+    { 0x80,0x80,0x80,0 },       // 7
+
+    { 0xC0,0xC0,0xC0,0 },       // 8
+    { 0xFF,0,   0,   0 },       // 9
+    { 0,   0xFF,0,   0 },       // 10
+    { 0xFF,0xFF,0,   0 },       // 11
+    { 0,   0,   0xFF,0 },       // 12
+    { 0xFF,0,   0xFF,0 },       // 13
+    { 0,   0xFF,0xFF,0 },       // 14
+    { 0xFF,0xFF,0xFF,0 }        // 15
+}
 };
+// eVb: 4.1 [END]
 
 BOOL bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo);
 
@@ -72,8 +89,12 @@
         ppdev->hpalDefault = (HPALETTE) 0;
     }
 
+// eVb: 4.2 [VGARISC Change] - VGA Palette is static, no need to free
+#if 0
     if (ppdev->pPal != (PPALETTEENTRY)NULL)
         EngFreeMem((PVOID)ppdev->pPal);
+#endif
+// eVb: 4.2 [END]
 }
 
 /******************************Public*Routine******************************\
@@ -85,6 +106,8 @@
 
 BOOL bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo)
 {
+// eVb: 4.3 [VGARISC Change] - VGA Palette is static, no need to build
+#if 0
     if (ppdev->ulBitCount == 8)
     {
         ULONG ulLoop;
@@ -141,20 +164,26 @@
             ppdev->pPal[246 + ulLoop] = BASEPALETTE[ulLoop+10];
         }
 
+#endif
+// eVb: 4.3 [END]
         //
         // Create handle for palette.
         //
 
         ppdev->hpalDefault =
         pDevInfo->hpalDefault = EngCreatePalette(PAL_INDEXED,
-                                                   256,
-                                                   (PULONG) ppdev->pPal,
+// eVb: 4.4 [VGARISC Change] - VGA Palette is 16 colors, not 256, and static
+                                                   16,
+                                                   (PULONG) 
&logPalVGA.palPalEntry,
+// eVb: 4.4 [END]
                                                    0,0,0);
 
         if (ppdev->hpalDefault == (HPALETTE) 0)
         {
             RIP("DISP bInitDefaultPalette failed EngCreatePalette\n");
-            EngFreeMem(ppdev->pPal);
+// eVb: 4.5 [VGARISC Change] - VGA Palette is static, no need to free
+            //EngFreeMem(ppdev->pPal);
+// eVb: 4.5 [END]        
             return(FALSE);
         }
 
@@ -164,6 +193,8 @@
 
         return(TRUE);
 
+// eVb: 4.6 [VGARISC Change] - VGA Palette is static, no bitfield palette 
needed
+#if 0
     } else {
 
         ppdev->hpalDefault =
@@ -181,6 +212,8 @@
     }
 
     return(TRUE);
+#endif
+// eVb: 4.6 [END]  
 }
 
 /******************************Public*Routine******************************\


Reply via email to