Changeset 7284260 in mainline for fb/sysio.c
- Timestamp:
- 2006-06-06T23:28:07Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bba6b09
- Parents:
- 0f09bd45
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/sysio.c
r0f09bd45 r7284260 37 37 38 38 #include "sysio.h" 39 40 #define WIDTH 80 41 #define HEIGHT 25 39 42 40 43 /* Allow only 1 connection */ … … 80 83 } 81 84 85 static void scroll(int i) 86 { 87 if (i > 0) { 88 curs_goto(HEIGHT-1, 0); 89 while (i--) 90 sysputs("\033D"); 91 } else if (i < 0) { 92 curs_goto(0,0); 93 while (i++) 94 sysputs("\033M"); 95 } 96 } 97 82 98 /** ANSI terminal emulation main thread */ 83 99 static void sysio_client_connection(ipc_callid_t iid, ipc_call_t *icall) … … 91 107 int newcol,newrow; 92 108 int fgcolor,bgcolor; 109 int i; 93 110 94 111 if (client_connected) { … … 120 137 newcol = IPC_GET_ARG2(call); 121 138 curs_goto(newrow, newcol); 139 lastrow = newrow; 140 lastcol = newcol; 122 141 break; 123 142 case FB_GET_CSIZE: 124 ipc_answer_fast(callid, 0, 25, 80);143 ipc_answer_fast(callid, 0, HEIGHT, WIDTH); 125 144 continue; 126 145 case FB_CLEAR: … … 131 150 fgcolor = IPC_GET_ARG1(call); 132 151 bgcolor = IPC_GET_ARG2(call); 133 if (fgcolor > bgcolor) 152 if (bgcolor == 0xf0f0f0) 153 set_style(0); 154 else if (fgcolor > bgcolor) 134 155 set_style(0); 135 156 else … … 137 158 retval = 0; 138 159 break; 160 case FB_SCROLL: 161 i = IPC_GET_ARG1(call); 162 if (i > HEIGHT || i < -HEIGHT) { 163 retval = EINVAL; 164 break; 165 } 166 scroll(i); 167 curs_goto(lastrow, lastcol); 168 retval = 0; 169 break; 170 139 171 default: 140 172 retval = ENOENT; … … 150 182 clrscr(); 151 183 curs_goto(0,0); 184 /* Set scrolling region to 0-25 lines */ 185 sysputs("\033[0;25r"); 152 186 }
Note:
See TracChangeset
for help on using the changeset viewer.