http://www.ousob.com --- Legacy Redefined #include <dos.h> #include <extend50.h> void setCursor(int *start, int *end); int getCursorStat(int *start, int *end); int getVideoPage(void); CLIPPER b_say() { union REGS regs ; register int i ; int start ; int end ; int cursorFlag ; int videoPage ; int gotAproblem = 0 ; int oldRow ; int oldCol ; int oldColor ; int newColor ; int newRow = _parni(1); int newCol = _parni(2); char *str = _parc(3) ; if( !ISNUM(1) || !ISNUM(2) || !ISCHAR(3) ){ gotAproblem++; } if( !gotAproblem ){ videoPage = getVideoPage(); if( (cursorFlag = getCursorStat(&start,&end)) ){ setCursor( (int *)-16, (int *)-16); } regs.h.ah = 0x03; regs.h.bh = videoPage; int86(0x10,&regs,&regs); oldRow = regs.h.dh; oldCol = regs.h.dl; regs.h.ah = 0x08; regs.h.bh = videoPage; int86(0x10,&regs,&regs); oldColor = regs.h.ah; regs.h.ah = 0x02; regs.h.bh = videoPage; regs.h.dh = newRow; regs.h.dl = newCol; int86(0x10,&regs,&regs); regs.h.ah = 0x08; regs.h.bh = videoPage; int86(0x10,&regs,&regs); newColor = regs.h.ah; for( i=0; i<strlen(str); i++){ regs.h.ah = 0x0e; regs.h.al = str[i]; regs.h.bh = videoPage; regs.h.bl = newColor; int86(0x10,&regs,&regs); } if( cursorFlag ){ setCursor( (int *)-6, (int *)-7); } } _ret(); } int getVideoPage(void) { union REGS ireg; ireg.h.ah = 0x0f; int86(0x10, &ireg, &ireg); return (ireg.h.bh); } int getCursorStat(int *start, int *end) { union REGS ireg; int retVal = 0; ireg.h.ah = 0x03; ireg.h.bh = xgetvpage(); int86(0x10, &ireg, &ireg); *start = (int) ireg.h.ch; *end = (int) ireg.h.cl; if( (*start >= 0 && *start <= 8) && (*end >= 0 && *end <= 8) ){ retVal = 1; } return(retVal); } void setCursor(int *start, int *end) { union REGS ireg; ireg.h.ah = 0x01; ireg.h.ch = (char) start; ireg.h.cl = (char) end; int86(0x10, &ireg, &ireg); }