Exemplo n.º 1
0
void vm_xputs(char x, char y, char attr, char *str)
{
    if (_osmode == DOS_MODE)
    {
        char *p, *cell, *pcell;
        cell = malloc(strlen(str) * 2);
        if (cell)
        {
            pcell = cell;
            p = str;
            while (*p)
            {
                *pcell++ = *p++;
                *pcell++ = attr;
            }
            vi_init();
            v_putline(cell, (int)(x - 1), (int)(y - 1), strlen(str));
            free(cell);
        }
    }
    else
    {
        VioWrtCharStrAtt(str, (USHORT) strlen(str), (USHORT) (y - 1), (USHORT) (x - 1), (PBYTE) &attr, 0);
    }
}
Exemplo n.º 2
0
void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
{
    /* this should be enough for the maximum width of a screen. */

    struct {unsigned char text, attr;} temp_line[256];
    int j;

    PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno));

    /* replace the attribute part of the chtype with the 
       actual color value for each chtype in the line */

    for (j = 0; j < len; j++)
    {
        chtype ch = srcp[j];

        temp_line[j].attr = pdc_atrtab[ch >> PDC_ATTR_SHIFT];

#ifdef CHTYPE_LONG
        if (ch & A_ALTCHARSET && !(ch & 0xff80))
            ch = acs_map[ch & 0x7f];
#endif
        temp_line[j].text = ch & 0xff;
    }

#ifdef EMXVIDEO
    v_putline((char *)temp_line, x, lineno, len);
#else
    VioWrtCellStr((PCH)temp_line, (USHORT)(len * sizeof(unsigned short)),
                  (USHORT)lineno, (USHORT)x, 0);
#endif
}
Exemplo n.º 3
0
void vm_putattr(char x, char y, char attr)
{
    if (_osmode == DOS_MODE)
    {
        char cell[2];
        vi_init();
        v_getline(cell, (int)(x - 1), (int)(y - 1), 1);
        *(cell + 1) = attr;
        v_putline(cell, (int)(x - 1), (int)(y - 1), 1);
    }
    else
    {
        VioWrtNAttr((PBYTE) &attr, 1, (USHORT) (y - 1), (USHORT) (x - 1), 0);
    }
}
Exemplo n.º 4
0
void vm_xputch(char x, char y, char attr, char ch)
{
    if (_osmode == DOS_MODE)
    {
        char cell[2];
        vi_init();
        *cell = ch;
        *(cell + 1) = attr;
        v_putline(cell, (int)(x - 1), (int)(y - 1), 1);
    }
    else
    {
        VioWrtCharStrAtt(&ch, 1, (USHORT) (y - 1), (USHORT) (x - 1), (PBYTE) &attr, 0);
    }
}
Exemplo n.º 5
0
void vm_putch(char x, char y, char ch)
{
    if (_osmode == DOS_MODE)
    {
        char cell[2];
        vi_init();
        v_getline(cell, (int)(x - 1), (int)(y - 1), 1);
        *cell = ch;
        v_putline(cell, (int)(x - 1), (int)(y - 1), 1);
    }
    else
    {
        VioWrtCharStr(&ch, 1, (USHORT) (y - 1), (USHORT) (x - 1), 0);
    }
}