ite_ul.c revision 1.1 1 1.1 chopps /* $NetBSD: ite_ul.c,v 1.1 1995/08/18 16:15:48 chopps Exp $ */
2 1.1 chopps
3 1.1 chopps /*
4 1.1 chopps * Copyright (c) 1995 Ignatios Souvatzis
5 1.1 chopps * All rights reserved.
6 1.1 chopps *
7 1.1 chopps * Redistribution and use in source and binary forms, with or without
8 1.1 chopps * modification, are permitted provided that the following conditions
9 1.1 chopps * are met:
10 1.1 chopps * 1. Redistributions of source code must retain the above copyright
11 1.1 chopps * notice, this list of conditions and the following disclaimer.
12 1.1 chopps * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 chopps * notice, this list of conditions and the following disclaimer in the
14 1.1 chopps * documentation and/or other materials provided with the distribution.
15 1.1 chopps * 3. All advertising materials mentioning features or use of this software
16 1.1 chopps * must display the following acknowledgement:
17 1.1 chopps * This product includes software developed by Lutz Vieweg.
18 1.1 chopps * 4. The name of the author may not be used to endorse or promote products
19 1.1 chopps * derived from this software without specific prior written permission
20 1.1 chopps *
21 1.1 chopps * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 chopps * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 chopps * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 chopps * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 chopps * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 chopps * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 chopps * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 chopps * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 chopps * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 chopps * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 chopps */
32 1.1 chopps #include "grful.h"
33 1.1 chopps #if NGRFUL > 0
34 1.1 chopps
35 1.1 chopps #include <sys/param.h>
36 1.1 chopps #include <sys/conf.h>
37 1.1 chopps #include <sys/proc.h>
38 1.1 chopps #include <sys/device.h>
39 1.1 chopps #include <sys/ioctl.h>
40 1.1 chopps #include <sys/tty.h>
41 1.1 chopps #include <sys/systm.h>
42 1.1 chopps #include <dev/cons.h>
43 1.1 chopps #include <machine/cpu.h>
44 1.1 chopps #include <amiga/amiga/device.h>
45 1.1 chopps #include <amiga/amiga/isr.h>
46 1.1 chopps #include <amiga/dev/itevar.h>
47 1.1 chopps #include <amiga/dev/grfioctl.h>
48 1.1 chopps #include <amiga/dev/grfvar.h>
49 1.1 chopps #include <amiga/dev/grf_ulreg.h>
50 1.1 chopps
51 1.1 chopps #ifndef KFONT_CUSTOM
52 1.1 chopps #ifdef KFONT_8X11
53 1.1 chopps #define kernel_font_width kernel_font_width_8x11
54 1.1 chopps #define kernel_font_height kernel_font_height_8x11
55 1.1 chopps #define kernel_font_baseline kernel_font_baseline_8x11
56 1.1 chopps #define kernel_font_boldsmear kernel_font_boldsmear_8x11
57 1.1 chopps #define kernel_font_lo kernel_font_lo_8x11
58 1.1 chopps #define kernel_font_hi kernel_font_hi_8x11
59 1.1 chopps #define kernel_font kernel_font_8x11
60 1.1 chopps #define kernel_cursor kernel_cursor_8x11
61 1.1 chopps #else
62 1.1 chopps #define kernel_font_width kernel_font_width_8x8
63 1.1 chopps #define kernel_font_height kernel_font_height_8x8
64 1.1 chopps #define kernel_font_baseline kernel_font_baseline_8x8
65 1.1 chopps #define kernel_font_boldsmear kernel_font_boldsmear_8x8
66 1.1 chopps #define kernel_font_lo kernel_font_lo_8x8
67 1.1 chopps #define kernel_font_hi kernel_font_hi_8x8
68 1.1 chopps #define kernel_font kernel_font_8x8
69 1.1 chopps #define kernel_cursor kernel_cursor_8x8
70 1.1 chopps #endif
71 1.1 chopps #endif
72 1.1 chopps
73 1.1 chopps extern u_int8_t kernel_font_width, kernel_font_height, kernel_font_baseline;
74 1.1 chopps extern short kernel_font_boldsmear;
75 1.1 chopps extern u_int8_t kernel_font_lo, kernel_font_hi;
76 1.1 chopps extern u_int8_t kernel_font[], kernel_cursor[];
77 1.1 chopps
78 1.1 chopps
79 1.1 chopps #ifdef DEBUG_UL
80 1.1 chopps #define gsp_out(ba,cmd,len) gsp_dump(cmd,len); gsp_write(ba,cmd,len)
81 1.1 chopps #else
82 1.1 chopps #define gsp_out(ba,cmd,len) gsp_write(ba,cmd,len)
83 1.1 chopps #endif
84 1.1 chopps
85 1.1 chopps int ulowell_console = 1;
86 1.1 chopps
87 1.1 chopps void ulowell_cursor __P((struct ite_softc *,int));
88 1.1 chopps void ulowell_scroll __P((struct ite_softc *,int,int,int,int));
89 1.1 chopps void ulowell_deinit __P((struct ite_softc *));
90 1.1 chopps void ulowell_clear __P((struct ite_softc *,int,int,int,int));
91 1.1 chopps void ulowell_putc __P((struct ite_softc *,int,int,int,int));
92 1.1 chopps void ulowell_init __P((struct ite_softc *));
93 1.1 chopps
94 1.1 chopps #ifdef DEBUG_UL
95 1.1 chopps void gsp_dump __P((u_int16_t *,int));
96 1.1 chopps #endif
97 1.1 chopps
98 1.1 chopps /* Text always on overlay plane, so: */
99 1.1 chopps
100 1.1 chopps #define UL_FG(ip) 0xFFFF
101 1.1 chopps #define UL_BG(ip) 0x0000
102 1.1 chopps
103 1.1 chopps /*
104 1.1 chopps * this function is called from grf_ul to init the grf_softc->g_conpri
105 1.1 chopps * field each time a ulowell board is attached.
106 1.1 chopps */
107 1.1 chopps int
108 1.1 chopps grful_cnprobe()
109 1.1 chopps {
110 1.1 chopps static int done;
111 1.1 chopps int uv;
112 1.1 chopps
113 1.1 chopps if (ulowell_console && done == 0)
114 1.1 chopps uv = CN_INTERNAL;
115 1.1 chopps else
116 1.1 chopps uv = CN_NORMAL;
117 1.1 chopps done = 1;
118 1.1 chopps return(uv);
119 1.1 chopps }
120 1.1 chopps
121 1.1 chopps /*
122 1.1 chopps * init the required fields in the grf_softc struct for a
123 1.1 chopps * grf to function as an ite.
124 1.1 chopps */
125 1.1 chopps void
126 1.1 chopps grful_iteinit(gp)
127 1.1 chopps struct grf_softc *gp;
128 1.1 chopps {
129 1.1 chopps gp->g_iteinit = ulowell_init;
130 1.1 chopps gp->g_itedeinit = ulowell_deinit;
131 1.1 chopps gp->g_iteclear = ulowell_clear;
132 1.1 chopps gp->g_iteputc = ulowell_putc;
133 1.1 chopps gp->g_itescroll = ulowell_scroll;
134 1.1 chopps gp->g_itecursor = ulowell_cursor;
135 1.1 chopps }
136 1.1 chopps
137 1.1 chopps void
138 1.1 chopps ulowell_init(ip)
139 1.1 chopps struct ite_softc *ip;
140 1.1 chopps {
141 1.1 chopps struct gspregs *ba;
142 1.1 chopps
143 1.1 chopps u_int16_t *sp;
144 1.1 chopps u_int16_t cmd[8];
145 1.1 chopps
146 1.1 chopps int i;
147 1.1 chopps
148 1.1 chopps ba = (struct gspregs *) ip->grf->g_regkva;
149 1.1 chopps
150 1.1 chopps ip->font = kernel_font;
151 1.1 chopps ip->font_lo = kernel_font_lo;
152 1.1 chopps ip->font_hi = kernel_font_hi;
153 1.1 chopps ip->ftwidth = kernel_font_width;
154 1.1 chopps ip->ftheight = kernel_font_height;
155 1.1 chopps ip->ftbaseline = kernel_font_baseline;
156 1.1 chopps ip->ftboldsmear = kernel_font_boldsmear;
157 1.1 chopps
158 1.1 chopps /* upload font data */
159 1.1 chopps
160 1.1 chopps ba->ctrl = LBL|INCW;
161 1.1 chopps ba->hstadrh = 0xFFA2;
162 1.1 chopps ba->hstadrl = 0x0200;
163 1.1 chopps
164 1.1 chopps ba->data = 0x0000;
165 1.1 chopps ba->data = 0xFFA3;
166 1.1 chopps ba->data = ip->ftwidth;
167 1.1 chopps ba->data = ip->ftheight;
168 1.1 chopps ba->data = ip->ftbaseline;
169 1.1 chopps ba->data = 1;
170 1.1 chopps ba->data = ip->font_lo;
171 1.1 chopps ba->data = ip->font_hi;
172 1.1 chopps ba->data = ip->ftboldsmear;
173 1.1 chopps
174 1.1 chopps ba->hstadrh = 0xFFA3;
175 1.1 chopps ba->hstadrl = 0x0000;
176 1.1 chopps
177 1.1 chopps /*
178 1.1 chopps * font has to be word aligned and padded to word boundary.
179 1.1 chopps * 8 bit wide fonts will be byte swapped in the bit swap
180 1.1 chopps * routine.
181 1.1 chopps */
182 1.1 chopps
183 1.1 chopps i = (ip->font_hi - ip->font_lo + 1) * ip->ftheight;
184 1.1 chopps if (ip->ftwidth <= 8)
185 1.1 chopps i /= 2;
186 1.1 chopps for (sp = (u_int16_t *)ip->font; i>0; --i,++sp) {
187 1.1 chopps ba->data = *sp;
188 1.1 chopps }
189 1.1 chopps
190 1.1 chopps /* bitwise mirror the font: */
191 1.1 chopps
192 1.1 chopps cmd[0] = GCMD_FNTMIR;
193 1.1 chopps gsp_out(ba, cmd, 1);
194 1.1 chopps
195 1.1 chopps ip->priv = NULL;
196 1.1 chopps ip->cursor_opt = 0;
197 1.1 chopps
198 1.1 chopps if (ip->ftwidth >0 && ip->ftheight > 0) {
199 1.1 chopps ip->cols = ip->grf->g_display.gd_dwidth / ip->ftwidth;
200 1.1 chopps ip->rows = ip->grf->g_display.gd_dheight / ip->ftheight;
201 1.1 chopps }
202 1.1 chopps
203 1.1 chopps ulowell_clear(ip, 0, 0, ip->rows, ip->cols);
204 1.1 chopps
205 1.1 chopps /*
206 1.1 chopps * switch overlay plane 0 on again, in case s.b. did a GM_GRFOVOFF
207 1.1 chopps * XXX maybe this should be done on each output, by the TMS code?
208 1.1 chopps * what happens on panic?
209 1.1 chopps
210 1.1 chopps ba->ctrl = LBL;
211 1.1 chopps GSPSETHADRS(ba, 0xFE800000);
212 1.1 chopps ba->data = 0;
213 1.1 chopps ba->hstadrl = 0x0020;
214 1.1 chopps gup->gus_ovslct |= 1;
215 1.1 chopps ba->data = gup->gus_ovslct;
216 1.1 chopps */
217 1.1 chopps
218 1.1 chopps #ifdef UL_DEBUG
219 1.1 chopps printf("ulowell_init: %d %d %d %d %d %d\n", ip->ftwidth, ip->ftheight,
220 1.1 chopps ip->ftbaseline, ip->font_lo, ip->font_hi, ip->ftboldsmear);
221 1.1 chopps #endif
222 1.1 chopps }
223 1.1 chopps
224 1.1 chopps
225 1.1 chopps void ulowell_cursor(struct ite_softc *ip, int flag)
226 1.1 chopps {
227 1.1 chopps struct gspregs *ba;
228 1.1 chopps u_int16_t cmd[7];
229 1.1 chopps int pos;
230 1.1 chopps
231 1.1 chopps ba = (struct gspregs *)ip->grf->g_regkva;
232 1.1 chopps
233 1.1 chopps if (flag == END_CURSOROPT)
234 1.1 chopps --ip->cursor_opt;
235 1.1 chopps else if (flag == START_CURSOROPT) {
236 1.1 chopps if (!ip->cursor_opt)
237 1.1 chopps ulowell_cursor(ip, ERASE_CURSOR);
238 1.1 chopps ++ip->cursor_opt;
239 1.1 chopps return; /* if we are already opted */
240 1.1 chopps }
241 1.1 chopps
242 1.1 chopps if (ip->cursor_opt)
243 1.1 chopps return; /* if we are still nested. */
244 1.1 chopps
245 1.1 chopps /* else we draw the cursor */
246 1.1 chopps
247 1.1 chopps if (flag != DRAW_CURSOR && flag != END_CURSOROPT) {
248 1.1 chopps /* erase cursor */
249 1.1 chopps #if 0
250 1.1 chopps cmd[0] = GCMD_PIXBLT;
251 1.1 chopps cmd[1] = 1024 - ip->ftwidth;
252 1.1 chopps cmd[2] = 1024 - ip->ftheight;
253 1.1 chopps cmd[3] = ip->ftwidth;
254 1.1 chopps cmd[4] = ip->ftheight;
255 1.1 chopps cmd[5] = ip->cursorx * ip->ftwidth;
256 1.1 chopps cmd[6] = ip->cursory * ip->ftheight;
257 1.1 chopps gsp_out(ba, cmd, 7);
258 1.1 chopps #endif
259 1.1 chopps cmd[0] = GCMD_FILL;
260 1.1 chopps cmd[1] = UL_FG(ip);
261 1.1 chopps cmd[2] = ip->cursorx * ip->ftwidth;
262 1.1 chopps cmd[3] = ip->cursory * ip->ftheight;
263 1.1 chopps cmd[4] = ip->ftwidth;
264 1.1 chopps cmd[5] = ip->ftheight;
265 1.1 chopps cmd[6] = 10; /* thats src xor dst */
266 1.1 chopps gsp_out(ba, cmd, 7);
267 1.1 chopps }
268 1.1 chopps
269 1.1 chopps if (flag != DRAW_CURSOR && flag != MOVE_CURSOR &&
270 1.1 chopps flag != END_CURSOROPT)
271 1.1 chopps return;
272 1.1 chopps
273 1.1 chopps /* draw cursor */
274 1.1 chopps
275 1.1 chopps ip->cursorx = min(ip->curx, ip->cols-1);
276 1.1 chopps ip->cursory = ip->cury;
277 1.1 chopps #if 0
278 1.1 chopps cmd[0] = GCMD_PIXBLT;
279 1.1 chopps cmd[1] = ip->cursorx * ip->ftwidth;
280 1.1 chopps cmd[2] = ip->cursory * ip->ftheight;
281 1.1 chopps cmd[3] = ip->ftwidth;
282 1.1 chopps cmd[4] = ip->ftheight;
283 1.1 chopps cmd[5] = 1024 - ip->ftwidth;
284 1.1 chopps cmd[6] = 1024 - ip->ftheight;
285 1.1 chopps gsp_out(ba, cmd, 7);
286 1.1 chopps #endif
287 1.1 chopps cmd[0] = GCMD_FILL;
288 1.1 chopps cmd[1] = UL_FG(ip);
289 1.1 chopps cmd[2] = ip->cursorx * ip->ftwidth;
290 1.1 chopps cmd[3] = ip->cursory * ip->ftheight;
291 1.1 chopps cmd[4] = ip->ftwidth;
292 1.1 chopps cmd[5] = ip->ftheight;
293 1.1 chopps cmd[6] = 10; /* thats src xor dst */
294 1.1 chopps gsp_out(ba, cmd, 7);
295 1.1 chopps
296 1.1 chopps }
297 1.1 chopps
298 1.1 chopps
299 1.1 chopps
300 1.1 chopps static void screen_up (struct ite_softc *ip, int top, int bottom, int lines)
301 1.1 chopps {
302 1.1 chopps struct gspregs *ba;
303 1.1 chopps
304 1.1 chopps u_int16_t cmd[7];
305 1.1 chopps
306 1.1 chopps ba = (struct gspregs *)ip->grf->g_regkva;
307 1.1 chopps
308 1.1 chopps #ifdef DEBUG_UL
309 1.1 chopps printf("screen_up %d %d %d ->",top,bottom,lines);
310 1.1 chopps #endif
311 1.1 chopps /* do some bounds-checking here.. */
312 1.1 chopps
313 1.1 chopps if (top >= bottom)
314 1.1 chopps return;
315 1.1 chopps
316 1.1 chopps if (top + lines >= bottom)
317 1.1 chopps {
318 1.1 chopps ulowell_clear (ip, top, 0, bottom - top, ip->cols);
319 1.1 chopps return;
320 1.1 chopps }
321 1.1 chopps
322 1.1 chopps cmd[0] = GCMD_PIXBLT;
323 1.1 chopps cmd[1] = 0; /* x */
324 1.1 chopps cmd[2] = top * ip->ftheight; /* y */
325 1.1 chopps cmd[3] = ip->cols * ip->ftwidth; /* w */
326 1.1 chopps cmd[4] = (bottom-top+1) * ip->ftheight; /* h */
327 1.1 chopps cmd[5] = 0; /* dst x */
328 1.1 chopps cmd[6] = (top-lines) * ip->ftheight; /* dst y */
329 1.1 chopps gsp_out(ba, cmd, 7);
330 1.1 chopps
331 1.1 chopps ulowell_clear(ip, bottom-lines+1, 0, lines-1, ip->cols);
332 1.1 chopps };
333 1.1 chopps
334 1.1 chopps static void screen_down (struct ite_softc *ip, int top, int bottom, int lines)
335 1.1 chopps {
336 1.1 chopps struct gspregs *ba;
337 1.1 chopps
338 1.1 chopps u_int16_t cmd[7];
339 1.1 chopps
340 1.1 chopps ba = (struct gspregs *)ip->grf->g_regkva;
341 1.1 chopps
342 1.1 chopps #ifdef DEBUG_UL
343 1.1 chopps printf("screen_down %d %d %d ->",top,bottom,lines);
344 1.1 chopps #endif
345 1.1 chopps
346 1.1 chopps /* do some bounds-checking here.. */
347 1.1 chopps
348 1.1 chopps if (top >= bottom)
349 1.1 chopps return;
350 1.1 chopps
351 1.1 chopps if (top + lines >= bottom)
352 1.1 chopps {
353 1.1 chopps ulowell_clear (ip, top, 0, bottom - top, ip->cols);
354 1.1 chopps return;
355 1.1 chopps }
356 1.1 chopps
357 1.1 chopps cmd[0] = GCMD_PIXBLT;
358 1.1 chopps cmd[1] = 0; /* x */
359 1.1 chopps cmd[2] = top * ip->ftheight; /* y */
360 1.1 chopps cmd[3] = ip->cols * ip->ftwidth; /* w */
361 1.1 chopps cmd[4] = (bottom - top - lines) * ip->ftheight; /* h */
362 1.1 chopps cmd[5] = 0; /* dst x */
363 1.1 chopps cmd[6] = (top + lines) * ip->ftheight; /* dst y */
364 1.1 chopps gsp_out(ba, cmd, 7);
365 1.1 chopps
366 1.1 chopps ulowell_clear(ip, top, 0, lines, ip->cols);
367 1.1 chopps };
368 1.1 chopps
369 1.1 chopps void ulowell_deinit(struct ite_softc *ip)
370 1.1 chopps {
371 1.1 chopps ip->flags &= ~ITE_INITED;
372 1.1 chopps }
373 1.1 chopps
374 1.1 chopps
375 1.1 chopps void ulowell_putc(struct ite_softc *ip, int c, int dy, int dx, int mode)
376 1.1 chopps {
377 1.1 chopps struct gspregs *ba;
378 1.1 chopps register u_int8_t attr;
379 1.1 chopps u_int16_t cmd[8];
380 1.1 chopps
381 1.1 chopps ba = (struct gspregs *)ip->grf->g_regkva;
382 1.1 chopps
383 1.1 chopps cmd[0] = GCMD_CHAR;
384 1.1 chopps cmd[1] = c & 0xff;
385 1.1 chopps cmd[2] = 0x0;
386 1.1 chopps cmd[3] = UL_FG(ip);
387 1.1 chopps cmd[4] = dx * ip->ftwidth;
388 1.1 chopps cmd[5] = dy * ip->ftheight;
389 1.1 chopps cmd[6] = mode;
390 1.1 chopps gsp_write(ba, cmd, 7);
391 1.1 chopps }
392 1.1 chopps
393 1.1 chopps void ulowell_clear(struct ite_softc *ip, int sy, int sx, int h, int w)
394 1.1 chopps {
395 1.1 chopps /* XXX TBD */
396 1.1 chopps struct gspregs * ba;
397 1.1 chopps
398 1.1 chopps u_int16_t cmd[7];
399 1.1 chopps
400 1.1 chopps #ifdef DEBUG_UL
401 1.1 chopps printf("ulowell_clear %d %d %d %d ->",sy,sx,h,w);
402 1.1 chopps #endif
403 1.1 chopps ba = (struct gspregs *)ip->grf->g_regkva;
404 1.1 chopps
405 1.1 chopps cmd[0] = GCMD_FILL;
406 1.1 chopps cmd[1] = 0x0; /* XXX */
407 1.1 chopps cmd[2] = sx * ip->ftwidth;
408 1.1 chopps cmd[3] = sy * ip->ftheight;
409 1.1 chopps cmd[4] = w * ip->ftwidth;
410 1.1 chopps cmd[5] = h * ip->ftheight;
411 1.1 chopps cmd[6] = 0;
412 1.1 chopps
413 1.1 chopps gsp_out(ba, cmd, 7);
414 1.1 chopps }
415 1.1 chopps
416 1.1 chopps void ulowell_scroll(struct ite_softc *ip, int sy, int sx, int count, int dir)
417 1.1 chopps {
418 1.1 chopps struct gspregs *ba;
419 1.1 chopps
420 1.1 chopps register int height, dy, i;
421 1.1 chopps u_int16_t cmd[7];
422 1.1 chopps
423 1.1 chopps ba = (struct gspregs *)ip->grf->g_regkva;
424 1.1 chopps
425 1.1 chopps #ifdef DEBUG_UL
426 1.1 chopps printf("ulowell_scroll %d %d %d %d ->",sy,sx,count,dir);
427 1.1 chopps #endif
428 1.1 chopps
429 1.1 chopps ulowell_cursor(ip, ERASE_CURSOR);
430 1.1 chopps
431 1.1 chopps if (dir == SCROLL_UP) {
432 1.1 chopps screen_up (ip, sy, ip->bottom_margin, count);
433 1.1 chopps } else if (dir == SCROLL_DOWN) {
434 1.1 chopps screen_down (ip, sy, ip->bottom_margin, count);
435 1.1 chopps } else if (dir == SCROLL_RIGHT) {
436 1.1 chopps cmd[0] = GCMD_PIXBLT;
437 1.1 chopps cmd[1] = sx * ip->ftwidth;
438 1.1 chopps cmd[2] = sy * ip->ftheight;
439 1.1 chopps cmd[3] = (ip->cols - sx - count) * ip->ftwidth;
440 1.1 chopps cmd[4] = ip->ftheight;
441 1.1 chopps cmd[5] = (sx + count) * ip->ftwidth;
442 1.1 chopps cmd[6] = sy * ip->ftheight;
443 1.1 chopps gsp_out(ba,cmd,7);
444 1.1 chopps ulowell_clear (ip, sy, sx, 1, count);
445 1.1 chopps } else {
446 1.1 chopps cmd[0] = GCMD_PIXBLT;
447 1.1 chopps cmd[1] = sx * ip->ftwidth;
448 1.1 chopps cmd[2] = sy * ip->ftheight;
449 1.1 chopps cmd[3] = (ip->cols - sx) * ip->ftwidth;
450 1.1 chopps cmd[4] = ip->ftheight;
451 1.1 chopps cmd[5] = (sx - count) * ip->ftwidth;
452 1.1 chopps cmd[6] = sy * ip->ftheight;
453 1.1 chopps gsp_out(ba,cmd,7);
454 1.1 chopps ulowell_clear (ip, sy, ip->cols - count, 1, count);
455 1.1 chopps }
456 1.1 chopps }
457 1.1 chopps
458 1.1 chopps #ifdef DEBUG_UL
459 1.1 chopps void
460 1.1 chopps gsp_dump(cmd,len)
461 1.1 chopps u_int16_t *cmd;
462 1.1 chopps int len;
463 1.1 chopps {
464 1.1 chopps printf("gsp");
465 1.1 chopps while (len-- > 0)
466 1.1 chopps printf(" %lx",*cmd++);
467 1.1 chopps printf("\n");
468 1.1 chopps }
469 1.1 chopps #endif
470 1.1 chopps #endif /* NGRFUL */
471