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

📄 xslgpe.h

📁 X-scale 27x 平台
💻 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.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

Module Name:

Abstract:

Functions:

Notes:

--*/

#ifndef __XSLGPE_H__
#define __XSLGPE_H__

#include <dbgapi.h>

#define CHDBG(x) NKDbgPrintfW x ;

class XSLGPESurf;

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

	GPEMode			m_ModeInfo;
	DWORD			m_pvFlatFrameBuffer;
	DWORD			m_cbScanLineLength;
	DWORD			m_cxPhysicalScreen;
	DWORD			m_cyPhysicalScreen;
	DWORD			m_colorDepth;
	DWORD			m_VirtualFrameBuffer;
	DWORD			m_RedMaskSize;
	DWORD			m_RedMaskPosition;
	DWORD			m_GreenMaskSize;
	DWORD			m_GreenMaskPosition;
	DWORD			m_BlueMaskSize;
	DWORD			m_BlueMaskPosition;

	Node2D			*m_p2DVideoMemory;

#ifdef _X86_
// Only need these two field for emulator environment.
	DWORD			m_VesaMode;
	BOOL			m_InVPC;
#endif

//#ifdef _ARM_
// For XScale platform determine display panel type
	int             m_IsTftPanel;
	int             m_IsDualPanel;
//#endif
	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:
	XSLGPE(void);
	virtual INT		NumModes(void);
	virtual SCODE	SetMode(INT modeId,	HPALETTE *palette);
	virtual INT		InVBlank(void);
	virtual SCODE	SetPalette(const PALETTEENTRY *source, USHORT firstEntry,
								USHORT numEntries);
	virtual SCODE	GetModeInfo(GPEMode *pMode,	INT modeNumber);
	virtual SCODE	SetPointerShape(GPESurf *mask, GPESurf *colorSurface,
									INT xHot, INT yHot, INT cX, INT cY);
	virtual SCODE	MovePointer(INT xPosition, INT yPosition);
	virtual void	WaitForNotBusy(void);
	virtual INT		IsBusy(void);
  	virtual VOID    PowerHandler(BOOL bOff);
	virtual void    ContrastCmd(ULONG cjIn, PVOID pvIn, ULONG cjOut, PVOID pvOut);

	virtual void	GetPhysicalVideoMemory(unsigned long *physicalMemoryBase, unsigned long *videoMemorySize);
#ifdef	DD_ENABLE
    void            GetVirtualVideoMemory(unsigned long * virtualMemoryBase, unsigned long *videoMemorySize);
#endif	// DD_ENABLE
	virtual SCODE	Line(GPELineParms *lineParameters, EGPEPhase phase);
	virtual SCODE	BltPrepare(GPEBltParms *blitParameters);
	virtual SCODE	BltComplete(GPEBltParms *blitParameters);
	virtual ULONG	GetGraphicsCaps();

	virtual ULONG   DrvEscape(
                        SURFOBJ *pso,
                        ULONG    iEsc,
                        ULONG    cjIn,
                        PVOID    pvIn,
                        ULONG    cjOut,
                        PVOID    pvOut);

	SCODE			WrappedEmulatedLine (GPELineParms *lineParameters);
	void			CursorOn (void);
	void			CursorOff (void);

	// surf.cpp
	virtual SCODE	AllocSurface(GPESurf **surface, int width, int height, EGPEFormat format, int surfaceFlags);
#ifdef	DD_ENABLE
    virtual SCODE   AllocSurface(DDGPESurf **ppSurf, int width, int height, EGPEFormat format, EDDGPEPixelFormat pixelFormat, int surfaceFlags);
	virtual void	SetVisibleSurface( GPESurf *pSurf, BOOL bWaitForVBlank = FALSE);
#endif	// DD_ENABLE

#ifdef	DD_ENABLE
    friend void buildDDHALInfo( LPDDHALINFO lpddhi, DWORD modeidx );
#endif	// DD_ENABLE
};

