⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 halcaps.cpp

📁 Sm501 VGA芯片wince下驱动代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
		//DDCKEYCAPS_DESTBLT					|		// Supports transparent blitting with a color key that identifies the replaceable bits of the destination surface for RGB colors.  
		DDCKEYCAPS_DESTOVERLAYONEACTIVE  	|		// Supports only one active destination color key value for visible overlay surfaces.  
		DDCKEYCAPS_DESTOVERLAYYUV			|		// Supports overlaying using color keying of the replaceable bits of the destination surface being overlaid for YUV colors.  
		DDCKEYCAPS_DESTOVERLAY  			|		// Supports overlaying with color keying of the replaceable bits of the destination surface being overlaid for RGB colors.  
#endif
	    DDCKEYCAPS_SRCBLT  					|		// Supports transparent blitting using the color key for the source with this surface for RGB colors.  
#if (_WINCEOSVER < 600)
		// DDCKEYCAPS_DESTBLTCLRSPACE			|		// Supports transparent blitting with a color space that identifies the replaceable bits of the destination surface for RGB colors.  
		// DDCKEYCAPS_DESTBLTCLRSPACEYUV		|		// Supports transparent blitting with a color space that identifies the replaceable bits of the destination surface for YUV colors.  
		// DDCKEYCAPS_DESTBLTYUV  				|		// Supports transparent blitting with a color key that identifies the replaceable bits of the destination surface for YUV colors.  
		// DDCKEYCAPS_DESTOVERLAYCLRSPACE  	|		// Supports a color space as the color key for the destination of RGB colors.  
		// DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV	|	  	// Supports a color space as the color key for the destination of YUV colors.  
		// DDCKEYCAPS_NOCOSTOVERLAY  			|		// Indicates there are no bandwidth trade-offs for using the color key with an overlay.  
		// DDCKEYCAPS_SRCBLTCLRSPACE  			|		// Supports transparent blitting using a color space for the source with this surface for RGB colors.  
		// DDCKEYCAPS_SRCBLTCLRSPACEYUV  		|		// Supports transparent blitting using a color space for the source with this surface for YUV colors.  
		// DDCKEYCAPS_SRCBLTYUV  				|		// Supports transparent blitting using the color key for the source with this surface for YUV colors.  
		DDCKEYCAPS_SRCOVERLAY  				|		// Supports overlaying using the color key for the source with this overlay surface for RGB colors.  
		// DDCKEYCAPS_SRCOVERLAYCLRSPACE  		|		// Supports overlaying using a color space as the source color key for the overlay surface for RGB colors.  
		// DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV  	|		// Supports overlaying using a color space as the source color key for the overlay surface for YUV colors.  
		// DDCKEYCAPS_SRCOVERLAYONEACTIVE  	|		// Supports only one active source color key value for visible overlay surfaces.  
		// DDCKEYCAPS_SRCOVERLAYYUV 			|		// Supports overlaying using the color key for the source with this overlay surface for YUV colors. 
#endif
	0;
