home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / video / vesabios.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  3.8 KB  |  127 lines

  1. /*
  2.  * Copyright (C) 1990-1992 by Michael Davidson.
  3.  * All rights reserved.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software
  6.  * and its documentation for any purpose and without fee is hereby
  7.  * granted, provided that the above copyright notice appear in all
  8.  * copies and that both that copyright notice and this permission
  9.  * notice appear in supporting documentation.
  10.  *
  11.  * This software is provided "as is" without express or implied warranty.
  12.  */
  13.  
  14. #ifndef    VESABIOS_H
  15. #define    VESABIOS_H
  16.  
  17. #include    "v86types.h"
  18.  
  19. /*
  20.  * definitions for VESA BIOS extensions
  21.  */
  22.  
  23. /*
  24.  * VESA BIOS INT 10 subfunctions
  25.  */
  26. #define    VESA_INFO        0x4f00
  27. #define    VESA_MODE_INFO        0x4f01
  28. #define    VESA_SET_MODE        0x4f02
  29. #define    VESA_GET_MODE        0x4f03
  30. #define    VESA_SAVE_RESTORE    0x4f04
  31. #define    VESA_WINDOW_CONTROL    0x4f05
  32. #define    VESA_SCANLINE        0x4f06
  33. #define    VESA_DISPLAY_START    0x4f07
  34.  
  35. /*
  36.  * VESA return value in AX
  37.  */
  38. #define    VESA_RETURN_OK        0x004f
  39.  
  40. /*
  41.  * structure returned by VESA_INFO
  42.  */
  43. #pragma pack(1)
  44. struct    __VESAInfo
  45. {
  46.     dword_t    signature;        /* signature - 'VESA'        */
  47.     word_t    version;        /* version            */
  48.     fptr_t    vendor_data;        /* far pointer to vendor data    */
  49.     fptr_t    capabilities;        /* reserved            */
  50.     fptr_t    mode_table;        /* far pointer to mode table    */
  51.     word_t    memory_size;        /* memory size in 64k blocks    */
  52.     byte_t    pad[236];        /* pad structure to 256    bytes    */
  53. };
  54. #pragma    pack()
  55.  
  56. typedef    struct __VESAInfo    VESAInfo;
  57.  
  58. #define    VESA_SIGNATURE    0x41534556L    /* 'VESA'            */
  59.  
  60. #pragma pack(1)
  61. struct    __VESAModeInfo
  62. {
  63.     word_t    attributes;        /* mode attributes        */
  64.     byte_t    window_attributes[2];    /* window attributes        */
  65.     word_t    window_granularity;    /* window granularity in 1K units*/
  66.     word_t    window_size;        /* window size in 1K units    */
  67.     word_t    window_seg[2];        /* segment address of window    */
  68.     fptr_t    window_func;        /* far pointer to window func    */
  69.     word_t    scanline_size;        /* bytes per scanline        */
  70.  /*** start of optional information ***/
  71.     word_t    x_resolution;        /* horizontal resolution    */
  72.     word_t    y_resolution;        /* vertical resolution        */
  73.     byte_t    char_cell_width;    /* char cell width (pixels)    */
  74.     byte_t    char_cell_height;    /* char cell height (pixels)    */
  75.     byte_t    planes;            /* # of bit planes        */
  76.     byte_t    bits_per_pixel;        /* # of bits per pixel        */
  77.     byte_t    banks;            /* # of memory banks        */
  78.     byte_t    model;            /* display memory organisation    */
  79.     byte_t    bank_size;        /* bank size in 1K units    */
  80.     byte_t    display_pages;        /* # of display pages        */
  81.     byte_t    pad0;
  82.     byte_t    red_bits;
  83.     byte_t    red_shift;
  84.     byte_t    green_bits;
  85.     byte_t    green_shift;
  86.     byte_t    blue_bits;
  87.     byte_t    blue_shift;
  88.     byte_t    pad[219];        /* pad structure to 256    bytes    */
  89. };
  90. #pragma    pack()
  91.  
  92. typedef    struct __VESAModeInfo    VESAModeInfo;
  93.  
  94. /*
  95.  * VESA mode attribute flags
  96.  */
  97. #define    VESA_MODE_SUPPORTED    0x01    /* this mode supported        */
  98. #define    VESA_MODE_OPT_INFO    0x02    /* optional info available    */
  99. #define    VESA_MODE_STD_BIOS    0x04    /* standard BIOS support    */
  100. #define    VESA_MODE_COLOR        0x08    /* color mode            */
  101. #define    VESA_MODE_GRAPHICS    0x10    /* graphics mode        */
  102.  
  103. /*
  104.  * VESA window attribute flags
  105.  */
  106. #define    VESA_WINDOW_EXISTS    0x01    /* window exists        */
  107. #define    VESA_WINDOW_READABLE    0x02    /* window is readable        */
  108. #define    VESA_WINDOW_WRITEABLE    0x04    /* window is writeable        */
  109.  
  110. /*
  111.  * VESA memory models
  112.  */
  113. #define    VESA_MEM_TEXT        0x00    /* standard text mode        */
  114. #define    VESA_MEM_CGA        0x01    /* CGA style graphics mode    */
  115. #define    VESA_MEM_HERCULES    0x02    /* Hercules style graphics mode    */
  116. #define    VESA_MEM_4PLANE        0x04    /* 4 plane planar mode        */
  117. #define    VESA_MEM_PACKED_PIXEL    0x08    /* packed pixel mode        */
  118. #define    VESA_MEM_UNPACKED_PIXEL    0x10    /* 256 color unpacked pixel mode*/
  119.  
  120. extern int        VESAVersion();
  121. extern char        *VESAVendorData();
  122. extern unsigned short    *VESAModeTable();
  123. extern VESAModeInfo    *VESABiosGetModeInfo(unsigned short);
  124. extern int         VESABiosSetMode(int);
  125. extern int        VESABiosGetMode();
  126. #endif    /* VESABIOS_H */
  127.