Changeset 8dc12ac in mainline for uspace/srv/fb/serial_console.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 */
Note:
See TracChangeset
for help on using the changeset viewer.