RGB Color Balance
- From: Vijaya mohan <Vijayamohan@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 18 Nov 2006 23:55:02 -0800
Hi
I am writing a display driver for Windows Ce 5.0. i am using Samsung S3C2440
cpu. I am modifying the display driver given MBA2440 training board from aiji
system. I did configure for 400X234 resolution. The display is stable. no
flickering.
display mode is RGB mode. driver is configured for 24bit mode.
But the display looks like reddish. it seems the RED color is high. green is
less and blue is high.
bit mask used;
static ulong gBitMasks[] = { 0xFF0000, 0x00FF00, 0x0000FF }; // 24bit 888
MODE
my Question is :
how to balance these colors. how to change the color contrast of each color.
i am enclosing the source code.
INSTANTIATE_GPE_ZONES(0x3,"MGDI Driver","unused1","unused2") // Start with
errors and warnings
static GPE *gGPE = (GPE*)NULL;
static ulong gBitMasks[] = { 0xFF0000, 0x00FF00, 0x0000FF }; // 24bit 888
MODE
ULONG *APIENTRY DrvGetMasks(DHPDEV dhpdev)
{
return gBitMasks;
}
static TCHAR gszBaseInstance[256] = _T("Drivers\\Display\\S3C2440\\CONFIG");
#define dim(x) (sizeof(x) / sizeof(x[0]))
// This prototype avoids problems exporting from .lib
BOOL APIENTRY GPEEnableDriver(ULONG engineVersion, ULONG cj, DRVENABLEDATA
*data,
PENGCALLBACKS engineCallbacks);
// GWES will invoke this routine once prior to making any other calls into
the driver.
// This routine needs to save its instance path information and return TRUE.
If it
// returns FALSE, GWES will abort the display initialization.
BOOL APIENTRY
DisplayInit(LPCTSTR pszInstance, DWORD dwNumMonitors)
{
DWORD dwStatus;
HKEY hkDisplay;
BOOL fOk = FALSE;
RETAILMSG(debmess, (_T("SALCD2: display instance '%s', num monitors
%d\r\n"),
pszInstance != NULL ? pszInstance : _T("<NULL>"), dwNumMonitors));
if(pszInstance != NULL) {
_tcsncpy(gszBaseInstance, pszInstance, dim(gszBaseInstance));
}
// sanity check the path by making sure it exists
dwStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, gszBaseInstance, 0, 0,
&hkDisplay);
if(dwStatus == ERROR_SUCCESS) {
RegCloseKey(hkDisplay);
fOk = TRUE;
} else {
RETAILMSG(debmess, (_T("SALCD2: DisplayInit: can't open '%s'\r\n"),
gszBaseInstance));
}
RETAILMSG(debmess, (_T("fok = %x\r\n"),fOk));
return fOk;
}
BOOL APIENTRY DrvEnableDriver(ULONG engineVersion, ULONG cj, DRVENABLEDATA
*data,
PENGCALLBACKS engineCallbacks)
{
BOOL fOk = FALSE;
// make sure we know where our registry configuration is
if(gszBaseInstance[0] != 0) {
fOk = GPEEnableDriver(engineVersion, cj, data, engineCallbacks);
}
return fOk;
}
//
// Main entry point for a GPE-compliant driver
//
GPE *GetGPE(void)
{
if (!gGPE)
{
gGPE = new S3C2440DISP();
}
return gGPE;
}
#define LCD_XSIZE_TFT_200 400
#define LCD_YSIZE_TFT_200 234
unsigned int TempBuffer[LCD_XSIZE_TFT_200+1][LCD_YSIZE_TFT_200];
S3C2440DISP::S3C2440DISP (void)
{
RETAILMSG(debmess, (TEXT("++S3C2440DISP::S3C2440DISP\r\n")));
// setup up display mode related constants
m_nScreenWidth = LCD_XSIZE_TFT_200;
m_nScreenHeight = LCD_YSIZE_TFT_200;
m_colorDepth = 24;
m_cbScanLineLength = m_nScreenWidth*4;
m_FrameBufferSize = m_nScreenHeight * m_cbScanLineLength*8;
// memory map register access window, frame buffer, and program LCD
controller
InitializeHardware();
RETAILMSG(debmess, (_T("S3C2440DISP::InitializeHardware------>ok!\r\n")));
// setup ModeInfo structure
RETAILMSG(debmess, (_T("S3C2440DISP::Mode Info set!\r\n")));
m_ModeInfo.modeId = 0;
m_ModeInfo.width = m_nScreenWidth;
m_ModeInfo.height = m_nScreenHeight;
m_ModeInfo.Bpp = m_colorDepth;
m_ModeInfo.format = gpe32Bpp;
m_ModeInfo.frequency = 60; // ?
// m_ModeInfo.frequency = 75; // ?
m_pMode = &m_ModeInfo;
// allocate primary display surface
RETAILMSG(debmess, (_T("S3C2440DISP::Primary Surface init!\r\n")));
m_pPrimarySurface = new GPESurf(m_nScreenWidth, m_nScreenHeight,
(void*)(m_VirtualFrameBuffer), m_cbScanLineLength, m_ModeInfo.format);
RETAILMSG(debmess, (_T("S3C2440DISP::Primary Surface init --->
ok!\r\n")));
// memset((void*)m_pPrimarySurface->Buffer(), 0x0,
sizeof(m_FrameBufferSize));
RETAILMSG(debmess,
(_T("S3C2440DISP::==================================#\r\n")));
RETAILMSG(debmess, (_T("S3C2440DISP::Memset => m_pPrimary_addr=%x,
m_FrameBuff_Size=%d\r\n",(void*)m_pPrimarySurface, m_FrameBufferSize )));
memset((void*)m_pPrimarySurface->Buffer(), 0x0,
sizeof(m_FrameBufferSize));
// init cursor related vars
RETAILMSG(debmess, (_T("S3C2440DISP::Cursor Set!\r\n")));
m_CursorVisible = FALSE;
m_CursorDisabled = TRUE;
m_CursorForcedOff = FALSE;
memset (&m_CursorRect, 0x0, sizeof(m_CursorRect));
m_CursorBackingStore = NULL;
m_CursorXorShape = NULL;
m_CursorAndShape = NULL;
}
void S3C2440DISP::InitializeHardware (void)
{
WORD *ptr;
unsigned int *dptr;
DWORD index;
HKEY hkDisplay = NULL;
DWORD dwLCDPhysicalFrameBase;
DWORD dwStatus, dwType, dwSize;
RETAILMSG(debmess, (_T("++S3C2440DISP::InitializeHardware\r\n")));
// open the registry key and read our configuration
dwStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, gszBaseInstance, 0, 0,
&hkDisplay);
dwType = REG_DWORD;
if(dwStatus == ERROR_SUCCESS && dwType == REG_DWORD) {
dwSize = sizeof(DWORD);
dwStatus = RegQueryValueEx(hkDisplay, _T("LCDVirtualFrameBase"), NULL,
&dwType,
(LPBYTE) &gdwLCDVirtualFrameBase, &dwSize);
RETAILMSG(0,
(_T("S3C2440DISP::InitializeHardware--->LCDVirtualFrameBase ok!\r\n")));
}
if(dwStatus == ERROR_SUCCESS && dwType == REG_DWORD) {
dwSize = sizeof(DWORD);
dwStatus = RegQueryValueEx(hkDisplay, _T("LCDPhysicalFrameBase"), NULL,
&dwType,
(LPBYTE) &dwLCDPhysicalFrameBase, &dwSize);
RETAILMSG(debmess,
(_T("S3C2440DISP::InitializeHardware--->LCDPhysicalFrameBase ok!\r\n")));
}
// close the registry key
if(hkDisplay != NULL) {
RegCloseKey(hkDisplay);
RETAILMSG(debmess,
(_T("S3C2440DISP::InitializeHardware--->RegCloseKey ok!\r\n")));
}
// did we get everything?
RETAILMSG(debmess, (_T("S3C2440DISP::InitializeHardware--->dwStatus
Ready!\r\n")));
if(dwStatus != ERROR_SUCCESS) {
RETAILMSG(debmess, (_T("SALCD2: InitializeHardware: couldn't get
registry configuration\r\n")));
return;
}
RETAILMSG(debmess, (_T("S3C2440DISP::InitializeHardware--->dwStatus Set
ok!\r\n")));
// map frame buffer into process space memory
m_VirtualFrameBuffer = (unsigned int)VirtualAlloc(0, (0xa00000),
MEM_RESERVE, PAGE_NOACCESS);
if (m_VirtualFrameBuffer == NULL)
{
RETAILMSG(0,(TEXT("m_VirtualFrameBuffer is not allocated\n\r")));
return;
}
else if (!VirtualCopy((PVOID)m_VirtualFrameBuffer,
(PVOID)gdwLCDVirtualFrameBase, (0xa00000), PAGE_READWRITE | PAGE_NOCACHE))
{
RETAILMSG(0, (TEXT("m_VirtualFrameBuffer is not mapped\n\r")));
VirtualFree((PVOID)m_VirtualFrameBuffer, 0, MEM_RELEASE);
return;
}
RETAILMSG(debmess, (TEXT("m_VirtualFrameBuffer is mapped at %x(PHY :
%x)\n\r"), m_VirtualFrameBuffer, gdwLCDVirtualFrameBase));
RETAILMSG(debmess, (TEXT("Clearing frame buffer !!!\n\r")));
dptr = (unsigned int *)m_VirtualFrameBuffer;
// clear rest of frame buffer out
for (index = 0; index < LCD_XSIZE_TFT_200*LCD_YSIZE_TFT_200; index++)
{
if(index < LCD_XSIZE_TFT_200*60)
{
dptr[index] = 0xffffff;
}
else if(index < LCD_XSIZE_TFT_200*60*2)
{
dptr[index] = 0xff0000;
}
else if(index < LCD_XSIZE_TFT_200*60*3)
{
dptr[index] = 0x00ff00;
}
else
{
dptr[index] = 0x0000ff;
}
}
RETAILMSG(1, (_T("--S3C2440DISP::InitializeHardware\r\n")));
}
SCODE S3C2440DISP::SetMode (INT modeId, HPALETTE *palette)
{
RETAILMSG(0, (TEXT("++S3C2440DISP::SetMode\r\n")));
if (modeId != 0)
{
RETAILMSG(0, (TEXT("S3C2440DISP::SetMode Want mode %d, only have
mode 0\r\n"),modeId));
return E_INVALIDARG;
}
if (palette)
{
*palette = EngCreatePalette (PAL_BITFIELDS, 0, NULL, gBitMasks[0],
gBitMasks[1], gBitMasks[2]);
}
RETAILMSG(1, (TEXT("--S3C2440DISP::SetMode\r\n")));
return S_OK;
}
SCODE S3C2440DISP::GetModeInfo(GPEMode *mode, INT modeNumber)
{
RETAILMSG(0, (TEXT("++S3C2440DISP::GetModeInfo\r\n")));
if (modeNumber != 0)
{
return E_INVALIDARG;
}
*mode = m_ModeInfo;
RETAILMSG(0, (TEXT("--S3C2440DISP::GetModeInfo\r\n")));
return S_OK;
}
int S3C2440DISP::NumModes()
{
RETAILMSG(0, (TEXT("++S3C2440DISP::NumModes\r\n")));
RETAILMSG(0, (TEXT("--S3C2440DISP::NumModes\r\n")));
return 1;
}
void S3C2440DISP::CursorOn (void)
{
UCHAR *ptrScreen = (UCHAR*)m_pPrimarySurface->Buffer();
UCHAR *ptrLine;
UCHAR *cbsLine;
UCHAR *xorLine;
UCHAR *andLine;
int x, y;
if (!m_CursorForcedOff && !m_CursorDisabled && !m_CursorVisible)
{
if (!m_CursorBackingStore)
{
RETAILMSG(0, (TEXT("S3C2440DISP::CursorOn - No backing store
available\r\n")));
return;
}
for (y = m_CursorRect.top; y < m_CursorRect.bottom; y++)
{
if (y < 0)
{
continue;
}
if (y >= m_nScreenHeight)
{
break;
}
ptrLine = &ptrScreen[y * m_pPrimarySurface->Stride()];
cbsLine = &m_CursorBackingStore[(y - m_CursorRect.top) * (m_CursorSize.x
* (m_colorDepth >> 3))];
xorLine = &m_CursorXorShape[(y - m_CursorRect.top) * m_CursorSize.x];
andLine = &m_CursorAndShape[(y - m_CursorRect.top) * m_CursorSize.x];
for (x = m_CursorRect.left; x < m_CursorRect.right; x++)
{
if (x < 0)
{
continue;
}
if (x >= m_nScreenWidth)
{
break;
}
cbsLine[(x - m_CursorRect.left) * (m_colorDepth >> 3)] = ptrLine[x *
(m_colorDepth >> 3)];
ptrLine[x * (m_colorDepth >> 3)] &= andLine[x - m_CursorRect.left];
ptrLine[x * (m_colorDepth >> 3)] ^= xorLine[x - m_CursorRect.left];
if (m_colorDepth > 8)
{
cbsLine[(x - m_CursorRect.left) * (m_colorDepth >> 3) + 1] = ptrLine[x
* (m_colorDepth >> 3) + 1];
ptrLine[x * (m_colorDepth >> 3) + 1] &= andLine[x - m_CursorRect.left];
ptrLine[x * (m_colorDepth >> 3) + 1] ^= xorLine[x - m_CursorRect.left];
if (m_colorDepth > 16)
{
cbsLine[(x - m_CursorRect.left) * (m_colorDepth >> 3) + 2] = ptrLine[x
* (m_colorDepth >> 3) + 2];
ptrLine[x * (m_colorDepth >> 3) + 2] &= andLine[x - m_CursorRect.left];
ptrLine[x * (m_colorDepth >> 3) + 2] ^= xorLine[x - m_CursorRect.left];
}
}
}
}
m_CursorVisible = TRUE;
}
}
void S3C2440DISP::CursorOff (void)
{
UCHAR *ptrScreen = (UCHAR*)m_pPrimarySurface->Buffer();
UCHAR *ptrLine;
UCHAR *cbsLine;
int x, y;
if (!m_CursorForcedOff && !m_CursorDisabled && m_CursorVisible)
{
if (!m_CursorBackingStore)
{
RETAILMSG(0, (TEXT("S3C2440DISP::CursorOff - No backing store
available\r\n")));
return;
}
for (y = m_CursorRect.top; y < m_CursorRect.bottom; y++)
{
// clip to displayable screen area (top/bottom)
if (y < 0)
{
continue;
}
if (y >= m_nScreenHeight)
{
break;
}
ptrLine = &ptrScreen[y * m_pPrimarySurface->Stride()];
cbsLine = &m_CursorBackingStore[(y - m_CursorRect.top) * (m_CursorSize.x
* (m_colorDepth >> 3))];
for (x = m_CursorRect.left; x < m_CursorRect.right; x++)
{
// clip to displayable screen area (left/right)
if (x < 0)
{
continue;
}
if (x >= m_nScreenWidth)
{
break;
}
ptrLine[x * (m_colorDepth >> 3)] = cbsLine[(x - m_CursorRect.left) *
(m_colorDepth >> 3)];
if (m_colorDepth > 8)
{
ptrLine[x * (m_colorDepth >> 3) + 1] = cbsLine[(x - m_CursorRect.left)
* (m_colorDepth >> 3) + 1];
if (m_colorDepth > 16)
{
ptrLine[x * (m_colorDepth >> 3) + 2] = cbsLine[(x - m_CursorRect.left)
* (m_colorDepth >> 3) + 2];
}
}
}
}
m_CursorVisible = FALSE;
}
}
SCODE S3C2440DISP::SetPointerShape(GPESurf *pMask, GPESurf *pColorSurf, INT
xHot, INT yHot, INT cX, INT cY)
{
UCHAR *andPtr; // input pointer
UCHAR *xorPtr; // input pointer
UCHAR *andLine; // output pointer
UCHAR *xorLine; // output pointer
char bAnd;
char bXor;
int row;
int col;
int i;
int bitMask;
RETAILMSG(0, (TEXT("S3C2440DISP::SetPointerShape(0x%X, 0x%X, %d, %d, %d,
%d)\r\n"),pMask, pColorSurf, xHot, yHot, cX, cY));
// turn current cursor off
CursorOff();
// release memory associated with old cursor
if (m_CursorBackingStore)
{
delete (void*)m_CursorBackingStore;
m_CursorBackingStore = NULL;
}
if (m_CursorXorShape)
{
delete (void*)m_CursorXorShape;
m_CursorXorShape = NULL;
}
if (m_CursorAndShape)
{
delete (void*)m_CursorAndShape;
m_CursorAndShape = NULL;
}
if (!pMask) // do we have a new cursor shape
{
m_CursorDisabled = TRUE; // no, so tag as disabled
}
else
{
m_CursorDisabled = FALSE; // yes, so tag as not disabled
// allocate memory based on new cursor size
m_CursorBackingStore = new UCHAR[(cX * (m_colorDepth >> 3)) * cY];
m_CursorXorShape = new UCHAR[cX * cY];
m_CursorAndShape = new UCHAR[cX * cY];
// store size and hotspot for new cursor
m_CursorSize.x = cX;
m_CursorSize.y = cY;
m_CursorHotspot.x = xHot;
m_CursorHotspot.y = yHot;
andPtr = (UCHAR*)pMask->Buffer();
xorPtr = (UCHAR*)pMask->Buffer() + (cY * pMask->Stride());
// store OR and AND mask for new cursor
for (row = 0; row < cY; row++)
{
andLine = &m_CursorAndShape[cX * row];
xorLine = &m_CursorXorShape[cX * row];
for (col = 0; col < cX / 8; col++)
{
bAnd = andPtr[row * pMask->Stride() + col];
bXor = xorPtr[row * pMask->Stride() + col];
for (bitMask = 0x0080, i = 0; i < 8; bitMask >>= 1, i++)
{
andLine[(col * 8) + i] = bAnd & bitMask ? 0xFF : 0x00;
xorLine[(col * 8) + i] = bXor & bitMask ? 0xFF : 0x00;
}
}
}
}
return S_OK;
}
SCODE S3C2440DISP::MovePointer(INT xPosition, INT yPosition)
{
RETAILMSG(0, (TEXT("S3C2440DISP::MovePointer(%d, %d)\r\n"), xPosition,
yPosition));
CursorOff();
if (xPosition != -1 || yPosition != -1)
{
// compute new cursor rect
m_CursorRect.left = xPosition - m_CursorHotspot.x;
m_CursorRect.right = m_CursorRect.left + m_CursorSize.x;
m_CursorRect.top = yPosition - m_CursorHotspot.y;
m_CursorRect.bottom = m_CursorRect.top + m_CursorSize.y;
CursorOn();
}
return S_OK;
}
void S3C2440DISP::WaitForNotBusy(void)
{
RETAILMSG(0, (TEXT("S3C2440DISP::WaitForNotBusy\r\n")));
return;
}
int S3C2440DISP::IsBusy(void)
{
RETAILMSG(0, (TEXT("S3C2440DISP::IsBusy\r\n")));
return 0;
}
void S3C2440DISP::GetPhysicalVideoMemory(unsigned long *physicalMemoryBase,
unsigned long *videoMemorySize)
{
RETAILMSG(0, (TEXT("S3C2440DISP::GetPhysicalVideoMemory\r\n")));
*physicalMemoryBase = gdwLCDVirtualFrameBase;
*videoMemorySize = m_cbScanLineLength * m_nScreenHeight;
}
SCODE S3C2440DISP::AllocSurface(GPESurf **surface, INT width, INT height,
EGPEFormat format, INT surfaceFlags)
{
RETAILMSG(0, (TEXT("S3C2440DISP::AllocSurface\r\n")));
if (surfaceFlags & GPE_REQUIRE_VIDEO_MEMORY)
{
return E_OUTOFMEMORY;
}
// Allocate from system memory
*surface = new GPESurf(width, height, format);
if (*surface != NULL)
{
// Check that the bits were allocated succesfully
if (((*surface)->Buffer()) == NULL)
{
delete *surface; // Clean up
}
else
{
return S_OK;
}
}
return E_OUTOFMEMORY;
}
SCODE S3C2440DISP::WrappedEmulatedLine (GPELineParms *lineParameters)
{
SCODE retval;
RECT bounds;
int N_plus_1; // Minor length of bounding rect + 1
// calculate the bounding-rect to determine overlap with cursor
if (lineParameters->dN) // The line has a diagonal component (we'll
refresh the bounding rect)
{
N_plus_1 = 2 + ((lineParameters->cPels * lineParameters->dN) /
lineParameters->dM);
}
else
{
N_plus_1 = 1;
}
switch(lineParameters->iDir)
{
case 0:
bounds.left = lineParameters->xStart;
bounds.top = lineParameters->yStart;
bounds.right = lineParameters->xStart + lineParameters->cPels + 1;
bounds.bottom = bounds.top + N_plus_1;
break;
case 1:
bounds.left = lineParameters->xStart;
bounds.top = lineParameters->yStart;
bounds.bottom = lineParameters->yStart + lineParameters->cPels + 1;
bounds.right = bounds.left + N_plus_1;
break;
case 2:
bounds.right = lineParameters->xStart + 1;
bounds.top = lineParameters->yStart;
bounds.bottom = lineParameters->yStart + lineParameters->cPels + 1;
bounds.left = bounds.right - N_plus_1;
break;
case 3:
bounds.right = lineParameters->xStart + 1;
bounds.top = lineParameters->yStart;
bounds.left = lineParameters->xStart - lineParameters->cPels;
bounds.bottom = bounds.top + N_plus_1;
break;
case 4:
bounds.right = lineParameters->xStart + 1;
bounds.bottom = lineParameters->yStart + 1;
bounds.left = lineParameters->xStart - lineParameters->cPels;
bounds.top = bounds.bottom - N_plus_1;
break;
case 5:
bounds.right = lineParameters->xStart + 1;
bounds.bottom = lineParameters->yStart + 1;
bounds.top = lineParameters->yStart - lineParameters->cPels;
bounds.left = bounds.right - N_plus_1;
break;
case 6:
bounds.left = lineParameters->xStart;
bounds.bottom = lineParameters->yStart + 1;
bounds.top = lineParameters->yStart - lineParameters->cPels;
bounds.right = bounds.left + N_plus_1;
break;
case 7:
bounds.left = lineParameters->xStart;
bounds.bottom = lineParameters->yStart + 1;
bounds.right = lineParameters->xStart + lineParameters->cPels + 1;
bounds.top = bounds.bottom - N_plus_1;
break;
default:
RETAILMSG(0, (TEXT("Invalid direction: %d\r\n"),
lineParameters->iDir));
return E_INVALIDARG;
}
// check for line overlap with cursor and turn off cursor if overlaps
if (m_CursorVisible && !m_CursorDisabled &&
m_CursorRect.top < bounds.bottom && m_CursorRect.bottom > bounds.top &&
m_CursorRect.left < bounds.right && m_CursorRect.right > bounds.left)
{
CursorOff();
m_CursorForcedOff = TRUE;
}
// do emulated line
retval = EmulatedLine (lineParameters);
// se if cursor was forced off because of overlap with line bouneds and
turn back on
if (m_CursorForcedOff)
{
m_CursorForcedOff = FALSE;
CursorOn();
}
return retval;
}
SCODE S3C2440DISP::Line(GPELineParms *lineParameters, EGPEPhase phase)
{
RETAILMSG(0, (TEXT("S3C2440DISP::Line\r\n")));
if (phase == gpeSingle || phase == gpePrepare)
{
if ((lineParameters->pDst != m_pPrimarySurface))
{
lineParameters->pLine = EmulatedLine;
}
else
{
lineParameters->pLine = (SCODE (GPE::*)(struct GPELineParms *))
WrappedEmulatedLine;
}
}
return S_OK;
}
SCODE S3C2440DISP::BltPrepare(GPEBltParms *blitParameters)
{
RECTL rectl;
RETAILMSG(0, (TEXT("S3C2440DISP::BltPrepare\r\n")));
// default to base EmulatedBlt routine
blitParameters->pBlt = EmulatedBlt;
// see if we need to deal with cursor
if (m_CursorVisible && !m_CursorDisabled)
{
// check for destination overlap with cursor and turn off cursor if overlaps
if (blitParameters->pDst == m_pPrimarySurface) // only care if dest is
main display surface
{
if (blitParameters->prclDst != NULL) // make sure there is a valid prclDst
{
rectl = *blitParameters->prclDst; // if so, use it
}
else
{
rectl = m_CursorRect; // if not, use the Cursor rect - this forces
the cursor to be turned off in this case
}
if (m_CursorRect.top < rectl.bottom && m_CursorRect.bottom > rectl.top &&
m_CursorRect.left < rectl.right && m_CursorRect.right > rectl.left)
{
CursorOff();
m_CursorForcedOff = TRUE;
}
}
// check for source overlap with cursor and turn off cursor if overlaps
if (blitParameters->pSrc == m_pPrimarySurface) // only care if source is
main display surface
{
if (blitParameters->prclSrc != NULL) // make sure there is a valid prclSrc
{
rectl = *blitParameters->prclSrc; // if so, use it
}
else
{
rectl = m_CursorRect; // if not, use the CUrsor rect - this forces
the cursor to be turned off in this case
}
if (m_CursorRect.top < rectl.bottom && m_CursorRect.bottom > rectl.top &&
m_CursorRect.left < rectl.right && m_CursorRect.right > rectl.left)
{
CursorOff();
m_CursorForcedOff = TRUE;
}
}
}
// see if there are any optimized software blits available
EmulatedBltSelect02(blitParameters);
EmulatedBltSelect08(blitParameters);
EmulatedBltSelect16(blitParameters);
return S_OK;
}
SCODE S3C2440DISP::BltComplete(GPEBltParms *blitParameters)
{
RETAILMSG(0, (TEXT("S3C2440DISP::BltComplete\r\n")));
// see if cursor was forced off because of overlap with source or
destination and turn back on
if (m_CursorForcedOff)
{
m_CursorForcedOff = FALSE;
CursorOn();
}
return S_OK;
}
INT S3C2440DISP::InVBlank(void)
{
RETAILMSG(0, (TEXT("S3C2440DISP::InVBlank\r\n")));
return 0;
}
SCODE S3C2440DISP::SetPalette(const PALETTEENTRY *source, USHORT firstEntry,
USHORT numEntries)
{
RETAILMSG(0, (TEXT("S3C2440DISP::SetPalette\r\n")));
if (firstEntry < 0 || firstEntry + numEntries > 256 || source == NULL)
{
return E_INVALIDARG;
}
return S_OK;
}
ULONG S3C2440DISP::GetGraphicsCaps()
{
return GCAPS_GRAY16;
}
--
V. Vijaya Mohan
Software Engineer
Carmanpark.co.ltd
.
- Follow-Ups:
- RE: RGB Color Balance
- From: Vijaya mohan
- RE: RGB Color Balance
- Prev by Date: Re: How to enable KITL for CEPC..
- Next by Date: Re: How to enable KITL for CEPC..
- Previous by thread: Re: KeybdDriverVKeyToUnicode
- Next by thread: RE: RGB Color Balance
- Index(es):
Relevant Pages
|