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