📄 gxvideo.h
字号:
/*
* $Workfile: GXVIDEO.H $
* $Revision: 6 $
* $Date: 4/07/00 8:50a $
* $Modtime: 4/07/00 8:37a $
* $Author: Sarma $
*
* Copyright (c) 1998 National Semiconductor Corporation.
* All Rights Reserved.
*
* This software is the confidential and proprietary information of National
* Semiconductor Corporation. ("Confidential Information").
* You shall not disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you entered into
* with National Semiconductor Corporation.
* This code is supplied as is.
*
*/
/*
*$Log: /CE/Platform/Nsc/Drivers/Video/gxvideo/base/GXVIDEO.H $
*
* 6 4/07/00 8:50a Sarma
* Removed Cyrix Corporation from the legal/confidentail information.
*
* 5 3/29/00 9:29a Sarma
* Added special READ/WRITE macros to be used by Directdraw functions. Two
* new Alloc functions added for directdraw , AllocSurface and
* AllocOverlaySurface. The new Gxvideo constructor is also for the
* directdraw interface.
*
* 4 10/14/99 2:57p Sarma
* Moved the defines from config to be shared by flash.cpp.
* Added interfaces from flash.cpp.
*
* 3 7/20/99 2:21p Sarma
* Added Power Handler function in Misc.cpp and supporting functions for
* power management
*
* 2 11/12/98 3:29p Sarma
* Added Confidential copyright to files with VSS keywords for
* log/history.
* Added functions support for ScreenPower, GetBltSolidColor,
* AcceleratedBitmapScreenLookupBlt, AcceleratedPatternLookupFill,
* AcceleratedWxHPatternFill.
*$History: GXVIDEO.H $
*
* ***************** Version 6 *****************
* User: Sarma Date: 4/07/00 Time: 8:50a
* Updated in $/CE/Platform/Nsc/Drivers/Video/gxvideo/base
* Removed Cyrix Corporation from the legal/confidentail information.
*
* ***************** Version 5 *****************
* User: Sarma Date: 3/29/00 Time: 9:29a
* Updated in $/CE/Platform/Nsc/Drivers/Video/gxvideo/base
* Added special READ/WRITE macros to be used by Directdraw functions. Two
* new Alloc functions added for directdraw , AllocSurface and
* AllocOverlaySurface. The new Gxvideo constructor is also for the
* directdraw interface.
*
* ***************** Version 4 *****************
* User: Sarma Date: 10/14/99 Time: 2:57p
* Updated in $/wince/v2.1/gxvideo
* Moved the defines from config to be shared by flash.cpp.
* Added interfaces from flash.cpp.
*
* ***************** Version 3 *****************
* User: Sarma Date: 7/20/99 Time: 2:21p
* Updated in $/wince/v2.1/gxvideo
* Added Power Handler function in Misc.cpp and supporting functions for
* power management
*
* ***************** Version 2 *****************
* User: Sarma Date: 11/12/98 Time: 3:29p
* Updated in $/wince/v2.1/gxvideo
* Added Confidential copyright to files with VSS keywords for
* log/history.
* Added functions support for ScreenPower, GetBltSolidColor,
* AcceleratedBitmapScreenLookupBlt, AcceleratedPatternLookupFill,
* AcceleratedWxHPatternFill.
*/
#ifndef __GXVIDEO_H__
#define __GXVIDEO_H__
#include "gpevga.h"
#include "cy_regs.h"
#include "gxdefs.h"
#include "cx5530.h"
#define COMPRESSION_ENABLE 0
#define SUPPORT_DDC 1
#define CX5510 0x2000 // 5510 core logic
#define CX5520 0x0080 // 5520 core logic
#define CX5530 0x4000 // 5530 core logic
#define DHRUVA 0x8000 // DHRUVA/MediaPC System on a chip
//
// MACROS
//
#define WAIT_BLIT(base) while ((*((volatile unsigned long *) (base+GP_BLIT_STATUS))) & \
(BS_PIPELINE_BUSY | BS_BLIT_BUSY | BS_BLIT_PENDING));
#define WAIT_PIPELINE(base) while ((*((volatile unsigned long *) (base+GP_BLIT_STATUS))) &\
BS_PIPELINE_BUSY);
#define WAIT_BUSY(base) while ((*((volatile unsigned long *) (base+GP_BLIT_STATUS))) & \
BS_BLIT_BUSY)
#define WAIT_PENDING(base) while ((*((volatile unsigned long *) (base+GP_BLIT_STATUS))) & \
BS_BLIT_PENDING)
#define READ_REG8(base, offset) *((volatile unsigned char *) ((base)+(offset)))
#define READ_REG16(base, offset) *((volatile unsigned short *) ((base)+(offset)))
#define READ_REG32(base, offset) *((volatile unsigned long *) ((base)+(offset)))
#define WRITE_REG8(base, offset, value) *((volatile unsigned char *) ((base)+(offset))) = \
(unsigned char)(value);
#define WRITE_REG16(base, offset, value) *((volatile unsigned short *) ((base)+(offset))) = \
(unsigned short)(value);
#define WRITE_REG32(base, offset, value) *((volatile unsigned long *) ((base)+(offset))) = \
(unsigned long)(value);
#ifdef DD_SUPPORT
#define MEM_READ_8(base, offset) *((volatile unsigned char *) ((base)+(offset)))
#define MEM_READ_16(base, offset) *((volatile unsigned short *) ((base)+(offset)))
#define MEM_READ_32(base, offset) *((volatile unsigned long *) ((base)+(offset)))
#define MEM_WRITE_8(base, offset, value) *((volatile unsigned char *) ((base)+(offset))) = \
(unsigned char)(value);
#define MEM_WRITE_16(base, offset, value) *((volatile unsigned short *) ((base)+(offset))) = \
(unsigned short)(value);
#define MEM_WRITE_32(base, offset, value) *((volatile unsigned long *) ((base)+(offset))) = \
(unsigned long)(value);
#endif //DD_SUPPORT
class GxVideoSurf;
class GxVideo : public GPEVGA
{
private:
#if DDHAL
public: // temporarily moved - will fix later
#endif
// Ports and memory ranges used to access registers
// Port m_IOPort[numPortIDs]; // Device specific ports used by GxVideo
SubIndexedRegArray16 reg_BEE8; // Indexed accelerator registers
unsigned char *m_pMMIO; // Memory Mapped IO range
unsigned char *m_pLAW; // Linear access window
int m_nVideoMemorySize; // Size in bytes of video RAM total
Node2D *m_p2DVideoMemory; // Base entry representing all video memory
int m_nScreenStride; // Stride of 2d memory in bytes
unsigned int m_nTicksAtFlip; // TickCount at time flip was requested
unsigned int m_nTicksAtResync; // TickCount when we last waited for VBlank
GxVideoSurf *m_pOldVisibleSurface; // Visible surface before flip
GxVideoSurf *m_pNewVisibleSurface; // Visible surface after flip
unsigned long m_nLAWPhysical;
unsigned long gcfg, tcfg, ocfg, dcfg30;
void delay_milliseconds();
unsigned char ProcessorID; //Processor ID of Gx.
unsigned long DeviceId; //Device ID of Cx
unsigned short BB0_Base_Address; //Base Address for BB0
unsigned short BB1_Base_Address; //Base Address for BB1
unsigned short BB0_Size_Bytes; //Blit Buffer Width in bytes
unsigned long BB0_Size_Pixels; //Blit Buffer Width in pixels
unsigned long Display_BPP; //BPP of current display mode
int CurrentMode; //Current display mode, -1 if not inited
int m_resolution; // 640x480 or 1024x768, etc.
public:
// Config.cpp:
GxVideo();
virtual SCODE SetMode( int modeNo, HPALETTE *pPalette );
//power management (VESA DPMS)
void ScreenPower( int mode );
// Cursor.cpp:
virtual SCODE SetPointerShape(
GPESurf *pMask,
GPESurf *pColorSurf,
int xHot,
int yHot,
int cx,
int cy );
virtual SCODE MovePointer(
int x,
int y );
void SetCursorColors(
unsigned long color );
//unsigned long foreground, // 0x00bbggrr format
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -