home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / SRC_DBCS / VDHWNDW / VDHEQU.INC < prev    next >
Text File  |  1995-04-14  |  8KB  |  193 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 = VDHEQU.INC
  15. ;*
  16. ;* DESCRIPTIVE NAME = Macros, definitions for base video
  17. ;*
  18. ;*
  19. ;* VERSION      V2.0
  20. ;*
  21. ;* DATE
  22. ;*
  23. ;* DESCRIPTION  Macros, definitions for base video
  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. ;*   03/25/89              132     DCR 132 changes
  44. ;*   04/11/91              1348    NAKADA, Enable DBCS support in Vio-Window, DCR 1348
  45. ;*   09/25/91              B726706 WKB, OEM changes
  46. ;*
  47. ;*****************************************************************************/
  48.  
  49. FUNC_NUM        EQU     256               ; BufferUpdate function number
  50. GRAPHICS_MODE   EQU     0000000000000010b ; Mode type bit 1
  51. PVB_SEL_BIT     EQU     0000000000000001b ; PVB flag bit
  52. LVB_SEL_BIT     EQU     0000000000000010b ; LVB flag bit
  53. CGAAttr         EQU     0000000000000100b ; passed attrs are CGA format ;          
  54. RESERVED_FLAGS  EQU     1111111111111000b
  55. I_ReadCellTypes equ     0               ; table for EGA format LVB      ;          
  56. I_ReadCharStr   equ     1               ; Read characters               ;          
  57. I_ReadCellStr   equ     2               ; Read character/attribute 's   ;          
  58. I_ScrollUp      equ     3               ; Scroll window up              ;          
  59. I_ScrollDown    equ     4               ; Scroll window down            ;          
  60. I_ScrollLeft    equ     5               ; Scroll window left            ;          
  61. I_ScrollRight   equ     6               ; Scroll window right           ;          
  62. I_WrtCellStr    equ     7               ; Write character/attribute 's  ;          
  63. I_WrtCharStr    equ     8               ; Write characters              ;          
  64. I_WrtCharStrAt  equ     9               ; Write characters with attr    ;          
  65. I_WrtNChar      equ     0ah             ; Write character N times       ;          
  66. I_WrtNAttr      equ     0bh             ; Write attribute N times       ;          
  67. I_WrtNCell      equ     0ch             ; Write cell N times            ;          
  68. I_LVBToPVB      equ     0dh             ; Copy the LVB to the PVB       ;          
  69. MIN_WRT_INDEX   EQU     7                                               ;          
  70. MAX_INDEX       EQU     13              ; Max index value allowed       ;          
  71. STATUS_PORT     EQU     3DAH            ; Video port for retrace status
  72.  
  73. WorldAttrCount  equ     3                                               ;          
  74. WorldFMTATTR    equ     0370h                                           ;          
  75. WorldCellSize   equ     4                                               ;          
  76. DefaultCellSize equ     2                                               ;          
  77. LEFT            equ     0001h                                           ;          
  78. UP              equ     0002h                                           ;          
  79. RIGHT           equ     0004h                                           ;          
  80. DOWN            equ     0008h                                           ;          
  81. LVBPVB          equ     0010h                                           ;          
  82. DOMOVE          equ     0001h                                           ;          
  83. DOFILL          equ     0002h                                           ;          
  84.  
  85. ;/*
  86. ;** OEMFlags bit definitions:                                      ;MS?? - BEGIN
  87. ;** WARNING: These are also defined in VDH.H, be sure to update both files
  88. ;*/
  89.  
  90. IDC_CGA         equ     0001h   ; Dual Mode Plasma Controller
  91. VDU_CGA         equ     0002h   ; VDU Controller
  92. DSM_MONITOR     equ     0004h   ; Dual Scan Monitor
  93. PARADISE_VGA    equ     0008h   ; Paradise VGA adapter
  94. PRISM_VGA       equ     0010h   ; Prism LCD VGA adapter
  95. CRYSTAL_VGA     equ     0020h   ; Crystal LCD VGA adapter
  96. STARLIGHT_VGA   equ     0040h   ; Starlight 132 VGA adapter
  97. STARDUST_VGA    equ     0080h   ; Stardust VGA adapter
  98. VGA_E           equ     0100h   ; IBM VGA-E adapter
  99. FAST_CGA        equ     8000h   ; Don't wait on CGA retrace for screen update
  100.  
  101. ;/*
  102. ;**            CPQ132 (B726706)
  103. ;** This is for non-IBM 132 column adapters only.  -AJP
  104. ;*/
  105.  
  106. OEM_132_COLUMNS equ     (STARLIGHT_VGA OR STARDUST_VGA)
  107.  
  108. IFDEF D1348
  109.                                 ;/function index for DBCS BufferUpdate
  110. DefaultFmtIndx  equ     0       ; index of default format function
  111. WorldFmtIndx    equ     2       ; index of world format function
  112. PSFmtIndx       equ     4       ; index of default PS format function
  113. ExtPSFmtIndx    equ     6       ; index of extended PS format function
  114.  
  115.                                 ;/DBCS BufferUpdate (bisecting DBCS
  116.                                 ; character status)
  117. BisectDBCS_START        equ     0001h   ; bisected starting DBCS character
  118. BisectDBCS_LAST         equ     0002h   ; bisected ending DBCS character
  119. BisectDBCS_LEFT         equ     0004h   ; bisected DBCS character in left side
  120. BisectDBCS_RIGHT        equ     0008h   ; bisected DBCS character in right side
  121.  
  122. CharBlank       equ     ' '             ; space character
  123. DBCSFlag        equ     01h
  124. TrailByteFlag   equ     80h
  125. SBCS_BYTE       equ     0
  126.  
  127. IFDEF EPOCH
  128. epochDBCSLead   equ     01h
  129. epochDBCSTrail  equ     02h
  130. ENDIF
  131.  
  132. ;/***************************************************************************
  133. ;*
  134. ;* MACRO NAME    = CheckLeadByte
  135. ;*
  136. ;* DESCRIPTION   = Check if DBCS leading byte or not
  137. ;*
  138. ;* INPUT         = AL = Checked Character Code Point
  139. ;*                 AH = attr#3 when cell size = 4 bytes
  140. ;*                    = 0      when cell size = 2 bytes
  141. ;*                 DS -> viops_*
  142. ;*
  143. ;* OUTPUT        = CF = 0 if SBCS
  144. ;*                      1 if DBCS
  145. ;*
  146. ;* RETURN-NORMAL = NONE
  147. ;* RETURN-ERROR  = NONE
  148. ;*
  149. ;**************************************************************************/
  150.  
  151. lcid_mask       equ     00000011B
  152. DBCSEvBufSiz    equ     10
  153. CheckLeadByte macro
  154.         local   DBCS_LOOP, DBCS_NO, DBCS_OK, DBCS_END
  155.         push    cx
  156.         push    dx
  157.         push    bx
  158.         xor     bh,bh
  159.         mov     bl,ah
  160.         and     bl,lcid_mask
  161.         xchg    bx,ax
  162.         mov     dx,size DBCSENVINFO
  163.         mul     dx
  164.         xchg    bx,ax
  165.  
  166.         clc
  167.         mov     cx,DBCSEvBufSiz/2       ; set loop count
  168.  
  169.         lds     si,[bp].lpNLSExt        ; ds:si -> dbcs env. buffer
  170.  
  171.         mov     dx,ds:[bx+si]
  172. DBCS_LOOP:
  173.         cmp     dx,0
  174.         jz      DBCS_END
  175.         cmp     dl,al                   ; comp start value
  176.         ja      DBCS_END                ; smaller than lower limit
  177.         cmp     al,dh                   ; comp stop value
  178.         jbe     DBCS_OK                 ; in range
  179. DBCS_NO:
  180.         inc     si                      ; see next vector
  181.         inc     si
  182.         mov     dx,ds:[si]
  183.         loop    DBCS_LOOP
  184. DBCS_OK:
  185.         stc
  186. DBCS_END:
  187.         pop     bx
  188.         pop     dx
  189.         pop     cx
  190.         endm
  191. ENDIF ;D1348
  192.  
  193.