- Timestamp:
- 2006-06-02T10:54:45Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf9afa07
- Parents:
- 838c48e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/fb.c
r838c48e r49d072e 77 77 /* Auto-cursor position */ 78 78 int cursor_active, cur_col, cur_row; 79 int cursor_shown; 79 80 } viewport_t; 80 81 … … 396 397 } 397 398 399 static void cursor_hide(int vp) 400 { 401 viewport_t *vport = &viewports[vp]; 402 403 if (vport->cursor_active && vport->cursor_shown) { 404 invert_char(vp, vport->cur_row, vport->cur_col); 405 vport->cursor_shown = 0; 406 } 407 } 408 409 static void cursor_print(int vp) 410 { 411 viewport_t *vport = &viewports[vp]; 412 413 /* Do not check for cursor_shown */ 414 if (vport->cursor_active) { 415 invert_char(vp, vport->cur_row, vport->cur_col); 416 vport->cursor_shown = 1; 417 } 418 } 419 420 static void cursor_blink(int vp) 421 { 422 viewport_t *vport = &viewports[vp]; 423 424 if (vport->cursor_shown) 425 cursor_hide(vp); 426 else 427 cursor_print(vp); 428 } 429 398 430 /** Draw character at given position relative to viewport 399 431 * … … 407 439 viewport_t *vport = &viewports[vp]; 408 440 409 if (vport->cursor_active && (vport->cur_col != col || vport->cur_row != row)) 441 /* Optimize - do not hide cursor if we are going to overwrite it */ 442 if (vport->cursor_active && vport->cursor_shown && 443 (vport->cur_col != col || vport->cur_row != row)) 410 444 invert_char(vp, vport->cur_row, vport->cur_col); 411 445 … … 422 456 vport->cur_row--; 423 457 } 424 if (vport->cursor_active) 425 invert_char(vp, vport->cur_row, vport->cur_col); 458 cursor_print(vp); 426 459 } 427 460 … … 449 482 450 483 while (1) { 451 callid = async_get_call(&call); 484 callid = async_get_call_timeout(&call,250000); 485 if (!callid) { 486 cursor_blink(vp); 487 continue; 488 } 452 489 switch (IPC_GET_METHOD(call)) { 453 490 case IPC_M_PHONE_HUNGUP: … … 472 509 case FB_CLEAR: 473 510 clear_port(vp); 474 if (vport->cursor_active) 475 invert_char(vp, vport->cur_row, vport->cur_col); 511 cursor_print(vp); 476 512 retval = 0; 477 513 break; … … 484 520 } 485 521 retval = 0; 486 if (viewports[vp].cursor_active) { 487 invert_char(vp, vport->cur_row, vport->cur_col); 488 invert_char(vp, row, col); 489 } 522 cursor_hide(vp); 490 523 vport->cur_col = col; 491 524 vport->cur_row = row; 525 cursor_print(vp); 492 526 break; 493 527 case FB_CURSOR_VISIBILITY: 494 i = IPC_GET_ARG1(call); 528 cursor_hide(vp); 529 vport->cursor_active = IPC_GET_ARG1(call); 530 cursor_print(vp); 495 531 retval = 0; 496 if ((i && vport->cursor_active) || (!i && !vport->cursor_active))497 break;498 499 vport->cursor_active = i;500 invert_char(vp, vport->cur_row, vport->cur_col);501 532 break; 502 533 case FB_GET_CSIZE: … … 509 540 break; 510 541 } 511 if (vport->cursor_active) 512 invert_char(vp, vport->cur_row, vport->cur_col); 542 cursor_hide(vp); 513 543 scroll_port(vp, i); 514 if (vport->cursor_active) 515 invert_char(vp, vport->cur_row, vport->cur_col); 544 cursor_print(vp); 516 545 retval = 0; 517 546 break; … … 526 555 break; 527 556 } 557 cursor_hide(vp); 528 558 vp = i; 529 559 vport = &viewports[vp]; 560 cursor_print(vp); 530 561 retval = 0; 531 562 break;
Note:
See TracChangeset
for help on using the changeset viewer.