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

📄 sa2video.h

📁 针对Intel Xscale PXA255的WinCE boot loader源代码包!极具参考价值!
💻 H
字号:
//
// 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.
//


#ifndef __SA2VIDEO_H__
#define __SA2VIDEO_H__

#include <dispdrvr.h>

// OEM escape code base
#define ESCAPECODEBASE			100000
#define DISPLAYPAGE				(ESCAPECODEBASE + 1)
#define GETPALETTERAMPHYSICAL	(ESCAPECODEBASE + 2)
#define VERTICALBLANKINTERRUPT	(ESCAPECODEBASE + 3)
#define OS_SCREENACCESS			(ESCAPECODEBASE + 4)
#define SCROLL					(ESCAPECODEBASE + 5)

// GAPI support
#define kidVersion100	100
#define kfLandscape		0x8		// Screen is rotated 270 degrees
#define kfPalette		0x10
#define kfDirect		0x20
#define kfDirect555		0x40
#define kfDirect565		0x80
#define kfDirect888		0x100
#define GETGXINFO		0x00020000

struct GXDeviceInfo {
	long idVersion;
	void * pvFrameBuffer;
	unsigned long cbStride;
	unsigned long cxWidth;
	unsigned long cyHeight;
	unsigned long cBPP;
	unsigned long ffFormat;
	short vkButtonUpPortrait;
	short vkButtonUpLandscape;
	POINT ptButtonUp;
	short vkButtonDownPortrait;
	short vkButtonDownLandscape;
	POINT ptButtonDown;
	short vkButtonLeftPortrait;
	short vkButtonLeftLandscape;
	POINT ptButtonLeft;
	short vkButtonRightPortrait;
	short vkButtonRightLandscape;
	POINT ptButtonRight;
	short vkButtonAPortrait;
	short vkButtonALandscape;
	POINT ptButtonA;
	short vkButtonBPortrait;
	short vkButtonBLandscape;
	POINT ptButtonB;
	short vkButtonCPortrait;
	short vkButtonCLandscape;
	POINT ptButtonC;
	short vkButtonStartPortrait;
	short vkButtonStartLandscape;
	POINT ptButtonStart;
	void * pvReserved1;
	void * pvReserved2;
};


#ifdef	DD_ENABLE
class SA2Video : public DDGPE
#else	// DD_ENABLE
class SA2Video : public GPE
#endif	// DD_ENABLE
{
private:

#ifdef DD_ENABLE
	GPEModeEx		m_pModeEx;
#endif
	HANDLE			m_hevInterrupt;
	void			*m_pVirtualFrameBuffer;

	SCODE			WrappedEmulatedLine(GPELineParms *pParms);
	SCODE			WrappedEmulatedBlt(GPEBltParms *pParms);
	DWORD			m_VirtualFrameBuffer;
	Node2D			*m_p2DVideoMemory;
	DWORD			m_cbScanLineLength;
	DWORD			m_RedMaskSize;
	DWORD			m_RedMaskPosition;
	DWORD			m_GreenMaskSize;
	DWORD			m_GreenMaskPosition;
	DWORD			m_BlueMaskSize;
	DWORD			m_BlueMaskPosition;
	
	/*
	DWORD			m_pvFlatFrameBuffer;
	
	DWORD			m_cxPhysicalScreen;
	DWORD			m_cyPhysicalScreen;
	DWORD			m_colorDepth;
	DWORD			m_VirtualFrameBuffer;
	DWORD			m_VesaMode;

	

	BOOL			m_CursorDisabled;
	BOOL			m_CursorVisible;
	BOOL			m_CursorForcedOff;
	RECTL			m_CursorRect;
	POINTL			m_CursorSize;
	POINTL			m_CursorHotspot;

	// allocate enough backing store for a 64x64 cursor on a 32bpp (4 bytes per pixel) screen
	UCHAR			m_CursorBackingStore[64 * 64 * 4];
	UCHAR			m_CursorXorShape[64 * 64];
	UCHAR			m_CursorAndShape[64 * 64];
*/
public:
					SA2Video();
	virtual int		NumModes();
	virtual SCODE	SetMode(int modeId, HPALETTE *pPalette);
	virtual int		InVBlank();
	virtual SCODE	SetPalette(const PALETTEENTRY *src,
						unsigned short firstEntry,unsigned short numEntries);
	virtual SCODE	GetModeInfo(GPEMode *pMode,int modeNo );
   	virtual VOID    PowerHandler(BOOL bOff);
	virtual SCODE	SetPointerShape(GPESurf *pMask,GPESurf *pColorSurf,
						int xHot,int yHot,int cx,int cy);
	virtual SCODE	MovePointer(int x,int y);
	virtual void	WaitForNotBusy();
	virtual int		IsBusy();
	virtual void	GetPhysicalVideoMemory(unsigned long *pPhysicalMemoryBase,
						unsigned long *pVideoMemorySize);
	virtual SCODE	AllocSurface(GPESurf **ppSurf,int width,int height,
						EGPEFormat format,int surfaceFlags);
	virtual SCODE	Line(GPELineParms *pLineParms,EGPEPhase phase);
	virtual SCODE	BltPrepare(GPEBltParms *pBltParms);
	virtual SCODE	BltComplete(GPEBltParms *pBltParms);
	virtual ULONG	DrvEscape(SURFOBJ *pso, ULONG iEsc, ULONG cjIn, PVOID pvIn, ULONG cjOut, PVOID pvOut);
	virtual void    ContrastCmd(ULONG cjIn, PVOID pvIn, ULONG cjOut, PVOID pvOut);


#ifdef	DD_ENABLE
    void            GetVirtualVideoMemory(unsigned long * virtualMemoryBase, unsigned long *videoMemorySize);
    virtual SCODE   AllocSurface(DDGPESurf **ppSurf, int width, int height, EGPEFormat format, EDDGPEPixelFormat pixelFormat, int surfaceFlags);
	//virtual void	SetVisibleSurface( GPESurf *pSurf, BOOL bWaitForVBlank = FALSE);
    friend void buildDDHALInfo( LPDDHALINFO lpddhi, DWORD modeidx );
#endif	// DD_ENABLE
	
	BOOL IsrThreadStart(void);
	BOOL IsrThreadProc(void);

};

#endif __SA2VIDEO_H__

⌨️ 快捷键说明

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