Rev 1649 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1649 | Rev 1719 | ||
---|---|---|---|
Line 118... | Line 118... | ||
118 | 118 | ||
119 | if (client_connected) { |
119 | if (client_connected) { |
120 | ipc_answer_fast(iid, ELIMIT, 0,0); |
120 | ipc_answer_fast(iid, ELIMIT, 0,0); |
121 | return; |
121 | return; |
122 | } |
122 | } |
- | 123 | ||
123 | client_connected = 1; |
124 | client_connected = 1; |
124 | ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */ |
125 | ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */ |
125 | while (1) { |
126 | while (1) { |
126 | callid = async_get_call(&call); |
127 | callid = async_get_call(&call); |
127 | switch (IPC_GET_METHOD(call)) { |
128 | switch (IPC_GET_METHOD(call)) { |
128 | case IPC_M_PHONE_HUNGUP: |
129 | case IPC_M_PHONE_HUNGUP: |
129 | client_connected = 0; |
130 | client_connected = 0; |
130 | ipc_answer_fast(callid,0,0,0); |
131 | ipc_answer_fast(callid, 0, 0, 0); |
131 | return; /* Exit thread */ |
132 | return; /* Exit thread */ |
132 | case FB_PUTCHAR: |
133 | case FB_PUTCHAR: |
133 | c = IPC_GET_ARG1(call); |
134 | c = IPC_GET_ARG1(call); |
134 | newrow = IPC_GET_ARG2(call); |
135 | newrow = IPC_GET_ARG2(call); |
135 | newcol = IPC_GET_ARG3(call); |
136 | newcol = IPC_GET_ARG3(call); |
136 | if (lastcol != newcol || lastrow!=newrow) |
137 | if ((lastcol != newcol) || (lastrow != newrow)) |
- | 138 | curs_goto(newrow, newcol); |
|
- | 139 | lastcol = newcol + 1; |
|
- | 140 | lastrow = newrow; |
|
- | 141 | sysput(c); |
|
- | 142 | retval = 0; |
|
- | 143 | break; |
|
- | 144 | case FB_CURSOR_GOTO: |
|
- | 145 | newrow = IPC_GET_ARG1(call); |
|
- | 146 | newcol = IPC_GET_ARG2(call); |
|
137 | curs_goto(newrow, newcol); |
147 | curs_goto(newrow, newcol); |
138 | lastcol = newcol + 1; |
- | |
139 | lastrow = newrow; |
148 | lastrow = newrow; |
140 | sysput(c); |
- | |
141 | retval = 0; |
- | |
142 | break; |
- | |
143 | case FB_CURSOR_GOTO: |
- | |
144 | newrow = IPC_GET_ARG1(call); |
- | |
145 | newcol = IPC_GET_ARG2(call); |
- | |
146 | curs_goto(newrow, newcol); |
- | |
147 | lastrow = newrow; |
- | |
148 | lastcol = newcol; |
149 | lastcol = newcol; |
149 | break; |
- | |
150 | case FB_GET_CSIZE: |
- | |
151 | ipc_answer_fast(callid, 0, HEIGHT, WIDTH); |
- | |
152 | continue; |
- | |
153 | case FB_CLEAR: |
- | |
154 | clrscr(); |
- | |
155 | retval = 0; |
- | |
156 | break; |
- | |
157 | case FB_SET_STYLE: |
- | |
158 | fgcolor = IPC_GET_ARG1(call); |
- | |
159 | bgcolor = IPC_GET_ARG2(call); |
- | |
160 | if (fgcolor < bgcolor) |
- | |
161 | set_style(0); |
- | |
162 | else |
- | |
163 | set_style(7); |
- | |
164 | retval = 0; |
150 | retval = 0; |
165 | break; |
- | |
166 | case FB_SCROLL: |
- | |
167 | i = IPC_GET_ARG1(call); |
- | |
168 | if (i > HEIGHT || i < -HEIGHT) { |
- | |
169 | retval = EINVAL; |
- | |
170 | break; |
151 | break; |
- | 152 | case FB_GET_CSIZE: |
|
- | 153 | ipc_answer_fast(callid, 0, HEIGHT, WIDTH); |
|
- | 154 | continue; |
|
- | 155 | case FB_CLEAR: |
|
- | 156 | clrscr(); |
|
- | 157 | retval = 0; |
|
- | 158 | break; |
|
- | 159 | case FB_SET_STYLE: |
|
- | 160 | fgcolor = IPC_GET_ARG1(call); |
|
- | 161 | bgcolor = IPC_GET_ARG2(call); |
|
- | 162 | if (fgcolor < bgcolor) |
|
- | 163 | set_style(0); |
|
- | 164 | else |
|
- | 165 | set_style(7); |
|
- | 166 | retval = 0; |
|
- | 167 | break; |
|
- | 168 | case FB_SCROLL: |
|
- | 169 | i = IPC_GET_ARG1(call); |
|
- | 170 | if ((i > HEIGHT) || (i < -HEIGHT)) { |
|
- | 171 | retval = EINVAL; |
|
- | 172 | break; |
|
171 | } |
173 | } |
172 | scroll(i); |
174 | scroll(i); |
173 | curs_goto(lastrow, lastcol); |
175 | curs_goto(lastrow, lastcol); |
174 | retval = 0; |
176 | retval = 0; |
175 | break; |
177 | break; |
176 | - | ||
177 | default: |
178 | default: |
178 | retval = ENOENT; |
179 | retval = ENOENT; |
179 | } |
180 | } |
- | 181 | ||
180 | ipc_answer_fast(callid,retval,0,0); |
182 | ipc_answer_fast(callid, retval, 0, 0); |
181 | } |
183 | } |
182 | } |
184 | } |
183 | 185 | ||
184 | /** ANSI terminal emulation initialization */ |
186 | /** ANSI terminal emulation initialization */ |
185 | void sysio_init(void) |
187 | void sysio_init(void) |
Line 191... | Line 193... | ||
191 | sysputs("\033[0;25r"); |
193 | sysputs("\033[0;25r"); |
192 | } |
194 | } |
193 | 195 | ||
194 | /** |
196 | /** |
195 | * @} |
197 | * @} |
196 | */ |
198 | */ |
197 | - |