home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / SNIP9404.ZIP / SCRNMACS.H < prev    next >
C/C++ Source or Header  |  1994-04-03  |  2KB  |  93 lines

  1. /*
  2. **  Macros for managing direct video writes by Jerry Houston
  3. **
  4. **  prototypes for SCROLL.C and VIDPORT.C functions added by Bob Stout
  5. */
  6.  
  7. #if defined(__TURBOC__)
  8.  #define FAR far
  9. #else
  10.  #define FAR _far
  11. #endif
  12.  
  13. #ifndef MK_FP
  14.  #define MK_FP(seg,off) ((void far *)(((long)(seg) << 16)|(unsigned)(off)))
  15. #endif
  16.  
  17. /*
  18. **  Text screen scrolling function from SCROLL.C in SNIPPETS
  19. */
  20.  
  21. #define SCROLL_UP 0
  22. #define SCROLL_DN 1
  23.  
  24. void scroll(int direction,
  25.             int num_lines,
  26.             int vattrib,
  27.             int ulrow,
  28.             int ulcomumn,
  29.             int lrrow,
  30.             int lrcolumn);
  31.  
  32. /*
  33. **  Functions in VIDPORT.C in SNIPPETS
  34. */
  35.  
  36. void GotoXY(int col, int row);
  37. void ClrScrn(int vattrib);
  38. void GetCurPos(int *col, int *row);
  39. int  GetCurAtr(void);
  40. void ClrEol(void);
  41. void ClrEop(void);
  42. void Repaint(int vattrib);
  43.  
  44. #if !defined(COLORMODE)
  45.  #define COLORMODE  ((*(char FAR *)0x0449) != 7)
  46.  #define EXT_KBD    (*(char FAR *)0x0496 & 16)
  47.  #define VIDPAGE    (*((unsigned char far *)0x0462))
  48.  #define ROWSIZE    (*(int FAR *)0x044A)
  49.  #define SCANLINES  ((int)*(char FAR*)0x0461)
  50.  #define SCRBUFF    ((unsigned FAR *)((COLORMODE)?0xB8000000:0xB0000000))
  51.  #define SCREENSEG  ((unsigned)((COLORMODE)?0xB800:0xB000))
  52.  #define SCREENSIZE ((*(int FAR *)0x044C) >> 1)
  53.  #define SCREENCOLS (*(int FAR *)0x044A)
  54.  #define SCREENROWS ((*(char FAR *)0x0484)?1+(*(char FAR *)0x0484):25)
  55. #endif
  56.  
  57. /*
  58.      COLORMODE  = true/false, are we using color?
  59.      EXT_KBD    = true/false, extended keyboard in use?
  60.      VIDPAGE    = current video page in use
  61.      SCANLINES  = number of scan lines in a character.
  62.      SCRBUFF    = returns B800:0000 if using color, B000:0000 if mono.
  63.      SCREENSEG  = when you just need the segment portion.
  64.      SCREENSIZE = number of (2-byte) cells required to save screen.
  65.      SCREENCOLS = number of columns, often 80.
  66.      SCREENROWS = number of rows, usually defaults to 25.
  67. */
  68.  
  69. /*
  70. ** colors -- Use as is for foreground colors
  71. **           For background, shift left by 4 and OR with
  72. **           foreground and possible video attributes
  73. */
  74.  
  75. #define BLACK 0
  76. #define BLUE 1
  77. #define GREEN 2
  78. #define CYAN 3
  79. #define RED 4
  80. #define MAGENTA 5
  81. #define BROWN 6
  82. #define WHITE 7
  83. #define GRAY 8
  84. #define LTBLUE 9
  85. #define LTGREEN 10
  86. #define LTCYAN 11
  87. #define LTRED 12
  88. #define LTMAGENTA 13
  89. #define YELLOW 14
  90. #define HIWHITE 15    /* hi-intensity white */
  91.  
  92. #define BG_(a) (((a) & 0x7f) << 4)
  93.