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

  1. /*
  2.  * pc98.h: machine dependent parameters for PC9801/PC98XA
  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: pc98.hv  1.2  90/06/24 00:11:02  hirano  Exp $
  12.  */
  13.  
  14.  
  15. #ifdef PC98
  16. /****************************************************
  17.  * PC98 parameters
  18.  */
  19. #define CRTBIOS        0x18    /* CRT BIOS interrupt vector        */
  20. #define KEY_BIOS    0x18    /* keyboard BIOS interrupt vector    */
  21. #define PRINTER_BIOS    0x1a    /* printer BIOS interrupt vector    */
  22. #define BIOS_DS        0x40    /* BIOS work; data segment        */
  23. #define BIOS_KEY_TAB    0x12a    /* BIOS work; key map            */
  24. #define BIOS_KEY_WORK    0x502    /* BIOS work; key table            */
  25. #define CPU_CLOCK    0x501    /* CPU clock flag at 0:501        */
  26. #define TIMER_INT    7        /* interval timer interrupt        */
  27.  
  28. #define IMR        0x02    /* intterrupt mask register        */
  29. #define ICR        0x00    /* interrrupt control register        */
  30. #define EOI        0x20    /* end of interrupt command for ICR    */
  31. #define ADDR_KEY_DATA    0x41    /* keyboard 8251 data register        */
  32. #define ADDR_KEY_STATUS    0x43    /* keyboard 8251 status register    */
  33. #define TIMER_MODE    0x77    /* TIMER mode register address        */
  34. #define TIMER_COUNTER2    0x75    /* timer counter2 register address    */
  35. #define PORT_C        0x37    /* parallel port C register        */
  36. #define RS_DATA        0x0    /* serial 8251 data register (offset)    */
  37. #define RS_STATUS     0x2    /* serial 8251 cmd/status register (offset) */
  38. #define TX_READY    0x05    /* transmitter buffer empty        */
  39. #define PRINTER_PORT    0x42    /* printer port                */
  40.  
  41. #define ADDR_PORT_COM1    0x30    /* serial port com1: address        */
  42. #define ADDR_PORT_COM2    0xb0    /* ??? serial port com2: address    */
  43. #define ADDR_PORT_COM3    0xff    /* ??? serial port com3: address    */
  44. #define ADDR_PORT_COM4    0xff    /* ??? serial port com4: address    */
  45. #define PORT_VECTOR_COM1 0x0c    /* serial port com1: vector        */
  46. #define PORT_VECTOR_COM2 0xff    /* ??? serial port com2: vector        */
  47. #define PORT_VECTOR_COM3 0xff    /* ??? serial port com3: vector        */
  48. #define PORT_VECTOR_COM4 0xff    /* ??? serial port com4: vector        */
  49.  
  50. /*
  51.  * interrupt mask register on master IMR
  52.  * 1= mask, 0=non mask
  53.  * bit 4 = serial port 1
  54.  * if com1, 00010000
  55.  */
  56. #define INT_MASK_COM1    0x10    /* enable com1 receive interrupt    */
  57. #define INT_MASK_COM2    0x0    /* ??? enable com2 receive interrupt    */
  58. #define INT_MASK_COM3    0x0    /* ??? enable com3 receive interrupt    */
  59. #define INT_MASK_COM4    0x0    /* ??? enable com4 receive interrupt    */
  60.  
  61. #define PORT_BASE    1    /* portNo 0 is com1:            */
  62. #define TX_TIMEOUT    5    /* transmit time out 100 * 5 = 500msec    */
  63. #define BAUD_NUM_MAX 7        /* up to 38400 baud                */
  64.  
  65. #define MAX_FUNKEY    17    /* max length of key string (16+1)    */
  66. #define NUM_FUNKEY    10    /* number of function keys        */
  67. #define NUM_PADKEY    27    /* number of keypad/cursor keys        */
  68. #define CS_KEY        0x0000    /* ctrl-space key            */
  69.  
  70. #ifdef PC98XA    /* high resolution mode */
  71. /*
  72.  * TEXT VRAM
  73.  */
  74. #define VRAMSEG        0xe000        /* PC98XA VRAM segment            */
  75. #define PAGE0        0x0000        /* PC98XA page 0 address        */
  76. #define PAGE1        0x1000        /* PC98XA page 1 address        */
  77. #define VRAM1SEG    0xe100        /* PC98XA VRAM page1 segment    */
  78. #define ATTR_OFFSET    0x2000        /* PC98XA VRAM page 0 attribute area */
  79.  
  80. /*
  81.  * GRAPHIC VRAM for soft font
  82.  */
  83. #define GVRAMSEG    0xc000    /* PC98XA GVRAM segment            */
  84. #define MAX_X_DOT    1120    /* graphic mode x dots            */
  85. #define MAX_Y_DOT    750        /* graphic mode y dots            */
  86.  
  87. #else /* NORMAL MODE */
  88. /*
  89.  * TEXT VRAM
  90.  */
  91. #define VRAMSEG     0xa000    /* PC9801 VRAM page0 segment    */
  92. #define PAGE0        0x0000    /* PC9801 page 0 address        */
  93. #define PAGE1        0x1000    /* PC9801 page 1 address        */
  94. #define VRAM1SEG     0xa100    /* PC9801 VRAM page1 segment    */
  95. #define ATTR_OFFSET 0x2000    /* PC9801 VRAM page0 attribute area    */
  96.  
  97. /*
  98.  * GRAPHIC MODE for soft font
  99.  */
  100. #define GVRAMSEG    0xa800    /* PC9801 GVRAM segment            */
  101. #define MAX_X_DOT    640        /* graphic mode x dots            */
  102. #define MAX_Y_DOT    400        /* graphic mode x dots            */
  103. #endif /* PC98XA */
  104.  
  105. #define CLICK_BEEP  400        /* click beep length            */
  106. #define BELL_BEEP   2        /* bell beep length (100msec * 3 = 300msec) */
  107. #define TICK_SEC    10        /* timer tick is 10 per 1 sec    */
  108. #define TICK_INTERVAL    100    /* 100 msec for 1 interval        */
  109. #define BLINK_ON_INTERVAL 6 /* 6 tick soft cursor blink on    */
  110. #define BLINK_OFF_INTERVAL 3 /* 3 tick soft cursor blink off    */
  111.  
  112. #define FBOX_CHAR 0x83        /* scroll bar SHOWING char        */
  113. #define EBOX_CHAR 0x95        /* scroll bar HIDDING char        */
  114.  
  115. /*
  116.  * screen attribute
  117.  */
  118. #define _NORMAL    0xe1        /* white, normal    */
  119. #define    _UNDER    0x09        /* black, under, normal    */
  120. #define    _REVER    0x05        /* black, reverse, normal */
  121. #define    _HIGH    0xc1        /* yellow, normal    */
  122. #define _BLINK    0x03        /* blink, normal    */
  123. #define    B_UNDER        0x08        /* under bit    */
  124. #define    B_REVER        0x04        /* reverse bit    */
  125. #define B_BLINK        0x02        /* blink bit    */
  126. #define B_NORMAL    0x01        /* normal bit    */
  127. #define A_WHITE        0xe0        /* white        */
  128. #define A_BLACK        0x00        /* black        */
  129. #define A_YELLOW    0xc0        /* yellow        */
  130. #define MAX_BACK_COLOR        8
  131.  
  132. #endif /* PC98 */
  133.  
  134.