#ifdef DD_ENABLE
class XSLGPESurf : public DDGPESurf
#else	// DD_ENABLE
class XSLGPESurf : public GPESurf
#endif	// DD_ENABLE
{
private:
    Node2D          *m_pNode2D;
public:
                    XSLGPESurf(int width, int height, ULONG offset, PVOID pBits, int stride, EGPEFormat format, Node2D *pNode);
#ifdef	DD_ENABLE
                    XSLGPESurf(int width, int height, ULONG offset, PVOID pBits, int stride, EGPEFormat format, EDDGPEPixelFormat pixelFormat, Node2D *pNode);
#endif	// DD_ENABLE
    virtual         ~XSLGPESurf(void);
    int             Top(void) { return m_pNode2D->Top(); }
    int             Left(void) { return m_pNode2D->Left(); }
};


#ifdef	DD_ENABLE
extern DDGPE	*gGPE;
#else	// DD_ENABLE
extern GPE	*gGPE;
#endif	// DD_ENABLE

// Global variable only for XScale-ARM driver
//#ifdef _ARM

//\\//\\//\\//\\//\\//\\//\\//\\//
//@@@ defined in libi2c.lib
//\\/\\//\\//\\//\\//\\//\\//\\//
//#include <libi2c.h>
#include "chrontel.h"

#include <lcd.h>

#ifdef __cplusplus
extern "C" {
#endif
	
	extern volatile LCD_PALETTE  *v_pPaletteBuffer;
	
	extern PBYTE virtFlatFrameBuffer;
	extern PBYTE physFlatFrameBuffer;
    extern volatile LCD_PALETTE  *v_pPaletteBuffer;
	
	extern volatile LCD_FRAME_DESCRIPTOR	*frameDescriptorCh0;
	extern volatile LCD_FRAME_DESCRIPTOR	*frameDescriptorCh1;
	extern volatile LCD_FRAME_DESCRIPTOR	*frameDescriptorPalette;
	
	extern unsigned lcdFramePages;  // default 2
	extern unsigned lcdFramePageSize;      // one fram page size in byte
	extern unsigned lcdPaletteSize;        // 0x200 for 8bit
    extern unsigned lcdFrameBitsPerPixel;

ULONG FindBestClock(ULONG clk, int isDPCmode, unsigned *ppcd, unsigned *lval);
int SetCrtcTiming( PDISPTIMING dt);
void LcdSetupGPIOs();
void LcdContrast(unsigned value);
void SetDmaDescriptor(int dual_panel, int page, unsigned sx, unsigned sy, int dbl_line);
void CleanupLcdMemory();
int AllocLcdMemory(int sx, int sy, int bpp);

    
#ifdef __cplusplus
}
#endif

//#endif   // end of _ARM_


//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// XSLGPE Variables & functions
//\\//\\//\\//\\//\\//\\//\\//\\/\\//\\//
//
//Global Variables
extern ULONG gBitMasks[];
extern VIDEO_POWER_MANAGEMENT videoPMState;

// hold the handle for the driver of Video output device
extern UINT hVideoOutDevice;     // 0 if no Video Output Device connected
extern UINT hVodDev;   // Config for LVDS,DVI,CRT,TV device driver
//extern unsigned dispScreenX, dispScreenY;

extern BOOL isCrtcTimeSet;
extern DISPTIMING dptVideoTiming;
extern BOOL bIsTftPanel;

// crttimings.cpp
extern PDISPTIMING FindCrtcTiming(int sx, int sy, BOOL chvoe_time);
// defined in vd_PowerHandler.cpp file
extern void DispDrvrPowerHandler(BOOL bOff);

extern void CleanFrameBuffer(PVOID buffer, unsigned sx, unsigned sy, unsigned bpp);

extern void LcdControlInit(int isTft, int isDualPanel);

extern int doPrivateEscape( 
    int iEsc,        //[in] Specifies the escape function to be performed.. 
    int cjIn,        //[in] Specifies the number of bytes of data pointed to by the lpszInData parameter. 
    LPCSTR pvIn,  //[in] Long pointer to the input structure required for the specified escape. 
    int cjOut,       //[in] Specifies the number of bytes of data pointed to by the lpszOutData parameter.
    LPSTR pvOut   //[out] Long pointer to the structure that receives output from this escape. 
);


#endif __XSLGPE_H__

⌨️ 快捷键说明

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