home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / TMTP100D.ZIP / EXAMPLES / VESA / VESA.INC < prev    next >
Encoding:
Text File  |  1995-11-04  |  5.3 KB  |  138 lines

  1. ;*****************************************************************
  2. ;
  3. ;  VESA library include file
  4. ;
  5. ;*****************************************************************
  6.  
  7. ifdef masm                                      ; Allow MASM assembly
  8. Global  EQU     externdef
  9. endif
  10.  
  11. Global C _BankSetTable        :Dword
  12. Global C Current_Bank         :Byte
  13. Global C VbeSetBank           :Dword
  14. Global C VbeSetStart          :Dword
  15. Global C SetVbeMode           :Near
  16. Global C CheckVbeMode         :Near
  17. Global C VbeFunc06            :Near
  18.  
  19.  
  20.  
  21.  
  22. ;***********************************************************
  23. ;                SET VIDEO BANK MACRO
  24. ; DL=bank number
  25. ;***********************************************************
  26. SetBank MACRO
  27. LOCAL @@setnew
  28.         cmp    Current_Bank,dl
  29.         je     @@setnew
  30.         and    edx,01fh
  31.         mov    Current_Bank,dl
  32.         mov    edx,_BankSetTable[edx*4]
  33.         push   ebx
  34.         xor    ebx,ebx
  35.         call   [VbeSetBank]
  36.         pop    ebx
  37. @@setnew:
  38. ENDM
  39.  
  40. ;***********************************************************
  41. ;       INCREMENT THE CURRENT BANK NUMEBR
  42. ;***********************************************************
  43. NextBank   MACRO
  44.         push    edx
  45.         push    ebx
  46.         xor     edx,edx
  47.         mov     dl,Current_Bank
  48.         inc     dl
  49.         mov     Current_Bank,dl
  50.         mov     edx,_BankSetTable[edx*4]
  51.         xor     ebx,ebx
  52.         call    [VbeSetBank]
  53.         pop     ebx
  54.         pop     edx
  55. ENDM
  56.  
  57.  
  58. ;***********************************************************
  59. ; SET VIDEO DISPLAY START MACRO
  60. ; ECX=pixel in scan line
  61. ; EDX=scan line number
  62. ;***********************************************************
  63. SetStart MACRO
  64.         call   [VbeSetStart]
  65. ENDM
  66.  
  67.  
  68.  
  69.  
  70. ; Data structure for VESA function 4F00h ( Get VBE Information )
  71. ;
  72.  
  73.      VbeInfoBlock struc
  74.      VbeSignature        db   'VESA'    ; VBE Signature
  75.      VbeVersion          dw   0200h     ; VBE Version
  76.      OemStringPtr        dd   ?         ; Pointer to OEM String
  77.      Capabilities        db   4 dup (?) ; Capabilities of graphics cont.
  78.      VideoModePtr        dd   ?         ; Pointer to Video Mode List
  79.      TotalMemory         dw   ?         ; Number of 64kb memory blocks
  80.                                         ; Added for VBE 2.0
  81.      OemSoftwareRev      dw   ?         ; VBE implementation Software revision
  82.      OemVendorNamePtr    dd   ?         ; Pointer to Vendor Name String
  83.      OemProductNamePtr   dd   ?         ; Pointer to Product Name String
  84.      OemProductRevPtr    dd   ?         ; Pointer to Product Revision String
  85.      _Reserved_          db   222 dup (?); Reserved for VBE implementation
  86.                                         ; scratch area
  87.      OemData             db   256 dup (?); Data Area for OEM Strings
  88.      VbeInfoBlock ends
  89.  
  90.  
  91.  
  92. ; Data structure for VESA function 4F01h ( Get mode Information )
  93. ;
  94.      ModeInfoBlock   struc
  95.  
  96.      ; Mandatory information for all VBE revisions
  97.      ModeAttributes      dw ?      ; mode attributes
  98.      WinAAttributes      db ?      ; window A attributes
  99.      WinBAttributes      db ?      ; window B attributes
  100.      WinGranularity      dw ?      ; window granularity
  101.      WinSize             dw ?      ; window size
  102.      WinASegment         dw ?      ; window A start segment
  103.      WinBSegment         dw ?      ; window B start segment
  104.      WinFuncPtr          dd ?      ; pointer to window function
  105.      BytesPerScanLine    dw ?      ; bytes per scan line
  106.  
  107.      ; Mandatory information for VBE 1.2 and above
  108.      XResolution         dw ?      ; horizontal resolution in pixels or chars
  109.      YResolution         dw ?      ; vertical resolution in pixels or chars
  110.      XCharSize           db ?      ; character cell width in pixels
  111.      YCharSize           db ?      ; character cell height in pixels
  112.      NumberOfPlanes      db ?      ; number of memory planes
  113.      BitsPerPixel        db ?      ; bits per pixel
  114.      NumberOfBanks       db ?      ; number of banks
  115.      MemoryModel         db ?      ; memory model type
  116.      BankSize            db ?      ; bank size in KB
  117.      NumberOfImagePages  db ?      ; number of images
  118.      _Reserved           db ?      ; reserved for page function
  119.  
  120.      ; Direct Color fields (required for direct/6 and YUV/7 memory models)
  121.      RedMaskSize         db ?      ; size of direct color red mask in bits
  122.      RedFieldPosition    db ?      ; bit position of lsb of red mask
  123.      GreenMaskSize       db ?      ; size of direct color green mask in bits
  124.      GreenFieldPosition  db ?      ; bit position of lsb of green mask
  125.      BlueMaskSize        db ?      ; size of direct color blue mask in bits
  126.      BlueFieldPosition   db ?      ; bit position of lsb of blue mask
  127.      RsvdMaskSize        db ?      ; size of direct color reserved mask in bits
  128.      RsvdFieldPosition   db ?      ; bit position of lsb of reserved mask
  129.      DirectColorModeInfo db ?      ; direct color mode attributes
  130.  
  131.      ; Mandatory information for VBE 2.0 and above
  132.      PhysBasePtr         dd ?      ; physical address for flat frame buffer
  133.      OffScreenMemOffset  dd ?      ; pointer to start of off screen memory
  134.      OffScreenMemSize    dw ?      ; amount of off screen memory in 1k units
  135.      __Reserved          db 206 dup (?)  ; remainder of ModeInfoBlock
  136.      ModeInfoBlock ends
  137.  
  138.