Lines Matching refs:ip

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