vesah.inc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Carl Eric Codere
  5. This include implements VESA basic access.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. TYPE
  13. pModeList = ^tModeList;
  14. tModeList = Array [0..255] of word; {list of modes terminated by -1}
  15. {VESA modes are >=100h}
  16. TVESAinfo = packed record { VESA Information request }
  17. signature : array [1..4] of char; { This should be VESA }
  18. version : word; { VESA revision }
  19. str : pChar; { pointer to OEM string }
  20. caps : longint; { video capabilities }
  21. modeList : pModeList; { pointer to SVGA modes }
  22. (* pad : array [18..260] of byte; { extra padding more then }
  23. end; { VESA standard because of bugs on }
  24. { some video cards. }
  25. *)
  26. TotalMem : word;
  27. { VESA 2.0 }
  28. OEMversion : word;
  29. VendorPtr : longint;
  30. ProductPtr : longint;
  31. RevisionPtr : longint;
  32. filler : Array[1..478]of Byte;
  33. end;
  34. TVESAModeInfo = packed record
  35. attr : word; { mode attributes (1.0) }
  36. winAAttr,
  37. winBAttr : byte; { window attributes (1.0) }
  38. winGranularity : word; {in K} { Window granularity (1.0) }
  39. winSize : word; {in K} { window size (1.0) }
  40. winASeg, { Window A Segment address (1.0) }
  41. winBSeg : word; { Window B Segment address (1.0) }
  42. winFunct : procedure; { Function to swtich bank }
  43. BytesPerScanLine: word; {bytes per scan line (1.0) }
  44. { extended information }
  45. xRes, yRes : word; {pixels}
  46. xCharSize,
  47. yCharSize : byte;
  48. planes : byte;
  49. bitsPixel : byte;
  50. banks : byte;
  51. memModel : byte;
  52. bankSize : byte; {in K}
  53. NumberOfPages: byte;
  54. (*
  55. pad : array [29..260] of byte; { always put some more space then required}
  56. end; *)
  57. reserved : byte; { pos $1E }
  58. rm_size : byte; { pos $1F }
  59. rf_pos : byte; { pos $20 }
  60. gm_size : byte; { pos $21 }
  61. gf_pos : byte; { pos $22 }
  62. bm_size : byte; { pos $23 }
  63. bf_pos : byte; { pos $24 }
  64. (* res_mask : word; { pos $25 }
  65. here there was an alignment problem !!
  66. with default alignment
  67. res_mask was shifted to $26
  68. and after PhysAddress to $2A !!! PM *)
  69. res_size : byte;
  70. res_pos : byte;
  71. DirectColorInfo: byte; { pos $27 }
  72. { VESA 2.0 }
  73. PhysAddress : longint; { pos $28 }
  74. OffscreenPtr : longint; { pos $2C }
  75. OffscreenMem : word; { pos $30 }
  76. reserved2 : Array[1..458]of Byte; { pos $32 }
  77. end;
  78. var
  79. VESAInfo : TVESAInfo; { VESA Driver information }
  80. VESAModeInfo : TVESAModeInfo; { Current Mode information }
  81. hasVesa: Boolean; { true if we have a VESA compatible graphics card}
  82. { initialized in QueryAdapterInfo in graph.inc }
  83. {
  84. $Log$
  85. Revision 1.4 2000-01-07 16:41:32 daniel
  86. * copyright 2000
  87. Revision 1.3 2000/01/07 16:32:24 daniel
  88. * copyright 2000 added
  89. Revision 1.2 1999/12/10 12:51:09 pierre
  90. + some VESA 2 extensions
  91. Revision 1.1 1999/11/08 11:15:21 peter
  92. * move graph.inc to the target dir
  93. Revision 1.2 1999/09/26 13:31:07 jonas
  94. * changed name of modeinfo variable to vesamodeinfo and fixed
  95. associated errors (fillchar(modeinfo,sizeof(tmodeinfo),#0) instead
  96. of sizeof(TVesamodeinfo) etc)
  97. * changed several sizeof(type) to sizeof(varname) to avoid similar
  98. errors in the future
  99. Revision 1.1 1999/09/24 22:52:40 jonas
  100. * optimized patternline a bit (always use hline when possible)
  101. * isgraphmode stuff cleanup
  102. * vesainfo.modelist now gets disposed in cleanmode instead of in
  103. closegraph (required moving of some declarations from vesa.inc to
  104. new vesah.inc)
  105. * queryadapter gets no longer called from initgraph (is called from
  106. initialization of graph unit)
  107. * bugfix for notput in 32k and 64k vesa modes
  108. * a div replaced by / in fillpoly
  109. }