VESAVID.H 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef VQMVESAVID_H
  19. #define VQMVESAVID_H
  20. /****************************************************************************
  21. *
  22. * C O N F I D E N T I A L --- W E S T W O O D S T U D I O S
  23. *
  24. *----------------------------------------------------------------------------
  25. *
  26. * FILE
  27. * VESAVid.h (32-Bit protected mode)
  28. *
  29. * DESCRIPTION
  30. * VESA video manager definitions.
  31. *
  32. * PROGRAMMER
  33. * Denzil E. Long, Jr.
  34. *
  35. * DATE
  36. * Febuary 3, 1995
  37. *
  38. ****************************************************************************/
  39. #ifndef __WATCOMC__
  40. #include <pharlap.h>
  41. #else
  42. #include "realmode.h"
  43. #endif
  44. /*---------------------------------------------------------------------------
  45. * VESA Video Modes
  46. *-------------------------------------------------------------------------*/
  47. #define VESA_640X400_256 0x100
  48. #define VESA_640X480_256 0x101
  49. #define VESA_800X600_16 0x102
  50. #define VESA_800X600_256 0x103
  51. #define VESA_1024X768_16 0x104
  52. #define VESA_1024X768_256 0x105
  53. #define VESA_1280X400_16 0x106
  54. #define VESA_1280X400_256 0x107
  55. #define VESA_TEXT_80X60 0x108
  56. #define VESA_TEXT_132X25 0x109
  57. #define VESA_TEXT_132X60 0x10C
  58. #define VESA_320X200_32K_1 0x10D
  59. #define VESA_320X200_32K_2 0x10E
  60. #define VESA_640X480_32K 0x110
  61. #define VESA_640X480_65K 0x111
  62. #define VESA_640X480_16M 0x112
  63. #define VESA_800X600_32K 0x113
  64. #define VESA_800X600_65K 0x114
  65. #define VESA_1024X768_32K 0x116
  66. #define VESA_1024X768_65K 0x117
  67. #define VESA_MIN VESA_640X400_256
  68. #define VESA_MAX VESA_1024X768_65K
  69. /*---------------------------------------------------------------------------
  70. * Structure definitions
  71. *-------------------------------------------------------------------------*/
  72. /* VESAInfo - General information about this VESA implementation.
  73. * (Filled in by VESA BIOS Function 0)
  74. *
  75. * Signature - Will always be 'VESA'
  76. * Version - Version #
  77. * OEMString - OEM ID string
  78. * Capabilities - Not defined by VESA yet
  79. * AvailModes - List of available modes; terminated with -1 (0xffff)
  80. * TotalMemory - ???
  81. * Reserved - Pads structure to 256 bytes total
  82. */
  83. typedef struct _VESAInfo {
  84. char Signature[4];
  85. unsigned short Version;
  86. REALPTR OEMString;
  87. unsigned long Capabilities;
  88. REALPTR AvailModes;
  89. unsigned short TotalMemory;
  90. unsigned char Reserved[236];
  91. } VESAInfo;
  92. /* VESAModeInfo - Information about this VESA mode.
  93. * (Filled in by VESA BIOS Function 1)
  94. *
  95. * Attributes - bit 0: 1 = mode is supported
  96. * bit 1: 1 = optional info available
  97. * bit 2: 1 = std BIOS output functions valid in this mode
  98. * bit 3: 0 = monochrome, 1 = color
  99. * bit 4: 0 = text mode, 1 = graphics
  100. * WinA_Attributes - bit 0 = window exists, bit 1=readable, bit 2= writable
  101. * WinB_Attributes - bit 0 = window exists, bit 1=readable, bit 2= writable
  102. * WinGranularity - smallest address boundary window can be placed upon;
  103. * size is in KB (ie 64, 32, 4)
  104. * WinSize - size of windows in KB (ie 64, 32)
  105. * WinA_Segment - location of Window A in CPU space (usually 0xa000)
  106. * WinB_Segment - location of Window B in CPU space (usually 0xb000)
  107. * WinFunc - address of window-setting function (This is provided
  108. * as an alternative to Int 10 for speed.)
  109. * BytesPerScanline - # bytes per scan line
  110. *
  111. * Optional info (available if bit 1 of Attributes is set):
  112. *
  113. * XRes - X-resolution
  114. * YRes - Y-resolution
  115. * XCharSize - Horizontal size of char cell
  116. * YCharSize - Vertical size of char cell
  117. * NumPlanes - # of memory planes (???)
  118. * BitsPerPixel - # bites per pixel
  119. * NumBanks - # of banks (ie planes)
  120. * MemoryModel - 00h = Text mode
  121. * 01h = CGA mode
  122. * 02h = Hercules
  123. * 03h = 4 plane planar mode
  124. * 04h = packed pixel mode (1 byte/pixel)
  125. * 05h = non-chain 4, 256-color mode
  126. * 06-0Fh =
  127. * 10-FFh = OEM-specific
  128. * BankSize - Bank size in KB
  129. */
  130. typedef struct _VESAModeInfo {
  131. unsigned short Attributes;
  132. unsigned char WinA_Attributes;
  133. unsigned char WinB_Attributes;
  134. unsigned short WinGranularity;
  135. unsigned short WinSize;
  136. unsigned short WinA_Segment;
  137. unsigned short WinB_Segment;
  138. REALPTR WinFunc;
  139. unsigned short BytesPerScanline;
  140. unsigned short XRes;
  141. unsigned short YRes;
  142. unsigned char XCharSize;
  143. unsigned char YCharSize;
  144. unsigned char NumPlanes;
  145. unsigned char BitsPerPixel;
  146. unsigned char NumBanks;
  147. unsigned char MemoryModel;
  148. unsigned char BankSize;
  149. unsigned char NumInputPages;
  150. unsigned char Reserved;
  151. unsigned char RedMaskSize;
  152. unsigned char RedFieldPosition;
  153. unsigned char GreenMaskSize;
  154. unsigned char GreenFieldPosition;
  155. unsigned char BlueMaskSize;
  156. unsigned char BlueFieldPosition;
  157. unsigned char RsvdMaskSize;
  158. unsigned char RsvdFieldPosition;
  159. unsigned char DirectColorModeInfo;
  160. unsigned char pad[216];
  161. } VESAModeInfo;
  162. /*---------------------------------------------------------------------------
  163. * Function prototypes
  164. *-------------------------------------------------------------------------*/
  165. long InitVESA(void);
  166. void UninitVESA(void);
  167. VESAModeInfo *SetVESAMode(long mode);
  168. VESAModeInfo *ReadVESAModeInfo(long mode);
  169. void SetVESAWindow(long grain_num);
  170. #endif /* VQMVESAVID_H */