Annotation of ntddk/src/video/displays/vga256/i386/driver.inc, revision 1.1.1.1

1.1       root        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: 
                     11: ; Sizes assumed for 1-window and 2 RW-window banks.
                     12: 
                     13: BANK_SIZE_1_WINDOW      equ 10000h
                     14: BANK_SIZE_2RW_WINDOW    equ 8000h
                     15: 
                     16: ; Specifies desired justification for requestion scan line within bank window
                     17: 
                     18: JustifyTop              equ 0
                     19: JustifyBottom           equ 1
                     20: 
                     21: ; Specifies which window is to be mapped by two-window bank handler.
                     22: 
                     23: MapSourceBank           equ 0
                     24: MapDestBank             equ 1
                     25: 
                     26: ;------------------------------------------------------------------------;
                     27: 
                     28: ; Miscellaneous driver flags
                     29: 
                     30: DRIVER_PLANAR_CAPABLE   equ 1
                     31: 
                     32: ; Bank status flags
                     33: 
                     34: BANK_BROKEN_RASTER1     equ 1       ; If bank1 or read bank has broken raster
                     35: BANK_BROKEN_RASTER2     equ 2       ; If bank2 or write bank has broken raster
                     36: BANK_BROKEN_RASTERS     equ (BANK_BROKEN_RASTER1 + BANK_BROKEN_RASTER2)
                     37: 
                     38: ;------------------------------------------------------------------------;
                     39: ; Structures for maintaining a realized brush:
                     40: 
                     41: RBRUSH_BLACKWHITE       equ 001h    ; Black and white brush
                     42: RBRUSH_2COLOR           equ 002h    ; 2 color brush
                     43: RBRUSH_NCOLOR           equ 004h    ; n color brush
                     44: RBRUSH_4PELS_WIDE       equ 008h    ; Brush is 4xN
                     45: 
                     46: BRUSH_SIZE              equ 64      ; An 8x8 8bpp brush needs 64 bytes
                     47: 
                     48: RBRUSH struc
                     49: rb_fl                       dd  ?           ; Flags
                     50: rb_xBrush                   dd  ?           ; Realized brush's x brush origin
                     51:                                             ; Pattern in planar format
                     52: rb_ulFgColor                dd  ?           ; Foreground color for 2-color
                     53: rb_ulBkColor                dd  ?           ; Background color for 2-color
                     54: rb_cy                       dd  ?           ; Height of pattern
                     55: rb_cyLog2                   dd  ?           ; log2 of height
                     56: rb_iCache                   dd  ?           ; Cache entry index; 0 not valid
                     57: rb_aulPattern               dd  (BRUSH_SIZE / 4) dup (?)
                     58: RBRUSH ends
                     59: 
                     60: BRUSHCACHEENTRY struc
                     61: bce_prbVerifyRealization    dd  ?           ; For verifying cache entry valid
                     62: bce_yCache                  dd  ?           ; Scan where entry's bits live
                     63: bce_ulCache                 dd  ?           ; Planar (!) offset to cache entry
                     64: BRUSHCACHEENTRY ends
                     65: 
                     66: ;------------------------------------------------------------------------;
                     67: ; The Physical Device data structure.
                     68: 
                     69: PDEV struc
                     70: pdev_fl                     dd  ?   ; Driver flags
                     71: pdev_hDriver                dd  ?   ; Handle to \Device\Screen
                     72: pdev_hdevEng                dd  ?   ; Engine's handle to PDEV
                     73: pdev_hsurfEng               dd  ?   ; Engine's handle to surface
                     74: pdev_hsurfBm                dd  ?   ; Handle to the "punt" surface
                     75: pdev_pSurfObj               dd  ?   ; Pointer to the locked "punt" surface
                     76: 
                     77: pdev_hpalDefault            dd  ?   ; Handle to the default palette for device.
                     78: 
                     79: pdev_pjScreen               dd  ?   ; This is pointer to base screen address
                     80: pdev_cxScreen               dd  ?   ; Visible screen width
                     81: pdev_cyScreen               dd  ?   ; Visible screen height
                     82: pdev_ulMode                 dd  ?   ; Mode in which the mini-port driver is
                     83: pdev_lDeltaScreen           dd  ?   ; Distance from one scan to the next
                     84: 
                     85: pdev_flRed                  dd  ?   ; For bitfields device, Red Mask
                     86: pdev_flGreen                dd  ?   ; For bitfields device, Green Mask
                     87: pdev_flBlue                 dd  ?   ; For bitfields device, Blue Mask
                     88: pdev_ulBitCount             dd  ?   ; # of bits per pel 8,16 are only supported
                     89: 
                     90: pdev_pdda                   dd  ?   ; DDA drawing object for trapezoids
                     91: 
                     92: pdev_pGdiInfo               dd  ?   ; Pointer to temporary buffer for GDIINFO struct
                     93: pdev_pDevInfo               dd  ?   ; Pointer to temporary buffer for DEVINFO struct
                     94: 
                     95: pdev_ulrm0_wmX              dd  ?   ; Values to set GC5 to to select read mode
                     96:                                     ;  0 together with write modes 0-3
                     97: 
                     98: pdev_pjGlyphFlipTableBase   dd  ?   ; Base allocated address for flip table;
                     99:                                     ;  the pointer we use is this pointer
                    100:                                     ;  rounded up to the nearest 256-byte
                    101:                                     ;  boundary
                    102: pdev_pjGlyphFlipTable       dd  ?   ; Pointer to table used to flip glyph bits
                    103:                                     ;  0-3 and 4-7
                    104: 
                    105: pdev_pPal                   dd  ?   ; If this is pal managed, this is the pal
                    106: 
                    107: ; Off Screen Save Stuff:
                    108: 
                    109: pdev_hbmTmp                 dd  ?   ; Handle to temporary buffer
                    110: pdev_psoTmp                 dd  ?   ; Temporary surface
                    111: pdev_pvTmp                  dd  ?   ; Pointer to temporary buffer
                    112: pdev_cyTmp                  dd  ?   ; # of scans in temporary surface
                    113: 
                    114: ; Brush cache:
                    115: 
                    116: pdev_iCache                 dd  ?   ; Index for last brush to be allocated
                    117: pdev_iCacheLast             dd  ?   ; Last valid cache index
                    118: pdev_pbceCache              dd  ?   ; Pointer to allocated cache
                    119: 
                    120: ; Bank manager stuff common between planar and non-planar modes:
                    121: 
                    122: pdev_cTotalScans            dd  ?   ; Number of usable on & off screen scans
                    123: pdev_pBankInfo              dd  ?   ; Bank info for current mode
                    124: pdev_flBank                 dd  ?   ; Flags for current bank state
                    125: pdev_ulBitmapSize           dd  ?   ; Length of bitmap if there were no
                    126:                                     ;  banking, in CPU addressable bytes
                    127: 
                    128: pdev_ulWindowBank           dd  ?,? ; Current banks mapped into windows
                    129:                                     ;  0 & 1 (used in 2 window mode only)
                    130: 
                    131: pdev_pvBitmapStart          dd  ?   ; Single-window bitmap start pointer
                    132:                                     ;  (adjusted as necessary to make
                    133:                                     ;  window map in at proper offset)
                    134: pdev_pvBitmapStart2Window   dd  ?,? ; Double-window window 0 and 1 bitmap
                    135:                                     ; start
                    136: 
                    137: ; Non-planar mode specific bank management control stuff:
                    138: 
                    139: pdev_vbtBankingType         dd  ?   ; Type of banking
                    140: pdev_pfnBankSwitchCode      dd  ?   ; Pointer to bank switch code
                    141: pdev_lNextScan              dd  ?   ; Offset to next bank in bytes
                    142: pdev_pjJustifyTopBank       dd  ?   ; Pointer to lookup table for
                    143:                                     ;  converting scans to banks
                    144: pdev_pbiBankInfo            dd  ?   ; Pointer to array of bank clip info
                    145: pdev_ulJustifyBottomOffset  dd  ?   ; Number of scans from top to bottom
                    146:                                     ;  of bank, for bottom justifying
                    147: pdev_iLastBank              dd  ?   ; Index of last valid bank in
                    148: pdev_ulBank2RWSkip          dd  ?   ; Offset from one bank index to next
                    149:                                     ;  to make two 32K banks appear to be
                    150:                                     ;  one seamless 64K bank
                    151: 
                    152: pdev_pfnBankControl         dd  ?   ; Pointer to bank control function
                    153: pdev_pfnBankControl2Window  dd  ?   ; Pointer to double-window bank
                    154:                                     ;  control function
                    155: 
                    156: pdev_pfnBankNext            dd  ?   ; Pointer to next bank function
                    157: pdev_pfnBankNext2Window     dd  ?   ; Pointer to double-window next bank
                    158:                                     ;  function
                    159: pdev_rcl1WindowClip         db  (size RECTL) dup (?)
                    160:                                     ; Single-window banking clip rect
                    161: pdev_rcl2WindowClip         db  (2*(size RECTL)) dup (?)
                    162:                                     ; Double-window banking clip rects for
                    163:                                     ;  windows 0 & 1
                    164: 
                    165: ; Planar mode specific bank management control stuff:
                    166: 
                    167: pdev_vbtPlanarType          dd  ?   ; Type of planar banking
                    168: pdev_pfnPlanarSwitchCode    dd  ?   ; Pointer to planar bank switch code
                    169: pdev_lPlanarNextScan        dd  ?   ; Offset to next planar bank in bytes
                    170: pdev_pjJustifyTopPlanar     dd  ?   ; Pointer to lookup table for
                    171:                                     ;  converting scans to planar banks
                    172: pdev_pbiPlanarInfo          dd  ?   ; Pointer to array of bank clip info
                    173: pdev_ulPlanarBottomOffset   dd  ?   ; Number of scans from top to bottom
                    174:                                     ;  of bank, for bottom justifying
                    175: pdev_iLastPlanar            dd  ?   ; Index of last valid bank in
                    176: pdev_ulPlanar2RWSkip        dd  ?   ; Offset from one bank index to next
                    177:                                     ;  to make two 32K banks appear to be
                    178:                                     ;  one seamless 64K bank
                    179: 
                    180: pdev_pfnPlanarControl       dd  ?   ; Pointer to bank control function
                    181: pdev_pfnPlanarControl2      dd  ?   ; Pointer to double-window bank
                    182:                                     ;  control function
                    183: 
                    184: pdev_pfnPlanarNext          dd  ?   ; Pointer to next bank function
                    185: pdev_pfnPlanarNext2         dd  ?   ; Pointer to double-window next bank
                    186:                                     ;  function
                    187: pdev_rcl1PlanarClip         db  (size RECTL) dup (?)
                    188:                                     ; Single-window banking clip rect
                    189: pdev_rcl2PlanarClip         db  (2*(size RECTL)) dup (?)
                    190:                                     ; Double-window banking clip rects for
                    191: 
                    192: pdev_pfnPlanarEnable        dd  ?   ; Function to enable planar mode
                    193: pdev_pfnPlanarDisable       dd  ?   ; Function to disable planar mode
                    194: 
                    195: ; Smart bank management stuff:
                    196: 
                    197: pdev_iLastScan              dd  ?   ; Last scan we want to enumerate
                    198: pdev_pvScanScan0            dd  ?   ; Surface's original pvScan0
                    199: pdev_rclSaveBounds          db  (size RECTL) dup (?)
                    200:                                     ; Clip object's original bounds
                    201: pdev_pcoNull                dd  ?   ; Pointer to empty clip object
                    202: pdev_iSaveDComplexity       db  ?   ; Clip object's original complexity
                    203: pdev_fjSaveOptions          db  ?   ; Clip object's original flags
                    204: pdev_ajFiller               db  ?,? ; Pack to dword alignment
                    205: 
                    206: ; NOTE: This stuff must come at the end of the structure, so that we don't
                    207: ;       have to declare an array size for ahbmPat:
                    208: 
                    209: pdev_cPatterns              dd  ?   ; Count of bitmap patterns created
                    210: pdev_ahbmPat                dd  ?   ; Array of engine handles to standard
                    211: PDEV ends
                    212: 
                    213: pdev_rcl2WindowClipS        equ     (pdev_rcl2WindowClip)
                    214: pdev_rcl2WindowClipD        equ     (pdev_rcl2WindowClip + (size RECTL))
                    215: 
                    216: pdev_rcl2PlanarClipS        equ     (pdev_rcl2PlanarClip)
                    217: pdev_rcl2PlanarClipD        equ     (pdev_rcl2PlanarClip + (size RECTL))
                    218: 
                    219: pdev_pvBitmapStart2WindowS  equ     (pdev_pvBitmapStart2Window)
                    220: pdev_pvBitmapStart2WindowD  equ     (pdev_pvBitmapStart2Window + dword)
                    221: 
                    222: ;------------------------------------------------------------------------;
                    223: 
                    224: ; Macro to do a simple RET, with no stack stuff, in a proc.
                    225: 
                    226: PLAIN_RET macro
                    227:         db      0c3h
                    228:         endm
                    229: 
                    230: ; Macro to replace a CALL followed immediately by a JMP:
                    231: 
                    232: CALL_AND_JUMP macro CALL_ADDR,JUMP_ADDR
                    233:         push    offset JUMP_ADDR
                    234:         jmp     CALL_ADDR
                    235:         endm

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.