|
Introduction to Writing Windows CE Display Drivers(7)
- m_nLAWPhysical - This specifies the physical address of the linear access window of the display device for accessing the frame buffer.
- m_nLAWSize - The size of the linear access window.
- m_nVideoMemorySize - The total amount of video memory available.
- m_nVideoMemoryStart - The offset of video memory in the linear access window. This is usually 0.
- m_nScreenStride - The number of bytes per display line.
- m_bHWCursor - Flag to indicate support for hardware cursor, which is used to bypass existing software cursor support. The actual implementation for hardware cursors still would need to be included.
- m_b555Mode - Flag to indicate that the 16-bit mode uses 5 bits each for red, green, and blue.
- m_bIsVGADevice - Flag to indicate that the device is VGA based. This should actually be cleared in the constructor to prevent mapping of VGA registers, but at this point is still useful in bypassing default VGA implementations for SetPalette() and InVBlank().
Once the hardware specific initialization is completed in ModeInit(), the SetMode() function continues the hardware independent mode initialization. The m_pMode, m_nScreenWidth and m_nScreenHeight variables, used by other functions, are set for the new display mode. Then a pointer, m_pLAW, to be used later for accessing video memory, is mapped to the physical address of the linear access window of the display device. To do this, calls to the VirtualAlloc() and VirtualCopy() functions are required. See the Platform Builder help for more information on these functions. Next, a Node2D object, m_p2DVideoMemory, representing all of available video memory is created. This Node2D object manages video memory for the AllocSurface() function, which is then called to create the primary display surface, m_pPrimarySurface. Finally, the bit mask is initialized and the default palette is setup. It may not be clear within this function, but there are really two different 16-bit display modes in common use. One mode uses 5 bits each for red, green and blue, while the other mode uses 5 bits for red and blue and 6 bits for green. The mask values are used by GDI to generate the correct pixel value to represent a particular color. The flag m_b555Mode is used in the driver to determine which 16-bit display mode has been set in the hardware when initializing the mask values. For modes other than 16-bit, this flag is ignored. It is worth noting that the bit mask created here, m_ulBitMasks, is also used by the DDI function DrvGetMasks() to return pixel formatting information.
|