home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 1.ddi / SUPP.LIF / RTERM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-06  |  3.7 KB  |  145 lines

  1. /*
  2.  *  RTERM.H
  3.  *        Header file for RTERM.C - Terminal emulator for iRMX
  4.  */
  5. #define TRUE    0xff
  6. #define FALSE   0x0
  7.  
  8. #define    NULLPTR            ((void *) 0)
  9. #define MK_FP(seg, off) ((void far*) ((unsigned long) (seg)<<16 | (off)));
  10.  
  11. #define MAXSTR        256    // Max buffer size
  12. #define VMASK        0x30    // Bit mask for testing
  13. #define VPORT        0x410    // Port for equipment status
  14. #define MAXPAGE        8    // Max video pages
  15. #define DOWN        0x07    // Scroll direction
  16. #define UP        0x06
  17.  
  18. #define    OUTPUTSTOPPED        0x1
  19. #define    SCROLLFLAG        0x1
  20. #define    NUMFLAG            0x2
  21. #define    CAPSFLAG        0x4
  22. #define    ALTFLAG            0x10
  23. #define    CTLFLAG            0x20
  24. #define    SHIFTFLAG        0x40
  25. #define    LF            0xa
  26. #define    CLOSEALTKEY        0xb8
  27. #define    CONTROLQ        0x11
  28. #define    CONTROLS        0x13
  29. #define    BREAKTYPEOFFSET        8
  30. #define    HIGHESTSCANCODE        83    // Support only 84 scan codes
  31. #define    NKEYCODES        84
  32. #define    NORMFUNCTMIN        0x3b    // Normal F1 to F10 keys
  33. #define    NORMFUNCTMAX        0x44
  34. #define    SHCTFUNCTMIN        0x54    // Shift or Control plus
  35. #define    SHCTFUNCTMAX        0x67    // a function key F1 to F10
  36. /*
  37.  * NUL character indicate that the system or application should
  38.  *  interpreted the following character as a special function code.
  39.  */
  40. #define    FUNCTIONKEYCODE        0x0
  41. #define    BREAKCONTACT        0x80
  42. #define    TOGGLELEDCMD        0xed
  43. #define    INDICATORBITS        0x7
  44. #define    INPUTINTERRUPT        0x1
  45.  
  46. #define    CRTCOLS            80
  47. #define    LASTCOL            79
  48. #define    CRTROWS            25
  49. #define    LASTROW            24
  50. #define    SCREENLENGTH     (25 * 80)     // length is 80 * 25
  51.  
  52. #define    DEFAULTRAWSIZE        256
  53. #define    DEFAULTRAWMASK        255
  54.  
  55. /* values for console state */
  56.  
  57. #define    RAWMODE            0x80
  58. #define    LITERALMODE        0x40
  59. #define    CANCELOUTPUT        0x10
  60. #define    MONOINDEXREG        0x3b4    // monochrome
  61. #define    COLORINDEXREG        0x3d4    // CGA adapter
  62. #define    CMOSADDRESS        0x70    // CMOS RAM address
  63. #define    CMOSDATA        0x71
  64. #define    CMOSEQUIPBYTE        0x14
  65. #define    DISPLAYABLECHAR        0x20
  66. #define    BLANKCHARACTER        0x20
  67. #define    DEFAULTATTRIB        0x700    // attribute is white on black
  68. #define    DATAREGOFFSET        0x1
  69. #define    MODEREGOFFSET        0x4
  70. #define    STATREGOFFSET        0x6
  71.  
  72. //
  73. // All colors can be used as foreground or background color
  74. //
  75.  
  76. #define BLACK     0 
  77. #define BLUE      1
  78. #define GREEN     2
  79. #define CYAN      3
  80. #define RED       4
  81. #define MAGNETA   5
  82. #define BROWN     6
  83. #define WHITE     7
  84. #define GRAY      8
  85. #define LBLUE     9
  86. #define LGREEN    10
  87. #define LCYAN     11
  88. #define LRED      12
  89. #define LMAGENTA  13
  90. #define YELLOW    14
  91. #define LWHITE    15
  92.  
  93. #define HI_INTENS  0x08
  94. #define NO_BLINK   0x7f
  95.  
  96. short  Num_chars;
  97. char   Temp_str[29];              // Temporary buffer for queuing inputs
  98.  
  99. int Temp_Buff[SCREENLENGTH + 2];  // Temp. buffer to transfer screen data
  100.  
  101. int save_buffer[4000];            // place to save the DOS screen (not used)
  102. int far *save_buff;               // far address of save_buffer
  103.  
  104. unsigned int far *bflag_ptr = (unsigned far *) 0x00000472;
  105.  
  106. unsigned int far *src_ptr;
  107. unsigned int far *des_ptr;
  108. unsigned int far *temp_ptr;
  109. unsigned int tmp = 0;
  110.  
  111. static unsigned int forground, background;
  112. static unsigned int index;
  113. static unsigned char X_char;
  114. static unsigned char Stop_output;
  115. static unsigned int temp;
  116. static unsigned char *dinfop;
  117. static unsigned int temp_w;
  118. static unsigned int t_count;
  119.  
  120. typedef int DISPL_MEM[80];
  121. DISPL_MEM far *video_p;
  122.  
  123. typedef struct {
  124.                   char flag_byte;
  125.                   char data_byte;
  126.                 } OUT_BUFFER;
  127.  
  128. typedef struct {
  129.                   char count;
  130.                   char data_byte[29];
  131.                 } IN_BUFFER;
  132.  
  133. static struct
  134. {
  135.     unsigned int displayw;
  136.     unsigned char column;
  137.     unsigned char row;
  138.     unsigned char mode;
  139.     unsigned char page;
  140.     unsigned long crtlen;
  141.     unsigned char console_state;
  142.     unsigned char routine_index;
  143.     unsigned int output_state;
  144. } r_term;
  145.