home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / screen / scrn02 / video.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-27  |  3.6 KB  |  138 lines

  1. /* video.h */
  2.  
  3. #define TRUE    1
  4. #define FALSE    0
  5.  
  6. /* bios video interupt signal - use with int86() */
  7. #define  VID_INT    0x10    
  8. #define  VIDEO_INT    0x10
  9.  
  10. /* primary monochrome attributes */
  11. #define  NON_DISPLAY     0x00
  12. #define  UNDERLINE       0x01
  13. #define  NORMAL_DISPLAY  0x07
  14. #define  INVERSE         0x70
  15.  
  16. /* primary color attributes - foreground or background */
  17. #define BLACK        0x00
  18. #define BLUE        0x01
  19. #define GREEN        0x02
  20. #define CYAN        0x03
  21. #define RED        0x04
  22. #define MAGENTA        0x05
  23. #define BROWN        0x06
  24. #define WHITE        0x07
  25.  
  26. /* highlighted color attributes - not legal background colors */
  27. #define GREY        0x08
  28. #define LT_BLUE        0x09
  29. #define LT_GREEN    0x0A
  30. #define LT_CYAN        0x0B
  31. #define LT_RED        0x0C
  32. #define LT_MAGENTA    0x0D
  33. #define YELLOW        0x0E
  34. #define HOTWHITE    0x0F
  35.  
  36. /* OR these with primary attributes */
  37. #define  HIGHLIGHT     0x08 
  38. #define  BLINK             0x80
  39.  
  40.  
  41. /* video modes (as defined by the Rom BIOS) */
  42. #define  BW40_MODE           0
  43. #define  CO40_MODE           1
  44. #define  BW80_MODE           2
  45. #define  CO80_MODE           3
  46. #define  CO320_MODE          4
  47. #define  BW320_MODE          5
  48. #define  BW640_MODE          6
  49. #define  MONO_MODE           7
  50. #define  E320X200_MODE         0x0D
  51. #define  E640X200_MODE       0x0E
  52. #define  EGA_MONO_MODE         0x0F
  53. #define  EGA_MODE            0x10
  54.             
  55. /* 
  56. * Rom BIOS function values 
  57. * Put one of these values into inregs.h.ah (defined in dos.h)
  58. * before calling the VIDEO_IO services with int86().
  59. */
  60.  
  61. #define  V_SET_MODE    0
  62. #define  V_CUR_TYPE    1
  63. #define  V_SET_CUR      2
  64. #define  V_GET_CUR      3
  65. #define  V_SETPAGE      5
  66. #define  V_SCRLUP       6
  67. #define  V_SCRLDOWN     7
  68. #define  V_GCA          8
  69. #define  V_WCA          9
  70. #define  V_WC          10
  71. #define  V_WTTY        14
  72. #define  V_GET_MODE    15
  73.  
  74. /* 
  75. *    SEGMENT and STATUS PORT definitions used for direct
  76. *    screen writes.
  77. */
  78.  
  79. /* screen buffer segments */
  80. #define MONO_SEG    0xB000
  81. #define COLOR_SEG    0xB800
  82.  
  83. /* CRT base values */
  84. #define MONO_BASE    0x3B0
  85. #define COLOR_BASE    0x3D0
  86.  
  87. /* status port addresses - add to appropriate base value above */
  88. #define CRT_STATUS    0x0A
  89. #define M6845_INDEX    0x04
  90. #define M6845_DATA    0x05
  91. #define CRT_CTRL    0x08
  92.  
  93. /*
  94. * Definitions used to determine video adapter type with vcard_type()
  95. */
  96. #define MONO_ADAPTER    0
  97. #define CGA_ADAPTER    1
  98. #define EGA_ADAPTER    2
  99.  
  100.  
  101. /*
  102. * Structure definition used by direct screen writes.
  103. */
  104.  
  105. typedef struct scrn
  106.     { unsigned offset;    /* screen segment address */
  107.       unsigned segment;    /* offset = cursor position */
  108.       unsigned stat_port;    /* status port address to check for retrace */
  109.       int attrib;        /* attribute used when writing chars */
  110.       int cga_card;        /* enables retrace checking if not zero */
  111.     } SCRN, *SCRNPTR;  
  112.  
  113.  
  114. /* enable type checking for functions */
  115. int vid_state(int *);
  116. void vid_init(int);
  117. void vid_page(int);
  118. void vid_set_cur(int, int);
  119. void vid_get_cur(int *, int *);
  120. void vid_cur_right(int);
  121. void vid_cur_switch(int);
  122. void vid_up(int, int, int, int, int, int);
  123. void vid_down(int, int, int, int, int, int);
  124. int vcard_type(void);
  125. void scrn_init(SCRN *);
  126. void scrn_puts(char *, SCRN *);
  127. void scrn_putca(int, SCRN *);
  128. int scrn_getca(int *, SCRN *);
  129. void scrn_save(int, int, int, int, char *, SCRN *);
  130. void scrn_restore(int, int, int, int, char *, SCRN *);
  131. void scrn_pos(int, int, SCRN *);
  132. void scrn_attrib(int, SCRN *);
  133. void scrn_color(int, int, SCRN *);
  134. void scrn_set_cga(int, SCRN *);
  135. void scrn_border(int, int, int, int, int, SCRN *);
  136. void scrn_hborder(int, int, int, int, SCRN *);
  137. void scrn_wzoom(int, int, int, int, char *, int, SCRN *);
  138.