halsurf.cpp

来自「该BSP是基于PXA270+WINCE的BSP」· C++ 代码 · 共 473 行 · 第 1/2 页

CPP
473
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/* 
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** Portions of the source code contained or described herein and all documents
** related to such source code (Material) are owned by Intel Corporation
** or its suppliers or licensors and is licensed by Microsoft Corporation for distribution.  
** Title to the Material remains with Intel Corporation or its suppliers and licensors. 
** Use of the Materials is subject to the terms of the Microsoft license agreement which accompanied the Materials.  
** No other license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise 
** Some portion of the Materials may be copyrighted by Microsoft Corporation.
*/
#include "precomp.h"

extern "C" BOOL bDoRotation;

extern "C" void DispDrvrDirtyRectDump(LPCRECT prc);

DWORD WINAPI HalFlipToGDISurface( LPDDHAL_FLIPTOGDISURFACEDATA pd )
{
    DEBUGENTER( HalFlipToGDISurface );
    /*
    typedef struct _DDHAL_FLIPTOGDISURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL    lpDD;             // driver struct
        DWORD                      dwToGDI;          // TRUE if flipping to the GDI surface, FALSE if flipping away
        DWORD                      dwReserved;       // reserved for future use
        HRESULT                    ddRVal;           // return value
        LPDDHAL_FLIPTOGDISURFACE   FlipToGDISurface; // PRIVATE: ptr to callback
    } DDHAL_FLIPTOGDISURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalCreateSurface( LPDDHAL_CREATESURFACEDATA pd )
{
    DEBUGENTER( HalCreateSurface );
    /*
    typedef struct _DDHAL_CREATESURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDSURFACEDESC             lpDDSurfaceDesc;// description of surface being created
        LPDDRAWI_DDRAWSURFACE_LCL   FAR *lplpSList; // list of created surface objects
        DWORD                       dwSCnt;         // number of surfaces in SList
        HRESULT                     ddRVal;         // return value
        LPDDHAL_CREATESURFACE       CreateSurface;  // PRIVATE: ptr to callback
    } DDHAL_CREATESURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

//////////////////////////// DDHAL_DDEXEBUFCALLBACKS ////////////////////////////

DWORD WINAPI HalCanCreateSurface( LPDDHAL_CANCREATESURFACEDATA pd )
{
    DEBUGENTER( HalCanCreateSurface );
    /*
    typedef struct _DDHAL_CANCREATESURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL    lpDD;                // driver struct
        LPDDSURFACEDESC            lpDDSurfaceDesc;    // description of surface being created
        DWORD                    bIsDifferentPixelFormat;
                                                    // pixel format differs from primary surface
        HRESULT                    ddRVal;                // return value
        LPDDHAL_CANCREATESURFACE    CanCreateSurface;
                                                    // PRIVATE: ptr to callback
    } DDHAL_CANCREATESURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalCreateExecuteBuffer( LPDDHAL_CREATESURFACEDATA pd )
{
    DEBUGENTER( HalCreateExecuteBuffer );
    /*
    typedef struct _DDHAL_CREATESURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDSURFACEDESC             lpDDSurfaceDesc;// description of surface being created
        LPDDRAWI_DDRAWSURFACE_LCL   FAR *lplpSList; // list of created surface objects
        DWORD                       dwSCnt;         // number of surfaces in SList
        HRESULT                     ddRVal;         // return value
        LPDDHAL_CREATESURFACE       CreateSurface;  // PRIVATE: ptr to callback
    } DDHAL_CREATESURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}


DWORD WINAPI HalDestroyExecuteBuffer( LPDDHAL_DESTROYSURFACEDATA pd )
{
    DEBUGENTER( HalDestroyExecutebuffer );
    /*
    typedef struct _DDHAL_DESTROYSURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        HRESULT                     ddRVal;         // return value
        LPDDHALSURFCB_DESTROYSURFACE DestroySurface;// PRIVATE: ptr to callback
        BOOL                        fDestroyGlobal;
    } DDHAL_DESTROYSURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalLock( LPDDHAL_LOCKDATA pd )
{
    DEBUGENTER( HalLock );
    /*
    typedef struct _DDHAL_LOCKDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        DWORD                       bHasRect;       // rArea is valid
        RECTL                       rArea;          // area being locked
        LPVOID                      lpSurfData;     // pointer to screen memory (return value)
        HRESULT                     ddRVal;         // return value
        LPDDHALSURFCB_LOCK          Lock;           // PRIVATE: ptr to callback
    } DDHAL_LOCKDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalUnlock( LPDDHAL_UNLOCKDATA pd )
{
    DEBUGENTER( HalUnlock );
    /*
    typedef struct _DDHAL_UNLOCKDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        HRESULT                     ddRVal;            // return value
        LPDDHALSURFCB_UNLOCK        Unlock;         // PRIVATE: ptr to callback
    } DDHAL_UNLOCKDATA;
    */

    DDGPEUnlock(pd);

    if (bDoRotation
        && pd->lpDDSurface->lpGbl->fpVidMem == (DWORD)g_pGPE->PrimarySurface()->Buffer())
    {
        RECT rc;

        rc.left   = 0;
        rc.top    = 0;
        rc.right  = g_pGPE->PrimarySurface()->Width();
        rc.bottom = g_pGPE->PrimarySurface()->Height();

        DispDrvrDirtyRectDump(&rc);
    }

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

//////////////////////////// DDHAL_DDSURFACECALLBACKS ////////////////////////////

DWORD WINAPI HalDestroySurface( LPDDHAL_DESTROYSURFACEDATA pd )
{
    DEBUGENTER( HalDestroySurface );
    /*
    typedef struct _DDHAL_DESTROYSURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        HRESULT                     ddRVal;         // return value
        LPDDHALSURFCB_DESTROYSURFACE DestroySurface;// PRIVATE: ptr to callback
        BOOL                        fDestroyGlobal;
    } DDHAL_DESTROYSURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalSetSurfaceDesc(LPDDHAL_HALSETSURFACEDESCDATA pd)
{
    DEBUGENTER( HalSetSurfaceDesc );
    /*
        typedef struct _DDHAL_HALSETSURFACEDESCDATA
        {
            DWORD           dwSize;                 // Size of this structure
            LPDDRAWI_DDRAWSURFACE_LCL  lpDDSurface; // Surface
            LPDDSURFACEDESC    lpddsd;                    // Description of surface
            HRESULT         ddrval;
        } DDHAL_HALSETSURFACEDESCDATA;
    */

    // Implementation
    pd->ddrval = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalFlip( LPDDHAL_FLIPDATA pd )
{
    DEBUGENTER( HalFlip );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?