#if (_WINCEOSVER < 600)
	lpddhi->ddCaps.dwFXCaps=					// driver specific stretching and effects capabilites
		//DDFXCAPS_BLTMIRRORUPDOWN |			// Supports vertical inversion Blts
		DDFXCAPS_BLTSTRETCHY 			|		// Supports stretch blts in the Y-direction
		DDFXCAPS_BLTSHRINKY 			|		// Supports shrink blts in the Y-direction
		DDFXCAPS_BLTSTRETCHX 			|		// Supports stretch blts in the X-direction
		DDFXCAPS_BLTSHRINKX 			|		// Supports shrink blts in the X-direction
		DDFXCAPS_BLTARITHSTRETCHY		|
		DDFXCAPS_BLTARITHSTRETCHYN 		|
		DDFXCAPS_OVERLAYSTRETCHX		|
		DDFXCAPS_OVERLAYSTRETCHXN		|
		DDFXCAPS_OVERLAYSTRETCHY		|
		DDFXCAPS_OVERLAYSTRETCHYN		|
		DDFXCAPS_OVERLAYARITHSTRETCHYN	|
		DDFXCAPS_OVERLAYARITHSTRETCHY	|
		DDFXCAPS_OVERLAYSHRINKX 		|
		DDFXCAPS_OVERLAYSHRINKXN 		|
		DDFXCAPS_OVERLAYSHRINKY 		|
		DDFXCAPS_OVERLAYSHRINKYN 		|
		//DDFXCAPS_OVERLAYALPHA			|
		0;

    lpddhi->ddCaps.dwCaps2 =                    // more driver specific capabilities
		// DDCAPS2_CERTIFIED					// Display hardware is certified
		DDCAPS2_NO2DDURING3DSCENE |				// Driver cannot interleave 2D & 3D operations
		DDCAPS2_VIDEOPORT |					// Display hardware contains a video port
		DDCAPS2_AUTOFLIPOVERLAY |			// automatic doubled buffered display of video port
		DDCAPS2_CANBOBINTERLEAVED |			// Overlay can display each field of interlaced data
		DDCAPS2_CANBOBNONINTERLEAVED |		// As above but for non-interleaved data
		DDCAPS2_CANFLIPODDEVEN |				// Driver supports bob without using a video port
		// DDCAPS2_COLORCONTROLOVERLAY |		// The overlay surface contains color controls
		// DDCAPS2_COLORCONTROLPRIMARY |		// The primary surface contains color controls
		// DDCAPS2_CANDROPZ16BIT |				// RGBZ -> RGB supported for 16:16 RGB:Z
		// DDCAPS2_NONLOCALVIDMEM |				// Driver supports non-local video memory
		// DDCAPS2_NONLOCALVIDMEMCAPS |			// Dirver supports non-local video memory but has different capabilities
		// DDCAPS2_NOPAGELOCKREQUIRED |			// Driver neither requires nor prefers surfaces to be pagelocked
		DDCAPS2_WIDESURFACES |					// Driver can create surfaces which are wider than the primary surface
		// DDCAPS2_CANBOBHARDWARE |				// Driver supports bob using hardware
		// DDCAPS2_COPYFOURCC |					// Driver supports bltting any FOURCC surface to another surface of the same FOURCC
		DDCAPS2_FLIPNOVSYNC |					// Driver respond to FLIP_NOVSYNC request
		0 ;
#endif

	if (pGPE->m_nScreenBpp <= 8)
	{
	lpddhi->ddCaps.dwPalCaps = 					// palette capabilities
		// DDPCAPS_1BIT |							// Simple 1-bit palette
		// DDPCAPS_2BIT |							// Simple 2-bit palette
		// DDPCAPS_4BIT |							// Simple 4-bit palette
		// DDPCAPS_8BITENTRIES |				// Palette indexes into 8 bit target
#if (_WINCEOSVER < 600)
		DDPCAPS_8BIT |							// Simple 8-bit palette
		DDPCAPS_INITIALIZE |					// DDraw should initalize palette
		DDPCAPS_ALLOW256 |						// All 256 entries may be set
#endif												//   ..from lpDDColorArray
		DDPCAPS_PRIMARYSURFACE |				// Palette is attached to primary surface
		// DDPCAPS_PRIMARYSURFACELEFT |			// Palette is attached to left-eye primary surface
		0;
	}
	else
	{
		lpddhi->ddCaps.dwPalCaps = 					// palette capabilities
			0;
	}
#if (_WINCEOSVER < 600)
	lpddhi->ddCaps.dwSVCaps=0;					// Stereo vision capabilities (none)
	lpddhi->ddCaps.dwAlphaBltConstBitDepths = 0;// No Alpha Blt's
	lpddhi->ddCaps.dwAlphaBltPixelBitDepths = 0;
	lpddhi->ddCaps.dwAlphaBltSurfaceBitDepths = 0;
	lpddhi->ddCaps.dwZBufferBitDepths=0;		// No z buffer
#endif
	lpddhi->ddCaps.dwVidMemTotal = g_nVideoMemorySize;	// total amount of video memory
	lpddhi->ddCaps.dwVidMemFree = g_nVideoMemorySize;	// amount of free video memory

	lpddhi->ddCaps.dwMaxVisibleOverlays=1;	  	// maximum number of visible overlays
	lpddhi->ddCaps.dwCurrVisibleOverlays = 0;	// current number of visible overlays
	lpddhi->ddCaps.dwMinOverlayStretch=1;		// Min Overlay Stretch factor
	lpddhi->ddCaps.dwMaxOverlayStretch=((SCREEN_HEIGHT < 256)?128:256)*1000; 	// Max Overlay Stretch factor

	lpddhi->ddCaps.dwNumFourCCCodes = MAX_FOURCC; 	// number of four cc codes
	lpddhi->ddCaps.dwAlignBoundarySrc = 0;		// source rectangle alignment
	lpddhi->ddCaps.dwAlignSizeSrc = 0;			// source rectangle byte size
