Exemple #1
0
void
sc_vtb_clear(sc_vtb_t *vtb, int c, int attr)
{
	vm_offset_t p = vtb_pointer(vtb, 0);

	if (vtb->vtb_type == VTB_FRAMEBUFFER) {
		fillw_io(c, p, vtb->vtb_size);
		fillw_io(at2pc98(attr), p + ATTR_OFFSET_FB, vtb->vtb_size);
	} else {
		fillw(c, (void *)p, vtb->vtb_size);
		fillw(at2pc98(attr), (void *)(p + attr_offset(vtb)),
		      vtb->vtb_size);
	}
}
Exemple #2
0
/* Write character and attribute at cursor position. */
void
write_char(int c, int fgcol, int bgcol)
{

    *crtat = (c == 0x5c ? 0xfc : (c & 0xff));
    *(crtat + 0x1000) = at2pc98(fgcol, bgcol);
}
Exemple #3
0
void
sc_vtb_erase(sc_vtb_t *vtb, int at, int count, int c, int attr)
{
    vm_offset_t p;

    if (at + count > vtb->vtb_size)
        count = vtb->vtb_size - at;
    p = vtb_pointer(vtb, at);
    if (vtb->vtb_type == VTB_FRAMEBUFFER) {
        fillw_io(c, p, count);
        fillw_io(at2pc98(attr), p + ATTR_OFFSET_FB, count);
    } else {
        fillw(c, (void *)p, count);
        fillw(at2pc98(attr), (void *)(p + attr_offset(vtb)), count);
    }
}
Exemple #4
0
/* Clear display from current position to end of screen */
void
CD(void)
{
    int pos;

    get_pos();
    for (pos = 0; crtat + pos <= Crtat + col * row; pos++) {
	*(crtat + pos) = ' ';
	*(crtat + pos + 0x1000) = at2pc98(fg_c, bg_c);
    }
    end_term();
}
Exemple #5
0
/* Scroll up the whole window by a number of rows. If rows==0,
 * clear the window. fg and bg are attributes for the new lines
 * inserted in the window.
 */
void
scroll_up(int rows, int fgcol, int bgcol)
{
    unsigned short *cp;
    int i;

    if (rows == 0)
	rows = 25;
    cp = Crtat;
    for (i = rows; i < row; i++) {
	bcopy((void *)(cp + col), (void *)cp, col * 2);
	cp += col;
    }
    for (i = 0; i < col; i++) {
	*(cp + 0x1000) = at2pc98(fgcol, bgcol);
	*cp++ = ' ';
    }
}
Exemple #6
0
static void
vidc_biosputchar(int c)
{
    unsigned short *cp;
    int i, pos;

#ifdef TERM_EMU
    *crtat = (c == 0x5c ? 0xfc : c);
    *(crtat + 0x1000) = at2pc98(fg, bg);
#else
    switch(c) {
    case '\b':
        crtat--;
	break;
    case '\r':
        crtat -= (crtat - Crtat) % col;
	break;
    case '\n':
        crtat += col;
	break;
    default:
        *crtat = (c == 0x5c ? 0xfc : c);
	*(crtat++ + 0x1000) = 0xe1;
	break;
    }

    if (crtat >= Crtat + col * row) {
        cp = Crtat;
	for (i = 1; i < row; i++) {
	    bcopy((void *)(cp + col), (void *)cp, col * 2);
	    cp += col;
	}
	for (i = 0; i < col; i++) {
	    *cp++ = ' ';
	}
	crtat -= col;
    }
    pos = crtat - Crtat;
    while ((inb(0x60) & 0x04) == 0) {}
    outb(0x62, 0x49);
    outb(0x60, pos & 0xff);
    outb(0x60, pos >> 8);
#endif
}