Changeset 6b5111a in mainline
- Timestamp:
- 2006-06-02T14:12:09Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5b6de81
- Parents:
- 37458472
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
console/screenbuffer.h
r37458472 r6b5111a 60 60 } 61 61 62 static inline int style_same(style_t s1, style_t s2) 63 { 64 return s1.fg_color == s2.fg_color && s1.bg_color == s2.bg_color; 65 } 66 62 67 63 68 int screenbuffer_putchar(screenbuffer_t *scr, char c); -
fb/fb.c
r37458472 r6b5111a 77 77 unsigned int rows, cols; 78 78 /* Style for text printing */ 79 int bgcolor, fgcolor;79 style_t style; 80 80 /* Auto-cursor position */ 81 81 int cursor_active, cur_col, cur_row; … … 192 192 unsigned int x; 193 193 for (x = 0; x < viewports[vp].width; x++) 194 putpixel(vp, x, y, viewports[vp]. bgcolor);194 putpixel(vp, x, y, viewports[vp].style.bg_color); 195 195 } 196 196 … … 240 240 screen.pixelbytes * viewports[vp].width); 241 241 /* Clear first row */ 242 clear_line(0, viewports[vp]. bgcolor);242 clear_line(0, viewports[vp].style.bg_color); 243 243 for (y=1;y < rows*FONT_SCANLINES; y++) 244 244 memcpy(&screen.fbaddress[POINTPOS(viewports[vp].x,viewports[vp].y+y)], … … 254 254 255 255 256 /** Draw one line of glyph at a given position */257 static void draw_glyph_line(int vp,unsigned int glline, unsigned int x, unsigned int y)258 {259 unsigned int i;260 261 for (i = 0; i < 8; i++)262 if (glline & (1 << (7 - i))) {263 putpixel(vp, x + i, y, viewports[vp].fgcolor);264 } else265 putpixel(vp, x + i, y, viewports[vp].bgcolor);266 }267 268 256 /***************************************************************/ 269 257 /* Character-console functions */ 270 258 271 259 /** Draw character at given position */ 272 static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy) 273 { 260 static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy, style_t style) 261 { 262 int i; 274 263 unsigned int y; 275 276 for (y = 0; y < FONT_SCANLINES; y++) 277 draw_glyph_line(vp ,fb_font[glyph * FONT_SCANLINES + y], sx, sy + y); 264 unsigned int glline; 265 266 for (y = 0; y < FONT_SCANLINES; y++) { 267 glline = fb_font[glyph * FONT_SCANLINES + y]; 268 for (i = 0; i < 8; i++) { 269 if (glline & (1 << (7 - i))) 270 putpixel(vp, sx + i, sy + y, style.fg_color); 271 else 272 putpixel(vp, sx + i, sy + y, style.bg_color); 273 } 274 } 278 275 } 279 276 … … 303 300 byte >>= x % 8; 304 301 if (byte & 1) 305 putpixel(vp ,startx + x, starty + y, viewports[vp]. fgcolor);302 putpixel(vp ,startx + x, starty + y, viewports[vp].style.fg_color); 306 303 } 307 304 } … … 341 338 viewports[i].cols = width / COL_WIDTH; 342 339 343 viewports[i]. bgcolor = DEFAULT_BGCOLOR;344 viewports[i]. fgcolor = DEFAULT_FGCOLOR;340 viewports[i].style.bg_color = DEFAULT_BGCOLOR; 341 viewports[i].style.fg_color = DEFAULT_FGCOLOR; 345 342 346 343 viewports[i].cur_col = 0; … … 438 435 * @param col Screen position relative to viewport 439 436 */ 440 static void draw_char(int vp, char c, unsigned int row, unsigned int col )437 static void draw_char(int vp, char c, unsigned int row, unsigned int col, style_t style) 441 438 { 442 439 viewport_t *vport = &viewports[vp]; … … 447 444 invert_char(vp, vport->cur_row, vport->cur_col); 448 445 449 draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES );446 draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES, style); 450 447 451 448 vport->cur_col = col; … … 470 467 clear_port(vp); 471 468 for (i=0; i < vport->cols * vport->rows; i++) { 472 if (data[i].character == ' ' ) /* TODO: && data[i].style==vport->style */469 if (data[i].character == ' ' && style_same(data[i].style,vport->style)) 473 470 continue; 474 draw_char(vp, data[i].character, i/vport->rows, i % vport->cols); 471 draw_char(vp, data[i].character, i/vport->rows, i % vport->cols, 472 data[i].style); 475 473 } 476 474 cursor_print(vp); … … 545 543 ipc_answer_fast(callid,0,0,0); 546 544 547 draw_char(vp, c, row, col );545 draw_char(vp, c, row, col, vport->style); 548 546 continue; /* msg already answered */ 549 547 case FB_CLEAR: … … 621 619 break; 622 620 case FB_SET_STYLE: 623 vport-> fgcolor = IPC_GET_ARG1(call);624 vport-> bgcolor = IPC_GET_ARG2(call);621 vport->style.fg_color = IPC_GET_ARG1(call); 622 vport->style.bg_color = IPC_GET_ARG2(call); 625 623 retval = 0; 626 624 break; -
libc/generic/as.c
r37458472 r6b5111a 120 120 } 121 121 122 /* TODO: make this type defined somewhere else */123 typedef sysarg_t __address;124 125 122 /** Return pointer to some unmapped area, where fits new as_area 126 123 *
Note:
See TracChangeset
for help on using the changeset viewer.