os/kernelhwsrv/kernel/eka/drivers/edisp/epoc/generic/wd_generic.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // WD_TEMPLATE.CPP
    15 // Screen Driver for Text Window Server
    16 // TO DO: (mandatory)
    17 // This is the screen driver for the simple text Window Server supplied as part of
    18 // E32. It is required to run the text shell, E32 & F32 tests etc.
    19 // This is a working generic implementation which you shouldn't need to alter, but
    20 // you may customise it if required. e.g. Change the default display mode or colors.
    21 // ASSUMPTIONS MADE BY THIS IMPLEMENTATION
    22 // * The start of each character on the display is byte aligned.
    23 // 
    24 //
    25 
    26 #include "ws_std.h"
    27 #include <e32twin.h>
    28 #include <hal.h>
    29 #include "u32std.h"
    30 #include <videodriver.h>
    31 
    32 #if 0
    33 #define __DEBUG_PRINT(a) RDebug::Print(a)
    34 #define __DEBUG_PRINT2(a,b) RDebug::Print(a,b)
    35 #else
    36 #define __DEBUG_PRINT(a)
    37 #define __DEBUG_PRINT2(a,b)
    38 #endif
    39 
    40 #ifdef __X86__
    41 extern CScreenDriver* NewScreenDriverVgaText();
    42 #endif
    43 
    44 const TUint32 KHwAccBlockFill=1;
    45 const TUint32 KHwAccBlockCopy=2;
    46 
    47 inline TInt HwBlockFill(SRectOpInfo &a)
    48 	{
    49 	return UserSvr::HalFunction(EHalGroupDisplay, EDisplayHalBlockFill, &a, NULL);
    50 	}
    51 
    52 inline TInt HwBlockCopy(SRectOpInfo &a)
    53 	{
    54 	return UserSvr::HalFunction(EHalGroupDisplay, EDisplayHalBlockCopy, &a, NULL);
    55 	}
    56 
    57 /**
    58  * Main screen driver implementation class.
    59  *
    60  * TO DO: (optional)
    61  *
    62  * The public API of this class is defined by the CScreenDriver class.
    63  * You may want to add some private definitions to this.
    64  */
    65 class CScreenDriverTemplate : public CScreenDriver
    66 	{
    67 public:
    68 	CScreenDriverTemplate();
    69 	virtual void Init(TSize &aScreenSize,TSize &aFontSize);
    70 	virtual void Blit(const TText *aBuffer,TInt aLength,const TPoint &aPosition);
    71 	virtual TBool ScrollUp(const TRect& aRect);
    72 	virtual void Clear(const TRect& aRect);
    73 
    74 	virtual void SetPixel(const TPoint& aPoint,TUint8 aColour);
    75 	virtual TInt GetPixel(const TPoint& aPoint);
    76 	virtual void SetWord(const TPoint& aPoint,TInt aWord);
    77 	virtual TInt GetWord(const TPoint& aPoint);
    78 	virtual void SetLine(const TPoint& aPoint,const TPixelLine& aPixelLine);
    79 	virtual void GetLine(const TPoint& aPoint,TPixelLine& aPixelLine);
    80 
    81 	virtual void SetPaletteEntry(TColorIndex anIndex,TUint8 aRed,TUint8 aGreen,TUint8 aBlue);
    82 	virtual void GetPaletteEntry(TColorIndex anIndex,TUint8 &aRed,TUint8 &aGreen,TUint8 &aBlue);
    83 	virtual void SetForegroundColor(TColorIndex anIndex);
    84 	virtual void SetBackgroundColor(TColorIndex anIndex);
    85 	virtual void GetAttributeColors(TColorIndex* anArray);
    86 	virtual TInt SetMode(TVideoMode aMode);
    87 private:
    88 	TUint8* CharPosToScreenAddress(const TPoint& aCharPos);
    89 	TInt ColorToPixel(TInt aColorRgb);
    90 	void CalcColorMode();
    91 private:
    92 	TInt iDisplayMode;
    93 	TInt iMode;
    94 	TInt iScreenAddress;
    95 	TInt iScreenWidth;
    96 	TInt iScreenHeight;
    97 	TInt iScreenOffsetBetweenLines;
    98 	TInt iBitsPerPixel;
    99 	TInt iIsMono;
   100 	TInt iIsPalettized;
   101 	TInt iPixelSize;
   102 	TInt iBackgroundPixel;
   103 	TInt iTextPixel;
   104 	TUint32 iBackgroundFill;
   105 	TUint32 iTextFill;
   106 	TUint32 iHwAcc;
   107 	static const TUint8 Reverse[256];
   108 	static const TUint8 Font[256][10];
   109 	friend class CScreenDriver;
   110 	};
   111 
   112 
   113 /**
   114  * Table used to reverse the bits in a byte
   115  *
   116  * For example, index 0x03 (= 0000 0011 binary)
   117  * returns 0xC0 (= 1100 0000 binary)
   118  */
   119 const TUint8 CScreenDriverTemplate::Reverse[256] =
   120 	{
   121 	0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
   122 	0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
   123 	0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
   124 	0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
   125 	0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
   126 	0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
   127 	0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
   128 	0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
   129 	0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
   130 	0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
   131 	0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
   132 	0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
   133 	0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
   134 	0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
   135 	0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
   136 	0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF
   137 	};
   138 
   139 
   140 
   141 /**
   142  * Define a font to be used
   143  * This is an 8x10 Font taken from the MISA driver
   144  * 
   145  * TO DO: (mandatory)
   146  */
   147 const TInt KPixelsPerChar = 8;	// character width in pixels
   148 const TInt KLinesPerChar = 10;	// character height in pixels
   149 
   150 const TUint8 CScreenDriverTemplate::Font[256][10] =
   151  	{
   152 		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
   153 		{0x7E,0x81,0xA5,0x81,0xBD,0x99,0x81,0x7E,0x00,0x00},
   154 		{0x7E,0xFF,0xDB,0xFF,0xC3,0xE7,0xFF,0x7E,0x00,0x00},
   155 		{0x6C,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00},
   156 		{0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00},
   157 		{0x38,0x7C,0x38,0xFE,0xFE,0x7C,0x38,0x7C,0x00,0x00},
   158 		{0x10,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x7C,0x00,0x00},
   159 		{0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00},
   160 		{0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0x00,0x00},
   161 		{0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00},
   162 		{0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0x00,0x00},
   163 		{0x0F,0x07,0x0F,0x7D,0xCC,0xCC,0xCC,0x78,0x00,0x00},
   164 		{0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x00,0x00},
   165 		{0x3F,0x33,0x3F,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00},
   166 		{0x7F,0x63,0x7F,0x63,0x63,0x67,0xE6,0xC0,0x00,0x00},
   167 		{0x99,0x5A,0x3C,0xE7,0xE7,0x3C,0x5A,0x99,0x00,0x00},
   168 
   169 		{0x80,0xE0,0xF8,0xFE,0xF8,0xE0,0x80,0x00,0x00,0x00},
   170 		{0x02,0x0E,0x3E,0xFE,0x3E,0x0E,0x02,0x00,0x00,0x00},
   171 		{0x18,0x3C,0x7E,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00},
   172 		{0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x00,0x00,0x00},
   173 		{0x7F,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x00,0x00,0x00},
   174 		{0x3E,0x63,0x38,0x6C,0x6C,0x38,0xCC,0x78,0x00,0x00},
   175 		{0x00,0x00,0x00,0x00,0x7E,0x7E,0x7E,0x00,0x00,0x00},
   176 		{0x18,0x3C,0x7E,0x18,0x7E,0x3C,0x18,0xFF,0x00,0x00},
   177 		{0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x00,0x00,0x00},
   178 		{0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00},
   179 		{0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00},
   180 		{0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00},
   181 		{0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00},
   182 		{0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00},
   183 		{0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x00,0x00,0x00,0x00},
   184 		{0x00,0xFF,0xFF,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00},
   185 
   186 		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
   187 		{0x30,0x78,0x78,0x78,0x30,0x00,0x30,0x00,0x00,0x00},	// !
   188 		{0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
   189 		{0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00},	//#
   190 		{0x30,0x7C,0xC0,0x78,0x0C,0xF8,0x30,0x00,0x00,0x00},	//$
   191 		{0x00,0xC6,0xCC,0x18,0x30,0x66,0xC6,0x00,0x00,0x00},
   192 		{0x38,0x6C,0x38,0x76,0xDC,0xCC,0x76,0x00,0x00,0x00},
   193 		{0x60,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
   194 		{0x18,0x30,0x60,0x60,0x60,0x30,0x18,0x00,0x00,0x00},
   195 		{0x60,0x30,0x18,0x18,0x18,0x30,0x60,0x00,0x00,0x00},
   196 		{0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00},
   197 		{0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00,0x00,0x00},
   198 		{0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00},
   199 		{0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00},	//-
   200 		{0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00},	//.
   201 		{0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00},	///
   202 
   203 		{0x7C,0xC6,0xCE,0xDE,0xF6,0xE6,0x7C,0x00,0x00,0x00},	//0
   204 		{0x30,0x70,0x30,0x30,0x30,0x30,0xFC,0x00,0x00,0x00},
   205 		{0x78,0xCC,0x0C,0x38,0x60,0xCC,0xFC,0x00,0x00,0x00},
   206 		{0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78,0x00,0x00,0x00},
   207 		{0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x1E,0x00,0x00,0x00},
   208 		{0xFC,0xC0,0xF8,0x0C,0x0C,0xCC,0x78,0x00,0x00,0x00},
   209 		{0x38,0x60,0xC0,0xF8,0xCC,0xCC,0x78,0x00,0x00,0x00},
   210 		{0xFC,0xCC,0x0C,0x18,0x30,0x30,0x30,0x00,0x00,0x00},
   211 		{0x78,0xCC,0xCC,0x78,0xCC,0xCC,0x78,0x00,0x00,0x00},
   212 		{0x78,0xCC,0xCC,0x7C,0x0C,0x18,0x70,0x00,0x00,0x00},	//9
   213 		{0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00,0x00},	//:
   214 		{0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x60,0x00,0x00},	//;
   215 		{0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x00,0x00,0x00},	//<
   216 		{0x00,0x00,0xFC,0x00,0x00,0xFC,0x00,0x00,0x00,0x00},	//=
   217 		{0x60,0x30,0x18,0x0C,0x18,0x30,0x60,0x00,0x00,0x00},	//>
   218 		{0x78,0xCC,0x0C,0x18,0x30,0x00,0x30,0x00,0x00,0x00},	//?
   219 
   220 		{0x7C,0xC6,0xDE,0xDE,0xDE,0xC0,0x78,0x00,0x00,0x00},	//@
   221 		{0x30,0x78,0xCC,0xCC,0xFC,0xCC,0xCC,0x00,0x00,0x00},	//A
   222 		{0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00},	//B
   223 		{0x3C,0x66,0xC0,0xC0,0xC0,0x66,0x3C,0x00,0x00,0x00},	//C
   224 		{0xF8,0x6C,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00},	//D
   225 		{0x7E,0x60,0x60,0x78,0x60,0x60,0x7E,0x00,0x00,0x00},	//E
   226 		{0x7E,0x60,0x60,0x78,0x60,0x60,0x60,0x00,0x00,0x00},	//F
   227 		{0x3C,0x66,0xC0,0xC0,0xCE,0x66,0x3E,0x00,0x00,0x00},	//G
   228 		{0xCC,0xCC,0xCC,0xFC,0xCC,0xCC,0xCC,0x00,0x00,0x00},	//H
   229 		{0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00},	//I
   230 		{0x1E,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00,0x00},	//J
   231 		{0xE6,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00},	//K
   232 		{0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00,0x00,0x00},	//L
   233 		{0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0x00,0x00,0x00},	//M
   234 		{0xC6,0xE6,0xF6,0xDE,0xCE,0xC6,0xC6,0x00,0x00,0x00},	//N
   235 		{0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00},	//O
   236 
   237 		{0xFC,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00,0x00},	//P
   238 		{0x78,0xCC,0xCC,0xCC,0xDC,0x78,0x1C,0x00,0x00,0x00},	//Q
   239 		{0xFC,0x66,0x66,0x7C,0x6C,0x66,0xE6,0x00,0x00,0x00},	//R
   240 		{0x78,0xCC,0xE0,0x70,0x1C,0xCC,0x78,0x00,0x00,0x00},	//S
   241 		{0xFC,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00},	//T
   242 		{0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFC,0x00,0x00,0x00},	//U
   243 		{0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00,0x00,0x00},	//V
   244 		{0xC6,0xC6,0xC6,0xD6,0xFE,0xEE,0xC6,0x00,0x00,0x00},	//W
   245 		{0xC6,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00},	//X
   246 		{0xCC,0xCC,0xCC,0x78,0x30,0x30,0x78,0x00,0x00,0x00},	//Y
   247 		{0xFE,0x06,0x0C,0x18,0x30,0x60,0xFE,0x00,0x00,0x00},	//Z
   248 		{0x78,0x60,0x60,0x60,0x60,0x60,0x78,0x00,0x00,0x00},
   249 		{0xC0,0x60,0x30,0x18,0x0C,0x06,0x02,0x00,0x00,0x00},
   250 		{0x78,0x18,0x18,0x18,0x18,0x18,0x78,0x00,0x00,0x00},
   251 		{0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00},
   252 		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},
   253 
   254 		{0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
   255 		{0x00,0x00,0x78,0x0C,0x7C,0xCC,0x76,0x00,0x00,0x00},
   256 		{0xE0,0x60,0x60,0x7C,0x66,0x66,0xDC,0x00,0x00,0x00},
   257 		{0x00,0x00,0x78,0xCC,0xC0,0xCC,0x78,0x00,0x00,0x00},
   258 		{0x1C,0x0C,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00,0x00},
   259 		{0x00,0x00,0x78,0xCC,0xFC,0xC0,0x78,0x00,0x00,0x00},
   260 		{0x38,0x6C,0x60,0xF0,0x60,0x60,0xF0,0x00,0x00,0x00},
   261 		{0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0xF8,0x00,0x00},
   262 		{0xE0,0x60,0x6C,0x76,0x66,0x66,0xE6,0x00,0x00,0x00},
   263 		{0x30,0x00,0x70,0x30,0x30,0x30,0x78,0x00,0x00,0x00},
   264 		{0x0C,0x00,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00},
   265 		{0xE0,0x60,0x66,0x6C,0x78,0x6C,0xE6,0x00,0x00,0x00},
   266 		{0x70,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00},
   267 		{0x00,0x00,0xCC,0xFE,0xFE,0xD6,0xC6,0x00,0x00,0x00},
   268 		{0x00,0x00,0xF8,0xCC,0xCC,0xCC,0xCC,0x00,0x00,0x00},
   269 		{0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00},
   270 
   271 		{0x00,0x00,0xDC,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00},
   272 		{0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0x1E,0x00,0x00},
   273 		{0x00,0x00,0xDC,0x76,0x66,0x60,0xF0,0x00,0x00,0x00},
   274 		{0x00,0x00,0x7C,0xC0,0x78,0x0C,0xF8,0x00,0x00,0x00},
   275 		{0x10,0x30,0x7C,0x30,0x30,0x34,0x18,0x00,0x00,0x00},
   276 		{0x00,0x00,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00},
   277 		{0x00,0x00,0xCC,0xCC,0xCC,0x78,0x30,0x00,0x00,0x00},
   278 		{0x00,0x00,0xC6,0xD6,0xFE,0xFE,0x6C,0x00,0x00,0x00},
   279 		{0x00,0x00,0xC6,0x6C,0x38,0x6C,0xC6,0x00,0x00,0x00},
   280 		{0x00,0x00,0xCC,0xCC,0xCC,0x7C,0x0C,0xF8,0x00,0x00},
   281 		{0x00,0x00,0xFC,0x98,0x30,0x64,0xFC,0x00,0x00,0x00},
   282 		{0x1C,0x30,0x30,0xE0,0x30,0x30,0x1C,0x00,0x00,0x00},
   283 		{0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00,0x00,0x00},
   284 		{0xE0,0x30,0x30,0x1C,0x30,0x30,0xE0,0x00,0x00,0x00},
   285 		{0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
   286 		{0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0x00,0x00,0x00},
   287 
   288 		{0x3C,0x66,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00},
   289 		{0x00,0x66,0x00,0x66,0x66,0x66,0x3F,0x00,0x00,0x00},
   290 		{0x0E,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00,0x00,0x00},
   291 		{0x7E,0xC3,0x3C,0x06,0x3E,0x66,0x3F,0x00,0x00,0x00},
   292 		{0x66,0x00,0x3C,0x06,0x3E,0x66,0x3F,0x00,0x00,0x00},
   293 		{0x70,0x00,0x3C,0x06,0x3E,0x66,0x3F,0x00,0x00,0x00},
   294 		{0x18,0x18,0x3C,0x06,0x3E,0x66,0x3F,0x00,0x00,0x00},
   295 		{0x00,0x00,0x3C,0x60,0x60,0x3C,0x06,0x1C,0x00,0x00},
   296 		{0x7E,0xC3,0x3C,0x66,0x7E,0x60,0x3C,0x00,0x00,0x00},
   297 		{0x66,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00,0x00,0x00},
   298 		{0x70,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00,0x00,0x00},
   299 		{0x66,0x00,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00},
   300 		{0x7C,0xC6,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00},
   301 		{0x70,0x00,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00},
   302 		{0x63,0x1C,0x36,0x63,0x7F,0x63,0x63,0x00,0x00,0x00},
   303 		{0x18,0x18,0x00,0x3C,0x66,0x7E,0x66,0x00,0x00,0x00},
   304 
   305 		{0x0E,0x00,0x7E,0x30,0x3C,0x30,0x7E,0x00,0x00,0x00},
   306 		{0x00,0x00,0x7F,0x0C,0x7F,0xCC,0x7F,0x00,0x00,0x00},
   307 		{0x1F,0x36,0x66,0x7F,0x66,0x66,0x67,0x00,0x00,0x00},
   308 		{0x3C,0x66,0x00,0x3C,0x66,0x66,0x3C,0x00,0x00,0x00},
   309 		{0x00,0x66,0x00,0x3C,0x66,0x66,0x3C,0x00,0x00,0x00},
   310 		{0x00,0x70,0x00,0x3C,0x66,0x66,0x3C,0x00,0x00,0x00},
   311 		{0x3C,0x66,0x00,0x66,0x66,0x66,0x3F,0x00,0x00,0x00},
   312 		{0x00,0x70,0x00,0x66,0x66,0x66,0x3F,0x00,0x00,0x00},
   313 		{0x00,0x66,0x00,0x66,0x66,0x3E,0x06,0x7C,0x00,0x00},
   314 		{0xC3,0x18,0x3C,0x66,0x66,0x3C,0x18,0x00,0x00,0x00},
   315 		{0x66,0x00,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00},
   316 		{0x18,0x18,0x7E,0xC0,0xC0,0x7E,0x18,0x18,0x00,0x00},
   317 		{0x1C,0x36,0x32,0x78,0x30,0x73,0x7E,0x00,0x00,0x00},	//£
   318 		{0x66,0x66,0x3C,0x7E,0x18,0x7E,0x18,0x18,0x00,0x00},
   319 		{0xF8,0xCC,0xCC,0xFA,0xC6,0xCF,0xC6,0xC7,0x00,0x00},
   320 		{0x0E,0x1B,0x18,0x3C,0x18,0x18,0xD8,0x70,0x00,0x00},
   321 
   322 		{0x0E,0x00,0x3C,0x06,0x3E,0x66,0x3F,0x00,0x00,0x00},
   323 		{0x1C,0x00,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00},
   324 		{0x00,0x0E,0x00,0x3C,0x66,0x66,0x3C,0x00,0x00,0x00},
   325 		{0x00,0x0E,0x00,0x66,0x66,0x66,0x3F,0x00,0x00,0x00},
   326 		{0x00,0x7C,0x00,0x7C,0x66,0x66,0x66,0x00,0x00,0x00},
   327 		{0x7E,0x00,0x66,0x76,0x7E,0x6E,0x66,0x00,0x00,0x00},
   328 		{0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00},
   329 		{0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00},
   330 		{0x18,0x00,0x18,0x30,0x60,0x66,0x3C,0x00,0x00,0x00},
   331 		{0x00,0x00,0x00,0x7E,0x60,0x60,0x00,0x00,0x00,0x00},
   332 		{0x00,0x00,0x00,0x7E,0x06,0x06,0x00,0x00,0x00,0x00},
   333 		{0xC3,0xC6,0xCC,0xDE,0x33,0x66,0xCC,0x0F,0x00,0x00},
   334 		{0xC3,0xC6,0xCC,0xDB,0x37,0x6F,0xCF,0x03,0x00,0x00},
   335 		{0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x00},
   336 		{0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,0x00,0x00},
   337 		{0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x00,0x00},
   338 
   339 		{0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x00,0x00},
   340 		{0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA},
   341 		{0xDB,0x77,0xDB,0xEE,0xDB,0x77,0xDB,0xEE,0xDB,0x77},
   342 		{0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18},
   343 		{0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18},
   344 		{0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18},
   345 		{0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36},
   346 		{0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36},
   347 		{0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18},
   348 		{0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36},
   349 		{0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36},
   350 		{0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36},
   351 		{0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00},
   352 		{0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00},
   353 		{0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00},
   354 		{0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18},
   355 
   356 		{0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00},
   357 		{0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00},
   358 		{0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18},
   359 		{0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18},
   360 		{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},
   361 		{0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18},
   362 		{0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18},
   363 		{0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36},
   364 		{0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00},
   365 		{0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36},
   366 		{0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},
   367 		{0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36},
   368 		{0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36},
   369 		{0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},
   370 		{0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36},
   371 		{0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},
   372 
   373 		{0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00},
   374 		{0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18},
   375 		{0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36},
   376 		{0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00},
   377 		{0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00},
   378 		{0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18},
   379 		{0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36},
   380 		{0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36},
   381 		{0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18},
   382 		{0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00},
   383 		{0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18},
   384 		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00},
   385 		{0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00},
   386 		{0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x00,0x00},
   387 		{0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x00,0x00},
   388 		{0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},
   389 
   390 		{0x00,0x00,0x3B,0x6E,0x64,0x6E,0x3B,0x00,0x00,0x00},
   391 		{0x00,0x3C,0x66,0x7C,0x66,0x7C,0x60,0x60,0x00,0x00},
   392 		{0x00,0x7E,0x66,0x60,0x60,0x60,0x60,0x00,0x00,0x00},
   393 		{0x00,0x7F,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00},
   394 		{0x7E,0x66,0x30,0x18,0x30,0x66,0x7E,0x00,0x00,0x00},
   395 		{0x00,0x00,0x3F,0x6C,0x6C,0x6C,0x38,0x00,0x00,0x00},
   396 		{0x00,0x33,0x33,0x33,0x33,0x3E,0x30,0x60,0x00,0x00},
   397 		{0x00,0x3B,0x6E,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00},
   398 		{0x7E,0x18,0x3C,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00},
   399 		{0x1C,0x36,0x63,0x7F,0x63,0x36,0x1C,0x00,0x00,0x00},
   400 		{0x1C,0x36,0x63,0x63,0x36,0x36,0x77,0x00,0x00,0x00},
   401 		{0x0E,0x18,0x0C,0x3E,0x66,0x66,0x3C,0x00,0x00,0x00},
   402 		{0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00},
   403 		{0x06,0x0C,0x7E,0xDB,0xDB,0x7E,0x60,0xC0,0x00,0x00},
   404 		{0x1C,0x60,0xC0,0xFC,0xC0,0x60,0x1C,0x00,0x00,0x00},
   405 		{0x3C,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00},
   406 
   407 		{0x00,0x7E,0x00,0x7E,0x00,0x7E,0x00,0x00,0x00,0x00},
   408 		{0x18,0x18,0x7E,0x18,0x18,0x00,0x7E,0x00,0x00,0x00},
   409 		{0x30,0x18,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00},
   410 		{0x0C,0x18,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00},
   411 		{0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x00,0x00},
   412 		{0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00},
   413 		{0x18,0x18,0x00,0x7E,0x00,0x18,0x18,0x00,0x00,0x00},
   414 		{0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00},
   415 		{0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00},
   416 		{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00},
   417 		{0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00},
   418 		{0x0F,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00},
   419 		{0x78,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00},
   420 		{0x70,0x18,0x30,0x60,0x78,0x00,0x00,0x00,0x00,0x00},
   421 		{0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,0x00,0x00,0x00},
   422 		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
   423 	};
   424 
   425 
   426 
   427 /**
   428  * A copy of the standard 256 color palette used by the SymbianOS.
   429  * Each value is in the format 00000000bbbbbbbbggggggggrrrrrrrr
   430  */
   431 const TUint32 Palette256[256] =
   432 	{
   433 	0x00000000,	0x00000033,	0x00000066,	0x00000099,	0x000000cc,	0x000000ff,
   434 	0x00003300,	0x00003333,	0x00003366,	0x00003399,	0x000033cc,	0x000033ff,
   435 	0x00006600,	0x00006633,	0x00006666,	0x00006699,	0x000066cc,	0x000066ff,
   436 	0x00009900,	0x00009933,	0x00009966,	0x00009999,	0x000099cc,	0x000099ff,
   437 	0x0000cc00,	0x0000cc33,	0x0000cc66,	0x0000cc99,	0x0000cccc,	0x0000ccff,
   438 	0x0000ff00,	0x0000ff33,	0x0000ff66,	0x0000ff99,	0x0000ffcc,	0x0000ffff,
   439 
   440 	0x00330000,	0x00330033,	0x00330066,	0x00330099,	0x003300cc,	0x003300ff,
   441 	0x00333300,	0x00333333,	0x00333366,	0x00333399,	0x003333cc,	0x003333ff,
   442 	0x00336600,	0x00336633,	0x00336666,	0x00336699,	0x003366cc,	0x003366ff,
   443 	0x00339900,	0x00339933,	0x00339966,	0x00339999,	0x003399cc,	0x003399ff,
   444 	0x0033cc00,	0x0033cc33,	0x0033cc66,	0x0033cc99,	0x0033cccc,	0x0033ccff,
   445 	0x0033ff00,	0x0033ff33,	0x0033ff66,	0x0033ff99,	0x0033ffcc,	0x0033ffff,
   446 
   447 	0x00660000,	0x00660033,	0x00660066,	0x00660099,	0x006600cc,	0x006600ff,
   448 	0x00663300,	0x00663333,	0x00663366,	0x00663399,	0x006633cc,	0x006633ff,
   449 	0x00666600,	0x00666633,	0x00666666,	0x00666699,	0x006666cc,	0x006666ff,
   450 	0x00669900,	0x00669933,	0x00669966,	0x00669999,	0x006699cc,	0x006699ff,
   451 	0x0066cc00,	0x0066cc33,	0x0066cc66,	0x0066cc99,	0x0066cccc,	0x0066ccff,
   452 	0x0066ff00,	0x0066ff33,	0x0066ff66,	0x0066ff99,	0x0066ffcc,	0x0066ffff,
   453 
   454 	0x00111111, 0x00222222, 0x00444444, 0x00555555, 0x00777777,
   455 	0x00000011, 0x00000022, 0x00000044, 0x00000055, 0x00000077,
   456 	0x00001100,	0x00002200,	0x00004400,	0x00005500,	0x00007700,
   457 	0x00110000,	0x00220000,	0x00440000,	0x00550000,	0x00770000,
   458 
   459 	0x00880000,	0x00aa0000,	0x00bb0000,	0x00dd0000,	0x00ee0000,
   460 	0x00008800,	0x0000aa00,	0x0000bb00,	0x0000dd00,	0x0000ee00,
   461 	0x00000088,	0x000000aa,	0x000000bb,	0x000000dd,	0x000000ee,
   462 	0x00888888, 0x00aaaaaa, 0x00bbbbbb, 0x00dddddd, 0x00eeeeee,
   463 
   464 	0x00990000,	0x00990033,	0x00990066,	0x00990099,	0x009900cc,	0x009900ff,
   465 	0x00993300,	0x00993333,	0x00993366,	0x00993399,	0x009933cc,	0x009933ff,
   466 	0x00996600,	0x00996633,	0x00996666,	0x00996699,	0x009966cc,	0x009966ff,
   467 	0x00999900,	0x00999933,	0x00999966,	0x00999999,	0x009999cc,	0x009999ff,
   468 	0x0099cc00,	0x0099cc33,	0x0099cc66,	0x0099cc99,	0x0099cccc,	0x0099ccff,
   469 	0x0099ff00,	0x0099ff33,	0x0099ff66,	0x0099ff99,	0x0099ffcc,	0x0099ffff,
   470 
   471 	0x00cc0000,	0x00cc0033,	0x00cc0066,	0x00cc0099,	0x00cc00cc,	0x00cc00ff,
   472 	0x00cc3300,	0x00cc3333,	0x00cc3366,	0x00cc3399,	0x00cc33cc,	0x00cc33ff,
   473 	0x00cc6600,	0x00cc6633,	0x00cc6666,	0x00cc6699,	0x00cc66cc,	0x00cc66ff,
   474 	0x00cc9900,	0x00cc9933,	0x00cc9966,	0x00cc9999,	0x00cc99cc,	0x00cc99ff,
   475 	0x00cccc00,	0x00cccc33,	0x00cccc66,	0x00cccc99,	0x00cccccc,	0x00ccccff,
   476 	0x00ccff00,	0x00ccff33,	0x00ccff66,	0x00ccff99,	0x00ccffcc,	0x00ccffff,
   477 
   478 	0x00ff0000,	0x00ff0033,	0x00ff0066,	0x00ff0099,	0x00ff00cc,	0x00ff00ff,
   479 	0x00ff3300,	0x00ff3333,	0x00ff3366,	0x00ff3399,	0x00ff33cc,	0x00ff33ff,
   480 	0x00ff6600,	0x00ff6633,	0x00ff6666,	0x00ff6699,	0x00ff66cc,	0x00ff66ff,
   481 	0x00ff9900,	0x00ff9933,	0x00ff9966,	0x00ff9999,	0x00ff99cc,	0x00ff99ff,
   482 	0x00ffcc00,	0x00ffcc33,	0x00ffcc66,	0x00ffcc99,	0x00ffcccc,	0x00ffccff,
   483 	0x00ffff00,	0x00ffff33,	0x00ffff66,	0x00ffff99,	0x00ffffcc,	0x00ffffff
   484 	};
   485 
   486 /**
   487  * Construct and return the new screen driver
   488  */
   489 EXPORT_C CScreenDriver* CScreenDriver::New()
   490 	{
   491 	__DEBUG_PRINT(_L("CSD::New"));
   492 
   493 #ifdef __X86__
   494 	TInt mode=0;
   495 	HAL::Get(HAL::EDisplayMode, mode);
   496 	if (mode==0)
   497 		return NewScreenDriverVgaText();
   498 #endif
   499 	CScreenDriverTemplate *pS=new CScreenDriverTemplate;
   500 	if (pS->iScreenAddress)
   501 		{
   502 		return(pS);
   503 		}
   504 	delete pS;
   505 	return(NULL);
   506 	}
   507 
   508 
   509 
   510 /**
   511  * Implementation of the screen driver
   512  * Constructor
   513  */
   514 
   515 CScreenDriverTemplate::CScreenDriverTemplate()
   516 	{
   517 
   518 	__DEBUG_PRINT(_L("CSD::Ctor"));
   519 	
   520 	//
   521 	// Start in default mode the display driver is in
   522 	//
   523 	TInt offset;
   524 	TInt r = HAL::Get(HAL::EDisplayMode, iDisplayMode);
   525 	if(r!=KErrNone)
   526 		goto fail;
   527 	__DEBUG_PRINT2(_L("EDisplayMode %d"), iDisplayMode);
   528 	
   529 	iBitsPerPixel = iDisplayMode; //getbpp needs the current mode as its param
   530 	r = HAL::Get(HAL::EDisplayBitsPerPixel,iBitsPerPixel);	
   531 	if(r!=KErrNone)
   532 		goto fail;
   533 	__DEBUG_PRINT2(_L("EDisplayBitsPerPixel %d"), iBitsPerPixel);
   534 
   535 	iIsPalettized = iDisplayMode; //ispalettized needs the current mode as its param
   536 	r = HAL::Get(HAL::EDisplayIsPalettized,iIsPalettized);	
   537 	if(r!=KErrNone)
   538 		goto fail;
   539 	__DEBUG_PRINT2(_L("EDisplayIsPalettized %d"),iIsPalettized);
   540 
   541 	iIsMono = iDisplayMode; //ispalettized needs the current mode as its param
   542 	r = HAL::Get(HAL::EDisplayIsMono, iIsMono);	
   543 	if(r!=KErrNone)
   544 		goto fail;
   545 	__DEBUG_PRINT2(_L("EDisplayIsMono  %d"), iIsMono);
   546 
   547 	
   548 	CalcColorMode();
   549 
   550 	__DEBUG_PRINT2(_L("iMode is %d"),iMode);
   551 	//
   552 	// Obtain the screen info from HAL
   553 	//
   554 	r = HAL::Get(HAL::EDisplayMemoryAddress,iScreenAddress);
   555 	if(r!=KErrNone)
   556 		goto fail;
   557 	__DEBUG_PRINT2(_L("EDisplayMemoryAddress 0x%x"), iScreenAddress);
   558 	
   559 	offset = iDisplayMode;
   560 	r = HAL::Get(HAL::EDisplayOffsetToFirstPixel,offset);
   561 	if(r!=KErrNone)
   562 		goto fail;
   563 	__DEBUG_PRINT2(_L("EDisplayOffsetToFirstPixel  %d"),offset);
   564 	iScreenAddress += offset;
   565 
   566 	iScreenOffsetBetweenLines = iDisplayMode;
   567 	r = HAL::Get(HAL::EDisplayOffsetBetweenLines,iScreenOffsetBetweenLines);
   568 	if(r!=KErrNone)
   569 		goto fail;
   570 	__DEBUG_PRINT2(_L("EDisplayOffsetBetweenLines  %d"), iScreenOffsetBetweenLines);
   571 	
   572 	r = HAL::Get(HAL::EDisplayXPixels,iScreenWidth);
   573 	if(r!=KErrNone)
   574 		goto fail;
   575 	__DEBUG_PRINT2(_L("EDisplayXPixels  %d"),iScreenWidth);
   576 	
   577 	r = HAL::Get(HAL::EDisplayYPixels,iScreenHeight);
   578 	if(r!=KErrNone)
   579 		goto fail;
   580 	__DEBUG_PRINT2(_L("EDisplayYPixels  %d"), iScreenHeight);
   581 
   582 	if(iMode==EColor256)
   583 		{
   584 		// Setup palette (this is the standard SymbianOS 256 colour palette)
   585 		for(TInt i=0; i<256; i++)
   586 			{
   587 			TInt entry = Palette256[i]+(i<<24);
   588 			HAL::Set(HAL::EDisplayPaletteEntry,entry); // Ignore error
   589 			}
   590 	__DEBUG_PRINT(_L("EColor256"));
   591 		}
   592 	else if(iMode==EGray16)
   593 		{
   594 		// Setup palette
   595 		for(TInt i=0; i<16; i++)
   596 			{
   597 			TInt entry = i|(i<<4);
   598 			entry |= entry<<8;
   599 			entry |= entry<<12;
   600 			HAL::Set(HAL::EDisplayPaletteEntry,entry); // Ignore error
   601 			}
   602 	__DEBUG_PRINT(_L("EGray16"));
   603 		}
   604 	else if(iMode==EGray4)
   605 		{
   606 		// Setup palette
   607 		for(TInt i=0; i<4; i++)
   608 			{
   609 			TInt entry = i|(i<<2);
   610 			entry |= entry<<4;
   611 			entry |= entry<<8;
   612 			entry |= entry<<10;
   613 			HAL::Set(HAL::EDisplayPaletteEntry,entry); // Ignore error
   614 			}
   615 	__DEBUG_PRINT(_L("EGray4"));
   616 		}
   617 	else if(iMode==EMono)
   618 		{
   619 		// Setup palette
   620 		TInt entry = 0;
   621 		HAL::Set(HAL::EDisplayPaletteEntry,entry); // Ignore error
   622 		entry = 0x01FFFFFF;
   623 		HAL::Set(HAL::EDisplayPaletteEntry,entry); // Ignore error
   624 	__DEBUG_PRINT(_L("EMono"));
   625 		}
   626 	else
   627 		{
   628 		__DEBUG_PRINT(_L("unknown mode"));
   629 
   630 		}
   631 
   632 	//
   633 	// Initialise values used for drawing
   634 	//
   635 	if(iBitsPerPixel==12)
   636 		iPixelSize = 16;
   637 	else
   638 		iPixelSize = iBitsPerPixel;
   639 
   640 	{
   641 	TInt KBackgroundColor = 0xff0000; // color in format 0xbbggrr
   642 	TInt KTextColor = 0xffffff;		// color in format 0xbbggrr
   643 
   644 	if (( iBitsPerPixel == 24 ) || ( iBitsPerPixel == 32 ) )
   645 		{
   646 		iPixelSize = 32;
   647 //		KTextColor = 0x00FFFF;//Text color yellow when 24ubpp
   648 		}
   649 
   650 	if(iPixelSize<8)
   651 		{
   652 		KBackgroundColor = 0xffffff; // color in format 0xbbggrr
   653 		KTextColor = 0x000000;		// color in format 0xbbggrr
   654 		}
   655 
   656 	iBackgroundPixel = ColorToPixel(KBackgroundColor);
   657 	iBackgroundFill = iBackgroundPixel;
   658 	{
   659 	TInt shift = iPixelSize;
   660 	while(shift<32)
   661 		{
   662 		iBackgroundFill |= iBackgroundFill<<shift;
   663 		shift <<= 1;
   664 		}
   665 	}
   666 
   667 	iTextPixel = ColorToPixel(KTextColor);
   668 	iTextFill = iTextPixel;
   669 	{
   670 	TInt shift = iPixelSize;
   671 	while(shift<32)
   672 		{
   673 		iTextFill |= iTextFill<<shift;
   674 		shift <<= 1;
   675 		}
   676 	}
   677 	}
   678 
   679 	SRectOpInfo roi;
   680 	Mem::FillZ(&roi, sizeof(roi));
   681 	if (HwBlockFill(roi)==KErrNone)
   682 		iHwAcc |= KHwAccBlockFill;
   683 	if (HwBlockCopy(roi)==KErrNone)
   684 		iHwAcc |= KHwAccBlockCopy;
   685 
   686 	//
   687 	// Done
   688 	//
   689 	__DEBUG_PRINT(_L("CSD::Ctor done"));
   690 	return;
   691 
   692 fail:
   693 
   694 	iScreenAddress = NULL;
   695 	__DEBUG_PRINT2(_L("CSD::Ctor failed r=%d"),r);
   696 	}
   697 
   698 
   699 void CScreenDriverTemplate::Init(TSize &aScreenSize,TSize &aFontSize)
   700 //
   701 // Initialise the screen driver and report screen information
   702 //
   703 	{
   704 
   705 	__DEBUG_PRINT(_L("CSD::Init"));
   706 
   707 	aFontSize=TSize(KPixelsPerChar,KLinesPerChar);
   708 	aScreenSize.iWidth=iScreenWidth/KPixelsPerChar;
   709 	aScreenSize.iHeight=iScreenHeight/KLinesPerChar;
   710 
   711 	Clear(aScreenSize);
   712 	}
   713 
   714 
   715 TInt CScreenDriverTemplate::SetMode(TVideoMode aMode)
   716 	{
   717 	/**
   718 	 * TO DO: (optional)
   719 	 *
   720 	 * If you support multiple video modes then implement video mode switching
   721 	 * here. After the mode switch the screen contents should appear as before.
   722 	 * The current mode should be stored in iMode, and other member data updated
   723 	 * as appropriate. I.e. iScreenAddress, iScreenWidth, iScreenHeight, 
   724 	 * iScreenOffsetBetweenLines, iBitsPerPixel and iPixelSize (See ctor code.)
   725 	 */
   726 
   727 	__DEBUG_PRINT(_L("CSD::SetMode"));
   728 	return(aMode==iMode ? KErrNone : KErrNotSupported);
   729 	}
   730 
   731 
   732 TUint8* CScreenDriverTemplate::CharPosToScreenAddress(const TPoint& aCharPos)
   733 //
   734 // Returns the screen address for the given character position 
   735 //
   736 	{
   737 	return (TUint8*)iScreenAddress +
   738 		aCharPos.iY * iScreenOffsetBetweenLines * KLinesPerChar +
   739 		((aCharPos.iX * KPixelsPerChar * iPixelSize) >> 3);
   740 	}
   741 
   742 void CScreenDriverTemplate::CalcColorMode()
   743 	{
   744 	iMode = 0;
   745 	//calculate the color mode
   746 	if (iIsPalettized)
   747 		{
   748 		if (iIsMono)
   749 			{
   750 			if (1 == iBitsPerPixel)
   751 				iMode = EMono;
   752 			else if (2 == iBitsPerPixel)
   753 				iMode = EGray4;
   754 			else if (4 == iBitsPerPixel)
   755 				iMode = EGray16;
   756 			}
   757 		else
   758 			{
   759 			if (8 == iBitsPerPixel)
   760 				iMode = EColor256;
   761 			else if (4 == iBitsPerPixel)
   762 				iMode = EGray16;			//we are color but color16 is not supported
   763 			}
   764 		}
   765 	else
   766 		{
   767 		if (!iIsMono)
   768 			{
   769 			if (12 == iBitsPerPixel)
   770 				iMode = EColor4K;
   771 			else if (16 == iBitsPerPixel)
   772 				iMode = EColor64K;
   773 			else if (24 == iBitsPerPixel)
   774 				iMode = EColor16M;
   775 			else if (32 == iBitsPerPixel)
   776 				iMode = EColor16M;			
   777 			}
   778 		}
   779 
   780 	}
   781 
   782 TInt CScreenDriverTemplate::ColorToPixel(TInt aColorRgb)
   783 //
   784 // Returns the pixel value which is closest to the given RGB value
   785 //
   786 	{
   787 	TInt r = aColorRgb&0xFF;
   788 	TInt g = (aColorRgb>>8)&0xFF;
   789 	TInt b = (aColorRgb>>16)&0xFF;
   790 
   791 	switch(iMode)
   792 		{
   793 	case EColor16M:
   794 		return (r<<16)+(g<<8)+b;
   795 
   796 	case EColor64K:
   797 		return ((r>>3)<<11)+((g>>2)<<5)+(b>>3);
   798 
   799 	case EColor4K:
   800 		return ((r>>4)<<8)+((g>>4)<<4)+(b>>4);
   801 
   802 	case EColor256:
   803 		{
   804 		TInt best = 0;
   805 		TInt bestDif = KMaxTInt;
   806 		for(TInt i=0; i<256; i++)
   807 			{
   808 			TInt value = Palette256[i];
   809 			TInt dr = (value&0xFF)-r;
   810 			TInt dg = ((value>>8)&0xFF)-g;
   811 			TInt db = ((value>>16)&0xFF)-b;
   812 			TInt dif = dr*dr + dg*dg + db*db;
   813 			if(dif<bestDif)
   814 				{
   815 				bestDif = dif;
   816 				best = i;
   817 				}
   818 			}
   819 		return best;
   820 		}
   821 
   822 	case EGray16:
   823 		return (r*2+g*4+b)>>7;
   824 
   825 	case EGray4:
   826 		return (r*2+g*4+b)>>9;
   827 
   828 	case EMono:
   829 		return (r*2+g*4+b)>>10;
   830 		}
   831 
   832 	return 0;
   833 	}
   834 
   835 
   836 void CScreenDriverTemplate::Blit(const TText *aBuffer, TInt aLength, const TPoint &aPosition)
   837 //
   838 // Write contiguous block of characters to some segment of a line on the display
   839 //
   840 	{
   841 	//
   842 	// ASSUMPTION:
   843 	//
   844 	// The start of each character on the display is byte aligned.
   845 	// i.e. KPixelsPerChar*iPixelSize%8 == 0
   846 
   847 	// Clip text to screen width
   848 	if(aLength+aPosition.iX > iScreenWidth/KPixelsPerChar)
   849 		aLength = iScreenWidth/KPixelsPerChar-aPosition.iX;
   850 
   851 	TUint8* screenPtr = CharPosToScreenAddress(aPosition);
   852 	TInt lineAddon = iScreenOffsetBetweenLines-((iPixelSize*KPixelsPerChar)>>3);
   853 	TInt bgPixel = iBackgroundPixel;
   854 	TInt textPixel = iTextPixel;
   855 
   856 	while(aLength-->0)
   857 		{
   858 		TUint8* pixelPtr = screenPtr;
   859 		screenPtr += (iPixelSize*KPixelsPerChar)>>3;
   860 		TInt character = (*aBuffer++)&0xff;
   861 		TInt y;
   862 
   863 		switch(iPixelSize)
   864 			{
   865 
   866 		case 1:
   867 			for(y=0; y<KLinesPerChar; y++)
   868 				{
   869 				TInt bitData = Font[character][y];
   870 				TInt bitMask = 1<<(KPixelsPerChar-1);
   871 				TInt pixelShift = 0;
   872 				TInt byte = 0;
   873 				do
   874 					{
   875 					if(bitData & bitMask)
   876 						byte |= textPixel<<pixelShift;
   877 					else
   878 						byte |= bgPixel<<pixelShift;
   879 					if(pixelShift<7)
   880 						pixelShift++;
   881 					else
   882 						{
   883 						*pixelPtr++ = (TUint8)byte;
   884 						byte = 0;
   885 						pixelShift = 0;
   886 						}
   887 					bitMask >>= 1;
   888 					}
   889 				while(bitMask);
   890 				pixelPtr += lineAddon;
   891 				}
   892 			break;
   893 
   894 		case 2:
   895 			for(y=0; y<KLinesPerChar; y++)
   896 				{
   897 				TInt bitData = Font[character][y];
   898 				TInt bitMask = 1<<(KPixelsPerChar-1);
   899 				do
   900 					{
   901 					TInt byte;
   902 					if(bitData & bitMask)
   903 						byte = textPixel;
   904 					else
   905 						byte = bgPixel;
   906 					bitMask >>= 1;
   907 
   908 					if(bitData & bitMask)
   909 						byte |= textPixel<<2;
   910 					else
   911 						byte |= bgPixel<<2;
   912 					bitMask >>= 1;
   913 
   914 					if(bitData & bitMask)
   915 						byte |= textPixel<<4;
   916 					else
   917 						byte |= bgPixel<<4;
   918 					bitMask >>= 1;
   919 
   920 					if(bitData & bitMask)
   921 						byte |= textPixel<<6;
   922 					else
   923 						byte |= bgPixel<<6;
   924 					*pixelPtr++ = (TUint8)byte;
   925 					bitMask >>= 1;
   926 					}
   927 				while(bitMask);
   928 				pixelPtr += lineAddon;
   929 				}
   930 			break;
   931 
   932 		case 4:
   933 			for(y=0; y<KLinesPerChar; y++)
   934 				{
   935 				TInt bitData = Font[character][y];
   936 				TInt bitMask = 1<<(KPixelsPerChar-1);
   937 				do
   938 					{
   939 					TInt byte;
   940 					if(bitData & bitMask)
   941 						byte = textPixel;
   942 					else
   943 						byte = bgPixel;
   944 					bitMask >>= 1;
   945 
   946 					if(bitData & bitMask)
   947 						byte |= textPixel<<4;
   948 					else
   949 						byte |= bgPixel<<4;
   950 					*pixelPtr++ = (TUint8)byte;
   951 					bitMask >>= 1;
   952 					}
   953 				while(bitMask);
   954 				pixelPtr += lineAddon;
   955 				}
   956 			break;
   957 
   958 		case 8:
   959 			for(y=0; y<KLinesPerChar; y++)
   960 				{
   961 				TInt bitData = Font[character][y];
   962 				TInt bitMask = 1<<(KPixelsPerChar-1);
   963 				do
   964 					{
   965 					if(bitData & bitMask)
   966 						*pixelPtr++ = (TUint8)textPixel;
   967 					else
   968 						*pixelPtr++ = (TUint8)bgPixel;
   969 					bitMask >>= 1;
   970 					}
   971 				while(bitMask);
   972 				pixelPtr += lineAddon;
   973 				}
   974 			break;
   975 
   976 		case 16:
   977 			for(y=0; y<KLinesPerChar; y++)
   978 				{
   979 				TInt bitData = Font[character][y];
   980 				TInt bitMask = 1<<(KPixelsPerChar-1);
   981 				do
   982 					{
   983 					if(bitData & bitMask)
   984 						{
   985 						*pixelPtr++ = (TUint8)textPixel;
   986 						*pixelPtr++ = (TUint8)(textPixel>>8);
   987 						}
   988 					else
   989 						{
   990 						*pixelPtr++ = (TUint8)bgPixel;
   991 						*pixelPtr++ = (TUint8)(bgPixel>>8);
   992 						}
   993 					bitMask >>= 1;
   994 					}
   995 				while(bitMask);
   996 				pixelPtr += lineAddon;
   997 				}
   998 			break;
   999 
  1000 		case 24:
  1001 			for(y=0; y<KLinesPerChar; y++)
  1002 				{
  1003 				TInt bitData = Font[character][y];
  1004 				TInt bitMask = 1<<(KPixelsPerChar-1);
  1005 				do
  1006 					{
  1007 					if(bitData & bitMask)
  1008 						{
  1009 						*pixelPtr++ = (TUint8)textPixel;
  1010 						*pixelPtr++ = (TUint8)(textPixel>>8);
  1011 						*pixelPtr++ = (TUint8)(textPixel>>16);
  1012 						}
  1013 					else
  1014 						{
  1015 						*pixelPtr++ = (TUint8)bgPixel;
  1016 						*pixelPtr++ = (TUint8)(bgPixel>>8);
  1017 						*pixelPtr++ = (TUint8)(bgPixel>>16);
  1018 						}
  1019 					bitMask >>= 1;
  1020 					}
  1021 				while(bitMask);
  1022 				pixelPtr += lineAddon;
  1023 				}
  1024 			break;
  1025 
  1026 		case 32:
  1027 			for(y=0; y<KLinesPerChar; y++)
  1028 				{
  1029 				TInt bitData = Font[character][y];
  1030 				TInt bitMask = 1<<(KPixelsPerChar-1);
  1031 				do
  1032 					{
  1033 					if(bitData & bitMask)
  1034 						{
  1035 						*pixelPtr++ = (TUint8)textPixel;//Blue
  1036 						*pixelPtr++ = (TUint8)(textPixel>>8);//Green
  1037 						*pixelPtr++ = (TUint8)(textPixel>>16);//Red
  1038                         ++pixelPtr;
  1039 						}
  1040 					else
  1041 						{
  1042 						*pixelPtr++ = (TUint8)bgPixel;//Blue
  1043 						*pixelPtr++ = (TUint8)(bgPixel>>8);//Green
  1044 						*pixelPtr++ = (TUint8)(bgPixel>>16);//Red
  1045                         ++pixelPtr;
  1046 						}
  1047 					bitMask >>= 1;
  1048 					}
  1049 				while(bitMask);
  1050 				pixelPtr += lineAddon;
  1051 				}
  1052 			break;
  1053 
  1054 			}
  1055 		}
  1056 	}
  1057 
  1058 
  1059 TBool CScreenDriverTemplate::ScrollUp(const TRect& aRect)
  1060 //
  1061 // Scroll a rectangle of the screen up one character, don't update bottom line
  1062 //
  1063 	{
  1064 	__DEBUG_PRINT(_L("CSD::ScrollUp"));
  1065 
  1066 	if (iHwAcc & KHwAccBlockCopy)
  1067 		{
  1068 		SRectOpInfo roi;
  1069 		roi.iX = KPixelsPerChar*aRect.iTl.iX;
  1070 		roi.iY = KLinesPerChar*aRect.iTl.iY;
  1071 		roi.iWidth = aRect.Width()*KPixelsPerChar;
  1072 		roi.iHeight = (aRect.Height()-1) * KLinesPerChar;
  1073 		roi.iSrcX = roi.iX;
  1074 		roi.iSrcY = roi.iY + KLinesPerChar;
  1075 		HwBlockCopy(roi);
  1076 		return ETrue;
  1077 		}
  1078 	TUint8* dstAddress = CharPosToScreenAddress(aRect.iTl);
  1079 	TUint8* srcAddress = dstAddress + iScreenOffsetBetweenLines * KLinesPerChar;
  1080 	TInt lines = (aRect.Height()-1) * KLinesPerChar;
  1081 	TInt bytesPerLine = (aRect.Width() * KPixelsPerChar * iPixelSize)>>3;
  1082 
  1083 	while(lines>0)
  1084 		{
  1085         Mem::Copy(dstAddress,srcAddress,bytesPerLine);
  1086 		srcAddress += iScreenOffsetBetweenLines;
  1087 		dstAddress += iScreenOffsetBetweenLines;
  1088 		--lines;
  1089 		}
  1090 
  1091 	return ETrue;
  1092 	}
  1093 
  1094 
  1095 void CScreenDriverTemplate::Clear(const TRect& aRect)
  1096 //
  1097 // Clears a rectangular region with the background colour
  1098 //
  1099 	{
  1100 	__DEBUG_PRINT(_L("CSD::Clear"));
  1101 
  1102 	if (iHwAcc & KHwAccBlockFill)
  1103 		{
  1104 		SRectOpInfo roi;
  1105 		roi.iX = KPixelsPerChar*aRect.iTl.iX;
  1106 		roi.iY = KLinesPerChar*aRect.iTl.iY;
  1107 		roi.iWidth = aRect.Width()*KPixelsPerChar;
  1108 		roi.iHeight = aRect.Height() * KLinesPerChar;
  1109 		roi.iSrcX = roi.iX;
  1110 		roi.iSrcY = roi.iY;
  1111 		roi.iColor = iBackgroundFill;
  1112 		HwBlockCopy(roi);
  1113 		return;
  1114 		}
  1115 
  1116 	TUint8* dstAddress = CharPosToScreenAddress(aRect.iTl);
  1117 	TInt lines = aRect.Height() * KLinesPerChar;
  1118 	TInt bytesPerLine = (aRect.Width() * KPixelsPerChar * iPixelSize)>>3;
  1119 
  1120 	switch(iPixelSize)
  1121 		{
  1122 	case 32:
  1123 		while(lines>0)
  1124 			{
  1125 			TUint32 fillValue = iBackgroundFill;
  1126 			TUint8* ptr = dstAddress;
  1127 			TUint8* ptrLimit = ptr+bytesPerLine;
  1128 			while(ptr<ptrLimit)
  1129 				{
  1130 				*ptr++ = (TUint8)fillValue;//Blue
  1131 				*ptr++ = (TUint8)(fillValue<<8);//Green
  1132 				*ptr++ = (TUint8)(fillValue<<16);//Red
  1133                 ++ptr;
  1134 				}
  1135 			dstAddress += iScreenOffsetBetweenLines;
  1136 			--lines;
  1137 			}
  1138 		break;
  1139 
  1140 	case 24:
  1141 		while(lines>0)
  1142 			{
  1143 			TUint32 fillValue = iBackgroundFill;
  1144 			TUint8* ptr = dstAddress;
  1145 			TUint8* ptrLimit = ptr+bytesPerLine;
  1146 			while(ptr<ptrLimit)
  1147 				{
  1148 				*ptr++ = (TUint8)fillValue;
  1149 				*ptr++ = (TUint8)(fillValue<<8);
  1150 				*ptr++ = (TUint8)(fillValue<<16);
  1151 				}
  1152 			dstAddress += iScreenOffsetBetweenLines;
  1153 			--lines;
  1154 			}
  1155 		break;
  1156 
  1157 	case 16:
  1158 		while(lines>0)
  1159 			{
  1160 			TUint32 fillValue = iBackgroundFill;
  1161 			TUint8* ptr = dstAddress;
  1162 			TUint8* ptrLimit = ptr+bytesPerLine;
  1163 			while(ptr<ptrLimit)
  1164 				{
  1165 				*ptr++ = (TUint8)fillValue;
  1166 				*ptr++ = (TUint8)(fillValue<<8);
  1167 				}
  1168 			dstAddress += iScreenOffsetBetweenLines;
  1169 			--lines;
  1170 			}
  1171 		break;
  1172 
  1173 	default:
  1174 		while(lines>0)
  1175 			{
  1176 			Mem::Fill(dstAddress,bytesPerLine,iBackgroundFill);
  1177 			dstAddress += iScreenOffsetBetweenLines;
  1178 			--lines;
  1179 			}
  1180 		break;
  1181 		}
  1182 	}
  1183 
  1184 
  1185 
  1186 /**
  1187  * You don't need to implement this function.
  1188  */
  1189 void CScreenDriverTemplate::SetPixel(const TPoint& /*aPoint*/,TUint8 /*aColour*/)
  1190 	{
  1191 	__DEBUG_PRINT(_L("CSD::SetPix"));
  1192 	}
  1193 
  1194 
  1195 /**
  1196  * You don't need to implement this function.
  1197  */
  1198 TInt CScreenDriverTemplate::GetPixel(const TPoint& /*aPoint*/)
  1199 	{
  1200 	__DEBUG_PRINT(_L("CSD::GetPix"));
  1201 	return 0;
  1202 	}
  1203 
  1204 
  1205 /**
  1206  * You don't need to implement this function.
  1207  */
  1208 void CScreenDriverTemplate::SetWord(const TPoint& /*aPoint*/,TInt /*aWord*/)
  1209 	{
  1210 	__DEBUG_PRINT(_L("CSD::SetWord"));
  1211 	}
  1212 
  1213 
  1214 /**
  1215  * You don't need to implement this function.
  1216  */
  1217 TInt CScreenDriverTemplate::GetWord(const TPoint& /*aPoint*/)
  1218 	{
  1219 	__DEBUG_PRINT(_L("CSD::GetWord"));
  1220 	return 0;
  1221 	}
  1222 
  1223 
  1224 // You don't need to implement the following functions
  1225 
  1226 /**
  1227  * You don't need to implement this function.
  1228  */
  1229 void CScreenDriverTemplate::SetLine(const TPoint& /*aPoint*/,const TPixelLine& /*aPixelLine*/)
  1230 	{
  1231 	__DEBUG_PRINT(_L("CSD::SetLine"));
  1232 	}
  1233 
  1234 
  1235 /**
  1236  * You don't need to implement this function.
  1237  */
  1238 void CScreenDriverTemplate::GetLine(const TPoint& /*aPoint*/,TPixelLine& /*aPixelLine*/)
  1239 	{
  1240 	__DEBUG_PRINT(_L("CSD::GetLine"));
  1241 	}
  1242 
  1243 
  1244 /**
  1245  * You don't need to implement this function.
  1246  */
  1247 void CScreenDriverTemplate::SetPaletteEntry(TColorIndex /*anIndex*/,TUint8 /*aRed*/,TUint8 /*aGreen*/,TUint8 /*aBlue*/)
  1248 	{
  1249 	}
  1250 
  1251 
  1252 /**
  1253  * You don't need to implement this function.
  1254  */
  1255 void CScreenDriverTemplate::GetPaletteEntry(TColorIndex /*anIndex*/,TUint8& /*aRed*/,TUint8& /*aGreen*/,TUint8& /*aBlue*/)
  1256 	{
  1257 	}
  1258 
  1259 
  1260 /**
  1261  * You don't need to implement this function.
  1262  */
  1263 void CScreenDriverTemplate::SetForegroundColor(TColorIndex /*anIndex*/)
  1264 	{
  1265 	}
  1266 
  1267 
  1268 /**
  1269  * You don't need to implement this function.
  1270  */
  1271 void CScreenDriverTemplate::SetBackgroundColor(TColorIndex /*anIndex*/)
  1272 	{
  1273 	}
  1274 
  1275 
  1276 /**
  1277  * You don't need to implement this function.
  1278  */
  1279 void CScreenDriverTemplate::GetAttributeColors(TColorIndex* /*anArray*/)
  1280 	{
  1281 	}
  1282