Changeset 8dc12ac in mainline
- Timestamp:
- 2009-06-03T18:41:27Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d0e461
- Parents:
- 424cd43
- Location:
- uspace/srv/fb
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fb/ega.c
r424cd43 r8dc12ac 50 50 #include <ipc/services.h> 51 51 #include <libarch/ddi.h> 52 #include < console/style.h>53 #include < console/color.h>52 #include <io/style.h> 53 #include <io/color.h> 54 54 #include <sys/types.h> 55 55 … … 71 71 int ega_inverted_color = 0xf0; 72 72 73 #define NORMAL_COLOR ega_normal_color 73 #define NORMAL_COLOR ega_normal_color 74 74 #define INVERTED_COLOR ega_inverted_color 75 75 … … 96 96 } 97 97 98 static void cursor_goto(unsigned int row, unsigned int col)98 static void cursor_goto(unsigned int col, unsigned int row) 99 99 { 100 100 int ega_cursor; … … 145 145 } 146 146 147 static void printchar(wchar_t c, unsigned int row, unsigned int col)147 static void printchar(wchar_t c, unsigned int col, unsigned int row) 148 148 { 149 149 scr_addr[(row * scr_width + col) * 2] = ega_glyph(c); … … 242 242 { 243 243 switch (a->t) { 244 case at_style: return style_to_ega_style(a->a.s.style); 245 case at_rgb: return rgb_to_ega_style(a->a.r.fg_color, a->a.r.bg_color); 246 case at_idx: return color_to_ega_style(a->a.i.fg_color, 247 a->a.i.bg_color, a->a.i.flags); 248 default: return INVERTED_COLOR; 244 case at_style: 245 return style_to_ega_style(a->a.s.style); 246 case at_rgb: 247 return rgb_to_ega_style(a->a.r.fg_color, a->a.r.bg_color); 248 case at_idx: 249 return color_to_ega_style(a->a.i.fg_color, 250 a->a.i.bg_color, a->a.i.flags); 251 default: 252 return INVERTED_COLOR; 249 253 } 250 254 } … … 321 325 case FB_PUTCHAR: 322 326 c = IPC_GET_ARG1(call); 327 col = IPC_GET_ARG2(call); 328 row = IPC_GET_ARG3(call); 329 if (col >= scr_width || row >= scr_height) { 330 retval = EINVAL; 331 break; 332 } 333 printchar(c, col, row); 334 retval = 0; 335 break; 336 case FB_CURSOR_GOTO: 337 col = IPC_GET_ARG1(call); 323 338 row = IPC_GET_ARG2(call); 324 col = IPC_GET_ARG3(call);325 if (col >= scr_width || row >= scr_height) {326 retval = EINVAL;327 break;328 }329 printchar(c, row, col);330 retval = 0;331 break;332 case FB_CURSOR_GOTO:333 row = IPC_GET_ARG1(call);334 col = IPC_GET_ARG2(call);335 339 if (row >= scr_height || col >= scr_width) { 336 340 retval = EINVAL; 337 341 break; 338 342 } 339 cursor_goto( row, col);343 cursor_goto(col, row); 340 344 retval = 0; 341 345 break; -
uspace/srv/fb/ega.h
r424cd43 r8dc12ac 28 28 29 29 /** @addtogroup egafb 30 * @brief 30 * @brief HelenOS EGA framebuffer. 31 31 * @ingroup fbs 32 32 * @{ 33 */ 33 */ 34 34 /** @file 35 35 */ … … 44 44 /** @} 45 45 */ 46 -
uspace/srv/fb/fb.c
r424cd43 r8dc12ac 52 52 #include <kernel/errno.h> 53 53 #include <kernel/genarch/fb/visuals.h> 54 #include < console/color.h>55 #include < console/style.h>54 #include <io/color.h> 55 #include <io/style.h> 56 56 #include <async.h> 57 57 #include <bool.h> … … 376 376 static void vport_redraw(viewport_t *vport) 377 377 { 378 unsigned int col; 378 379 unsigned int row; 379 unsigned int col;380 380 381 381 for (row = 0; row < vport->rows; row++) { … … 432 432 static void vport_scroll(viewport_t *vport, int lines) 433 433 { 434 unsigned int col; 434 435 unsigned int row; 435 unsigned int col;436 436 unsigned int x; 437 437 unsigned int y; … … 1565 1565 int scroll; 1566 1566 wchar_t ch; 1567 unsigned int row, col;1567 unsigned int col, row; 1568 1568 1569 1569 if ((vport->cursor_active) || (anims_enabled)) … … 1602 1602 case FB_PUTCHAR: 1603 1603 ch = IPC_GET_ARG1(call); 1604 row= IPC_GET_ARG2(call);1605 col= IPC_GET_ARG3(call);1604 col = IPC_GET_ARG2(call); 1605 row = IPC_GET_ARG3(call); 1606 1606 1607 1607 if ((col >= vport->cols) || (row >= vport->rows)) { … … 1621 1621 break; 1622 1622 case FB_CURSOR_GOTO: 1623 row= IPC_GET_ARG1(call);1624 col= IPC_GET_ARG2(call);1623 col = IPC_GET_ARG1(call); 1624 row = IPC_GET_ARG2(call); 1625 1625 1626 1626 if ((col >= vport->cols) || (row >= vport->rows)) { … … 1642 1642 break; 1643 1643 case FB_GET_CSIZE: 1644 ipc_answer_2(callid, EOK, vport-> rows, vport->cols);1644 ipc_answer_2(callid, EOK, vport->cols, vport->rows); 1645 1645 continue; 1646 1646 case FB_SCROLL: -
uspace/srv/fb/serial_console.c
r424cd43 r8dc12ac 44 44 #include <bool.h> 45 45 #include <errno.h> 46 #include <console/color.h> 47 #include <console/style.h> 46 #include <io/color.h> 47 #include <io/style.h> 48 #include <string.h> 48 49 49 50 #include "../console/screenbuffer.h" … … 129 130 } 130 131 131 void serial_goto(const unsigned int row, const unsigned int col)132 { 133 if (( row > scr_height) || (col > scr_width))132 void serial_goto(const unsigned int col, const unsigned int row) 133 { 134 if ((col > scr_width) || (row > scr_height)) 134 135 return; 135 136 … … 154 155 { 155 156 if (i > 0) { 156 serial_goto( scr_height - 1, 0);157 serial_goto(0, scr_height - 1); 157 158 while (i--) 158 159 serial_puts("\033D"); … … 236 237 serial_sgr(SGR_REVERSE_OFF); 237 238 else 238 serial_sgr(SGR_REVERSE); 239 serial_sgr(SGR_REVERSE); 239 240 } 240 241 … … 242 243 { 243 244 switch (a->t) { 244 case at_style: serial_set_style(a->a.s.style); break; 245 case at_rgb: serial_set_rgb(a->a.r.fg_color, a->a.r.bg_color); break; 246 case at_idx: serial_set_idx(a->a.i.fg_color, 247 a->a.i.bg_color, a->a.i.flags); break; 248 default: break; 245 case at_style: 246 serial_set_style(a->a.s.style); 247 break; 248 case at_rgb: 249 serial_set_rgb(a->a.r.fg_color, a->a.r.bg_color); 250 break; 251 case at_idx: 252 serial_set_idx(a->a.i.fg_color, 253 a->a.i.bg_color, a->a.i.flags); 254 break; 255 default: 256 break; 249 257 } 250 258 } … … 266 274 attrs_t *a0, *a1; 267 275 268 serial_goto( y, x);276 serial_goto(x, y); 269 277 a0 = &data[0].attrs; 270 278 serial_set_attrs(a0); … … 272 280 for (j = 0; j < h; j++) { 273 281 if (j > 0 && w != scr_width) 274 serial_goto( y, x);282 serial_goto(x, j); 275 283 276 284 for (i = 0; i < w; i++) { … … 355 363 } 356 364 draw_text_data(interbuf, col, row, w, h); 365 lastcol = col + w; 357 366 lastrow = row + h - 1; 358 lastcol = col + w;359 367 retval = 0; 360 368 break; 361 369 case FB_PUTCHAR: 362 370 c = IPC_GET_ARG1(call); 363 row= IPC_GET_ARG2(call);364 col= IPC_GET_ARG3(call);371 col = IPC_GET_ARG2(call); 372 row = IPC_GET_ARG3(call); 365 373 if ((lastcol != col) || (lastrow != row)) 366 serial_goto( row, col);374 serial_goto(col, row); 367 375 lastcol = col + 1; 368 376 lastrow = row; … … 371 379 break; 372 380 case FB_CURSOR_GOTO: 373 row = IPC_GET_ARG1(call); 374 col = IPC_GET_ARG2(call); 375 serial_goto(row, col); 381 col = IPC_GET_ARG1(call); 382 row = IPC_GET_ARG2(call); 383 serial_goto(col, row); 384 lastcol = col; 376 385 lastrow = row; 377 lastcol = col;378 386 retval = 0; 379 387 break; 380 388 case FB_GET_CSIZE: 381 ipc_answer_2(callid, EOK, scr_ height, scr_width);389 ipc_answer_2(callid, EOK, scr_width, scr_height); 382 390 continue; 383 391 case FB_CLEAR: … … 417 425 } 418 426 serial_scroll(i); 419 serial_goto(last row, lastcol);427 serial_goto(lastcol, lastrow); 420 428 retval = 0; 421 429 break; … … 446 454 } 447 455 448 /** 456 /** 449 457 * @} 450 458 */ -
uspace/srv/fb/serial_console.h
r424cd43 r8dc12ac 44 44 45 45 void serial_puts(char *str); 46 void serial_goto(const unsigned int row, const unsigned int col);46 void serial_goto(const unsigned int col, const unsigned int row); 47 47 void serial_clrscr(void); 48 48 void serial_scroll(int i);
Note:
See TracChangeset
for help on using the changeset viewer.