#if (_WINCEOSVER < 600)
	lpddhi->ddCaps.dwAlignStrideAlign = 0;		// stride alignment
#endif
	lpddhi->ddCaps.ddsCaps.dwCaps=				// DDSCAPS structure has all the general capabilities
		// DDSCAPS_ALPHA |							// Can create alpha-only surfaces
		DDSCAPS_BACKBUFFER |						// Can create backbuffer surfaces
#if (_WINCEOSVER < 600)
		DDSCAPS_COMPLEX |							// Can create complex surfaces
#endif
		DDSCAPS_FLIP |								// Can flip between surfaces
		DDSCAPS_FRONTBUFFER |						// Can create front-buffer surfaces
#if (_WINCEOSVER < 600)
		DDSCAPS_OFFSCREENPLAIN |					// Can create off-screen bitmaps
#endif
		DDSCAPS_OVERLAY |							// Can create overlay surfaces
		DDSCAPS_PALETTE |							// Has one palette ???
		DDSCAPS_PRIMARYSURFACE |					// Has a primary surface
		// DDSCAPS_PRIMARYSURFACELEFT |				// Has a left-eye primary surface
		// DDSCAPS_TEXTURE |						// Supports texture surrfaces
//		DDSCAPS_SYSTEMMEMORY |					// Surfaces are in system memory
		DDSCAPS_VIDEOMEMORY |						// Surfaces are in video memory
#if (_WINCEOSVER < 600)
		DDSCAPS_VISIBLE |							// Changes are instant ???
#endif
		// DDSCAPS_ZBUFFER |						// Can create (pseudo) Z buffer
		// DDSCAPS_EXECUTEBUFFER |					// Can create execute buffer
		// DDSCAPS_3DDEVICE |						// Surfaces can be 3d targets
		// DDSCAPS_WRITEONLY |						// Can create write-only surfaces
		// DDSCAPS_ALLOCONLOAD |					// Can create alloconload surfaces
		// DDSCAPS_MIPMAP |							// Can create mipmap
		// DDSCAPS_VIDEOPORT |                       // Can create video port surfaces
		0;

	SETROPBIT(lpddhi->ddCaps.dwRops,SRCCOPY);	// Set bits for ROPS supported
	SETROPBIT(lpddhi->ddCaps.dwRops,PATCOPY);
	SETROPBIT(lpddhi->ddCaps.dwRops,BLACKNESS);
	SETROPBIT(lpddhi->ddCaps.dwRops,WHITENESS);

#ifdef ENABLE_DIRECT3D
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x00); // 0
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x88); // DSa
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xA0); // DPa
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x44); // SDna
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x50); // PDna
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xCC); // S
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xF0); // P
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x0A); // DPna
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x22); // DSna
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xAA); // D
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x5A); // DPx
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x66); // DSx
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xEE); // DSo
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xFA); // DPo
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x05); // DPon
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x11); // DSon
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x99); // DSxn
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xA5); // DPxn
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x55); // Dn
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xDD); // SDno
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xF5); // PDno
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x0F); // Pn
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x33); // Sn
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xAF); // DPno
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xBB); // DSno
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x5F); // DPan
	SETROPBIT(lpddhi->ddCaps.dwRops, 0x77); // DSan
	SETROPBIT(lpddhi->ddCaps.dwRops, 0xFF); // 1
#endif


    // caps for system to video blts
#if (_WINCEOSVER < 600)
    lpddhi->ddCaps.dwSVBCaps =          // driver specific capabilities
        //DDCAPS_BLT |                    // Display hardware is capable of
                                        // blt operations
        //DDCAPS_COLORKEY |               // Supports color key
        //DDCAPS_COLORKEYHWASSIST |       // colorkey is hardware assisted
        //DDCAPS_BLTCOLORFILL |           // Display hardware is capable of
                                        // color fill with bltter
        0;
    lpddhi->ddCaps.dwSVBCKeyCaps =      // color key capabilities of the surface
        //DDCKEYCAPS_SRCBLT |             // Hardware can use colorkey (cf source
                                        // only) ..for transparent blts
        0;
    lpddhi->ddCaps.dwSVBFXCaps=         // driver specific stretching and
                                        // effects capabilites
        0;


    lpddhi->dwMonitorFrequency = pModeTable->wRefreshRate;
    											 //monitor frequency in current mode (60 field/sec)
    lpddhi->dwModeIndex = 0; // g_nMode;		// current mode: index into array
