home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 06 / tricks / conio2.c < prev    next >
C/C++ Source or Header  |  1990-03-08  |  2KB  |  86 lines

  1. /* ------------------------------------------------------ */
  2. /*                     CONIO2.C                           */                                                     */
  3. /*       Erweiterung der QuickC-Bibliothek "conio"        */
  4. /*              um Turbo C-Funktionen                     */
  5. /*         (c) 1990 Michael Rother & TOOLBOX              */
  6. /* ------------------------------------------------------ */
  7. #include <bios.h>
  8. #include <graph.h>
  9. #include <conio2.h>
  10.  
  11. short wherex(void)
  12. {
  13.   struct rccoord koord;
  14.   koord = _gettextposition();
  15.   return (koord.col);
  16. }
  17.  
  18. short wherey(void)
  19. {
  20.   struct rccoord koord;
  21.   koord = _gettextposition();
  22.   return (koord.row);
  23. }
  24.  
  25. void gotoxy(short x, short y)
  26. {
  27.   _settextposition (y, x);
  28. }
  29.  
  30. void clrscr(void)
  31. {
  32.   _asm {
  33.         mov ah, 0Fh
  34.         int 10h
  35.         mov ah, 0
  36.         int 10h
  37.        }
  38. }
  39.  
  40. void clreol(void)
  41. {
  42.   short x;
  43.   union REGS regs;
  44.  
  45.   x = wherex();
  46.   regs.h.ah = 10;
  47.   regs.h.al = 32;
  48.   regs.h.bh = NULLI;
  49.   regs.h.cl = ((MAXSPALTE + 1) - (--x));
  50.   regs.h.ch = NULLI;
  51.  
  52.   int86 (0x10, ®s, ®s);
  53. }
  54.  
  55. void delline(void)
  56. {
  57.   union REGS regs;
  58.  
  59.   regs.h.ah = 6;
  60.   regs.h.al = EINSI;
  61.   regs.h.ch = (unsigned char) wherex();
  62.   regs.h.cl = NULLI;
  63.   regs.h.dh = MAXZEILE;
  64.   regs.h.dl = MAXSPALTE;
  65.   regs.h.bh = NULLI;
  66.  
  67.   int86 (0x10, ®s, ®s);
  68. }
  69.  
  70. void insline(void)
  71. {
  72.   union REGS regs;
  73.  
  74.   regs.h.ah = 7;
  75.   regs.h.al = EINSI;
  76.   regs.h.ch = (unsigned char) wherex();
  77.   regs.h.cl = NULLI;
  78.   regs.h.dh = MAXZEILE;
  79.   regs.h.dl = MAXSPALTE;
  80.   regs.h.bh = NULLI;
  81.  
  82.   int86 (0x10, ®s, ®s);
  83. }
  84. /* ------------------------------------------------------ */
  85. /*                  Ende von CONIO2.C                     */
  86.