Author: greatlrd
Date: Tue Jul 18 02:14:58 2006
New Revision: 23130
URL:
http://svn.reactos.org/svn/reactos?rev=23130&view=rev
Log:
start implement DrvGetDirectDrawInfo it is not complete only around 1/3 is done
Modified:
trunk/reactos/drivers/video/displays/framebuf/ddenable.c
trunk/reactos/drivers/video/displays/framebuf/framebuf.h
trunk/reactos/drivers/video/displays/framebuf/screen.c
trunk/reactos/drivers/video/displays/framebuf/surface.c
Modified: trunk/reactos/drivers/video/displays/framebuf/ddenable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/ddenable.c (original)
+++ trunk/reactos/drivers/video/displays/framebuf/ddenable.c Tue Jul 18 02:14:58 2006
@@ -51,16 +51,17 @@
ppdev->ddpfDisplay.dwGBitMask = ppdev->GreenMask;
ppdev->ddpfDisplay.dwBBitMask = ppdev->BlueMask;
- switch(ppdev->BitsPerPixel)
+ ppdev->ddpfDisplay.dwRGBBitCount=ppdev->BitsPerPixel;
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
+ ppdev->ddpfDisplay.dwFlags = DDPF_RGB;
+
+ switch(ppdev->iDitherFormat)
{
- case BMF_8BPP:
- ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
- ppdev->ddpfDisplay.dwRGBBitCount=8;
- ppdev->ddpfDisplay.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
+ case BMF_8BPP:
+ ppdev->ddpfDisplay.dwFlags |= DDPF_PALETTEINDEXED8;
break;
- case BMF_16BPP:
- ppdev->ddpfDisplay.dwRGBBitCount=16;
+ case BMF_16BPP:
switch(ppdev->RedMask)
{
case 0x7C00:
@@ -68,28 +69,23 @@
break;
default:
- ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
+ break;
}
break;
- case BMF_24BPP:
- ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
- ppdev->ddpfDisplay.dwRGBBitCount=24;
+ case BMF_24BPP:
break;
case BMF_32BPP:
- ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0xff000000;
- ppdev->ddpfDisplay.dwRGBBitCount=32;
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0xff000000;
break;
+
default:
- /* FIXME unknown pixelformat */
+ /* FIXME unknown pixel bits */
+ ppdev->ddpfDisplay.dwRGBBitCount=0;
break;
}
-
-
- //InitDDHAL(ppdev);
-
-
+
if (pCallBacks !=NULL)
{
memset(pCallBacks,0,sizeof(DD_CALLBACKS));
@@ -138,6 +134,52 @@
OUT DWORD *pdwNumFourCCCodes,
OUT DWORD *pdwFourCC)
{
- return FALSE;
+ PPDEV ppdev = (PPDEV)dhpdev;
+
+ /* rest some data */
+ *pdwNumFourCCCodes = 0;
+ *pdwNumHeaps = 0;
+
+
+
+ /*
+ check see if pvmList and pdwFourCC are second call
+ or frist. Secon call we fill in pHalInfo info
+ */
+
+ if(!(pvmList && pdwFourCC))
+ {
+
+ /* Calc how much memmory is left on the video cards memmory */
+ pHalInfo->ddCaps.dwVidMemTotal = (ppdev->MemHeight - ppdev->ScreenHeight) *
ppdev->ScreenDelta;
+
+ /* fill in some basic info that we need */
+ pHalInfo->vmiData.pvPrimary = ppdev->ScreenPtr;
+ pHalInfo->vmiData.fpPrimary = 0;
+ pHalInfo->vmiData.dwDisplayWidth = ppdev->ScreenWidth;
+ pHalInfo->vmiData.dwDisplayHeight = ppdev->ScreenHeight;
+ pHalInfo->vmiData.lDisplayPitch = ppdev->ScreenDelta;
+ pHalInfo->vmiData.ddpfDisplay.dwSize = sizeof(DDPIXELFORMAT);
+ pHalInfo->vmiData.ddpfDisplay.dwFlags = DDPF_RGB;
+ pHalInfo->vmiData.ddpfDisplay.dwRGBBitCount = ppdev->BitsPerPixel;
+ pHalInfo->vmiData.ddpfDisplay.dwRBitMask = ppdev->RedMask;
+ pHalInfo->vmiData.ddpfDisplay.dwGBitMask = ppdev->GreenMask;
+ pHalInfo->vmiData.ddpfDisplay.dwBBitMask = ppdev->BlueMask;
+ pHalInfo->vmiData.dwOffscreenAlign = 4;
+ pHalInfo->vmiData.dwZBufferAlign = 4;
+ pHalInfo->vmiData.dwTextureAlign = 4;
+
+ if ( ppdev->BitsPerPixel == 8 )
+ {
+ pHalInfo->vmiData.ddpfDisplay.dwFlags |= DDPF_PALETTEINDEXED8;
+ }
+
+
+
+
+
+ }
+
+ return TRUE;
}
Modified: trunk/reactos/drivers/video/displays/framebuf/framebuf.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/framebuf.h (original)
+++ trunk/reactos/drivers/video/displays/framebuf/framebuf.h Tue Jul 18 02:14:58 2006
@@ -63,6 +63,8 @@
#endif
/* DirectX Support */
+ DWORD iDitherFormat;
+ ULONG MemHeight;
BOOL bDDInitialized;
DDPIXELFORMAT ddpfDisplay;
DDHALINFO dxHalInfo;
Modified: trunk/reactos/drivers/video/displays/framebuf/screen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/screen.c (original)
+++ trunk/reactos/drivers/video/displays/framebuf/screen.c Tue Jul 18 02:14:58 2006
@@ -190,6 +190,8 @@
ppdev->ScreenHeight = SelectedMode->VisScreenHeight;
ppdev->ScreenDelta = SelectedMode->ScreenStride;
ppdev->BitsPerPixel = SelectedMode->BitsPerPlane *
SelectedMode->NumberOfPlanes;
+
+ ppdev->MemHeight = SelectedMode->VideoMemoryBitmapHeight;
ppdev->RedMask = SelectedMode->RedMask;
ppdev->GreenMask = SelectedMode->GreenMask;
Modified: trunk/reactos/drivers/video/displays/framebuf/surface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/surface.c (original)
+++ trunk/reactos/drivers/video/displays/framebuf/surface.c Tue Jul 18 02:14:58 2006
@@ -91,6 +91,8 @@
return FALSE;
}
+ ppdev->iDitherFormat = BitmapType;
+
ScreenSize.cx = ppdev->ScreenWidth;
ScreenSize.cy = ppdev->ScreenHeight;
@@ -181,8 +183,9 @@
&ulTemp);
if (ppdev->BitsPerPixel == 8)
{
- IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256);
+ IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256);
}
+
return Result;
}