📄 amadisp.h
字号:
//
// Copyright (c) 1995-1998 Microsoft Corporation.
// Copyright (c) 1998-2003 Renesas Technology Corp.
// All Rights Reserved.
//
// HD64404 Standard Display Driver
//
//
// FILE : AMADISP.H
// CREATED : 1997.--.-- ("wrap2bpp.h" in Windows CE 2.10 environment)
// MODIFIED : 2003. 6.17
// AUTHOR : Renesas Technology Corp.
// HARDWARE : US7751-HRPxxC (BigSur with HD64404, ITS-DS2A)
// HS7751RSTC01H (S1-E, ITS-DS5)
// TARGET OS : Microsoft(R) Windows(R) CE .NET 4.2
// FUNCTIONS : Class, macro, and global variable definitions
// HISTORY : (history not certain)
// 1998.11.--
// - Q2Disp.h (for HD64413) is created by modifying "wrap2bpp.h"
// in the WinCE2.10 developping environment.
// (some modification is applied in 1999.)
// 2001. 7.23
// - Modified for HD64404.
// 2001. 8.27
// - Modified to use HD64404 linear display function.
// 2001.10.31
// - External variable definitions are added to support
// configuration from registry.
// 2002. 1.28
// - g_dwLocalMemoryAddress is added to keep top address of
// HD64404 locally-connected SDRAM.
// - g_dwVideoMemoryAddress is renamed to g_dwVideoMemoryOffset.
// 2002. 9.25
// - Header style is changed.
// 2002.11.27
// - Register value storage for Programmable Clock Generator
// ICD2053B is added to ModeInit structure.
// - m_pHD64404Regs and SetClock are added to AMADisp class.
// - Register base globals for each modules are removed and
// g_dwRegisterAddress that is the register base global for all
// HD64404 modules is added.
//----------------------------------------------------------------------------
#ifndef __AMADISP_H__
#define __AMADISP_H__
#define CURSOR_XSIZE 64 /* GWES uses this size. Actual hardware */
#define CURSOR_YSIZE 64 /* cursor size is defined in DISPREGS.H. */
#define CURSOR_BYTES (CURSOR_XSIZE * CURSOR_YSIZE) /* 8bpp */
// Transparent color to draw mouse pointer on cursor1 (1 - 254).
#define CURSOR_TRANSPARENT_COLOR 10
// contrast controls, actually not supported
#define CONTRAST_CMD_GET 0
#define CONTRAST_CMD_SET 1
#define CONTRAST_CMD_INCREASE 2
#define CONTRAST_CMD_DECREASE 3
#define CONTRAST_CMD_DEFAULT 4
/* ModeInit structure to store display mode related parameters. */
/* Currently Windows CE does not support multiple display modes. */
struct ModeInit
{
GPEMode gpeMode; // GPE mode structure
DWORD MPXIFRegs[12]; // HD64404 MPX I/F registers
ULONG DORegs[0x0300]; // HD64404 DisplayOut registers
ULONG GERegs[0x0B00]; // HD64404 GraphicsEngine registers
UCHAR PCGRegs[5]; // ICD2053 PCG registers (S1-E I/O board)
};
/* Index of ICD2053B Programmable Clock Generator register values */
/* in ModeInit data structure. Actual registers are not accessed */
/* by address so these are only used to access data structure. */
#define PCG_I 0
#define PCG_Q 1
#define PCG_M 2
#define PCG_D 3
#define PCG_P 4
class AMADisp : public GPE
{
private:
volatile unsigned long *m_pHD64404Regs; // HD64404 register space base
volatile unsigned long *m_pDisplayOutRegs; // DisplayOut register base address
volatile unsigned long *m_pGraphicsEngineRegs; // GE register base address
volatile unsigned long *m_pMPXIFRegs; // MPX I/F register base address
volatile unsigned char *m_pVideoMemory; // total video memory base
volatile unsigned char *m_pCursorPattern; // cursor pattern area within video memory
DWORD m_nScreenStride;
public:
AMADisp();
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 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 BOOL ContrastControl(
ULONG cmd,
ULONG *pValue );
virtual VOID PowerHandler( BOOL bOff );
private:
BOOL SetClock( int nModeIndex );
BOOL SetRegisters( int nModeIndex );
};
class Emulator : public GPE
{
public:
//
// Sourceless blts
//
SCODE EmulatedBltFill08 ( GPEBltParms * );
SCODE EmulatedBltDstInvert08 ( GPEBltParms * );
SCODE EmulatedBltPatInvert08 ( GPEBltParms * );
//
// Sourced blts
//
SCODE EmulatedBltSrcCopy0808 ( GPEBltParms * );
SCODE EmulatedBltSrcAnd0808 ( GPEBltParms * );
SCODE EmulatedBltSrcPaint0808 ( GPEBltParms * );
SCODE EmulatedBltSrcInvert0808( GPEBltParms * );
//
// Text expansion
//
SCODE EmulatedBltText08 ( GPEBltParms * );
};
// Global variables, used to pass configuration information.
extern ModeInit AMADispMode[];
extern DWORD g_dwLocalMemoryAddress;
extern DWORD g_dwVideoMemoryOffset;
extern DWORD g_dwVideoMemorySize;
extern DWORD g_dwRegisterAddress;
//extern DWORD g_dwDriverMemoryAddress;
//extern DWORD g_dwInterruptNumber;
extern DWORD g_dwReservedVideoMemorySize;
extern DWORD g_dwFrameBufferOffset;
extern DWORD g_dwFrameBufferSize;
extern DWORD g_dwWorkAreaOffset;
extern DWORD g_dwWorkAreaSize;
extern DWORD g_dwSystemDLAreaOffset;
extern DWORD g_dwSystemDLAreaSize;
//extern DWORD g_dwReservedAreaOffset;
//extern DWORD g_dwReservedAreaSize;
extern DWORD g_dwCursorAreaOffset;
extern DWORD g_dwCursorAreaSize;
//extern DWORD g_dwLinePatternAreaOffset;
//extern DWORD g_dwLinePatternAreaSize;
extern DWORD g_dwDisplayClock;
extern DWORD g_dwCursorBlinkFrames;
#endif __AMADISP_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -