Changes in kernel/genarch/src/fb/fb.c [c43b89e8:adec5b45] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/fb.c
rc43b89e8 radec5b45 35 35 36 36 #include <genarch/fb/font-8x16.h> 37 #include <genarch/fb/logo-196x66.h> 37 38 #include <genarch/fb/fb.h> 38 39 #include <console/chardev.h> … … 52 53 #include <byteorder.h> 53 54 54 #define BG_COLOR 0x00 162055 #define FG_COLOR 0xf 3cf6555 #define BG_COLOR 0x000080 56 #define FG_COLOR 0xffff00 56 57 #define INV_COLOR 0xaaaaaa 57 58 … … 92 93 unsigned int yres; 93 94 95 unsigned int ylogo; 96 unsigned int ytrim; 94 97 unsigned int rowtrim; 95 98 … … 210 213 } 211 214 215 /** Hide logo and refresh screen 216 * 217 */ 218 static void logo_hide(fb_instance_t *instance) 219 { 220 instance->ylogo = 0; 221 instance->ytrim = instance->yres; 222 instance->rowtrim = instance->rows; 223 224 if ((!instance->parea.mapped) || (console_override)) 225 fb_redraw_internal(instance); 226 } 227 212 228 /** Draw character at given position 213 229 * … … 220 236 unsigned int yd; 221 237 238 if (y >= instance->ytrim) 239 logo_hide(instance); 240 222 241 if (!overlay) 223 242 instance->backbuf[BB_POS(instance, col, row)] = glyph; … … 225 244 if ((!instance->parea.mapped) || (console_override)) { 226 245 for (yd = 0; yd < FONT_SCANLINES; yd++) 227 memcpy(&instance->addr[FB_POS(instance, x, y + yd )],246 memcpy(&instance->addr[FB_POS(instance, x, y + yd + instance->ylogo)], 228 247 &instance->glyphs[GLYPH_POS(instance, glyph, yd)], 229 248 instance->glyphscanline); … … 237 256 static void screen_scroll(fb_instance_t *instance) 238 257 { 258 if (instance->ylogo > 0) { 259 logo_hide(instance); 260 return; 261 } 262 239 263 if ((!instance->parea.mapped) || (console_override)) { 240 264 unsigned int row; … … 366 390 instance->position / instance->cols, false); 367 391 instance->position++; 368 } while (( (instance->position % instance->cols) % 8 != 0) &&369 (instance->position < instance->cols * instance->rows));392 } while ((instance->position % 8) 393 && (instance->position < instance->cols * instance->rows)); 370 394 break; 371 395 default: … … 388 412 static void fb_redraw_internal(fb_instance_t *instance) 389 413 { 414 if (instance->ylogo > 0) { 415 unsigned int y; 416 417 for (y = 0; y < LOGO_HEIGHT; y++) { 418 unsigned int x; 419 420 for (x = 0; x < instance->xres; x++) 421 instance->rgb_conv(&instance->addr[FB_POS(instance, x, y)], 422 (x < LOGO_WIDTH) ? 423 fb_logo[y * LOGO_WIDTH + x] : 424 LOGO_COLOR); 425 } 426 } 427 390 428 unsigned int row; 391 429 392 430 for (row = 0; row < instance->rowtrim; row++) { 393 unsigned int y = ROW2Y(row);431 unsigned int y = instance->ylogo + ROW2Y(row); 394 432 unsigned int yd; 395 433 … … 414 452 (instance->xres - COL2X(instance->cols)) * instance->pixelbytes; 415 453 416 for (y = 0; y < instance->yres; y++)454 for (y = instance->ylogo; y < instance->yres; y++) 417 455 memcpy(&instance->addr[FB_POS(instance, COL2X(instance->cols), y)], 418 456 instance->bgscan, size); 419 457 } 420 458 421 if (ROW2Y(instance->rowtrim) < instance->yres) {459 if (ROW2Y(instance->rowtrim) + instance->ylogo < instance->yres) { 422 460 unsigned int y; 423 461 424 for (y = ROW2Y(instance->rowtrim); y < instance->yres; y++) 462 for (y = ROW2Y(instance->rowtrim) + instance->ylogo; 463 y < instance->yres; y++) 425 464 memcpy(&instance->addr[FB_POS(instance, 0, y)], 426 465 instance->bgscan, instance->bgscanbytes); … … 528 567 instance->rows = Y2ROW(instance->yres); 529 568 530 instance->rowtrim = instance->rows; 569 if (instance->yres > LOGO_HEIGHT) { 570 instance->ylogo = LOGO_HEIGHT; 571 instance->rowtrim = instance->rows - Y2ROW(instance->ylogo); 572 if (instance->ylogo % FONT_SCANLINES > 0) 573 instance->rowtrim--; 574 instance->ytrim = ROW2Y(instance->rowtrim); 575 } else { 576 instance->ylogo = 0; 577 instance->ytrim = instance->yres; 578 instance->rowtrim = instance->rows; 579 } 531 580 532 581 instance->glyphscanline = FONT_WIDTH * instance->pixelbytes;
Note:
See TracChangeset
for help on using the changeset viewer.