home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / COMM / MISC / SRC26_2.ZIP / SRC / IBMPC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-07  |  5.8 KB  |  171 lines

  1. /*
  2.  * ibmpc.h: machine dependent parameters for IBM-PC/AX/J3100
  3.  *
  4.  * Author: HIRANO Satoshi
  5.  * (C) 1989  Halca Computer Science Laboratory TM
  6.  *           University of Tokyo
  7.  *
  8.  * Edition history:
  9.  * 1.1 90/02/03 Halca.Hirano separate from config.h
  10.  *
  11.  * $Header: ibmpc.hv  1.2  90/06/23 16:18:36  hirano  Exp $
  12.  */
  13.  
  14. /*
  15.  * system calls
  16.  */
  17. #define VIDEOBIOS     0x10    /* VIDEO BIOS interrupt vector        */
  18. #define KEY_BIOS     0x16    /* keyboard BIOS interrupt vector    */
  19. #define PRINTER_BIOS     0x17    /* printer BIOS interrupt vector    */
  20.  
  21. #ifdef J3100
  22. #define SYSTEMSUB    0x60    /* system subroutine entry of BIOS    */
  23. #endif /* J3100 */
  24.  
  25. /* 
  26.  * NS16450 (INS8250A) serial port device register assignments
  27.  */
  28. #define THR          0x0    /* transmitter holding register    */
  29. #define RS_DATA        THR    /* transmit data register    */
  30. #define DIVL         0x0    /* divisor latch LSB        */
  31. #define DIVH         0x1    /* divisor latch MSB        */
  32. #define IER         0x1    /* interrupt enable register    */
  33. #define IIR         0x2    /* interrupt identification register */
  34. #define LCR         0x3    /* line control register    */
  35. #define MCR            0x4    /* modem control register    */
  36. #define LSR         0x5    /* line status register        */
  37. #define RS_STATUS    LSR    /* status register        */
  38. #define MSR         0x6    /* modem status register    */
  39.  
  40. /*
  41.  * LCR bits    
  42.  */
  43. #define LCR_DLAB     0x80    /* divisor latch access        */
  44. #define LCR_SBRK     0x40    /* 1=send break         */
  45. #define LCR_STCP     0x20    /* stack parity bit        */
  46. #define LCR_EPS        0x10    /* 0=even parity, 1=odd parity    */
  47. #define LCR_PEN     0x8    /* 0=no parity, 1=parity    */
  48. #define LCR_STB     0x4    /* 0=1 stop bit, 1=2 stop bit    */
  49. #define LCR_WLS_FLAG     0x3    /* 00=5 bit, 01=6, 10=7, 11=8    */
  50. #define LCR_5BITS     0
  51. #define LCR_6BITS     1
  52. #define LCR_7BITS     2
  53. #define LCR_8BITS     3
  54. #define TX_READY    0x20    /* transmitter buffer empty        */
  55.  
  56. /*
  57.  * hardware address, vectors, masks
  58.  */
  59. #define IMR         0x21    /* interrupt mask register (not offset!) */
  60. #define ADDR_PORT_COM1    0x3F8    /* serial port com1: address    */
  61. #define ADDR_PORT_COM2    0x2f8    /* serial port com2: address    */
  62. #define ADDR_PORT_COM3    0xff    /* ??? serial port com1: address    */
  63. #define ADDR_PORT_COM4    0xff    /* ??? serial port com2: address    */
  64. #define PORT_VECTOR_COM1 0xc    /* serial port com1: vector        */
  65. #define PORT_VECTOR_COM2 0xb    /* serial port com2: vector        */
  66. #define PORT_VECTOR_COM3 0xff    /* ??? serial port com3: vector        */
  67. #define PORT_VECTOR_COM4 0xff    /* ??? serial port com4: vector        */
  68. /*
  69.  * interrupt mask register on master IMR
  70.  * 1= mask, 0=non mask
  71.  * bit 3 = serial port 2
  72.  * bit 4 = serial port 1
  73.  * if com1, 00010000 else if com2, 00001000
  74.  */
  75. #define INT_MASK_COM1    0x10    /* enable com1 receive interrupt    */
  76. #define INT_MASK_COM2    0x08    /* enable com2 receive interrupt    */
  77. #define INT_MASK_COM3    0x0    /* ??? enable com3 receive interrupt    */
  78. #define INT_MASK_COM4    0x0    /* ??? enable com4 receive interrupt    */
  79. #define PORT_BASE    1    /* portNo 0 is com1:            */
  80.  
  81. /*
  82.  * video card info
  83.  */
  84. #ifdef IBMPC
  85. #define VRAM_EGA    0xb800    /* EGA VRAM segment            */
  86. #define VRAM_VGA    0xb800    /* VGA VRAM segment            */
  87. #define VRAM_CGA    0xb800    /* CGA VRAM segment            */
  88. #define VRAM_MDA    0xb000    /* MDA VRAM segment            */
  89. #define VRAM_MCGA    0xb800    /* MCGA VRAM segment            */
  90. #define GVRAMSEG    0xa000    /* EGA graphic VRAM segment        */
  91. #define DEFAULT_VRAM_CARD VRAM_EGA /* use default if no ENV set        */
  92. #define DEFAULT_CARD_MSG  "EGA"    /* used for warning message        */
  93. #define PAGE1        0x1000    /* page 1 address (size of page0)    */
  94. #define MAX_X_DOT    640        /* graphic mode x dots        */
  95. #define MAX_Y_DOT    350        /* graphic mode y dots        */
  96. #endif /* IBMPC */
  97.  
  98. #ifdef J3100
  99. #define VRAM_MONO    0xb800    /* monochrome VRAM segment        */
  100. #define VRAM_COLOR    0xa000    /* color VRAM segment            */
  101. #define GVRAMSEG    0xb800    /* this value is not used        */
  102. #define MAX_X_DOT    640        /* graphic mode x dots            */
  103. #define MAX_Y_DOT    400        /* graphic mode x dots            */
  104. #endif /* J3100 */
  105.  
  106. /*
  107.  * misc. address, parameters
  108.  */
  109. #define ADDR_BUZZAR    0x61    /* buzzar address            */
  110. #define CLICK_BEEP     700    /* click beep length            */
  111. #ifdef J3100
  112. #define BELL_BEEP      2    /* bell beep length (55 * 2 = 110 msec)    */
  113. #else /* !J3100 */
  114. #define BELL_BEEP      3    /* bell beep length (55 * 3 = 165 msec)    */
  115. #endif /* J3100 */
  116.  
  117. #define TIMER_VECT     0x1c    /* tick timer vector            */
  118. #define TICK_SEC    18    /* timer tick is 18.2 per 1 sec        */
  119. #define TICK_INTERVAL    55    /* 55 msec for 1 interval        */
  120. #define BLINK_ON_INTERVAL 8 /* 8 tick soft cursor blink on    */
  121. #define BLINK_OFF_INTERVAL 4 /* 4 tick soft cursor blink off    */
  122. #define BAUD_NUM_MAX     7    /* up to 38400 baud            */
  123. #define TX_TIMEOUT    25    /* transmit time out 18.2 * 25 = 500msec */
  124.  
  125. #define MAX_FUNKEY    17    /* max length of key string (16+1)    */
  126. #define NUM_FUNKEY    10    /* number of function keys        */
  127. #define NUM_PADKEY    13    /* number of keypad/cursor keys        */
  128. #define CS_KEY        0x0300    /* CTRL_space key            */
  129.  
  130. #ifdef IBMPC
  131. #ifdef AX
  132. #define FBOX_CHAR 0x13        /* scroll bar SHOWING char        */
  133. #define EBOX_CHAR 0x08        /* scroll bar HIDDING char        */
  134. #else
  135. #define FBOX_CHAR 0xdc        /* scroll bar SHOWING char        */
  136. #define EBOX_CHAR 0xc4        /* scroll bar HIDDING char        */
  137. #endif /* AX */
  138. #endif /* IBMPC */
  139.  
  140. #ifdef J3100
  141. #define FBOX_CHAR 0x16        /* scroll bar SHOWING char        */
  142. #define EBOX_CHAR 0x2d        /* scroll bar HIDDING char        */
  143. #endif /* J3100 */
  144.  
  145. /*
  146.  * screen (EGA) attribute
  147.  */
  148. #ifndef J3100
  149. #define _NORMAL        0x07
  150. #define    _UNDER        0x00
  151. #define    _REVER        0x70
  152. #define    _HIGH        0x08
  153. #define _BLINK        0x80
  154. #define MAX_BACK_COLOR        8
  155.  
  156. #else /* J3100 */
  157. /* attribute code following decoded into real attribute by putChar/j3100.c */
  158. #define    _NORMAL        0x00
  159. #define _UNDER        0x01
  160. #define _REVER        0x02
  161. #define _HIGH        0x04
  162. #define _BLINK        0x08
  163. #define    _NORMAL_ATTR    0x77
  164. #define    _UNDER_ATTR    0x7f
  165. #define    _REVER_ATTR    0x70
  166. #define    _HIGH_ATTR    0x70    /* J-3100 has no intensitied or    */
  167. #define    _BLINK_ATTR    0x70    /* blinking character attribute    */
  168. #define MAX_BACK_COLOR        1
  169. #endif /* J3100 */
  170.  
  171.