CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

VIDEO.H (9307B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /***************************************************************************
     17  **     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       **
     18  ***************************************************************************
     19  *                                                                         *
     20  *                 Project Name : 32 bit library                           *
     21  *                                                                         *
     22  *                    File Name : VIDEO.H                                  *
     23  *                                                                         *
     24  *                   Programmer : Scott K. Bowen                           *
     25  *                                                                         *
     26  *                   Start Date : August 3, 1994                           *
     27  *                                                                         *
     28  *                  Last Update : August 3, 1994   [SKB]                   *
     29  *                                                                         *
     30  *-------------------------------------------------------------------------*
     31  * Functions:                                                              *
     32  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     33 
     34 #ifndef VIDEO_H
     35 #define VIDEO_H
     36 
     37 #ifndef WWSTD_H
     38 #include "wwstd.h"
     39 #endif
     40 
     41 /*=========================================================================*/
     42 /*	The machine can be in one of the following graphic modes.  The global	*/
     43 /*	GraphicMode is set to one of these values.										*/
     44 /*=========================================================================*/
     45 #define	CGA_MODE					4			// DOS 320x200 4 color mode
     46 #define	TGA_MODE					9			// TANDY 320x200 16 color mode
     47 #define	EGA_MODE					13			// DOS 320x200 16 color mode
     48 #define	MCGA_MODE				0x13		// DOS 320x200 256 color mode
     49 #define	VGA_MODE					0x13		// DOS 320x200 256 color mode
     50 #define	EEGA_MODE				14			// DOS 640x400 16 color mode
     51 #define	ETGA_MODE				9			// TANDY 640x400 16 color mode
     52 #define	HGA_MODE					7			// DOS 768x400 2 color mode
     53 #define	TXT_MODE					3			// DOS plain old color text mode
     54 #define	VESA_640X400_256		0x100		// VESA 640x400 256 color mode
     55 #define	VESA_640X480_256		0x101		// VESA 640x480 256 color mode
     56 #define	VESA_800X600_256		0x103		// VESA 800x600 256 color mode
     57 #define	VESA_1024X768_256		0x105		//	VESA 1024x768 256 color mode
     58 #define	VESA_1280X400_256		0x107		// VESA 1280x400 256 color mode
     59 #define	VESA_TEXT_80X60		0x108		// VESA 80x60 text mode
     60 #define	VESA_TEXT_132X25		0x109		// VESA 132x25 text mode
     61 #define	VESA_TEXT_132X60		0x10C		// VESA 132x60 text mode
     62 #define	RESET_MODE				-1
     63 #define	UNINITIALIZED_MODE	-1
     64 #define	VESA_MIN 				VESA_640X400_256
     65 #define	VESA_MAX					VESA_TEXT_132X60
     66 
     67 /*=========================================================================*/
     68 /* Define the maximum number of bank entries											*/
     69 /*=========================================================================*/
     70 #define	MAX_BANK_ENTRIES		((1280L*1024L)/65536L)
     71 
     72 
     73 /*=========================================================================*
     74  * VesaInfoType - General info about this VESA implementation					*
     75  *                (Filled in by VESA BIOS Function 0)								*
     76  *																									*
     77  * Signature    - Will always be 'VESA'												*
     78  * Version      - Version #																*
     79  * OEMString    - OEM ID string															*
     80  * Capabilities - Not defined by VESA yet												*
     81  * AvailModes   - List of available modes; terminated with -1 (0xffff)		*
     82  * TotalMemory  - ???																		*
     83  * Reserved     - Pads structure to 256 bytes total								*
     84  *=========================================================================*/
     85 #ifdef NOT_FOR_WIN95
     86 typedef struct {
     87 	char    Signature[4];
     88 	short   Version;
     89 	REALPTR OEMString;
     90 	long    Capabilities;
     91 	REALPTR AvailModes;
     92 	short   TotalMemory;
     93 	char    Reserved[236];
     94 } VesaInfoType;
     95 
     96 #endif //NOT_FOR_WIN95
     97 
     98 /*=========================================================================*
     99  * VesaModeInfoType - Info about this VESA mode										*
    100  *                    (Filled in by VESA BIOS Function 1)						*
    101  *																									*
    102  * Attributes       - bit 0: 1 = mode is supported									*
    103  *                    bit 1: 1 = optional info available							*
    104  *                    bit 2: 1 = std BIOS output funcs valid in this mode	*
    105  *                    bit 3: 0 = monochrome, 1 = color							*
    106  *                    bit 4: 0 = text mode, 1 = graphics							*
    107  * WinA_Attributes  - bit 0 = win exists, bit 1=readable, bit 2= writable	*
    108  * WinB_Attributes  - bit 0 = win exists, bit 1=readable, bit 2= writable	*
    109  * WinGranularity   - smallest address boundary window can be placed upon;	*
    110  *                    size is in KB (ie 64, 32, 4)									*
    111  * WinSize          - size of windows in KB (ie 64, 32)							*
    112  * WinA_Segment     - location of Window A in CPU space (usually 0xa000)	*
    113  * WinB_Segment     - location of Window B in CPU space (usually 0xb000)	*
    114  * WinFunc          - address of window-setting function (This is provided *
    115  *                    as an alternative to Int 10 for speed.)					*
    116  * BytesPerScanline - # bytes per scan line											*
    117  * 																								*
    118  * Optional info (available if bit 1 of Attributes is set):						*
    119  *																									*
    120  * XRes             - X-resolution														*
    121  * YRes             - Y-resolution														*
    122  * XCharSize        - Horizontal size of char cell									*
    123  * YCharSize        - Vertical size of char cell									*
    124  * NumPlanes        - # of memory planes (???)										*
    125  * BitsPerPixel     - # bites per pixel												*
    126  * NumBanks         - # of banks (ie planes)											*
    127  * MemoryModel      - 00h = Text mode													*
    128  *                    01h = CGA mode													*
    129  *                    02h = Hercules													*
    130  *                    03h = 4 plane planar mode										*
    131  *                    04h = packed pixel mode (1 byte/pixel)					*
    132  *                    05h = non-chain 4, 256-color mode							*
    133  *                    06-0Fh = 															*
    134  *                    10-FFh = OEM-specific											*
    135  * BankSize         - Bank size in KB													*
    136  *=========================================================================*/
    137 #ifdef NOT_FOR_WIN95
    138 typedef struct {
    139 	short   Attributes;
    140 	char    WinA_Attributes;
    141 	char    WinB_Attributes;
    142 	short   WinGranularity;
    143 	short   WinSize;
    144 	short   WinA_Segment;
    145 	short   WinB_Segment;
    146 	REALPTR WinFunc;
    147 	short   BytesPerScanline;
    148 	short   XRes;
    149 	short   YRes;
    150 	char    XCharSize;
    151 	char    YCharSize;
    152 	char    NumPlanes;
    153 	char    BitsPerPixel;
    154 	char    NumBanks;
    155 	char    MemoryModel;
    156 	char    BankSize;
    157 	char    NumInputPages;
    158 	char    Reserved;
    159 	char    RedMaskSize;
    160 	char    RedFieldPosition;
    161 	char    GreenMaskSize;
    162 	char    GreenFieldPosition;
    163 	char    BlueMaskSize;
    164 	char    BlueFieldPosition;
    165 	char    RsvdMaskSize;
    166 	char    RsvdFieldPosition;
    167 	char    DirectColorModeInfo;
    168 	char    pad[216];
    169 } VesaModeInfoType;
    170 
    171 extern REALPTR	 VesaFunc;
    172 
    173 #endif //NOT_FOR_WIN95
    174 
    175 
    176 extern "C" {
    177 extern	int	GraphicMode;
    178 extern	long	XRes;
    179 extern	long	YRes;
    180 
    181 extern long		 BankTable [];
    182 extern unsigned long RMVesaVector ;
    183 extern unsigned long RMVesaRegs ;
    184 }
    185 
    186 /*=========================================================================*/
    187 /* The following prototypes are for the file: VIDEO.CPP							*/
    188 /*=========================================================================*/
    189 
    190 extern "C" int Set_Video_Mode(int mode);
    191 int Get_Video_Mode(void);
    192 void Update_Video_Mode (void) ;
    193 void Vesa_Info(void);
    194 void Vesa_Set_Window(long grain_num);
    195 int Get_Original_Video_Mode(void);
    196 void Set_Original_Video_Mode(int mode);
    197 
    198 /*=========================================================================*/
    199 /* The following prototypes are for the file: INITDLAY.CPP	  					*/
    200 /*=========================================================================*/
    201 
    202 extern VOID Init_Delay(VOID);
    203 extern BOOL VertBlank;
    204 
    205 /*=========================================================================*/
    206 /* The following prototypes are for the file: VERTBLNK.ASM	  					*/
    207 /*=========================================================================*/
    208 
    209 extern "C" {
    210 	extern WORD Get_Vert_Blank(VOID);
    211 	extern VOID Wait_Vert_Blank(BOOL blank);
    212 }
    213 
    214 /*=========================================================================*/
    215 
    216 #endif // VIDEO_H