Rev 1694 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1694 | Rev 1720 | ||
---|---|---|---|
Line 156... | Line 156... | ||
156 | } |
156 | } |
157 | 157 | ||
158 | static int save_screen(void) |
158 | static int save_screen(void) |
159 | { |
159 | { |
160 | int i; |
160 | int i; |
161 | short *mem; |
161 | |
162 | for (i=0 ;( i < MAX_SAVED_SCREENS ) && (saved_screens[i].data); i++); |
162 | for (i=0; ( i < MAX_SAVED_SCREENS ) && (saved_screens[i].data); i++) |
- | 163 | ; |
|
163 | if (i == MAX_SAVED_SCREENS) |
164 | if (i == MAX_SAVED_SCREENS) |
164 | return EINVAL; |
165 | return EINVAL; |
165 | if (!(saved_screens[i].data=malloc( 2 * scr_width*scr_height ))) |
166 | if (!(saved_screens[i].data=malloc( 2 * scr_width*scr_height ))) |
166 | return ENOMEM; |
167 | return ENOMEM; |
167 | memcpy (saved_screens[i].data ,scr_addr ,2 * scr_width * scr_height) |
168 | memcpy(saved_screens[i].data, scr_addr, 2 * scr_width * scr_height); |
168 | ; |
169 | |
169 | return i; |
170 | return i; |
170 | } |
171 | } |
171 | 172 | ||
172 | static int print_screen(int i) |
173 | static int print_screen(int i) |
173 | { |
174 | { |
174 | if (saved_screens[i].data) |
175 | if (saved_screens[i].data) |
175 | memcpy (scr_addr,saved_screens[i].data, 2 * scr_width * scr_height); |
176 | memcpy(scr_addr, saved_screens[i].data, 2 * scr_width * scr_height); |
176 | else return EINVAL; |
177 | else return EINVAL; |
177 | return i; |
178 | return i; |
178 | } |
179 | } |
179 | 180 | ||
180 | 181 | ||
Line 206... | Line 207... | ||
206 | return; /* Exit thread */ |
207 | return; /* Exit thread */ |
207 | case IPC_M_AS_AREA_SEND: |
208 | case IPC_M_AS_AREA_SEND: |
208 | /* We accept one area for data interchange */ |
209 | /* We accept one area for data interchange */ |
209 | intersize = IPC_GET_ARG2(call); |
210 | intersize = IPC_GET_ARG2(call); |
210 | if (intersize >= scr_width*scr_height*sizeof(*interbuf)) { |
211 | if (intersize >= scr_width*scr_height*sizeof(*interbuf)) { |
211 | receive_comm_area(callid,&call,(void **)&interbuf); |
212 | receive_comm_area(callid,&call,(void *)&interbuf); |
212 | continue; |
213 | continue; |
213 | } |
214 | } |
214 | retval = EINVAL; |
215 | retval = EINVAL; |
215 | break; |
216 | break; |
216 | case FB_DRAW_TEXT_DATA: |
217 | case FB_DRAW_TEXT_DATA: |
Line 267... | Line 268... | ||
267 | break; |
268 | break; |
268 | case FB_SET_STYLE: |
269 | case FB_SET_STYLE: |
269 | fgcolor = IPC_GET_ARG1(call); |
270 | fgcolor = IPC_GET_ARG1(call); |
270 | bgcolor = IPC_GET_ARG2(call); |
271 | bgcolor = IPC_GET_ARG2(call); |
271 | style = EGA_STYLE(fgcolor, bgcolor); |
272 | style = EGA_STYLE(fgcolor, bgcolor); |
- | 273 | retval = 0; |
|
272 | break; |
274 | break; |
273 | case FB_VP_DRAW_PIXMAP: |
275 | case FB_VP_DRAW_PIXMAP: |
274 | i = IPC_GET_ARG2(call); |
276 | i = IPC_GET_ARG2(call); |
275 | retval = print_screen(i); |
277 | retval = print_screen(i); |
276 | break; |
278 | break; |
Line 285... | Line 287... | ||
285 | } |
287 | } |
286 | if (saved_screens[i].data) { |
288 | if (saved_screens[i].data) { |
287 | free(saved_screens[i].data); |
289 | free(saved_screens[i].data); |
288 | saved_screens[i].data = NULL; |
290 | saved_screens[i].data = NULL; |
289 | } |
291 | } |
- | 292 | retval = 0; |
|
290 | break; |
293 | break; |
291 | 294 | ||
292 | default: |
295 | default: |
293 | retval = ENOENT; |
296 | retval = ENOENT; |
294 | } |
297 | } |