Rev 2015 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2015 | Rev 2025 | ||
---|---|---|---|
Line 149... | Line 149... | ||
149 | { |
149 | { |
150 | int i; |
150 | int i; |
151 | 151 | ||
152 | for (i=0; i < scr_width*scr_height; i++) { |
152 | for (i = 0; i < scr_width * scr_height; i++) { |
153 | scr_addr[i*2] = data[i].character; |
153 | scr_addr[i * 2] = data[i].character; |
154 | scr_addr[i*2+1] = EGA_STYLE(data[i].style.fg_color, data[i].style.bg_color); |
154 | scr_addr[i * 2 + 1] = EGA_STYLE(data[i].style.fg_color, |
- | 155 | data[i].style.bg_color); |
|
155 | } |
156 | } |
156 | } |
157 | } |
157 | 158 | ||
158 | static int save_screen(void) |
159 | static int save_screen(void) |
159 | { |
160 | { |
Line 171... | Line 172... | ||
171 | } |
172 | } |
172 | 173 | ||
173 | static int print_screen(int i) |
174 | static int print_screen(int i) |
174 | { |
175 | { |
175 | if (saved_screens[i].data) |
176 | if (saved_screens[i].data) |
176 | memcpy(scr_addr, saved_screens[i].data, 2 * scr_width * scr_height); |
177 | memcpy(scr_addr, saved_screens[i].data, 2 * scr_width * |
- | 178 | scr_height); |
|
- | 179 | else |
|
177 | else return EINVAL; |
180 | return EINVAL; |
178 | return i; |
181 | return i; |
179 | } |
182 | } |
180 | 183 | ||
181 | 184 | ||
182 | static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
185 | static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
Line 206... | Line 209... | ||
206 | ipc_answer_fast(callid,0,0,0); |
209 | ipc_answer_fast(callid, 0, 0, 0); |
207 | return; /* Exit thread */ |
210 | return; /* Exit thread */ |
208 | case IPC_M_AS_AREA_SEND: |
211 | case IPC_M_AS_AREA_SEND: |
209 | /* We accept one area for data interchange */ |
212 | /* We accept one area for data interchange */ |
210 | intersize = IPC_GET_ARG2(call); |
213 | intersize = IPC_GET_ARG2(call); |
211 | if (intersize >= scr_width*scr_height*sizeof(*interbuf)) { |
214 | if (intersize >= scr_width * scr_height * |
- | 215 | sizeof(*interbuf)) { |
|
212 | receive_comm_area(callid,&call,(void *)&interbuf); |
216 | receive_comm_area(callid, &call, (void *) |
- | 217 | &interbuf); |
|
213 | continue; |
218 | continue; |
214 | } |
219 | } |
215 | retval = EINVAL; |
220 | retval = EINVAL; |
216 | break; |
221 | break; |
217 | case FB_DRAW_TEXT_DATA: |
222 | case FB_DRAW_TEXT_DATA: |
Line 250... | Line 255... | ||
250 | cursor_goto(row,col); |
255 | cursor_goto(row, col); |
251 | retval = 0; |
256 | retval = 0; |
252 | break; |
257 | break; |
253 | case FB_SCROLL: |
258 | case FB_SCROLL: |
254 | i = IPC_GET_ARG1(call); |
259 | i = IPC_GET_ARG1(call); |
255 | if (i > scr_height || i < (- (int)scr_height)) { |
260 | if (i > scr_height || i < -((int) scr_height)) { |
256 | retval = EINVAL; |
261 | retval = EINVAL; |
257 | break; |
262 | break; |
258 | } |
263 | } |
259 | scroll(i); |
264 | scroll(i); |
260 | retval = 0; |
265 | retval = 0; |
Line 302... | Line 307... | ||
302 | int ega_init(void) |
307 | int ega_init(void) |
303 | { |
308 | { |
304 | void *ega_ph_addr; |
309 | void *ega_ph_addr; |
305 | size_t sz; |
310 | size_t sz; |
306 | 311 | ||
307 | - | ||
308 | ega_ph_addr=(void *)sysinfo_value("fb.address.physical"); |
312 | ega_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
309 | scr_width=sysinfo_value("fb.width"); |
313 | scr_width = sysinfo_value("fb.width"); |
310 | scr_height=sysinfo_value("fb.height"); |
314 | scr_height = sysinfo_value("fb.height"); |
311 | iospace_enable(task_get_id(), (void *) EGA_IO_ADDRESS, 2); |
315 | iospace_enable(task_get_id(), (void *) EGA_IO_ADDRESS, 2); |
312 | 316 |