Update contrib.
1 // Copyright (c) 1996-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // bootldr\src\display\display.cpp
18 #define FILE_ID 0x44495350
19 #define DEFINE_COLOURS
22 // Defining ENABLE_TRANSFER_STATS will display simplistic average and point
23 // transfer rates in bytes per second and provide an estimate of the length of
26 #define ENABLE_TRANSFER_STATS
29 #include <videodriver.h>
33 TInt Screenwidth, Screenheight; // screen dimentions in pixels
37 TUint PixelSize = 1; // size of a pixel in bytes
42 TUint32 ProgressTime[2];
45 // Palette entries are in the platform's config.h
46 const TUint16 Palette[16]= {
47 KPaletteEntBlack | KPaletteEntPBS,
48 KPaletteEntMidBlue, // 1
49 KPaletteEntMidGreen, // 2
50 KPaletteEntMidCyan, // 3
51 KPaletteEntMidRed, // 4
52 KPaletteEntMidMagenta, // 5
53 KPaletteEntMidYellow, // 6
54 KPaletteEntDimWhite, // 7
57 KPaletteEntGreen, // 10 A
58 KPaletteEntCyan, // 11 B
59 KPaletteEntRed, // 12 C
60 KPaletteEntMagenta, // 13 D
61 KPaletteEntYellow, // 14 E
62 KPaletteEntWhite // 15 F
65 const TUint KRgbBlack = 0x000000;
66 //const TUint KRgbDarkGray = 0x555555;
67 const TUint KRgbDarkRed = 0x800000;
68 const TUint KRgbDarkGreen = 0x008000;
69 const TUint KRgbDarkYellow = 0x808000;
70 const TUint KRgbDarkBlue = 0x000080;
71 const TUint KRgbDarkMagenta = 0x800080;
72 const TUint KRgbDarkCyan = 0x008080;
73 const TUint KRgbRed = 0xFF0000;
74 //const TUint KRgbGreen = 0x00FF00;
75 const TUint KRgbYellow = 0xFFFF00;
76 const TUint KRgbBlue = 0x0000FF;
77 const TUint KRgbMagenta = 0xFF00FF;
78 const TUint KRgbCyan = 0x00FFFF;
79 const TUint KRgbGray = 0xAAAAAA;
80 const TUint KRgbWhite = 0xFFFFFF;
82 const TUint KRgbDimWhite = 0xCCCCCC;
84 const TUint32 Palette32[16] =
93 KRgbDimWhite, // 7 KRgbDarkGray()
104 // KForeground, Kbackground and [I]Pcolour entries are indexes into the palette.
105 // The progress bar colours are of the form "(foreground << 8) | background"
106 const TUint8 KForeground = 15;
107 const TUint8 KBackground = 9;
108 const TUint PColour[2]={ 0xa08, 0xc08 }; // (10|8) and (12|8)
109 const TUint IPColour[2]={ 0x809, 0x809 }; // (8|9) and (8|9)
112 #define FONT_HEIGHT 10
115 #define SCREEN_SIZE (Screenheight*Screenwidth*PixelSize) // number of pixels (size in bytes)
117 #define MAX_COLUMN (Screenwidth/FONT_WIDTH) // chars per line e.g. 80 or 40
118 #define MAX_ROW (Screenheight/FONT_HEIGHT) // lines per screen e.g. 48 or 24
119 #define PROGRESSBAR0_ROW (MAX_ROW-1) // row in which to draw progress bar 0
120 #define PROGRESSBAR1_ROW (MAX_ROW-2) // row in which to draw progress bar 1
121 #define STATS_ROW (MAX_ROW-3) // DEBUGGING row in which to write eta/bps
123 // ascii character code - 32 == character index into bootldr table
125 extern const TUint8 Font[NUM_FONTS][FONT_HEIGHT] =
127 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
128 {0x30,0x78,0x78,0x78,0x30,0x00,0x30,0x00,0x00,0x00}, //!
129 {0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
130 {0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00}, //#
131 {0x30,0x7C,0xC0,0x78,0x0C,0xF8,0x30,0x00,0x00,0x00}, //$
132 {0x00,0xC6,0xCC,0x18,0x30,0x66,0xC6,0x00,0x00,0x00},
133 {0x38,0x6C,0x38,0x76,0xDC,0xCC,0x76,0x00,0x00,0x00},
134 {0x60,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
135 {0x18,0x30,0x60,0x60,0x60,0x30,0x18,0x00,0x00,0x00},
136 {0x60,0x30,0x18,0x18,0x18,0x30,0x60,0x00,0x00,0x00},
137 {0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00},
138 {0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00,0x00,0x00},
139 {0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00},
140 {0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00}, //-
141 {0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00}, //.
142 {0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00}, ///
144 {0x7C,0xC6,0xCE,0xDE,0xF6,0xE6,0x7C,0x00,0x00,0x00}, //0
145 {0x30,0x70,0x30,0x30,0x30,0x30,0xFC,0x00,0x00,0x00},
146 {0x78,0xCC,0x0C,0x38,0x60,0xCC,0xFC,0x00,0x00,0x00},
147 {0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78,0x00,0x00,0x00},
148 {0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x1E,0x00,0x00,0x00},
149 {0xFC,0xC0,0xF8,0x0C,0x0C,0xCC,0x78,0x00,0x00,0x00},
150 {0x38,0x60,0xC0,0xF8,0xCC,0xCC,0x78,0x00,0x00,0x00},
151 {0xFC,0xCC,0x0C,0x18,0x30,0x30,0x30,0x00,0x00,0x00},
152 {0x78,0xCC,0xCC,0x78,0xCC,0xCC,0x78,0x00,0x00,0x00},
153 {0x78,0xCC,0xCC,0x7C,0x0C,0x18,0x70,0x00,0x00,0x00}, //9
154 {0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00,0x00}, //:
155 {0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x60,0x00,0x00}, //;
156 {0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x00,0x00,0x00}, //<
157 {0x00,0x00,0xFC,0x00,0x00,0xFC,0x00,0x00,0x00,0x00}, //=
158 {0x60,0x30,0x18,0x0C,0x18,0x30,0x60,0x00,0x00,0x00}, //>
159 {0x78,0xCC,0x0C,0x18,0x30,0x00,0x30,0x00,0x00,0x00}, //?
161 {0x7C,0xC6,0xDE,0xDE,0xDE,0xC0,0x78,0x00,0x00,0x00}, //@
162 {0x30,0x78,0xCC,0xCC,0xFC,0xCC,0xCC,0x00,0x00,0x00}, //A
163 {0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00,0x00,0x00}, //B
164 {0x3C,0x66,0xC0,0xC0,0xC0,0x66,0x3C,0x00,0x00,0x00}, //C
165 {0xF8,0x6C,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00}, //D
166 {0x7E,0x60,0x60,0x78,0x60,0x60,0x7E,0x00,0x00,0x00}, //E
167 {0x7E,0x60,0x60,0x78,0x60,0x60,0x60,0x00,0x00,0x00}, //F
168 {0x3C,0x66,0xC0,0xC0,0xCE,0x66,0x3E,0x00,0x00,0x00}, //G
169 {0xCC,0xCC,0xCC,0xFC,0xCC,0xCC,0xCC,0x00,0x00,0x00}, //H
170 {0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00}, //I
171 {0x1E,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00,0x00}, //J
172 {0xE6,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00}, //K
173 {0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00,0x00,0x00}, //L
174 {0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0x00,0x00,0x00}, //M
175 {0xC6,0xE6,0xF6,0xDE,0xCE,0xC6,0xC6,0x00,0x00,0x00}, //N
176 {0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00}, //O
178 {0xFC,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,0x00,0x00}, //P
179 {0x78,0xCC,0xCC,0xCC,0xDC,0x78,0x1C,0x00,0x00,0x00}, //Q
180 {0xFC,0x66,0x66,0x7C,0x6C,0x66,0xE6,0x00,0x00,0x00}, //R
181 {0x78,0xCC,0xE0,0x70,0x1C,0xCC,0x78,0x00,0x00,0x00}, //S
182 {0xFC,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00}, //T
183 {0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFC,0x00,0x00,0x00}, //U
184 {0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00,0x00,0x00}, //V
185 {0xC6,0xC6,0xC6,0xD6,0xFE,0xEE,0xC6,0x00,0x00,0x00}, //W
186 {0xC6,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00}, //X
187 {0xCC,0xCC,0xCC,0x78,0x30,0x30,0x78,0x00,0x00,0x00}, //Y
188 {0xFE,0x06,0x0C,0x18,0x30,0x60,0xFE,0x00,0x00,0x00}, //Z
189 {0x78,0x60,0x60,0x60,0x60,0x60,0x78,0x00,0x00,0x00},
190 {0xC0,0x60,0x30,0x18,0x0C,0x06,0x02,0x00,0x00,0x00},
191 {0x78,0x18,0x18,0x18,0x18,0x18,0x78,0x00,0x00,0x00},
192 {0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00},
193 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},
195 {0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
196 {0x00,0x00,0x78,0x0C,0x7C,0xCC,0x76,0x00,0x00,0x00},
197 {0xE0,0x60,0x60,0x7C,0x66,0x66,0xDC,0x00,0x00,0x00},
198 {0x00,0x00,0x78,0xCC,0xC0,0xCC,0x78,0x00,0x00,0x00},
199 {0x1C,0x0C,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00,0x00},
200 {0x00,0x00,0x78,0xCC,0xFC,0xC0,0x78,0x00,0x00,0x00},
201 {0x38,0x6C,0x60,0xF0,0x60,0x60,0xF0,0x00,0x00,0x00},
202 {0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0xF8,0x00,0x00},
203 {0xE0,0x60,0x6C,0x76,0x66,0x66,0xE6,0x00,0x00,0x00},
204 {0x30,0x00,0x70,0x30,0x30,0x30,0x78,0x00,0x00,0x00},
205 {0x0C,0x00,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00},
206 {0xE0,0x60,0x66,0x6C,0x78,0x6C,0xE6,0x00,0x00,0x00},
207 {0x70,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00},
208 {0x00,0x00,0xCC,0xFE,0xFE,0xD6,0xC6,0x00,0x00,0x00},
209 {0x00,0x00,0xF8,0xCC,0xCC,0xCC,0xCC,0x00,0x00,0x00},
210 {0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00},
212 {0x00,0x00,0xDC,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00},
213 {0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0x1E,0x00,0x00},
214 {0x00,0x00,0xDC,0x76,0x66,0x60,0xF0,0x00,0x00,0x00},
215 {0x00,0x00,0x7C,0xC0,0x78,0x0C,0xF8,0x00,0x00,0x00},
216 {0x10,0x30,0x7C,0x30,0x30,0x34,0x18,0x00,0x00,0x00},
217 {0x00,0x00,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00},
218 {0x00,0x00,0xCC,0xCC,0xCC,0x78,0x30,0x00,0x00,0x00},
219 {0x00,0x00,0xC6,0xD6,0xFE,0xFE,0x6C,0x00,0x00,0x00},
220 {0x00,0x00,0xC6,0x6C,0x38,0x6C,0xC6,0x00,0x00,0x00},
221 {0x00,0x00,0xCC,0xCC,0xCC,0x7C,0x0C,0xF8,0x00,0x00},
222 {0x00,0x00,0xFC,0x98,0x30,0x64,0xFC,0x00,0x00,0x00},
223 {0x1C,0x30,0x30,0xE0,0x30,0x30,0x1C,0x00,0x00,0x00},
224 {0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00,0x00,0x00},
225 {0xE0,0x30,0x30,0x1C,0x30,0x30,0xE0,0x00,0x00,0x00},
226 {0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
227 {0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00},
230 inline void ColourPixel(TInt aXPos, TInt aYPos, TUint aColour)
232 colour a pixel on the screen
233 @param aXPos pixel's X coordinate
234 @param aYPos pixel's Y coordinate
235 @param aColour chosen colour specified as a palette index
238 TUint8* pV = (TUint8*)Screen + (aYPos * (Screenwidth * PixelSize)) + (aXPos * PixelSize);
243 *(TUint32*)pV = Palette32[aColour];
246 *pV++ = Palette[aColour] & 0xFF ;
247 *pV = Palette[aColour] >> 8 ;
253 // Kern::Fault("BOOTLDR colourpixel: Unsupported bpp", PixelSize);
258 #ifndef USE_ASM_DISPLAYCHAR
259 void DisplayChar(TInt aChar, TInt aXPos, TInt aYPos, TUint aColours)
261 Write a character to the framebuffer
262 @param aChar Character to draw
263 @param aXPos Character's column
264 @param aYPos Character's row
265 @param aColour Palette index specified (foreground << 8| background)
268 // Convert the ascii value into an index for the Font table
269 TInt tmpChar = aChar - 32;
271 // Validate this is a valid font index
272 if (tmpChar < 0 || tmpChar >= NUM_FONTS)
275 // Validate coordinates lie within range.
276 if (aXPos > MAX_COLUMN-1 || aYPos > MAX_ROW-1)
279 // for each line of the font
280 for (TUint line=0 ; line < FONT_HEIGHT ; line++)
282 TUint8 tmpLine = Font[tmpChar][line];
283 TUint8 tmpMask = 0x80;
284 // for each pixel of the line
285 for (TUint pixel=0 ; pixel < FONT_WIDTH ; pixel++)
287 ColourPixel(aXPos * FONT_WIDTH + pixel,
288 aYPos * FONT_HEIGHT + line,
289 (tmpLine & tmpMask) ? aColours >> 8 : aColours & 0xFF);
291 // Shift the mask one bit downward to examine the next pixel
292 tmpMask = tmpMask >> 1;
301 GLDEF_C void ClearScreen()
303 Set all the pixels on the screen to the background
306 for (TInt y = 0 ; y<Screenheight ; y++)
307 for (TInt x = 0 ; x<Screenwidth ; x++)
308 ColourPixel(x, y, KBackground);
312 Colours=(KForeground<<8)|KBackground;
317 Move all the pixels in the scrolling text area up one line and fill the
318 last line with the background colour
322 wordmove(pV, pV+(Screenwidth*PixelSize*FONT_HEIGHT), (Screenwidth*PixelSize*(Screenheight-(2*FONT_HEIGHT))-(Screenwidth*PixelSize*FONT_HEIGHT)));
323 pV+=(Screenwidth*PixelSize*(Screenheight-(2*FONT_HEIGHT))-(Screenwidth*PixelSize*FONT_HEIGHT));
325 TInt StartLine = (Screenheight-(4*FONT_HEIGHT));
326 for (TInt y = StartLine ; y<(StartLine+FONT_HEIGHT) ; y++)
327 for (TInt x = 0 ; x<Screenwidth ; x++)
328 ColourPixel(x, y, KBackground);
331 void ScrollScreenDown()
333 Move all the pixels in the scrolling text area down one line and fill the
334 first line with the background colour
338 wordmove(pV+(Screenwidth*PixelSize*FONT_HEIGHT), pV, (Screenwidth*PixelSize*(Screenheight-(2*FONT_HEIGHT))-(Screenwidth*PixelSize*FONT_HEIGHT)));
340 for (TInt y = 0 ; y<FONT_HEIGHT ; y++)
341 for (TInt x = 0 ; x<Screenwidth ; x++)
342 ColourPixel(x, y, KBackground);
348 Move the cursor down the screen, scrolling the text area if necessary
351 if (++YPos==(MAX_ROW-3))
360 Move the cursor up the screen, scrolling the text area if necessary
372 Move the cursor along the screen, scrolling the text area if necessary
375 if (++XPos==MAX_COLUMN)
384 Move the cursor backwards along the screen, scrolling the text area if necessary
394 void SetPos(TInt X, TInt Y)
396 Set the cursor to a point on the screen
397 @param X Character's column
398 @param Y Character's row
405 void PutChar(TUint aChar)
407 Write a character to the screen then moves the cursor to the next position,
408 scrolling the screen if necessary
409 @param aChar Character to write
414 case 0x08: CurLeft(); return; // BS '\b'
415 case 0x09: CurRight(); return; // HT '\t'
416 case 0x0a: CurDown(); return; // LF '\n'
417 case 0x0b: CurUp(); return; // VT '\v'
418 case 0x0c: ClearScreen(); return; // FF '\f'
419 case 0x0d: XPos=0; return; // CR '\r'
422 DisplayChar(aChar,XPos,YPos,Colours);
423 if (++XPos==MAX_COLUMN) // chars per line
426 if (++YPos==(MAX_ROW-3)) // lines per screen - 3 for progress bars & stats
428 YPos=(MAX_ROW-4); // lines per screen - 4
434 GLDEF_C void PrintToScreen(TRefByValue<const TDesC> aFmt, ...)
440 aBuf.AppendFormatList(aFmt,list);
442 //RDebug::RawPrint(aBuf);
445 void PutString(const TDesC& aBuf)
447 For each character in the given string write it to the screen
448 @param aString String of characters to write
451 const TText* pS=aBuf.Ptr();
452 const TText* pE=pS+aBuf.Length();
460 GLDEF_C void InitProgressBar(TInt aId, TUint aLimit, const TDesC& aBuf)
462 Initialise a progress bar, writes a label and sets the pixels to the
464 @param aId configure Bar0 or Bar1
465 @param aLimit Sets the upper bound of the value given to Update
466 @param aTitle Label to place before the progress bar (7 characters wide)
469 const TText* aTitle=aBuf.Ptr();
470 TInt line=aId ? PROGRESSBAR0_ROW : PROGRESSBAR1_ROW;
479 while ((c=*aTitle++)!=0 && x<7)
481 DisplayChar(c,x,line,Colours);
486 for (; x<(MAX_COLUMN-1); ++x)
487 DisplayChar(0x7f,x,line,IPColour[aId]);
490 GLDEF_C void UpdateProgressBar(TInt aId, TUint aProgress)
492 Update a progress bar filling in the bar to a new position
493 If ENABLE_TRANSFER_STATS has been defined at build time the function will
494 generate some simple statistics.
495 @param aId update Bar0 or Bar1
496 @param aProgress The point value between 0 and the given aLimit
499 TInt line=aId ? PROGRESSBAR0_ROW : PROGRESSBAR1_ROW;
500 TUint old_pixels=Pixels[aId];
502 #ifdef ENABLE_TRANSFER_STATS
503 // turn this on and get a few statistics as it loads
505 if (StartTime == 0) {
506 StartTime = User::NTickCount();
507 ProgressTime[aId] = StartTime;
509 TUint avg_bps=0, bps=0, eta=0;
510 TUint32 timenow = User::NTickCount();
511 TUint32 delta_time = timenow - ProgressTime[aId];
512 ProgressTime[aId] = timenow;
514 bps = ((aProgress - Progress[aId]) * 1000) / delta_time; // delta bytes / delta milliseconds
516 delta_time = (timenow - StartTime); // milliseconds since started
518 avg_bps = ((TUint64)aProgress * 1000) / delta_time;
519 eta = (Limit[aId] - aProgress) / avg_bps;
523 TInt savedXPos=XPos, savedYPos=YPos;
526 // Printf("C/s avg: %7d point: %7d ETA: %d ", avg_bps, bps, eta);
527 PrintToScreen(_L("point: %7d ETA: %d "), bps, eta);
533 Progress[aId]=aProgress;
534 Int64 prog64=aProgress;
535 prog64*=(Screenwidth - (8*FONT_WIDTH)); // screenwidth in pixels - 8 characters
537 TUint pixels=(TUint)prog64;
538 if (pixels>old_pixels)
542 while (old_pixels<pixels)
544 for (TInt i=0; i<6; ++i)
545 ColourPixel( old_pixels + (7*FONT_WIDTH), (line * FONT_HEIGHT) + 2 + i , (PColour[aId]>>8));
554 Reads the properties of the screen from the HAL and configures the settings so
555 this driver can colour in pixels.
564 HAL::Get(HAL::EDisplayMode, iDisplayMode);
565 iBitsPerPixel = iDisplayMode; //getbpp needs the current mode as its param
566 HAL::Get(HAL::EDisplayBitsPerPixel, iBitsPerPixel);
568 iIsPalettized = iDisplayMode; //ispalettized needs the current mode as its param
569 HAL::Get(HAL::EDisplayIsPalettized, iIsPalettized);
571 HAL::Get(HAL::EDisplayMemoryAddress, iScreenAddress);
573 offset = iDisplayMode;
574 HAL::Get(HAL::EDisplayOffsetToFirstPixel, offset);
575 iScreenAddress += offset;
577 // get the dimentions of the screen
578 HAL::Get(HAL::EDisplayXPixels, Screenwidth);
579 HAL::Get(HAL::EDisplayYPixels, Screenheight);
581 Screen = (TUint8 *)iScreenAddress;
584 RDebug::Printf("EDisplayMode %d", iDisplayMode);
585 RDebug::Printf("EDisplayBitsPerPixel %d", iBitsPerPixel);
586 RDebug::Printf("EDisplayIsPalettized %d", iIsPalettized);
587 RDebug::Printf("EDisplayMemoryAddress 0x%x (after offset)", iScreenAddress);
588 RDebug::Printf("EDisplayOffsetToFirstPixel %d",offset);
589 RDebug::Printf("EDisplayXPixels %d",Screenwidth);
590 RDebug::Printf("EDisplayYPixels %d", Screenheight);
593 // get the bits per pixel to work out the size
594 if (iBitsPerPixel == 32)
598 else if (iBitsPerPixel == 16)
602 else if (iBitsPerPixel == 8)
605 // derive where the palette is located - assumes when no offset to first
606 // pixel the palette is at end of framebuffer.
608 if(vidBuf().iOffsetToFirstPixel)
609 pV=(TUint8*)(vidBuf().iVideoAddress);
611 pV=(TUint8*)(vidBuf().iVideoAddress)+SCREEN_SIZE;
613 // Kern::Printf("Screenbuffer 0x%x palette 0x%x (%dx%d)",Screen,pV,Screenwidth,Screenheight);
615 memcpy(pV,Palette,32);
620 RDebug::Printf("BOOTLDR display: Unsupported bpp %d",iBitsPerPixel);