Changeset 50cfa6c in mainline
- Timestamp:
- 2009-07-14T21:25:13Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf5443d
- Parents:
- 7d88587
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/conf/mips32-gx.sh
r7d88587 r50cfa6c 8 8 fi 9 9 10 gxemul $@ -E testmips -C R4000 -X image.boot - d d0:"$DISK_IMG"10 gxemul $@ -E testmips -C R4000 -X image.boot -M 32 -d d0:"$DISK_IMG" -
uspace/app/tetris/screen.c
r7d88587 r50cfa6c 63 63 static int isset; /* true => terminal is in game mode */ 64 64 65 static int use_color; /* true => use colors */ 66 65 67 static const struct shape *lastshape; 66 68 … … 79 81 { 80 82 fflush(stdout); 81 console_set_rgb_color(fphone(stdout), 0xf0f0f0, color); 83 console_set_rgb_color(fphone(stdout), 0xf0f0f0, 84 use_color ? color : 0x000000); 82 85 } 83 86 … … 128 131 } 129 132 133 static int get_display_color_sup(void) 134 { 135 int rc; 136 int ccap; 137 138 rc = console_get_color_cap(fphone(stdout), &ccap); 139 if (rc != 0) 140 return 0; 141 142 return (ccap >= CONSOLE_CCAP_RGB); 143 } 144 130 145 /* 131 146 * Set up screen mode. … … 142 157 Cols = ws.ws_col; 143 158 } 159 160 use_color = get_display_color_sup(); 144 161 145 162 if ((Rows < MINROWS) || (Cols < MINCOLS)) { -
uspace/lib/libc/generic/io/console.c
r7d88587 r50cfa6c 70 70 } 71 71 72 int console_get_color_cap(int phone, int *ccap) 73 { 74 ipcarg_t ccap_tmp; 75 int rc; 76 77 rc = async_req_0_1(phone, CONSOLE_GET_COLOR_CAP, &ccap_tmp); 78 *ccap = ccap_tmp; 79 80 return rc; 81 } 82 72 83 void console_kcon_enable(int phone) 73 84 { -
uspace/lib/libc/include/io/console.h
r7d88587 r50cfa6c 44 44 } console_ev_type_t; 45 45 46 enum { 47 CONSOLE_CCAP_NONE = 0, 48 CONSOLE_CCAP_STYLE, 49 CONSOLE_CCAP_INDEXED, 50 CONSOLE_CCAP_RGB 51 }; 52 46 53 /** Console event structure. */ 47 54 typedef struct { … … 69 76 70 77 extern void console_cursor_visibility(int phone, bool show); 78 extern int console_get_color_cap(int phone, int *ccap); 71 79 extern void console_kcon_enable(int phone); 72 80 -
uspace/lib/libc/include/ipc/console.h
r7d88587 r50cfa6c 41 41 typedef enum { 42 42 CONSOLE_GET_SIZE = VFS_OUT_LAST, 43 CONSOLE_GET_COLOR_CAP, 43 44 CONSOLE_GET_EVENT, 44 45 CONSOLE_GOTO, -
uspace/lib/libc/include/ipc/fb.h
r7d88587 r50cfa6c 42 42 FB_CLEAR, 43 43 FB_GET_CSIZE, 44 FB_GET_COLOR_CAP, 44 45 FB_CURSOR_VISIBILITY, 45 46 FB_CURSOR_GOTO, … … 72 73 } fb_request_t; 73 74 75 enum { 76 FB_CCAP_NONE = 0, 77 FB_CCAP_STYLE, 78 FB_CCAP_INDEXED, 79 FB_CCAP_RGB 80 }; 81 74 82 #endif 75 83 -
uspace/srv/console/console.c
r7d88587 r50cfa6c 70 70 ipcarg_t cols; /**< Framebuffer columns */ 71 71 ipcarg_t rows; /**< Framebuffer rows */ 72 int color_cap; /**< Color capabilities (FB_CCAP_xxx) */ 72 73 } fb_info; 73 74 … … 171 172 break; 172 173 } 174 } 175 176 int ccap_fb_to_con(int ccap_fb, int *ccap_con) 177 { 178 switch (ccap_fb) { 179 case FB_CCAP_NONE: *ccap_con = CONSOLE_CCAP_NONE; break; 180 case FB_CCAP_STYLE: *ccap_con = CONSOLE_CCAP_STYLE; break; 181 case FB_CCAP_INDEXED: *ccap_con = CONSOLE_CCAP_INDEXED; break; 182 case FB_CCAP_RGB: *ccap_con = CONSOLE_CCAP_RGB; break; 183 default: return EINVAL; 184 } 185 186 return EOK; 173 187 } 174 188 … … 527 541 ipcarg_t arg2; 528 542 ipcarg_t arg3; 543 544 int cons_ccap; 545 int rc; 529 546 530 547 async_serialize_start(); … … 589 606 arg2 = fb_info.rows; 590 607 break; 608 case CONSOLE_GET_COLOR_CAP: 609 rc = ccap_fb_to_con(fb_info.color_cap, &cons_ccap); 610 if (rc != EOK) { 611 ipc_answer_0(callid, rc); 612 continue; 613 } 614 arg1 = cons_ccap; 615 break; 591 616 case CONSOLE_SET_STYLE: 592 617 fb_pending_flush(); … … 640 665 static bool console_init(void) 641 666 { 667 ipcarg_t color_cap; 668 642 669 /* Connect to keyboard driver */ 643 670 kbd_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_KEYBOARD, 0, 0); … … 675 702 async_req_0_0(fb_info.phone, FB_FLUSH); 676 703 async_req_0_2(fb_info.phone, FB_GET_CSIZE, &fb_info.cols, &fb_info.rows); 704 async_req_0_1(fb_info.phone, FB_GET_COLOR_CAP, &color_cap); 705 fb_info.color_cap = color_cap; 677 706 678 707 /* Set up shared memory buffer. */ -
uspace/srv/fb/ega.c
r7d88587 r50cfa6c 320 320 ipc_answer_2(callid, EOK, scr_width, scr_height); 321 321 continue; 322 case FB_GET_COLOR_CAP: 323 ipc_answer_1(callid, EOK, FB_CCAP_INDEXED); 324 continue; 322 325 case FB_CLEAR: 323 326 clrscr(); -
uspace/srv/fb/fb.c
r7d88587 r50cfa6c 1648 1648 ipc_answer_2(callid, EOK, vport->cols, vport->rows); 1649 1649 continue; 1650 case FB_GET_COLOR_CAP: 1651 ipc_answer_1(callid, EOK, FB_CCAP_RGB); 1652 continue; 1650 1653 case FB_SCROLL: 1651 1654 scroll = IPC_GET_ARG1(call); -
uspace/srv/fb/serial_console.c
r7d88587 r50cfa6c 389 389 ipc_answer_2(callid, EOK, scr_width, scr_height); 390 390 continue; 391 case FB_GET_COLOR_CAP: 392 ipc_answer_1(callid, EOK, color ? FB_CCAP_INDEXED : 393 FB_CCAP_STYLE); 394 continue; 391 395 case FB_CLEAR: 392 396 serial_clrscr();
Note:
See TracChangeset
for help on using the changeset viewer.