VESA.H 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. typedef char CHAR;
  2. typedef short SHORT;
  3. unsigned char *VESASource(int offset,int x,int y);
  4. unsigned char *VESADest(int offset,int x,int y);
  5. int VESAmode(int *modelist); // pointer to modes in order of preference, returns mode
  6. /*
  7. Modes are:
  8. 0x06a 800x600 Graphic 16 (== Vesa 0x102)
  9. 0x100 640x400 Graphic 256
  10. 0x101 640x480 Graphic 256
  11. 0x102 800x600 Graphic 16 (== Mode 0x6a)
  12. 0x103 800x600 Graphic 256
  13. 0x104 1024x768 Graphic 16
  14. 0x105 1024x768 Graphic 256
  15. 0x106 1280x1024 Graphic 16
  16. 0x107 1280x1024 Graphic 256
  17. 0x108 80 x 60 Text
  18. 0x109 132 x 25 Text
  19. 0x10A 132 x 43 Text
  20. 0x10B 132 x 50 Text
  21. 0x10C 132 x 60 Text
  22. 0x10D 320x200 Graphic 32K (1:5:5:5)
  23. 0x10E 320x200 Graphic 64K (5:6:5)
  24. 0x10F 320x200 Graphic 16.8M (8:8:8)
  25. 0x110 640x480 Graphic 32K (1:5:5:5)
  26. 0x111 640x480 Graphic 64K (5:6:5)
  27. 0x112 640x480 Graphic 16.8M (8:8:8)
  28. 0x113 800x600 Graphic 32K (1:5:5:5)
  29. 0x114 800x600 Graphic 64K (5:6:5)
  30. 0x115 800x600 Graphic 16.8M (8:8:8)
  31. 0x116 1024x768 Graphic 32K (1:5:5:5)
  32. 0x117 1024x768 Graphic 64K (5:6:5)
  33. 0x118 1024x768 Graphic 16.8M (8:8:8)
  34. 0x119 1280x1024 Graphic 32K (1:5:5:5)
  35. 0x11A 1280x1024 Graphic 64K (5:6:5)
  36. 0x11B 1280x1024 Graphic 16.8M (8:8:8)
  37. */
  38. int vesastart(int x, int y); // Set start pixel of display
  39. extern int winrange;
  40. extern int Vbytesperline;
  41. ////////////////////////////////////////////////////////////
  42. //// VESA STRUCTURES
  43. //
  44. struct VESA_INF
  45. {
  46. char VESASignature[4]; // 4 signature bytes = "VESA"
  47. SHORT VESAVersion; // VESA version number
  48. long *OEMStringPtr; // Pointer to OEM string
  49. CHAR Capabilities[4]; // capabilities of the video environment
  50. long *VideoModePtr; // pointer to supported Super VGA modes
  51. SHORT TotalMemory; // Number of 64kb memory blocks on board
  52. };
  53. struct ModeInfoBlock
  54. {
  55. // mandatory information
  56. SHORT ModeAttributes; // mode attributes
  57. CHAR WinAAttributes; // window A attributes
  58. CHAR WinBAttributes; // window B attributes
  59. short WinGranularity; // window granularity SHORT
  60. SHORT WinSize; // window size
  61. unsigned short WinASegment; // window A start segment
  62. unsigned short WinBSegment; // window B start segment
  63. long WinFuncPtr; // pointer to windor function
  64. SHORT BytesPerScanLine; // bytes per scan line
  65. // formerly optional information (now mandatory)
  66. SHORT XResolution; // horizontal resolution
  67. SHORT YResolution; // vertical resolution
  68. CHAR XCharSize; // character cell width
  69. CHAR YCharSize; // character cell height
  70. CHAR NumberOfPlanes; // number of memory planes
  71. CHAR BitsPerPixel; // bits per pixel
  72. CHAR NumberOfBanks; // number of banks
  73. CHAR MemoryModel; // memory model type
  74. CHAR BankSize; // bank size in kb
  75. CHAR NumberOfImagePages; // number of images
  76. CHAR Reserved; // reserved for page function
  77. // new Direct Color fields
  78. CHAR RedMaskSize; // size of direct color red mask in bits
  79. CHAR RedFieldPosition; // bit position of LSB of red mask
  80. CHAR GreenMaskSize; // size of direct color green mask in bits
  81. CHAR GreenFieldPosition; // bit position of LSB of green mask
  82. CHAR BlueMaskSize; // size of direct color blue mask in bits
  83. CHAR BlueFieldPosition; // bit position of LSB of blue mask
  84. CHAR RsvdMaskSize; // size of direct color reserved mask in bits
  85. CHAR DirectColorModeInfo; // Direct Color mode attributes
  86. };
  87. #ifndef _vesa_gen
  88. extern struct VESA_INF *vesa_inf;
  89. extern struct ModeInfoBlock *vmode_inf;
  90. #endif
  91. //
  92. ////
  93. ////////////////////////////////////////////////////////////
  94.