📄 halcaps.cpp
字号:
DDVPCAPS_READBACKFIELD |
// DDVPCAPS_READBACKLINE |
DDVPCAPS_SKIPEVENFIELDS |
DDVPCAPS_SKIPODDFIELDS |
DDVPCAPS_AUTOFLIP |
0,
DDVPFX_CROPX | // More video port FX capabilities
DDVPFX_CROPY |
DDVPFX_INTERLEAVE |
// DDVPFX_MIRRORLEFTRIGHT |
// DDVPFX_MIRRORUPDOWN |
// DDVPFX_PRESHRINKX |
// DDVPFX_PRESHRINKXS |
// DDVPFX_PRESHRINKY |
// DDVPFX_PRESHRINKYS |
DDVPFX_PRESHRINKXB | // Shrink by 1/2, 1/4, 1/8 or 1/16
DDVPFX_PRESHRINKYB | // Same as above
0,
2, // Number of autoflippable surfaces
1, // Byte restriction of placement within the surface
1, //8, // Byte restriction of width after prescaling
1, // Byte restriction of left cropping
1, // Byte restriction of cropping width
0, // Width can be shrunk in steps of 1/x
0, // Height can be shrunk in steps of 1/x
0, // Number of VBI autoflippable surfaces
0, // Reserved for future use
0 // Reserved for future use
};
#else
// callbacks from the DIRECTDRAWVIDEOPORT pseudo object
DDHAL_DDVIDEOPORTCALLBACKS VideoPortCallbacks =
{
sizeof(DDHAL_DDVIDEOPORTCALLBACKS),
// DDHAL_VPORT32_CANCREATEVIDEOPORT |
DDHAL_VPORT32_CREATEVIDEOPORT |
DDHAL_VPORT32_FLIP |
DDHAL_VPORT32_GETBANDWIDTH |
DDHAL_VPORT32_GETINPUTFORMATS |
DDHAL_VPORT32_GETOUTPUTFORMATS |
DDHAL_VPORT32_GETFIELD |
DDHAL_VPORT32_GETLINE |
DDHAL_VPORT32_GETCONNECT |
DDHAL_VPORT32_DESTROY |
DDHAL_VPORT32_GETFLIPSTATUS |
DDHAL_VPORT32_UPDATE |
DDHAL_VPORT32_WAITFORSYNC |
DDHAL_VPORT32_GETSIGNALSTATUS |
DDHAL_VPORT32_COLORCONTROL |
0,
0, //&HalCanCreateVideoPort,
0, //&HalCreateVideoPort,
0, //&HalFlipVideoPort,
0, //&HalGetVideoPortBandwidth,
0, //&HalGetVideoPortInputFormats,
0, //&HalGetVideoPortOutputFormats,
NULL, //lpReserved1
0, //&HalGetVideoPortField,
0, //&HalGetVideoPortLine,
0, //&HalGetVideoPortConnectInfo,
0, //&HalDestroyVideoPort,
0, //&HalGetVideoPortFlipStatus,
0, //&HalUpdateVideoPort,
0, //&HalWaitForVideoPortSync,
0, //&HalGetVideoSignalStatus,
0, //&HalColorControl,
};
#endif // VPE_ENABLE
#if (_WINCEOSVER < 600)
const DDKERNELCAPS KernelCaps =
{
sizeof(DDKERNELCAPS),
// DDKERNELCAPS_SKIPFIELDS |
// DDKERNELCAPS_AUTOFLIP |
// DDKERNELCAPS_SETSTATE |
// DDKERNELCAPS_LOCK |
// DDKERNELCAPS_FLIPVIDEOPORT |
// DDKERNELCAPS_FLIPOVERLAY |
// DDKERNELCAPS_FIELDPOLARITY |
0,
// DDIRQ_DISPLAY_VSYNC |
// DDIRQ_VPORT0_VSYNC |
0
};
#endif
#define SCREEN_WIDTH (g_pGPE->ScreenWidth())
#define SCREEN_HEIGHT (g_pGPE->ScreenHeight())
// set up by HalInit
// This global pointer is to be recorded in the DirectDraw structure
DDGPE* g_pGPE = (DDGPE*)NULL;
DDGPESurf* g_pDDrawPrimarySurface = NULL;
// InitDDHALInfo must set up this information
unsigned long g_nVideoMemorySize = 0L;
unsigned char * g_pVideoMemory = NULL; // virtual address of video memory from client's side
DWORD g_nTransparentColor = 0L;
#if (_WINCEOSVER < 600)
DDHALMODEINFO g_ModeInfo;
#endif
EXTERN_C void buildDDHALInfo( LPDDHALINFO lpddhi, DWORD modeidx )
{
//RETAILMSG(1, (TEXT(" SMI: Build DirectDraw Info\r\n")));
memset( lpddhi, 0, sizeof(DDHALINFO) ); // Clear the DDHALINFO structure
#if (_WINCEOSVER < 600)
SMI *pGPE = (SMI *) g_pGPE;
#else
SMI *pGPE = (SMI *)GetDDGPE();
g_pGPE = pGPE;
#endif
#if (_WINCEOSVER < 600)
DDHALMODEINFO *pModeTable = &g_ModeInfo;
#endif
/*
DDHALMODEINFO * pModeTable = NULL;
pModeTable = new DDHALMODEINFO();
if (!pModeTable) {
DEBUGMSG( GPE_ZONE_INIT,(TEXT("Unable to allocate mode table!\r\n")) );
return;
}
*/
#if (_WINCEOSVER < 600)
pModeTable->dwWidth = pGPE->m_pMode->width;
pModeTable->dwHeight = pGPE->m_pMode->height;
pModeTable->dwBPP = pGPE->m_pMode->Bpp;
if (pModeTable->dwBPP <= 8)
pModeTable->wFlags = DDMODEINFO_PALETTIZED;
else
pModeTable->wFlags = 0;
pModeTable->wRefreshRate = pGPE->m_pMode->frequency;
pModeTable->lPitch = pGPE->m_pModeEx->lPitch;
pModeTable->dwRBitMask = pGPE->m_pModeEx->dwRBitMask;
pModeTable->dwGBitMask = pGPE->m_pModeEx->dwGBitMask;
pModeTable->dwBBitMask = pGPE->m_pModeEx->dwBBitMask;
pModeTable->dwAlphaBitMask = pGPE->m_pModeEx->dwAlphaBitMask;
#endif
if( !g_pVideoMemory ) // in case this is called more than once...
{
// g_pGPE and g_pDDrawPrimarySurface were already set up by HalInit
unsigned long physicalVideoMemoryStart;
g_pGPE->GetPhysicalVideoMemory( &physicalVideoMemoryStart, &g_nVideoMemorySize );
DEBUGMSG( GPE_ZONE_INIT,(TEXT("GetPhysicalVideoMemory returned phys=0x%08x size=%d\r\n"),
physicalVideoMemoryStart, g_nVideoMemorySize));
g_pVideoMemory = (BYTE*)physicalVideoMemoryStart;
DEBUGMSG( GPE_ZONE_INIT,(TEXT("gpVidMem=%08x\r\n"), g_pVideoMemory ));
}
// Populate the rest of the DDHALINFO structure:
lpddhi->dwSize = sizeof(DDHALINFO);
lpddhi->lpDDCallbacks = &cbDDCallbacks;
lpddhi->lpDDSurfaceCallbacks = &cbDDSurfaceCallbacks;
lpddhi->lpDDPaletteCallbacks = &cbDDPaletteCallbacks;
#if (_WINCEOSVER < 600)
lpddhi->lpDDExeBufCallbacks = &cbDDExeBufCallbacks;
#endif
lpddhi->GetDriverInfo = HalGetDriverInfo;
#if (_WINCEOSVER < 600)
lpddhi->vmiData.fpPrimary = (unsigned long)(g_pVideoMemory) + g_pDDrawPrimarySurface->OffsetInVideoMemory(); // pointer to primary surface
lpddhi->vmiData.dwFlags = 0; // flags
lpddhi->vmiData.dwDisplayWidth = SCREEN_WIDTH; // current display width
lpddhi->vmiData.dwDisplayHeight = SCREEN_HEIGHT; // current display height
lpddhi->vmiData.lDisplayPitch = pModeTable->lPitch; // current display pitch
lpddhi->vmiData.ddpfDisplay.dwSize = sizeof(DDPIXELFORMAT);
// ... = 8bit/pixel palettized
lpddhi->vmiData.ddpfDisplay.dwFourCC = 0; // (FOURCC code)
if (pModeTable->wFlags & DDMODEINFO_PALETTIZED)
lpddhi->vmiData.ddpfDisplay.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
else
lpddhi->vmiData.ddpfDisplay.dwFlags = DDPF_RGB;
lpddhi->vmiData.ddpfDisplay.dwRBitMask = pModeTable->dwRBitMask;
lpddhi->vmiData.ddpfDisplay.dwGBitMask = pModeTable->dwGBitMask;
lpddhi->vmiData.ddpfDisplay.dwBBitMask = pModeTable->dwBBitMask;
lpddhi->vmiData.ddpfDisplay.dwRGBBitCount = pModeTable->dwBPP;
// how many bits per pixel (BD_4,8,16,24,32)
lpddhi->vmiData.dwOffscreenAlign = 16; // byte alignment for offscreen surfaces
lpddhi->vmiData.dwOverlayAlign = 16; // byte alignment for overlays
lpddhi->vmiData.dwTextureAlign = 128; // byte alignment for textures
lpddhi->vmiData.dwZBufferAlign = 16; // byte alignment for z buffers
lpddhi->vmiData.dwAlphaAlign = 16; // byte alignment for alpha
lpddhi->vmiData.dwNumHeaps = 0; // number of memory heaps in vmList
lpddhi->vmiData.pvmList = (LPVIDMEM)NULL; // array of heaps
#endif
// hw specific caps:
lpddhi->ddCaps.dwSize = sizeof(DDCAPS); // size of the DDDRIVERCAPS structure
#if (_WINCEOSVER < 600)
lpddhi->ddCaps.dwCaps = // driver specific capabilities
// DDCAPS_3D | // Display hardware has 3D acceleration
DDCAPS_BLT | // Display hardware is capable of blt operations
//DDCAPS_BLTQUEUE | // Display hardware is capable of asynchronous blt operations
//DDCAPS_BLTFOURCC | // Display hardware is capable of color space conversions during the blt operation
//DDCAPS_BLTSTRETCH | // Display hardware is capable of stretching during blt operations
DDCAPS_GDI | // Display hardware is shared with GDI
#ifdef SMI_ENABLEBACKENDVIDEO
DDCAPS_OVERLAY | // Display hardware can overlay
DDCAPS_OVERLAYCANTCLIP | // Set if display hardware supports overlays but can not clip them
DDCAPS_OVERLAYFOURCC | // overlay hardware is capable of color space conversions
DDCAPS_OVERLAYSTRETCH | // Indicates that stretching can be done by the overlay hardware
#endif
// DDCAPS_PALETTE | // unique DirectDrawPalettes can be created for DirectDrawSurfaces
// DDCAPS_PALETTEVSYNC | // palette changes can be syncd with the vertical
DDCAPS_READSCANLINE | // Display hardware can return the current scan line
// DDCAPS_STEREOVIEW | // Display hardware has stereo vision capabilities
// DDaCAPS_VBI | // Display hardware is capable of generating a vertical blank interrupt
// DDCAPS_ZBLTS | // Supports the use of z buffers with blt operations
// DDCAPS_ZOVERLAYS | // Supports Z Ordering of overlays
DDCAPS_COLORKEY | // Supports color key
// DDCAPS_ALPHA | // Supports alpha surfaces
// DDCAPS_COLORKEYHWASSIST | // colorkey is hardware assisted
// DDCAPS_NOHARDWARE | // no hardware support at all
DDCAPS_BLTCOLORFILL | // Display hardware is capable of color fill with bltter
// DDCAPS_BANKSWITCHED | // Display hardware is bank switched
// DDCAPS_BLTDEPTHFILL | // Display hardware is capable of depth filling Z-buffers with bltter
// DDCAPS_CANCLIP | // Display hardware is capable of clipping while bltting
// DDCAPS_CANCLIPSTRETCHED | // Display hardware is capable of clipping while stretch bltting
// DDCAPS_CANBLTSYSMEM | // Display hardware is capable of bltting to or from system memory
0;
if (!pGPE->m_SMISettings.m_bOverlayDisabled)
{
lpddhi->ddCaps.dwCaps = // driver specific capabilities
lpddhi->ddCaps.dwCaps |
DDCAPS_OVERLAY | // Display hardware can overlay
DDCAPS_OVERLAYCANTCLIP | // Set if display hardware supports overlays but can not clip them
DDCAPS_OVERLAYFOURCC | // overlay hardware is capable of color space conversions
DDCAPS_OVERLAYSTRETCH | // Indicates that stretching can be done by the overlay hardware
0;
}
if (!pGPE->m_SMISettings.m_bCSCDisabled)
{
lpddhi->ddCaps.dwCaps = // driver specific capabilities
lpddhi->ddCaps.dwCaps |
DDCAPS_BLTFOURCC | // Display hardware is capable of color space conversions during the blt operation
DDCAPS_BLTSTRETCH | // Display hardware is capable of stretching during blt operations
0;
}
#endif
lpddhi->ddCaps.dwCKeyCaps = // color key capabilities of the surface
#if (_WINCEOSVER < 600)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -