home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / SCTTYWRT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  2.0 KB  |  70 lines

  1. /**
  2. *
  3. * Name        scttywrt -- Write to screen using TTY format
  4. *
  5. * Synopsis    iret = scttywrt(ch,fore);
  6. *
  7. *        int  iret      Return value is always 0
  8. *        char ch       Character to display
  9. *        int  fore      Foreground attribute to use if
  10. *                  screen mode is a graphics mode
  11. *
  12. * Description    This function writes a character to the current page in
  13. *        the usual TTY format.
  14. *
  15. *        This function assumes that the current page is active
  16. *        (i.e., currently displayed).  Unexpected results may
  17. *        occur otherwise.
  18. *
  19. *        If the screen is in graphics mode, fore is used to set
  20. *        the color of the characters written.  Further, if the
  21. *        current page is not active and the screen is scrolled,
  22. *        fore is used as the color of the scrolled text.  Fore is
  23. *        ignored in text mode.
  24. *
  25. *        If the screen is scrolled in text mode due to a line
  26. *        feed character, the attribute for the new blank line is
  27. *        taken from the character position last occupied before
  28. *        the scroll.  If the scroll is caused by overflowing the
  29. *        last line of the screen, the attribute is taken from the
  30. *        former attribute at column 0 of the last line.
  31. *
  32. * Special    Line feed ('\012') causes the cursor to move down one
  33. * characters    line, unless it is already on the bottom line of the
  34. *        screen, in which case the screen is scrolled.
  35. *
  36. *        Carriage return ('\015') causes the cursor to move to
  37. *        column 0.
  38. *
  39. *        Backspace ('\010') causes the cursor to move one column
  40. *        to the left (non-destructively), unless it is already at
  41. *        column 0, in which case nothing happens.
  42. *
  43. *        The BEL character ('\007') causes the computer's bell to
  44. *        sound.
  45. *
  46. * Returns    iret          Return value is always 0
  47. *
  48. * Version    6.00 (C)Copyright Blaise Computing Inc.  1983,1987,1989
  49. *
  50. **/
  51.  
  52. #include <dos.h>
  53.  
  54. #include <bscreens.h>
  55.  
  56. int scttywrt(ch,fore)
  57. char ch;
  58. int  fore;
  59. {
  60.     union REGS inregs,outregs;
  61.  
  62.     inregs.h.ah = 14;
  63.     inregs.h.al = ch;
  64.     inregs.h.bh = (unsigned char) b_curpage;
  65.     inregs.h.bl = (unsigned char) fore;
  66.     int86(SC_BIOS_INT,&inregs,&outregs);
  67.  
  68.     return(0);
  69. }
  70.