void vm_xputch(char x, char y, char attr, char ch) { unsigned long address; address = vm_screenaddress(x, y); _farpokeb(_go32_conventional_mem_selector(), address, ch); _farpokeb(_go32_conventional_mem_selector(), address + 1L, attr); }
void vm_xgetchxy(char x, char y, char *attr, char *ch) { unsigned long address; address = vm_screenaddress(x, y); *ch = (char)_farpeekb(_go32_conventional_mem_selector(), address); *attr = (char)_farpeekb(_go32_conventional_mem_selector(), address + 1L); }
/* * Display msg with color at coordinates (y, x) */ void ossdsp(int y, int x, int color, char *s) { if (bios_flag) { __dpmi_regs regs; while (*s) { ossloc(y, x++); regs.h.ah = B_WRITECHAR; regs.h.al = *s++; regs.h.bh = video_page; regs.h.bl = color; regs.x.cx = 1; /* count = 1 */ __dpmi_int(0x10, ®s); } } else { union vcell vc; unsigned long vp; char *p = s; vp = scrbase + ((y * 80 + x) << 1); vc.ca.vattr = color; _farsetsel(_go32_conventional_mem_selector()); while (*p) { vc.ca.vchar = *p++; _farnspokew(vp, vc.s); vp += 2; } ossloc(y, x + (p - s - (*s ? 1 : 0))); } }
void delline(void) { int row, col, left, right, nbytes, bot, fill; ScreenGetCursor(&row, &col); left = txinfo.winleft - 1; right = txinfo.winright - 1; nbytes = (right-left+1)*2; bot = txinfo.winbottom-1; fill = ' ' | (ScreenAttrib << 8); while(row < bot) { movedata(_go32_conventional_mem_selector(), VIDADDR(row+1, left), _go32_conventional_mem_selector(), VIDADDR(row, left), nbytes); row++; } fillrow(bot,left,right,fill); }
void vm_puts(char x, char y, char *str) { char ofs; ofs = 0; while (*str) { unsigned long address; address = vm_screenaddress(x + ofs, y); _farpokeb(_go32_conventional_mem_selector(), address, *str); str++; ofs++; } }
static int readCharacters_PcBiosScreen (const ScreenBox *box, ScreenCharacter *buffer) { unsigned offset = ScreenPrimary; ScreenDescription description; int row, col; describe_PcBiosScreen(&description); if (!validateScreenBox(box, description.cols, description.rows)) return 0; _farsetsel(_go32_conventional_mem_selector()); for (row=box->top; row<box->top+box->height; ++row) for (col=box->left; col<box->left+box->width; ++col) { buffer->text = _farnspeekb(offset + row*description.cols*2 + col*2); buffer->attributes = _farnspeekb(offset + row*description.cols*2 + col*2 + 1); buffer++; } return 1; }
char vm_wherey(void) { return (char)(_farpeekb(_go32_conventional_mem_selector(), 0x0451) + 1); }
short vm_getscreensize(void) { return (short)_farpeekw(_go32_conventional_mem_selector(), 0x044c); }
char vm_getscreenheight(void) { return (char)(_farpeekb(_go32_conventional_mem_selector(), 0x0484) + 1); }
char vm_getscreenwidth(void) { return (char)_farpeekb(_go32_conventional_mem_selector(), 0x044a); }
static char vm_getscreenmode(void) { return (char)_farpeekb(_go32_conventional_mem_selector(), 0x0449); }
char vm_getattrxy(char x, char y) { unsigned long address; address = vm_screenaddress(x, y); return (char)_farpeekb(_go32_conventional_mem_selector(), address + 1L); }