Lines Matching refs:ip
103 #define UL_FG(ip) 0xFFFF
104 #define UL_BG(ip) 0x0000
140 ulowell_init(struct ite_softc *ip)
149 ba = (volatile struct gspregs *) ip->grf->g_regkva;
151 ip->font = kernel_font;
152 ip->font_lo = kernel_font_lo;
153 ip->font_hi = kernel_font_hi;
154 ip->ftwidth = kernel_font_width;
155 ip->ftheight = kernel_font_height;
156 ip->ftbaseline = kernel_font_baseline;
157 ip->ftboldsmear = kernel_font_boldsmear;
167 ba->data = ip->ftwidth;
168 ba->data = ip->ftheight;
169 ba->data = ip->ftbaseline;
171 ba->data = ip->font_lo;
172 ba->data = ip->font_hi;
173 ba->data = ip->ftboldsmear;
184 i = (ip->font_hi - ip->font_lo + 1) * ip->ftheight;
185 if (ip->ftwidth <= 8)
187 for (sp = (u_int16_t *)ip->font; i>0; --i,++sp) {
196 ip->priv = NULL;
197 ip->cursor_opt = 0;
199 if (ip->ftwidth >0 && ip->ftheight > 0) {
200 ip->cols = ip->grf->g_display.gd_dwidth / ip->ftwidth;
201 ip->rows = ip->grf->g_display.gd_dheight / ip->ftheight;
204 ulowell_clear(ip, 0, 0, ip->rows, ip->cols);
220 printf("ulowell_init: %d %d %d %d %d %d\n", ip->ftwidth, ip->ftheight,
221 ip->ftbaseline, ip->font_lo, ip->font_hi, ip->ftboldsmear);
226 void ulowell_cursor(struct ite_softc *ip, int flag)
231 ba = (volatile struct gspregs *)ip->grf->g_regkva;
234 --ip->cursor_opt;
236 if (!ip->cursor_opt)
237 ulowell_cursor(ip, ERASE_CURSOR);
238 ++ip->cursor_opt;
242 if (ip->cursor_opt)
251 cmd[1] = 1024 - ip->ftwidth;
252 cmd[2] = 1024 - ip->ftheight;
253 cmd[3] = ip->ftwidth;
254 cmd[4] = ip->ftheight;
255 cmd[5] = ip->cursorx * ip->ftwidth;
256 cmd[6] = ip->cursory * ip->ftheight;
260 cmd[1] = UL_FG(ip);
261 cmd[2] = ip->cursorx * ip->ftwidth;
262 cmd[3] = ip->cursory * ip->ftheight;
263 cmd[4] = ip->ftwidth;
264 cmd[5] = ip->ftheight;
275 ip->cursorx = uimin(ip->curx, ip->cols-1);
276 ip->cursory = ip->cury;
279 cmd[1] = ip->cursorx * ip->ftwidth;
280 cmd[2] = ip->cursory * ip->ftheight;
281 cmd[3] = ip->ftwidth;
282 cmd[4] = ip->ftheight;
283 cmd[5] = 1024 - ip->ftwidth;
284 cmd[6] = 1024 - ip->ftheight;
288 cmd[1] = UL_FG(ip);
289 cmd[2] = ip->cursorx * ip->ftwidth;
290 cmd[3] = ip->cursory * ip->ftheight;
291 cmd[4] = ip->ftwidth;
292 cmd[5] = ip->ftheight;
300 static void screen_up(struct ite_softc *ip, int top, int bottom, int lines)
306 ba = (volatile struct gspregs *)ip->grf->g_regkva;
318 ulowell_clear (ip, top, 0, bottom - top, ip->cols);
324 cmd[2] = top * ip->ftheight; /* y */
325 cmd[3] = ip->cols * ip->ftwidth; /* w */
326 cmd[4] = (bottom-top+1) * ip->ftheight; /* h */
328 cmd[6] = (top-lines) * ip->ftheight; /* dst y */
331 ulowell_clear(ip, bottom-lines+1, 0, lines-1, ip->cols);
334 static void screen_down(struct ite_softc *ip, int top, int bottom, int lines)
340 ba = (volatile struct gspregs *)ip->grf->g_regkva;
353 ulowell_clear (ip, top, 0, bottom - top, ip->cols);
359 cmd[2] = top * ip->ftheight; /* y */
360 cmd[3] = ip->cols * ip->ftwidth; /* w */
361 cmd[4] = (bottom - top - lines) * ip->ftheight; /* h */
363 cmd[6] = (top + lines) * ip->ftheight; /* dst y */
366 ulowell_clear(ip, top, 0, lines, ip->cols);
369 void ulowell_deinit(struct ite_softc *ip)
371 ip->flags &= ~ITE_INITED;
375 void ulowell_putc(struct ite_softc *ip, int c, int dy, int dx, int mode)
380 ba = (volatile struct gspregs *)ip->grf->g_regkva;
385 cmd[3] = UL_FG(ip);
386 cmd[4] = dx * ip->ftwidth;
387 cmd[5] = dy * ip->ftheight;
392 void ulowell_clear(struct ite_softc *ip, int sy, int sx, int h, int w)
402 ba = (volatile struct gspregs *)ip->grf->g_regkva;
406 cmd[2] = sx * ip->ftwidth;
407 cmd[3] = sy * ip->ftheight;
408 cmd[4] = w * ip->ftwidth;
409 cmd[5] = h * ip->ftheight;
415 void ulowell_scroll(struct ite_softc *ip, int sy, int sx, int count, int dir)
420 ba = (volatile struct gspregs *)ip->grf->g_regkva;
426 ulowell_cursor(ip, ERASE_CURSOR);
429 screen_up (ip, sy, ip->bottom_margin, count);
431 screen_down (ip, sy, ip->bottom_margin, count);
434 cmd[1] = sx * ip->ftwidth;
435 cmd[2] = sy * ip->ftheight;
436 cmd[3] = (ip->cols - sx - count) * ip->ftwidth;
437 cmd[4] = ip->ftheight;
438 cmd[5] = (sx + count) * ip->ftwidth;
439 cmd[6] = sy * ip->ftheight;
441 ulowell_clear (ip, sy, sx, 1, count);
444 cmd[1] = sx * ip->ftwidth;
445 cmd[2] = sy * ip->ftheight;
446 cmd[3] = (ip->cols - sx) * ip->ftwidth;
447 cmd[4] = ip->ftheight;
448 cmd[5] = (sx - count) * ip->ftwidth;
449 cmd[6] = sy * ip->ftheight;
451 ulowell_clear (ip, sy, ip->cols - count, 1, count);