#endif
	
	lpddhi->lpdwFourCC = SMIFourCC;				// fourcc codes supported
#if (_WINCEOSVER < 600)
    lpddhi->dwNumModes = 1; 					// number of modes supported
	lpddhi->lpModeInfo = pModeTable;			   	// mode information
#endif
	lpddhi->dwFlags =
#if (_WINCEOSVER < 600)
					DDHALINFO_MODEXILLEGAL |	// create flags
					DDHALINFO_GETDRIVERINFOSET |
#endif
					0;
#if (_WINCEOSVER < 600)
    lpddhi->lpPDevice = (LPVOID)0;				// physical device ptr
    lpddhi->hInstance = (DWORD)0;				// instance handle of driver
#endif
	lpddhi->ddCaps.dwMaxVideoPorts	= 1;
	lpddhi->ddCaps.dwCurrVideoPorts= 0;


	//lpddhi->ddCaps.dwOverlayCaps =              // overlay capabilities
 //       DDOVERLAYCAPS_FLIP                |     // Overlay may be flipped.
 //       DDOVERLAYCAPS_AUTOFLIP            |     // Overlay may be autoflipped when attached to a video port.
 //       DDOVERLAYCAPS_CKEYSRC             |     // Supports overlaying using the color key for the source with this overlay surface for RGB colors.
 //       DDOVERLAYCAPS_CKEYDEST            |     // Supports overlaying with color keying of the replaceable bits of the destination surface being overlaid for RGB colors.
 //       DDOVERLAYCAPS_CKEYDESTCLRSPACEYUV |     // Supports overlaying using color keying of the replaceable bits of the destination surface being overlaid for YUV colors.
 //       0;

 //   lpddhi->ddCaps.dwMaxVisibleOverlays  = 1;   // maximum number of visible overlays
 //   lpddhi->ddCaps.dwCurrVisibleOverlays = 0;   // current number of visible overlays

 //   lpddhi->ddCaps.dwMinOverlayStretch = 1;     // Min Overlay Stretch factor
 //   lpddhi->ddCaps.dwMaxOverlayStretch =((SCREEN_HEIGHT < 256)?128:256)*1000;     // Max Overlay Stretch factor

 //   lpddhi->ddCaps.dwAlignBoundarySrc  = 0;     // overlay source rectangle alignment
 //   lpddhi->ddCaps.dwAlignSizeSrc      = 0;     // overlay source rectangle byte size
 //   lpddhi->ddCaps.dwAlignBoundaryDest = 0;     // overlay destination rectangle alignment
 //   lpddhi->ddCaps.dwAlignSizeDest     = 0;     // overlay destination rectangle byte size

 //   lpddhi->ddCaps.dwMiscCaps =                 // more driver specific capabilities
 //       DDMISCCAPS_READSCANLINE      |          // The driver allows the current scanline number to be read
 //       DDMISCCAPS_READVBLANKSTATUS  |          // The driver allows the current vertical blank status to be read
 //       DDMISCCAPS_FLIPVSYNCWITHVBI  |          // The driver is able to synchronize flips with the vertical blanking period
 //       DDMISCCAPS_FLIPODDEVEN       |          // Driver supports bob without using a video port
 //       DDMISCCAPS_VIDEOPORT         |          // Display hardware contains a video port
 //       DDMISCCAPS_AUTOFLIPOVERLAY   |          // Automatic double buffered display of video port
 //       DDMISCCAPS_BOBINTERLEAVED    |          // Overlay can display each field of interlaced data
 //       DDMISCCAPS_BOBNONINTERLEAVED |          // As above for non-interleaved data
 //       0;

 //   lpddhi->ddCaps.dwMinVideoStretch = 1000;
 //   lpddhi->ddCaps.dwMaxVideoStretch = 1000;
 //   lpddhi->ddCaps.dwMaxVideoPorts   = 1;
 //   lpddhi->ddCaps.dwCurrVideoPorts  = 0;

#ifdef ENABLE_DIRECT3D
    init_D3D_caps(lpddhi);
#endif //ENABLE_DIRECT3D
}

#endif	// DD_ENABLE

⌨️ 快捷键说明

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