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); } }
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); } }
char vm_getattrxy(char x, char y) { if (_osmode == DOS_MODE) { char cell[2]; vi_init(); v_getline(cell, (int)(x - 1), (int)(y - 1), 1); return *(cell + 1); } else { char cell[2]; USHORT len = sizeof cell; VioReadCellStr(cell, &len, (USHORT) (y - 1), (USHORT) (x - 1), 0); return *(cell + 1); } }
void vm_xgetchxy(char x, char y, char *attr, char *ch) { if (_osmode == DOS_MODE) { char cell[2]; vi_init(); v_getline(cell, (int)(x - 1), (int)(y - 1), 1); *ch = *cell; *attr = *(cell + 1); } else { char cell[2]; USHORT len = sizeof cell; VioReadCellStr(cell, &len, (USHORT) (y - 1), (USHORT) (x - 1), 0); *ch = *cell; *attr = *(cell + 1); } }
int PDC_get_attribute(void) /***********************************************************************/ { #ifndef EMXVIDEO USHORT cellLen = 2; #endif int curRow=0, curCol=0; char Cell[4]; #ifdef PDCDEBUG if (trace_on) PDC_debug("PDC_get_attribute() - called\n"); #endif PDC_get_cursor_pos(&curRow, &curCol); #ifdef EMXVIDEO v_getline (Cell, curCol, curRow, 1); #else VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0); #endif return ((int) Cell[1]); }