home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / VDH / IDHEQU.INC < prev    next >
Text File  |  1995-04-14  |  14KB  |  306 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT (C) Microsoft Corporation, 1989
  4. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  5. ;
  6. ;    The following IBM OS/2 WARP source code is provided to you solely for
  7. ;    the purpose of assisting you in your development of OS/2 WARP device
  8. ;    drivers. You may use this code in accordance with the IBM License
  9. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  10. ;    Copyright statement may not be removed.;
  11. ;*****************************************************************************/
  12. ;/*****************************************************************************
  13. ;*
  14. ;* SOURCE FILE NAME = IDHEQU.INC
  15. ;*
  16. ;* DESCRIPTIVE NAME = Definitions for IDH routines
  17. ;*
  18. ;*
  19. ;* VERSION      V2.0
  20. ;*
  21. ;* DATE         
  22. ;*
  23. ;* DESCRIPTION  Definitions for IDH routines 
  24. ;*
  25. ;* FUNCTIONS    NONE
  26. ;*
  27. ;* NOTES        NONE
  28. ;*
  29. ;* STRUCTURES   NONE
  30. ;*
  31. ;* EXTERNAL REFERENCES
  32. ;*
  33. ;*              NONE
  34. ;*
  35. ;* EXTERNAL FUNCTIONS
  36. ;*
  37. ;*              NONE
  38. ;*
  39. ;* CHANGE ACTIVITY =
  40. ;*   DATE      FLAG        APAR    CHANGE DESCRIPTION
  41. ;*   --------  ----------  -----   --------------------------------------
  42. ;*   mm/dd/yy  @Vr.mpppxx  xxxxx   xxxxxxx
  43. ;*   01/11/89              P2986   enhance config and codepage support
  44. ;*   03/25/89              132     DCR 132 changes
  45. ;*   03/25/89              204     DCR 204
  46. ;*   07/15/89              B784056 Remove hardware dependencies in VDHINIT  
  47. ;*   09/26/89              B785912 Change default attribute to 07,
  48. ;*   01/24/90              704     2.0 unique - DCR 704 work
  49. ;*   07/23/90              1295    DCR 1295 - Support recognition of XGA device
  50. ;*   07/31/90              B790152 Return correct number of bytes in LVB,
  51. ;*
  52. ;*****************************************************************************/
  53.  
  54.                 .286p                             ;Generate protect mode code
  55.  
  56. IDHGSEG         equ     <_DATA>                   ;Default DGROUP name for C ;          
  57.  
  58. ;/*
  59. ;** Equates used by the Windowable Device Handler
  60. ;*/
  61.  
  62. ;/*
  63. ;** Stack frame used by all IDH routines
  64. ;*/
  65.  
  66. stackframe      STRUC                             ;VDH Stack Frame
  67.  
  68. stk_reges       dw      ?                         ;Reg ES save area
  69. stk_regds       dw      ?                         ;Reg DS save area
  70. stk_regdi       dw      ?                         ;Reg DI save area
  71. stk_regsi       dw      ?                         ;Reg SI save area
  72. stk_regbp       dw      ?                         ;Reg BP save area
  73. stk_regsp       dw      ?                         ;Reg SP save area
  74. stk_regbx       dw      ?                         ;Reg BX save area
  75. stk_regdx       dw      ?                         ;Reg DX save area
  76. stk_regcx       dw      ?                         ;Reg CX save area
  77. stk_regax       dw      ?                         ;Reg AX save area
  78. stk_flags       dw      ?                         ;Reg FL save area
  79. stk_retaddr     dd      ?                         ;Return Address
  80. stk_function    dd      ?                         ;Function Number
  81. stk_parmblock   dd      ?                         ;Parameter Block Address
  82. stk_envblock    dd      ?                         ;Environment Block Address
  83.  
  84. stackframe      ENDS
  85.  
  86. ;/*
  87. ;** Structure used to determine video hardware configuration ;         - Begin
  88. ;*/
  89.  
  90. Vhardware STRUC
  91.  
  92. ;/*
  93. ;**  WARNING: this structure is also defined in VDH.H, be sure
  94. ;**           to update both structures when changing this one
  95. ;*/
  96.  
  97.         fVideoType DW ?                          ; video hardware configuration
  98.         display    DW ?                          ; display type  (not used by BVHINIT)
  99.         memory     DD ?                          ; memory configuration
  100.         Reg_132    DW ?                          ; VGA-E 132 col. (not used by BVHINIT)
  101.         popupMode  DB ?                          ; popup mode  (not used by BVHINIT)
  102. Vhardware ENDS
  103.  
  104. ;/*
  105. ;**  Bit defintions for fVideoType
  106. ;*/
  107.  
  108. MPA_BIT            EQU 1      ; bit 0, MPA adapter with MONO monitor
  109. CGA_BIT            EQU 2      ; bit 1, CGA adapter with COLOR monitor
  110. EGM_BIT            EQU 4      ; bit 2, EGA adapter with MONO monitor
  111. EGC_BIT            EQU 8      ; bit 3, EGA adapter with COLOR monitor
  112. EGA_BIT            EQU 10h    ; bit 4, EGA adapter with ENHANCED COLOR monitor
  113. VGP_BIT            EQU 20h    ; bit 5, VGA plasma display
  114. VGM_BIT            EQU 40h    ; bit 6, VGA adapter with MONO monitor
  115. VGC_BIT            EQU 80h    ; bit 7, VGA adapter with COLOR monitor
  116. A8514M_BIT         EQU 100h   ; bit 8, 8514A with 8507 monitor
  117. A8514C_BIT         EQU 200h   ; bit 9, 8514A with 8512/3 monitor
  118. A8514A_BIT         EQU 400h   ; bit 10, 8514A with 8514 monitor
  119. A8514_15_BIT       EQU 800h   ; bit 11, 8514A with 8515 monitor
  120. A8514_03_BIT       EQU 1000h  ; bit 12, 8514A with Monochrome 8503 monitor
  121. NODISPLAY_BIT      EQU 2000h  ; bit 13, no display present on VGA system
  122. XGA_BIT            EQU 4000h  ; bit 14, XGA adapter present  ;          
  123.  
  124. ;/*
  125. ;** Bit defintions for fVideoMemory
  126. ;**  bits 0 and 1 reflect memory configuation for EGA or 8514A
  127. ;**
  128. ;**        0 0  - minimum memory, EGA = 64K, 8514A = .5M
  129. ;**        0 1  - EGA = 128K
  130. ;**        1 0  - EGA = 192K
  131. ;**        1 1  - maximum memory, EGA = 256K, 8514A = 1M
  132. ;*/
  133.  
  134. MEM_EGA64K      EQU 0000h
  135. MEM_EGA128K     EQU 0001h
  136. MEM_EGA192K     EQU 0002h
  137. MEM_EGA256K     EQU 0003h
  138. MEM_A85141MEG   EQU 0003h
  139.  
  140. ;/*
  141. ;**  All possible VGA configurations
  142. ;*/
  143.  
  144. VGA_BITS         EQU VGP_BIT+VGM_BIT+VGC_BIT+NODISPLAY_BIT
  145. A8514_BITS       EQU A8514M_BIT+A8514C_BIT+A8514A_BIT+A8514_15_BIT+A8514_03_BIT
  146.  
  147.                                                      ;         - End
  148.  
  149. ;/*
  150. ;** Structure of the global data used by IDH, IDHGSEG
  151. ;*/
  152.  
  153. idhglobal       STRUC
  154.  
  155. idh_ioport      dw      0                         ;I/O Port for Video Updates
  156.  
  157. idh_codepage    dw      0                         ;Current codepage id ;        
  158. idh_fontsize    dw      8                         ;8x8 Font is default ;        
  159.  
  160. idh_selector    dw      0                         ;CDIB/Work Buffer selector ;        
  161. idh_handle      dw      0                         ;Font file handle ;        
  162.  
  163. idh_scratch     dd      0                         ;Scratch area ;        
  164.  
  165. idh_cdib        db      '\SHAREMEM\DOS\CDIB',0 ;CDIB name ;        
  166.  
  167. idh_scr         db      '\DEV\SCREEN$',0 ;Name of Screen Device Driver  ;        
  168.  
  169. idhglobal       ENDS
  170.  
  171. idhenvironment  STRUC
  172.  
  173. env_modeoffset  dw      2                         ;Offset of mode data
  174.  
  175. env_mdlen       dw      34                        ;Length of mode data (=34)
  176. env_type        db      1                         ;Type for Mode
  177. env_colors      db      4                         ;Colors for Mode
  178. env_cols        dw      80                        ;Number of screen columns for text
  179. env_rows        dw      25                        ;Number of screen rows for text
  180. env_gcols       dw      640                       ;Number of screen columns for graphics
  181. env_grows       dw      200                       ;Number of screen rows for graphics
  182. env_attrformat  db      0                         ;Attribute format
  183. env_attrbytes   db      1                         ;Number of attribute bytes ;          
  184. env_bufaddr     dd      000B8000h                 ;Address of video buffer
  185. env_bufsize     dd      00000FA0h                 ;Size of video buffer
  186. env_fullbufsz   dd      00000FA0h                 ;Full buffer save size
  187. env_partbufsz   dd      00000FA0h                 ;Partial buffer save size
  188. env_extdata     dd      0                         ;Extended mode data address
  189. env_rectleft    dw      0                         ;Scrolling rectangle ;          
  190. env_recttop     dw      0                         ;Scrolling rectangle ;          
  191. env_rectright   dw      79                        ;Scrolling rectangle ;          
  192. env_rectbottom  dw      24                        ;Scrolling rectangle ;          
  193.  
  194. env_row         dw      0                         ;Cursor Row
  195. env_col         dw      0                         ;Cursor Column
  196. env_startline   dw      6                         ;Cursor Startline
  197. env_endline     dw      7                         ;Cursor Endline
  198. env_width       dw      1                         ;Cursor Width
  199. env_attr        dw      1                         ;Cursor Attribute
  200.  
  201. env_scrlleft    dw      0                         ;Scrollable Screen Rect  ;          
  202. env_scrltop     dw      0                         ;Scrollable Screen Rect  ;          
  203. env_scrlright   dw      79                        ;Scrollable Screen Rect  ;          
  204. env_scrlbottom  dw      24                        ;Scrollable Screen Rect  ;          
  205.  
  206. env_attrbufsiz  dw      1                         ;          
  207. env_attrbuf     db      07                        ;default attribute                         
  208.                 db      0                         ;second byte of 3 byte attribute;          
  209.                 db      0                         ;third byte of 3 byte attribute ;          
  210.                 db      0                         ;waste byte to keep structure aligned
  211. idhenvironment  ENDS
  212.  
  213. hardwareports   STRUC                             ;Generic Video Hardware Port Equates
  214.  
  215. hp_hchartotal   db      ?                         ;Horizontal Characters Total
  216. hp_hchardspl    db      ?                         ;Horizontal Characters Displayed
  217. hp_hsyncpos     db      ?                         ;Horizontal Sync Position
  218. hp_hsyncwidth   db      ?                         ;Horizontal Sync Width
  219. hp_vchartotal   db      ?                         ;Vertical Characters Total
  220. hp_vtotaladj    db      ?                         ;Vertical Total Adjustment
  221. hp_vchardspl    db      ?                         ;Vertical Characters Displayed
  222. hp_vsyncpos     db      ?                         ;Vertical Sync Position
  223. hp_interlace    db      ?                         ;Interlace Mode
  224. hp_maxscanline  db      ?                         ;Maximum Scan Line
  225. hp_cursorstart  db      ?                         ;Starting Cursor Scan Line
  226. hp_cursorend    db      ?                         ;Ending Cursor Scan Line
  227. hp_startaddrh   db      ?                         ;Starting Address (High)
  228. hp_startaddrl   db      ?                         ;Starting Address (Low)
  229. hp_cursoraddrh  db      ?                         ;Cursor Address (High)
  230. hp_cursoraddrl  db      ?                         ;Cursor Address (Low)
  231.  
  232. hardwareports   ENDS
  233.  
  234. ;/*
  235. ;**  Structure defining the BIOS data area ;        
  236. ;*/
  237.  
  238. realdata        STRUC                             ;Real Mode data area (based at 40:0)
  239.                 db      00010h dup (?)
  240. real_equipflag  dw      ?                         ;Bios Equipment Flag
  241.                 db      00037h dup (?)
  242. real_crtmode    db      ?                         ;Bios Video Mode
  243. real_crtcols    dw      ?                         ;Bios Video Columns
  244. real_crtlen     dw      ?                         ;Bios Video Length
  245. real_crtstart   dw      ?                         ;Bios Video Start Address
  246. real_cursorposn dw      8 dup (?)                ;Bios Cursor Positions
  247. real_cursormode dw      ?                         ;Bios Cursor Mode
  248. real_activepage db      ?                         ;Bios Active Video Page
  249. real_addr6845   dw      ?                         ;Bios Video Port Address
  250. real_crtmodeset db      ?                         ;Bios Video Mode Control Register
  251. real_crtpalette db      ?                         ;Bios Palette
  252.                 db      0001Dh dup (?)
  253. real_rows       db      ?                         ;Bios Video Rows
  254. real_points     dw      ?                         ;Bios Video Font Pels
  255. real_info       db      ?                         ;Bios EGA Info Byte
  256. real_info3      db      ?                         ;Bios EGA Info3 Byte
  257.                 db      0001Fh dup (?)
  258. real_saveptr    dd      ?                         ;Bios Video Save Area Pointer
  259. realdata        ENDS                              ;        
  260.  
  261. real_f_cgaemu   equ     01h                       ;INFO byte, CGA emulation flag
  262.  
  263. ;/*
  264. ;**  Structure defining the ABIOS Request Block ;        
  265. ;*/
  266.  
  267.  
  268. ABIOS_Request_Block     STRUC                     ;        
  269.  
  270. ABIOS_RB_Len            dw                       0 ;+00h
  271. ABIOS_DevId             dw                       0 ;+02h
  272. ABIOS_Unit              dw                       0 ;+04h
  273. ABIOS_Func              dw                       0 ;+06h
  274. ABIOS_RBFlags           dw                       0 ;+08h
  275. ABIOS_ELOff             dw                       0 ;+0Ah
  276. ABIOS_RetCode           dw                       0 ;+0Ch
  277. ABIOS_TimeOut           dw                       0 ;+0Eh
  278. ABIOS_DataPtr1x         dw                       0 ;+10h
  279. ABIOS_DataPtr1l         dw                       0 ;+12h
  280. ABIOS_DataPtr1h         dw                       0 ;+14h
  281.                         dw                       0
  282. ABIOS_Count             dw                       0 ;+18h
  283. ABIOS_DevCntlFlag       dw                       0 ;+1Ah
  284. ABIOS_ScanLines         db                       0 ;+1Ch
  285. ABIOS_CharGenType       db                       0 ;+1Dh
  286. ABIOS_VideoMode         dw                       0 ;+1Eh
  287. ABIOS_MonitorType       dw                       0 ;+20h
  288. ABIOS_CharHeight        dw                       0 ;+22h
  289. ABIOS_Map2Block         dw                       0 ;+24h
  290. ABIOS_UpdateFontFlag    dw                       0 ;+26h
  291. ABIOS_CharOffset        dw                       0 ;+28h
  292. ABIOS_FontDataSize      dw                       0 ;+2Ah
  293. ABIOS_Environment       dw                       0 ;+2Ch
  294. ABIOS_SR_Header_Size    dw                       0 ;+2Eh
  295. ABIOS_SR_Hdw_Size       dw                       0 ;+30h
  296. ABIOS_PaletteReg        dw                       0 ;+32h
  297. ABIOS_PaletteValue      dw                       0 ;+34h
  298.                         dw                       0 ;+36h
  299.                         dw                       0 ;+38h
  300.                         dw                       0 ;+3Ah
  301.                         dw                       0 ;+3Ch
  302.                         dw                       0 ;+3Eh = Padding for future use
  303.  
  304. ABIOS_Request_Block     ENDS                      ;        
  305.  
  306.