Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
8.4 KiB

  1. ;---------------------------Module-Header------------------------------;
  2. ; Module Name: driver.inc
  3. ;
  4. ; Contains prototypes for the 256 colour VGA driver.
  5. ;
  6. ; NOTE: Must mirror driver.h!
  7. ;
  8. ; Copyright (c) 1992 Microsoft Corporation
  9. ;-----------------------------------------------------------------------;
  10. ; Sizes assumed for 1-window and 2 RW-window banks.
  11. BANK_SIZE_1_WINDOW equ 10000h
  12. BANK_SIZE_2RW_WINDOW equ 8000h
  13. ; Specifies desired justification for requestion scan line within bank window
  14. JustifyTop equ 0
  15. JustifyBottom equ 1
  16. ; Specifies which window is to be mapped by two-window bank handler.
  17. MapSourceBank equ 0
  18. MapDestBank equ 1
  19. ;------------------------------------------------------------------------;
  20. ; Miscellaneous driver flags
  21. DRIVER_PLANAR_CAPABLE equ 1
  22. ; Bank status flags
  23. BANK_BROKEN_RASTER1 equ 1 ; If bank1 or read bank has broken raster
  24. BANK_BROKEN_RASTER2 equ 2 ; If bank2 or write bank has broken raster
  25. BANK_BROKEN_RASTERS equ (BANK_BROKEN_RASTER1 + BANK_BROKEN_RASTER2)
  26. ;------------------------------------------------------------------------;
  27. ; The Physical Device data structure.
  28. PDEV struc
  29. pdev_fl dd ? ; Driver flags
  30. pdev_hDriver dd ? ; Handle to \Device\Screen
  31. pdev_hdevEng dd ? ; Engine's handle to PDEV
  32. pdev_hsurfEng dd ? ; Engine's handle to surface
  33. pdev_hsurfBm dd ? ; Handle to the "punt" surface
  34. pdev_pSurfObj dd ? ; Pointer to the locked "punt" surface
  35. pdev_hpalDefault dd ? ; Handle to the default palette for device.
  36. pdev_pjScreen dd ? ; This is pointer to base screen address
  37. pdev_cxScreen dd ? ; Visible screen width
  38. pdev_cyScreen dd ? ; Visible screen height
  39. pdev_ulMode dd ? ; Mode in which the mini-port driver is
  40. pdev_lDeltaScreen dd ? ; Distance from one scan to the next
  41. pdev_flRed dd ? ; For bitfields device, Red Mask
  42. pdev_flGreen dd ? ; For bitfields device, Green Mask
  43. pdev_flBlue dd ? ; For bitfields device, Blue Mask
  44. pdev_ulBitCount dd ? ; # of bits per pel 16 is only supported
  45. pdev_pGdiInfo dd ? ; Pointer to temporary buffer for GDIINFO struct
  46. pdev_pDevInfo dd ? ; Pointer to temporary buffer for DEVINFO struct
  47. pdev_ulrm0_wmX dd ? ; Values to set GC5 to to select read mode
  48. ; 0 together with write modes 0-3
  49. ; Off Screen Save Stuff:
  50. pdev_hbmTmp dd ? ; Handle to temporary buffer
  51. pdev_psoTmp dd ? ; Temporary surface
  52. pdev_pvTmp dd ? ; Pointer to temporary buffer
  53. pdev_cyTmp dd ? ; # of scans in temporary surface
  54. ; DCI Stuff:
  55. pdev_bSupportDCI dd ? ; Does miniport support DCI?
  56. ; Bank manager stuff common between planar and non-planar modes:
  57. pdev_cTotalScans dd ? ; Number of usable on & off screen scans
  58. pdev_pBankInfo dd ? ; Bank info for current mode
  59. pdev_flBank dd ? ; Flags for current bank state
  60. pdev_ulBitmapSize dd ? ; Length of bitmap if there were no
  61. ; banking, in CPU addressable bytes
  62. pdev_ulWindowBank dd ?,? ; Current banks mapped into windows
  63. ; 0 & 1 (used in 2 window mode only)
  64. pdev_pvBitmapStart dd ? ; Single-window bitmap start pointer
  65. ; (adjusted as necessary to make
  66. ; window map in at proper offset)
  67. pdev_pvBitmapStart2Window dd ?,? ; Double-window window 0 and 1 bitmap
  68. ; start
  69. ; Non-planar mode specific bank management control stuff:
  70. pdev_vbtBankingType dd ? ; Type of banking
  71. pdev_pfnBankSwitchCode dd ? ; Pointer to bank switch code
  72. pdev_lNextScan dd ? ; Offset to next bank in bytes
  73. pdev_pjJustifyTopBank dd ? ; Pointer to lookup table for
  74. ; converting scans to banks
  75. pdev_pbiBankInfo dd ? ; Pointer to array of bank clip info
  76. pdev_ulJustifyBottomOffset dd ? ; Number of scans from top to bottom
  77. ; of bank, for bottom justifying
  78. pdev_iLastBank dd ? ; Index of last valid bank in
  79. pdev_ulBank2RWSkip dd ? ; Offset from one bank index to next
  80. ; to make two 32K banks appear to be
  81. ; one seamless 64K bank
  82. pdev_pfnBankControl dd ? ; Pointer to bank control function
  83. pdev_pfnBankControl2Window dd ? ; Pointer to double-window bank
  84. ; control function
  85. pdev_pfnBankNext dd ? ; Pointer to next bank function
  86. pdev_pfnBankNext2Window dd ? ; Pointer to double-window next bank
  87. ; function
  88. pdev_rcl1WindowClip db (size RECTL) dup (?)
  89. ; Single-window banking clip rect
  90. pdev_rcl2WindowClip db (2*(size RECTL)) dup (?)
  91. ; Double-window banking clip rects for
  92. ; windows 0 & 1
  93. ; Planar mode specific bank management control stuff:
  94. pdev_vbtPlanarType dd ? ; Type of planar banking
  95. pdev_pfnPlanarSwitchCode dd ? ; Pointer to planar bank switch code
  96. pdev_lPlanarNextScan dd ? ; Offset to next planar bank in bytes
  97. pdev_pjJustifyTopPlanar dd ? ; Pointer to lookup table for
  98. ; converting scans to planar banks
  99. pdev_pbiPlanarInfo dd ? ; Pointer to array of bank clip info
  100. pdev_ulPlanarBottomOffset dd ? ; Number of scans from top to bottom
  101. ; of bank, for bottom justifying
  102. pdev_iLastPlanar dd ? ; Index of last valid bank in
  103. pdev_ulPlanar2RWSkip dd ? ; Offset from one bank index to next
  104. ; to make two 32K banks appear to be
  105. ; one seamless 64K bank
  106. pdev_pfnPlanarControl dd ? ; Pointer to bank control function
  107. pdev_pfnPlanarControl2 dd ? ; Pointer to double-window bank
  108. ; control function
  109. pdev_pfnPlanarNext dd ? ; Pointer to next bank function
  110. pdev_pfnPlanarNext2 dd ? ; Pointer to double-window next bank
  111. ; function
  112. pdev_rcl1PlanarClip db (size RECTL) dup (?)
  113. ; Single-window banking clip rect
  114. pdev_rcl2PlanarClip db (2*(size RECTL)) dup (?)
  115. ; Double-window banking clip rects for
  116. pdev_pfnPlanarEnable dd ? ; Function to enable planar mode
  117. pdev_pfnPlanarDisable dd ? ; Function to disable planar mode
  118. ; Smart bank management stuff:
  119. pdev_iLastScan dd ? ; Last scan we want to enumerate
  120. pdev_pvScanScan0 dd ? ; Surface's original pvScan0
  121. pdev_rclSaveBounds db (size RECTL) dup (?)
  122. ; Clip object's original bounds
  123. pdev_pcoNull dd ? ; Pointer to empty clip object
  124. pdev_iSaveDComplexity db ? ; Clip object's original complexity
  125. pdev_fjSaveOptions db ? ; Clip object's original flags
  126. pdev_ajFiller db ?,? ; Pack to dword alignment
  127. PDEV ends
  128. pdev_rcl2WindowClipS equ (pdev_rcl2WindowClip)
  129. pdev_rcl2WindowClipD equ (pdev_rcl2WindowClip + (size RECTL))
  130. pdev_rcl2PlanarClipS equ (pdev_rcl2PlanarClip)
  131. pdev_rcl2PlanarClipD equ (pdev_rcl2PlanarClip + (size RECTL))
  132. pdev_pvBitmapStart2WindowS equ (pdev_pvBitmapStart2Window)
  133. pdev_pvBitmapStart2WindowD equ (pdev_pvBitmapStart2Window + dword)
  134. ;------------------------------------------------------------------------;
  135. ; Macro to do a simple RET, with no stack stuff, in a proc.
  136. PLAIN_RET macro
  137. db 0c3h
  138. endm
  139. ; Macro to replace a CALL followed immediately by a JMP:
  140. CALL_AND_JUMP macro CALL_ADDR,JUMP_ADDR
  141. push offset JUMP_ADDR
  142. jmp CALL_ADDR
  143. endm