Author: greatlrd
Date: Sun Jul 16 18:54:59 2006
New Revision: 23080
URL:
http://svn.reactos.org/svn/reactos?rev=23080&view=rev
Log:
Framebuf drv
Implement : DdCanCreateSurface
Stub : DdCreateSurface
adding struct ddpfDisplay and dxHalInfo
ddpfDisplay are being filld but not use
dxHalInfo are not fill it is rater large work getting it right
Modified:
trunk/reactos/drivers/video/displays/framebuf/dd.c
trunk/reactos/drivers/video/displays/framebuf/ddenable.c
trunk/reactos/drivers/video/displays/framebuf/framebuf.h
Modified: trunk/reactos/drivers/video/displays/framebuf/dd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/dd.c (original)
+++ trunk/reactos/drivers/video/displays/framebuf/dd.c Sun Jul 16 18:54:59 2006
@@ -22,3 +22,55 @@
#include "framebuf.h"
+
+DWORD CALLBACK
+DdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd)
+{
+
+ /* We do not support 3d buffer so we fail here */
+ if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) &&
+ (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
+ {
+ pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+ return DDHAL_DRIVER_HANDLED;
+ }
+
+
+ /* Check if another pixel format or not, we fail for now */
+ if (pccsd->bIsDifferentPixelFormat)
+ {
+ /* check the fourcc diffent FOURCC, but we only support BMP for now */
+ //if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_FOURCC)
+ //{
+ // /* We do not support other pixel format */
+ // switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC)
+ // {
+ // default:
+ // pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+ // return DDHAL_DRIVER_HANDLED;
+ // }
+ //}
+ // /* check the texture support, we do not support testure for now */
+ //else if((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_TEXTURE))
+ //{
+ // /* We do not support texture surface */
+ // pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+ // return DDHAL_DRIVER_HANDLED;
+ //}
+
+ /* Fail */
+ pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+ return DDHAL_DRIVER_HANDLED;
+ }
+
+ pccsd->ddRVal = DD_OK;
+ return DDHAL_DRIVER_HANDLED;
+}
+
+DWORD CALLBACK
+DdCreateSurface(PDD_CREATESURFACEDATA lpCreateSurface)
+{
+ lpCreateSurface->ddRVal = DDERR_GENERIC;
+ return DDHAL_DRIVER_NOTHANDLED;
+}
+
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 Sun Jul 16 18:54:59 2006
@@ -37,33 +37,94 @@
OUT DD_PALETTECALLBACKS *pPaletteCallBacks)
{
PPDEV ppdev = (PPDEV)dhpdev;
-
+
if (ppdev->bDDInitialized == TRUE)
{
return TRUE;
}
+ /* Setup pixel format */
+ ppdev->ddpfDisplay.dwSize = sizeof( DDPIXELFORMAT );
+ ppdev->ddpfDisplay.dwFourCC = 0;
+
+ ppdev->ddpfDisplay.dwRBitMask = ppdev->RedMask;
+ ppdev->ddpfDisplay.dwGBitMask = ppdev->GreenMask;
+ ppdev->ddpfDisplay.dwBBitMask = ppdev->BlueMask;
+
+ switch(ppdev->BitsPerPixel)
+ {
+ case BMF_8BPP:
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
+ ppdev->ddpfDisplay.dwRGBBitCount=8;
+ ppdev->ddpfDisplay.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
+ break;
+
+ case BMF_16BPP:
+ ppdev->ddpfDisplay.dwRGBBitCount=16;
+ switch(ppdev->RedMask)
+ {
+ case 0x7C00:
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0x8000;
+ break;
+
+ default:
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
+ }
+ break;
+
+ case BMF_24BPP:
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0;
+ ppdev->ddpfDisplay.dwRGBBitCount=24;
+ break;
+
+ case BMF_32BPP:
+ ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0xff000000;
+ ppdev->ddpfDisplay.dwRGBBitCount=32;
+ break;
+ default:
+ /* FIXME unknown pixelformat */
+ break;
+ }
+
+
+ //InitDDHAL(ppdev);
+
+
if (pCallBacks !=NULL)
{
memset(pCallBacks,0,sizeof(DD_CALLBACKS));
- /* FILL pCallBacks with hal stuff */
+ /* FILL pCallBacks with hal stuff */
+ pCallBacks->dwSize = sizeof(DDHAL_DDCALLBACKS);
+ pCallBacks->CanCreateSurface = (PDD_CANCREATESURFACE)DdCanCreateSurface;
+ pCallBacks->CreateSurface = (PDD_CREATESURFACE)DdCreateSurface;
+
+ /* Fill in the HAL Callback flags */
+ pCallBacks->dwFlags = DDHAL_CB32_CANCREATESURFACE |
DDHAL_CB32_CREATESURFACE;
}
if (pSurfaceCallBacks !=NULL)
{
memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS));
- /* FILL pSurfaceCallBacks with hal stuff */
+ /* FILL pSurfaceCallBacks with hal stuff */
+ // pSurfaceCallBacks.dwSize = sizeof(DDHAL_DDSURFACECALLBACKS);
+ // pSurfaceCallBacks.DestroySurface = DdDestroySurface;
+ // pSurfaceCallBacks.Lock = DdLock;
+ // pSurfaceCallBacks.Blt = DdBlt;
+
+ // pSurfaceCallBacks->dwFlags = DDHAL_SURFCB32_DESTROYSURFACE |
DDHAL_SURFCB32_LOCK | DDHAL_SURFCB32_BLT ;
}
if (pPaletteCallBacks !=NULL)
{
memset(pPaletteCallBacks,0,sizeof(DD_PALETTECALLBACKS));
-
/* FILL pPaletteCallBacks with hal stuff */
+ /* We will not support this callback in the framebuf.dll */
}
+
+ /* Fixme fill the ppdev->dxHalInfo with the info we need */
ppdev->bDDInitialized = TRUE;
return ppdev->bDDInitialized;
}
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 Sun Jul 16 18:54:59 2006
@@ -64,12 +64,20 @@
/* DirectX Support */
BOOL bDDInitialized;
+ DDPIXELFORMAT ddpfDisplay;
+ DDHALINFO dxHalInfo;
} PDEV, *PPDEV;
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#define DEVICE_NAME L"framebuf"
#define ALLOC_TAG TAG('F','B','U','F')
+
+DWORD CALLBACK
+DdCanCreateSurface( LPDDHAL_CANCREATESURFACEDATA pccsd );
+
+DWORD CALLBACK
+DdCreateSurface(PDD_CREATESURFACEDATA lpCreateSurface);
VOID STDCALL
DrvDisableDirectDraw(