Initial commit of Command & Conquer Red Alert source code.

This commit is contained in:
LFeenanEA
2025-02-27 16:15:05 +00:00
parent b685cea758
commit 5e733d5dcc
2082 changed files with 797727 additions and 0 deletions

68
WINVQ/INCLUDE/VOCFILE.H Normal file
View File

@@ -0,0 +1,68 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VOCFILE_H
#define VOCFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* vocfile.h
*
* DESCRIPTION
* VOC audio file definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
****************************************************************************/
/* VOC file header.
*
* type - File type description
* offset - Offset of data block from the start of VOC file.
* ver - File format version number
* id - File identification code.
*/
typedef struct _VOCHeader {
char type[0x14];
unsigned short offset;
unsigned short ver;
unsigned short id;
} VOCHeader;
/* VOC sub-block block types */
#define VBT_TERMINATE 0 /* Last block of file (no size field) */
#define VBT_VOICEDATA 1 /* New set of voice data */
#define VBT_VOICECONT 2 /* Continuation of voice data */
#define VBT_SILENCE 3 /* Silence period */
#define VBT_MARKER 4 /* Syncronization marker */
#define VBT_ASCII 5 /* NULL terminated string */
#define VBT_REPEAT 6 /* Mark beginning of repeat loop */
#define VBT_ENDREPEAT 7 /* Mark end of repeat loop */
#define VBT_EXTENDED 8
#define IS_VOC(a,b) (((~a)+0x1234)==b)
#define BLOCK_LEN(a) ((a&0x00FFFFFFL))
#endif /* VOCFILE_H */

106
WINVQ/INCLUDE/VQ.H Normal file
View File

@@ -0,0 +1,106 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQ_H
#define VQ_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* NAME
* vq.h
*
* DESCRIPTION
* VQ file definition
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* September 28, 1995
*
* NOTES
* VQ file organization:
*
* Header: This structure contains all the data pertaining to the VQ.
* (See structure definition for details)
*
* Size: 40 bytes
*
* Palette: Color palette used by this VQ. Stored as 24 bit RGB entries.
*
* Size: (PaletteRange * 3) bytes
*
* Codebook: Sequence of vector blocks used to represent the VQ image.
* Also called the dictionary. The sequence is sorted by
* usage, so the first entry is the most commonly used block.
*
* Size: ((BlockWidth * BlockHeight) * CodebookSize) bytes
*
* Pointers: Vector pointer map used to indicate the construction of
* the vector blocks. Also called codewords.
*
* Size: (((ImageWidth / BlockWidth)
* * (ImageHeight / BlockHeight)) * 2)
*
* Pointer format:
*
* Single color - Value less than or equal to 'Num1Color'
* Multi Color - Value greater than 'Num1Color'
*
****************************************************************************/
/* VQHeader - VQ header structure.
*
* ImageSize - Compressed image size
* ImageWidth - Image x-dimension
* ImageHeight - Image y-dimension
* BlockWidth - Block x-dimension
* BlockHeight - Block y-dimension
* BlockType - Block type
* PaletteRange - Number of palette colors
* Num1Color - Number of 1-color blocks & 1-color colors
* CodebookSize - Number of actual codebook entries
* CodingFlag - Flag for 2-color blocks
* FrameDiffMethod - Frame differencing method
* ForcedPalette - Force a palette on image
* F555Palette - Flag for output 15-bit palette
* VQVersion - VQ Version #
* pad[5] - Pad out to 40 bytes total
*/
typedef struct _VQHeader {
unsigned long ImageSize;
unsigned short ImageWidth;
unsigned short ImageHeight;
unsigned short BlockWidth;
unsigned short BlockHeight;
unsigned short BlockType;
unsigned short PaletteRange;
unsigned short Num1Color;
unsigned short CodebookSize;
unsigned short CodingFlag;
unsigned short FrameDiffMethod;
unsigned short ForcedPalette;
unsigned short F555Palette;
unsigned short VQVersion;
unsigned short pad[5];
} VQHeader;
#endif /* VQ_H */

View File

@@ -0,0 +1,124 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQACAPTION_H
#define VQACAPTION_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library (32 bit protected mode)
*
* FILE
* caption.h
*
* DESCRIPTION
* Text caption definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 26, 1995
*
****************************************************************************/
#define VQACAPTIONS_ON 0
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* CaptionNode: Node describing a caption to process.
*
* Succ - Pointer to the next node in the list (successor).
* Pred - Pointer to the previous node in the list (predecessor).
* Flags - Status flags.
* CapText - Pointer to the CaptionText being processed.
* Char - Pointer to current character in the string.
* CurX - Current X position.
* CurY - Current Y position.
* BoundW - Bounding width of text.
* BoundH - Bounding height of text.
*/
typedef struct _CaptionNode {
struct _CaptionNode *Succ;
struct _CaptionNode *Pred;
unsigned short Flags;
CaptionText *Captext;
char *Char;
unsigned short CurX;
unsigned short CurY;
unsigned short BoundW;
unsigned short BoundH;
} CaptionNode;
/* CaptionNode flag definitions. */
#define CNB_USED 0 /* This node is being used. */
#define CNF_USED (1<<CNB_USED)
/* CaptionList: Double linked list of outstanding captions to process.
*
* Head - Pointer to the first node in the list.
* Tail - Always NULL
* TailPred - Pointer to the last node in the list.
*/
typedef struct _CaptionList {
CaptionNode *Head;
CaptionNode *Tail;
CaptionNode *TailPred;
} CaptionList;
/* CaptionInfo:
*
* Next - Pointer to the next caption to be processed.
* List - List of pending captions to process.
* Font - Font to use for this caption.
* BoundX - X position of bounding box.
* BoundY - Y position of bounding box.
* BoundW - Width of bounding box.
* BoundH - Height of bounding box.
* Buffer - Caption chunk buffer.
*/
typedef struct _CaptionInfo {
CaptionText *Next;
CaptionList List;
void *Font;
char FontHeight;
char FontWidth;
void *Buffer;
} CaptionInfo;
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
CaptionInfo *OpenCaptions(void *captions, void *font);
void CloseCaptions(CaptionInfo *cap);
void DoCaptions(CaptionInfo *cap, unsigned long frame);
#endif /* VQACAPTION_H */


565
WINVQ/INCLUDE/VQA32/SOS.H Normal file
View File

@@ -0,0 +1,565 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sos.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOS_DEFINED
#define _SOS_DEFINED
#include "sosdefs.h"
#pragma pack(4)
// error definition for sound operating system
#define _SOS_ERR -1
// number of drivers allowed to be open at one time
#define _SOS_MAX_DRIVERS 5
// structure definition for the capabilities
typedef struct _tagCAPABILITIES
{
BYTE szDeviceName[ 32 ]; // device name
WORD wDeviceVersion; // device version
WORD wBitsPerSample; // bits per sound sample
WORD wChannels; // stereo/mono sound card
WORD wMinRate; // minimum rate
WORD wMaxRate; // maximum rate
WORD wMixerOnBoard; // board contains mixer
WORD wMixerFlags; // mixer capabilities
WORD wFlags; // miscellaneous flags
short far * lpPortList; // list of usable ports
short far * lpDMAList; // list of usable dma channels
short far * lpIRQList; // list of usable irq channels
short far * lpRateList; // list of usable rates, -1 if any in min to max
WORD fBackground; // foreground or background driver
WORD wDeviceID; // ID for the device
WORD wTimerID; // ID for the timer
} _SOS_CAPABILITIES;
// far pointer to the device capabilities structure
typedef _SOS_CAPABILITIES far * LPSOSDEVICECAPS;
// flag types for driver
#define _FLAGS_SIGNED 0x8000
// devices that can be loaded
#define _SOUND_BLASTER_8_MONO 0xe000
#define _SOUND_BLASTER_8_ST 0xe001
#define _SBPRO_8_ST _SOUND_BLASTER_8_ST
#define _SBPRO_8_MONO 0xe00f
#define _SOUND_MASTER_II_8_MONO 0xe002
#define _MV_PAS_8_MONO 0xe003
#define _MV_PAS_16_MONO 0xe004
#define _MV_PAS_8_ST 0xe005
#define _MV_PAS_16_ST 0xe006
#define _ADLIB_GOLD_8_ST 0xe007
#define _ADLIB_GOLD_16_ST 0xe008
#define _ADLIB_GOLD_8_MONO 0xe009
#define _ADLIB_GOLD_16_MONO 0xe00a
#define _MICROSOFT_8_MONO 0xe00b
#define _MICROSOFT_8_ST 0xe00c
#define _MICROSOFT_16_MONO 0xe00d
#define _MICROSOFT_16_ST 0xe00e
#define _SOUND_SOURCE_8_MONO_PC 0xe010
#define _SOUND_SOURCE_8_MONO_TANDY 0xe011
#define _GENERAL_PORT_8_MONO 0xe012
#define _GENERAL_PORT_8_MONO_R 0xe013
#define _SIERRA_8_MONO 0xe014
#define _SB16_8_MONO 0xe015
#define _SB16_8_ST 0xe016
#define _SB16_16_MONO 0xe017
#define _SB16_16_ST 0xe018
#define _ESS_AUDIODRIVE_8_MONO 0xe019
#define _ESS_AUDIODRIVE_8_ST 0xe01a
#define _ESS_AUDIODRIVE_16_MONO 0xe01b
#define _ESS_AUDIODRIVE_16_ST 0xe01c
#define _SOUNDSCAPE_8_MONO 0xe01d
#define _SOUNDSCAPE_8_ST 0xe01e
#define _SOUNDSCAPE_16_MONO 0xe01f
#define _SOUNDSCAPE_16_ST 0xe020
#define _RAP10_8_MONO 0xe021
#define _RAP10_16_MONO 0xe022
#define _GUS_8_MONO 0xe023
#define _GUS_8_ST 0xe024
#define _GUS_16_MONO 0xe025
#define _GUS_16_ST 0xe026
#define _GUS_MAX_8_MONO 0xe027
#define _GUS_MAX_8_ST 0xe028
#define _GUS_MAX_16_MONO 0xe029
#define _GUS_MAX_16_ST 0xe02a
#define _WAVEJAMMER_8_MONO 0xe02b
#define _WAVEJAMMER_8_ST 0xe02c
#define _WAVEJAMMER_16_MONO 0xe02d
#define _WAVEJAMMER_16_ST 0xe02e
#define _TEMPOCS_8_MONO 0xe02f
#define _TEMPOCS_8_ST 0xe030
#define _TEMPOCS_16_MONO 0xe031
#define _TEMPOCS_16_ST 0xe032
#define _WAVEJAMMERCD_8_MONO 0xe033
#define _WAVEJAMMERCD_8_ST 0xe034
#define _WAVEJAMMERCD_16_MONO 0xe035
#define _WAVEJAMMERCD_16_ST 0xe036
#define _SOUND_BLASTER_8_MONO_R 0xe050
#define _MICROSOFT_8_MONO_R 0xe051
#define _SOUND_MASTER_II_8_MONO_R 0xe052
#define _ADLIB_GOLD_8_MONO_R 0xe053
#define _MV_PAS_8_MONO_R 0xe054
#define _RAP10_8_MONO_R 0xe058
#define _RAP10_16_MONO_R 0xe059
#define _SB16_8_MONO_R 0xe05a
#define _SB16_8_ST_R 0xe05b
#define _SB16_16_MONO_R 0xe05c
#define _SB16_16_ST_R 0xe05d
#define _MV_PAS_16_MONO_R 0xe060
#define _SOUNDSCAPE_8_MONO_R 0xe061
#define _SOUNDSCAPE_8_ST_R 0xe062
#define _SOUNDSCAPE_16_MONO_R 0xe063
#define _SOUNDSCAPE_16_ST_R 0xe064
#define _ESS_AUDIODRIVE_8_MONO_R 0xe065
#define _ESS_AUDIODRIVE_8_ST_R 0xe066
#define _ESS_AUDIODRIVE_16_MONO_R 0xe067
#define _ESS_AUDIODRIVE_16_ST_R 0xe068
#define _SPEECH_THING_8_MONO 0xe090
#define _YAMAHA_8_MONO 0xe106
#define _INT_SPEAKER_8_MONO 0xe107
// call indexes for the loadable drivers
enum
{
_DRV_INIT,
_DRV_UNINIT,
_DRV_SETRATE,
_DRV_SETACTION,
_DRV_START,
_DRV_STOP,
_DRV_PAUSE,
_DRV_RESUME,
_DRV_CAPABILITIES,
_DRV_PLAY_FOREGROUND,
_DRV_GET_FILL_INFO,
_DRV_GET_CALL_FUNCTIONS,
_DRV_SET_CALL_FUNCTIONS
};
// fill info
typedef struct _tagFillInfo
{
LPSTR lpFillHandler; // pointer to fill handler
LPWORD lpDMAFillCount; // pointer to dma count
LPSTR lpSampleList; // pointer to sample list
LPWORD lpDMAMasterVolume; // pointer to dma count
} _SOS_FILL_INFO;
// caps info structure
typedef struct _tagCapsInfo
{
LPSTR lpPortList; // pointer to port list
LPSTR lpDMAList; // pointer to DMA list
LPSTR lpIRQList; // pointer to IRQ list
LPSTR lpRateList; // pointer to rate list
} _SOS_CAPS_INFO;
// maximum number of available voice
#define _MAX_VOICES 32
// structure definition
typedef struct _tagSAMPLE
{
LPSTR samplePtr; // pointer to data buffer
LPSTR sampleData; // pointer to active data
LPSTR sampleLoopPtr; // pointer for loop back
WORD sampleLength; // length of sample
WORD sampleIndex; // index into sample
WORD sampleLoopLength; // length of loop
WORD sampleBytesLeft; // bytes left to play in sample
WORD sampleLoopPoint; // byte count for loop point
WORD sampleLoopEndLength; // length of remaining chunk
short sampleFlags; // control sample
short sampleVolume; // volume control
short sampleID; // sample ID
short sampleChannel; // channel to play sample on
short sampleLoopCount; // loop count
short sampleLastFill; // last fill position
VOID ( far cdecl * sampleCallback )( WORD, WORD, WORD ); // callback function for sample
WORD samplePitchAdd;
short samplePitchFraction;
short samplePort; // port to use for non-dma digitized
WORD sampleTotalBytes;
WORD sampleByteLength;
short samplePanLocation;
short samplePanSpeed;
short samplePanDirection;
short samplePanStart;
short samplePanEnd;
short sampleDelayBytes;
short sampleDelayRepeat;
WORD sampleADPCMPredicted;
short sampleADPCMIndex;
short sampleRootNoteMIDI;
WORD sampleTemp1;
} _SOS_SAMPLE;
// enumeration for left or right channel
enum
{
_LEFT_CHANNEL,
_RIGHT_CHANNEL,
_CENTER_CHANNEL,
_INTERLEAVED
};
// enumeration for foreground and background
enum
{
_FOREGROUND,
_BACKGROUND
};
// defines for the sample flags
#define _ACTIVE 0x8000
#define _LOOPING 0x4000
#define _FIRST_TIME 0x2000
#define _PENDING_RELEASE 0x1000
#define _CONTINUE_BLOCK 0x0800
#define _PITCH_SHIFT 0x0400
#define _PANNING 0x0200
#define _VOLUME 0x0100
#define _TRANSLATE16TO8 0x0080
#define _STAGE_LOOP 0x0040
#define _TRANSLATE8TO16 0x0020
#define _STEREOTOMONO 0x0010
// defines for the wParam flags
#define _SINGLE_SAMPLE 0x01
#define _SOS_DCAPS_AUTO_REINIT 0x01
#define _SOS_DCAPS_MPU_401 0x02
#define _SOS_DCAPS_OPL2 0x04
#define _SOS_DCAPS_OPL3 0x08
#define _SOS_DCAPS_OPL4 0x10
#define _SOS_DCAPS_WAVETABLE 0x20
#define _SOS_DCAPS_DL_SAMPLES 0x40
#define _SOS_DCAPS_FIFO_DEVICE 0x80
#define _SOS_DCAPS_ENV_NEEDED 0x100
#define _SOS_DCAPS_PSEUDO_DMA1 0x200
#define _SOS_DCAPS_SIGNED_DATA 0x8000
// file header structure
typedef struct
{
// name ID
BYTE szName[ 32 ];
// number of drivers in the file
WORD wDrivers;
// offset of first driver
WORD lOffset;
// size of the file
WORD lFileSize;
} _FILEHEADER;
// driver header structure
typedef struct
{
// name ID
BYTE szName[ 32 ];
// offset of next driver
WORD lNextDriver;
// size of current driver
WORD wSize;
// id for the current device
WORD wDeviceID;
// id for the type of DOS extender
WORD wExtenderType;
} _DRIVERHEADER;
// device hardware information
typedef struct
{
// port to be used
WORD wPort;
// irq to use
WORD wIRQ;
// dma channel to se
WORD wDMA;
// extra parameter
WORD wParam;
} _SOS_HARDWARE;
// structure definition for start sample
typedef struct
{
// pointer to sample
LPSTR lpSamplePtr;
// size of the sample
WORD dwSampleSize;
// number of times to loop the sample -1 is infinite
WORD wLoopCount;
// channel to play sample on
WORD wChannel;
// volume to play sample at
WORD wVolume;
// id for the sample
WORD wSampleID;
// far pointer to the callback function
VOID ( far cdecl *lpCallback )( WORD, WORD, WORD );
// port to use if driver is a non-dma background driver
WORD wSamplePort;
// flags field
WORD wSampleFlags;
// total length of sample including loops, etc..
WORD dwSampleByteLength;
// loop point for the sample
WORD dwSampleLoopPoint;
WORD dwSampleLoopLength;
// pitch shifting components
WORD dwSamplePitchAdd;
WORD wSamplePitchFraction;
// pan components
WORD wSamplePanLocation;
WORD wSamplePanSpeed;
WORD wSamplePanDirection;
WORD wSamplePanStart;
WORD wSamplePanEnd;
// delay parts
WORD wSampleDelayBytes;
WORD wSampleDelayRepeat;
// compression components
WORD dwSampleADPCMPredicted;
WORD wSampleADPCMIndex;
// root note for pitch shifting
WORD wSampleRootNoteMIDI;
// filler for future upgrades
WORD dwSampleTemp1;
WORD dwSampleTemp2;
WORD dwSampleTemp3;
} _SOS_START_SAMPLE;
// structure for initializing a driver
typedef struct
{
WORD wBufferSize;
LPSTR lpBuffer;
BOOL wAllocateBuffer;
WORD wSampleRate;
WORD wParam;
LONG dwParam;
VOID ( far *lpFillHandler )( VOID );
LPSTR lpDriverMemory;
LPSTR lpDriverMemoryCS;
LPSTR lpTimerMemory;
LPSTR lpTimerMemoryCS;
WORD wTimerID;
WORD wPhysical;
} _SOS_INIT_DRIVER;
// define for the timer types to use
#define _SOS_NORMAL_TIMER 0x00
// enumeration for the timer types
enum
{
_TIMER_8_MONO = 0x1000,
_TIMER_8_ST,
_TIMER_16_MONO,
_TIMER_16_ST,
_TIMER_8_MONO_ULAW,
_TIMER_8_ST_ULAW,
_TIMER_16_MONO_ULAW,
_TIMER_16_ST_ULAW,
_TIMER_8_MONO_REC,
_TIMER_8_MONO_ULAW_REC,
_TIMER_UNDEFINED_1,
_TIMER_UNDEFINED_2,
_TIMER_UNDEFINED_3,
_TIMER_UNDEFINED_4,
_TIMER_UNDEFINED_5,
_TIMER_UNDEFINED_6,
_TIMER_UNDEFINED_7,
_TIMER_UNDEFINED_8,
_TIMER_UNDEFINED_9,
_TIMER_UNDEFINED_A,
_TIMER_UNDEFINED_B,
_TIMER_UNDEFINED_C,
_TIMER_UNDEFINED_D,
_TIMER_UNDEFINED_E,
_TIMER_UNDEFINED_F,
_TIMER_UNDEFINED_10,
_TIMER_UNDEFINED_11,
_TIMER_UNDEFINED_12,
_TIMER_UNDEFINED_13,
_TIMER_UNDEFINED_14,
_TIMER_UNDEFINED_15,
_TIMER_UNDEFINED_16,
_TIMER_8_SOUND_SOURCE,
_TIMER_8_SOUND_SOURCE_TANDY,
_TIMER_8_GENERAL_PORT,
_TIMER_8_GENERAL_PORT_REC
};
// define for no slots available
#define _ERR_NO_SLOTS ( WORD )-1
// error codes for the system
enum
{
_ERR_NO_ERROR,
_ERR_DRIVER_NOT_LOADED,
_ERR_INVALID_POINTER,
_ERR_DETECT_INITIALIZED,
_ERR_FAIL_ON_FILE_OPEN,
_ERR_MEMORY_FAIL,
_ERR_INVALID_DRIVER_ID,
_ERR_NO_DRIVER_FOUND,
_ERR_DETECTION_FAILURE,
_ERR_DRIVER_LOADED,
_ERR_INVALID_HANDLE,
_ERR_NO_HANDLES,
_ERR_PAUSED,
_ERR_NOT_PAUSED,
_ERR_INVALID_DATA,
_ERR_DRV_FILE_FAIL,
_ERR_INVALID_PORT,
_ERR_INVALID_IRQ,
_ERR_INVALID_DMA,
_ERR_INVALID_DMA_IRQ
};
// maximum number of timer events that can be registered
#define _TIMER_MAX_EVENTS 0x10
// flags for the debugging system
#define _SOS_DEBUG_NORMAL 0x0000
#define _SOS_DEBUG_NO_TIMER 0x0001
#define _SOS_TIMER_DPMI 0x0002
// define for types of DOS extenders
#define _SOS_RATIONAL 0x8000
#define _SOS_FLASHTECK 0x4000
// defines for the types of timers for different
// dos extenders
#define _SOS_TIMER_NEAR 0x8000
#define _SOS_TIMER_FAR 0x4000
// values for callback information
enum
{
_SAMPLE_PROCESSED,
_SAMPLE_LOOPING,
_SAMPLE_DONE
};
// define for special 18.2 callback rate to dos
#define _TIMER_DOS_RATE 0xff00
#pragma pack()
#pragma aux int_3 = "int 3"
#pragma pack( 1 )
typedef struct
{
unsigned region_size;
unsigned offset;
unsigned segment;
unsigned short number_available;
unsigned short number_used;
unsigned page0;
} EVDS_STRUCT;
typedef struct
{
unsigned region_size;
unsigned offset;
unsigned short segment;
unsigned short ID;
unsigned physical;
} VDS_STRUCT;
#pragma pack()
#include "sosdata.h"
#include "sosfnct.h"
#endif

View File

@@ -0,0 +1,128 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosdata.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOS_DATA
#define _SOS_DATA
#include <stddef.h>
#pragma pack(4)
extern WORD _sosDIGIData_Start;
extern WORD _sosDIGIData_End;
extern WORD _wSOSDriverLinear[];
extern WORD _wSOSTimerLinear[];
extern LPSTR _lpSOSDriver[];
extern LPSTR _lpSOSTimer[];
extern LPSTR _lpSOSDriverCS[];
extern LPSTR _lpSOSTimerCS[];
extern BOOL _wSOSDriverLoaded[];
extern BOOL _wSOSTimerLoaded[];
extern BOOL _wSOSDriverInitialized[];
extern WORD _wSOSOutputRate[];
extern WORD _wSOSDMABuffersize[];
extern LONG _dwSOSDMABufferPhysical[];
extern LPSTR _lpSOSDMABuffer[];
extern BOOL _wTimerUsed;
extern VOID ( far *_lpSOSFillHandler[] )( VOID );
extern WORD _wSOSTimerType[];
extern WORD _wSOSDriverType[];
extern _SOS_SAMPLE far * _lpSOSSampleList[][ _MAX_VOICES ];
extern LPWORD _lpSOSDMAIrqCount[];
extern LPWORD _lpSOSDMAFillCount[];
extern WORD _wSOSTmrNextCount;
extern VOID ( interrupt far *_lpSOSOldTimer )( VOID );
extern WORD _wSOSDriverID[];
extern _SOS_CAPABILITIES _sSOSDriverCaps[];
extern WORD _wSOSDMAPortList[];
extern BYTE _bSOSDMAChannel[];
extern _SOS_INIT_DRIVER _sSOSDIGIInitDriver[];
extern BYTE _pSOSDriverPath[];
extern BYTE _pSOSTempDriverPath[];
extern BOOL _wTIMERUsed;
extern WORD _wTIMERValue;
extern VOID ( far * _lpTIMEREvents[] )( VOID );
extern WORD _wTIMEREventRate[];
extern WORD _dwTIMEREventFraction[];
extern WORD _dwTIMEREventFractionCurrent[];
extern BYTE _bSOSMIDITimerSongHandler[];
extern BYTE _bSOSMIDISongHandle;
extern WORD _wSOSTimerMemHandle[];
extern WORD _wSOSDriverMemHandle[];
extern WORD _wSOSRealSeg[];
extern _FILEHEADER _sDETFileHeader;
extern _DRIVERHEADER _sDETDriverHeader;
extern _FILEHEADER sLOADFileHeader;
extern _DRIVERHEADER sLOADDriverHeader;
extern BOOL _wDETInitialized;
extern WORD _wDETLinear;
extern LPSTR _lpDETDriverBuffer;
extern LPSTR _lpDETDriverBufferCS;
extern WORD _hDETFile;
extern DWORD _dwDETDriverIndex;
extern WORD _wDETDriverIndexCur;
extern WORD _wDETMemHandle;
extern LPSOSDEVICECAPS _lpDETDeviceCaps;
extern _SOS_CAPABILITIES _sDETCaps;
extern PSTR _pSOSErrorStrings[];
extern BOOL _wSOSBufferAllocated[];
extern BOOL _wSOSSystemInitialized;
extern VDS_STRUCT _sSOSVDSInfo;
extern _SOS_FILL_INFO _sSOSFillInfo;
extern WORD _wSOSTimerEventIndex;
extern WORD _wSOSTimerEntered;
extern WORD _wSOSDriverSize[];
extern WORD _wSOSTimerSize[];
#ifdef __cplusplus
extern "C" {
#endif
extern WORD _sosDIGIData1_Start;
extern WORD _sosDIGIData1_End;
extern WORD _sosDIGIData2_Start;
extern WORD _sosDIGIData2_End;
extern BYTE _bTIMERInstalled;
extern BYTE _bTIMERDPMI;
extern WORD wDetectPort;
extern WORD wDetectIRQ;
extern WORD wDetectDMA;
extern WORD wDetectParam;
#ifdef __cplusplus
}
#endif
#pragma pack()
#endif


View File

@@ -0,0 +1,83 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosdefs.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOSDEFS_DEFINED
#define _SOSDEFS_DEFINED
#undef _TRUE
#undef _FALSE
#undef _NULL
enum
{
_FALSE,
_TRUE
};
#define _NULL 0
#ifndef VOID
#define VOID void
#endif
typedef int BOOL;
typedef unsigned int UINT;
typedef unsigned char BYTE;
typedef unsigned WORD;
#ifndef LONG
typedef signed long LONG;
#endif
typedef unsigned long DWORD;
typedef BYTE * PBYTE;
typedef char near * PSTR;
typedef WORD * PWORD;
typedef LONG * PLONG;
typedef VOID * PVOID;
typedef BYTE far * LPBYTE;
typedef BYTE far * LPSTR;
typedef WORD far * LPWORD;
typedef LONG far * LPLONG;
typedef VOID far * LPVOID;
typedef BYTE huge * HPBYTE;
typedef BYTE huge * HPSTR;
typedef WORD huge * HPWORD;
typedef LONG huge * HPLONG;
typedef VOID huge * HPVOID;
typedef unsigned HANDLE;
#endif


View File

@@ -0,0 +1,218 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosfnct.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOS_FUNCTIONS
#define _SOS_FUNCTIONS
#pragma pack(4)
WORD sosDIGILockMemory ( VOID );
WORD sosDIGIUnLockMemory ( VOID );
WORD sosDIGIInitSystem ( LPSTR, WORD );
WORD sosDIGIUnInitSystem ( VOID );
WORD sosDIGIInitDriver ( WORD, _SOS_HARDWARE far *,
_SOS_INIT_DRIVER far *, WORD far * );
WORD sosDIGIUnInitDriver ( WORD, BOOL, BOOL );
WORD sosDIGILoadDriver ( WORD, WORD, LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
WORD sosDIGIUnLoadDriver ( WORD );
WORD sosDIGIGetDeviceCaps ( WORD, LPSOSDEVICECAPS );
#ifdef PHARLAP
LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
#else
LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
#endif
WORD sosDIGIStopSample ( WORD, WORD );
WORD sosDIGISamplesPlaying ( WORD );
BOOL sosDIGISampleDone ( WORD, WORD );
BOOL sosDIGISampleFilling ( WORD, WORD );
WORD sosDIGIStartSample ( WORD, _SOS_START_SAMPLE far * );
WORD sosDIGIContinueSample ( WORD, WORD, _SOS_START_SAMPLE far * );
WORD sosDIGIDetectInit ( LPSTR );
WORD sosDIGIDetectUnInit ( VOID );
WORD sosDIGIDetectFindHardware ( WORD, _SOS_CAPABILITIES far *, WORD far * );
WORD sosDIGIDetectFindFirst ( _SOS_CAPABILITIES far *, WORD far * );
WORD sosDIGIDetectFindNext ( _SOS_CAPABILITIES far *, WORD far * );
WORD sosDIGIDetectGetSettings ( _SOS_HARDWARE far * );
WORD sosDIGIDetectGetCaps ( WORD, _SOS_CAPABILITIES far * );
WORD sosDIGIDetectVerifySettings( _SOS_HARDWARE far * );
PSTR sosGetErrorString ( WORD );
WORD sosDIGILoadTimer ( WORD , LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
WORD sosDIGIUnLoadTimer ( WORD );
WORD sosTIMERRegisterEvent ( WORD wCallRate, VOID ( far * lpTimerEvent )( VOID ), WORD far *lpTimerHandle );
WORD sosTIMERInitSystem ( WORD, WORD );
WORD sosTIMERUnInitSystem ( WORD );
WORD sosTIMERSetRate ( WORD );
WORD sosTIMERRemoveEvent ( WORD );
WORD sosTIMERAlterEventRate ( WORD, WORD );
WORD sosTIMERGetEventRate ( WORD );
VOID far sosTIMEROldHandler ( VOID );
VOID far sosTIMERHandler ( VOID );
// functions in soscntl.c
WORD sosDIGISetSampleVolume ( WORD, WORD, WORD );
WORD sosDIGIGetSampleVolume ( WORD, WORD );
WORD sosDIGISetChannel ( WORD, WORD, WORD );
WORD sosDIGIGetChannel ( WORD, WORD );
WORD sosDIGIGetBytesProcessed ( WORD, WORD );
WORD sosDIGIGetLoopCount ( WORD, WORD );
WORD sosDIGISetPanLocation ( WORD, WORD, WORD );
WORD sosDIGIGetPanLocation ( WORD, WORD );
DWORD sosDIGISetPitch ( WORD, WORD, DWORD );
DWORD sosDIGIGetPitch ( WORD, WORD );
WORD sosDIGIGetDMAPosition ( WORD );
WORD sosDIGISetPanSpeed ( WORD, WORD, WORD );
WORD sosDIGIGetPanSpeed ( WORD, WORD );
WORD sosDIGIGetSampleID ( WORD, WORD );
WORD sosDIGIGetSampleHandle ( WORD, WORD );
WORD sosDIGISetMasterVolume ( WORD, WORD );
#ifdef PHARLAP
VOID sosFreeVDSPage ( unsigned short, unsigned short, DWORD );
WORD sosAllocVDSPage ( unsigned short *, unsigned short *, DWORD * );
#else
WORD sosAllocVDSPage ( LPSTR *, WORD *, WORD * );
VOID sosFreeVDSPage ( WORD, WORD, LONG );
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef PHARLAP
extern int cdecl sosRealFree ( int );
extern BOOL cdecl _sos_read( WORD, LPSTR, WORD, WORD * );
extern int cdecl sosRealAlloc( int, int *, int * );
extern void cdecl sosDRVFarMemCopy( LPSTR, LPSTR, WORD );
extern int cdecl sosGetCS( VOID );
extern int cdecl sosGetES( VOID );
#else
extern int cdecl sosRealAlloc ( int, int *, int * );
extern int cdecl sosRealFree ( int );
#endif
// sos driver functions
extern WORD cdecl sosDRVLockMemory ( DWORD, DWORD );
extern WORD cdecl sosDRVUnLockMemory ( DWORD, DWORD );
extern void cdecl sosDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
extern void cdecl sosDetDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
extern void cdecl sosDRVGetCapsPtr ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
extern void cdecl sosDRVInit ( LPSTR, LPSTR, int, int, int, int, int, int );
extern void cdecl sosDRVStart ( LPSTR, LPSTR, int, int );
extern void cdecl sosDRVSetRate ( LPSTR, LPSTR, int );
extern void cdecl sosDRVSetAction ( LPSTR, LPSTR );
extern void cdecl sosDRVStop ( LPSTR, LPSTR );
extern void cdecl sosDRVUnInit ( LPSTR, LPSTR );
extern void cdecl sosDRVGetFillInfo ( LPSTR, LPSTR, LPSTR, int, int, int, _SOS_FILL_INFO * );
extern void cdecl sosFillSampleStructs ( PSTR, LPSTR );
extern WORD cdecl sosDetDRVExist ( LPSTR, LPSTR );
extern WORD cdecl sosDetDRVGetSettings ( LPSTR, LPSTR );
extern WORD cdecl sosDetDRVVerifySettings( LPSTR, WORD, WORD, WORD, LPSTR );
extern WORD cdecl sosDIGIInitForWindows( WORD );
extern WORD cdecl sosDIGIUnInitForWindows( WORD );
extern LPSTR cdecl sosAllocateFarMem ( WORD, PSTR, WORD * );
extern LPSTR cdecl sosCreateAliasCS ( LPSTR );
extern VOID cdecl sosFreeSelector ( LPSTR, DWORD );
extern LPSTR cdecl sosMAKEDOSPtr ( PSTR );
extern VOID cdecl sosDetDRVSetEnvString ( DWORD, PSTR );
extern PSTR cdecl sosDetDRVGetEnvString ( DWORD );
extern VOID cdecl sosDetDRVEnvStringInit ( LPSTR, LPSTR );
extern VOID cdecl sosDRVSetupCallFunctions( LPSTR, LPSTR, LPSTR, LPSTR );
extern WORD cdecl sosDRVGetFreeMemory ( VOID );
extern WORD cdecl sosDRVAllocVDSStruct ( WORD, WORD *, WORD * );
extern WORD cdecl sosDRVFreeVDSStruct ( WORD, WORD );
extern WORD cdecl sosDRVIsWindowsActive ( VOID );
extern WORD cdecl sosDRVVDSGetBuffer ( WORD );
extern WORD cdecl sosDRVVDSFreeBuffer ( WORD );
extern WORD cdecl getDS( VOID );
extern WORD cdecl sosDRVMakeDMASelector ( WORD );
extern WORD cdecl sosDRVFreeDMASelector ( WORD );
extern void cdecl sosTIMERDRVInit( int wRate, void ( far * )( void ) );
extern void cdecl sosTIMERDRVUnInit( void );
extern void cdecl sosTIMERDRVHandler( void );
extern void cdecl sosTIMERDRVFHandler( void );
extern void cdecl sosTIMERDRVEnable( void );
extern void cdecl sosTIMERDRVDisable( void );
extern void cdecl sosTIMERDRVCallOld( void );
extern void cdecl sosTIMERDRVSetRate( WORD );
extern void cdecl sosDIGITimer_Start( void );
extern void cdecl sosDIGITimer_End( void );
extern void cdecl sosDIGIDrv_Start( void );
extern void cdecl sosDIGIDrv_End( void );
#ifdef __cplusplus
}
#endif
// external functions for handling system initialization and
// uninitialization
WORD sosEXDIGInitDriver ( WORD, WORD, WORD, LPSTR,
_SOS_HARDWARE far *, WORD * );
WORD sosEXDIGIUnInitDriver ( VOID );
WORD sosEXDETFindDriver ( WORD, LPSTR, _SOS_HARDWARE far *,
_SOS_CAPABILITIES far * );
// memory locking prototypes
VOID sosDIGICaps_Start( VOID );
VOID sosDIGICaps_End( VOID );
VOID sosDIGIErr_Start( VOID );
VOID sosDIGIErr_End( VOID );
VOID sosDIGITmr_Start( VOID );
VOID sosDIGITmr_End( VOID );
VOID sosDIGIStart_Start( VOID );
VOID sosDIGIStart_End( VOID );
VOID sosDIGIPlyng_Start( VOID );
VOID sosDIGIPlyng_End( VOID );
VOID sosDIGIRate_Start( VOID );
VOID sosDIGIRate_End( VOID );
VOID sosDIGIDone_Start( VOID );
VOID sosDIGIDone_End( VOID );
VOID sosDIGIDetec_Start( VOID );
VOID sosDIGIDetec_End( VOID );
VOID sosDIGIInit_Start( VOID );
VOID sosDIGIInit_End( VOID );
VOID sosDIGILoad_Start( VOID );
VOID sosDIGILoad_End( VOID );
VOID sosDIGICntl_Start( VOID );
VOID sosDIGICntl_End( VOID );
#pragma pack()
#endif

View File

@@ -0,0 +1,129 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosres.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#define _SOS_RESOURCE
#ifndef _SOS_RESOURCE
#define _SOS_RESOURCE
// structure for resource file header
typedef struct
{
// file version
WORD wVersion;
// file size
LONG dwFileSize;
// number of resources in file
WORD wResCount;
// offset of resource data from top of file
LONG dwResOffset;
// offset of sync track from top of file
LONG dwSyncTrackOffset;
} _RES_FILE_HEADER;
// structure for resource block header
typedef struct
{
// resource id
WORD wID;
// resource type
WORD wResType;
// offset of next block
LONG dwNextBlock;
// size of the current resource information
LONG dwResSize;
// rate to play block at
WORD wBlockRate;
// id for the sync track to use
WORD wSyncTrackID;
} _RES_BLOCK_HEADER;
// structure for sync mark tag
typedef struct _tagSYNCMARK
{
// ID of the type of mark being used
WORD wID;
// location in data of sync mark
LONG dwSyncOffset;
// length of sync block
LONG dwSyncSize;
// start sample data
_SOS_START_SAMPLE sampleData;
} _RES_SYNCMARK;
typedef union
{
// structure for sync mark tag
_RES_SYNCMARK syncMark;
} _RES_TAG;
// union for filter information for prepareWave
typedef union
{
// filter type
WORD wFilterID;
// structure for volume
struct volume
{
WORD wVolume;
};
// structure for delay
struct delay
{
WORD wDelaySamples;
};
} _SOS_FILTER;
#endif


124
WINVQ/INCLUDE/VQA32/UNVQ.H Normal file
View File

@@ -0,0 +1,124 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAUNVQ_H
#define VQAUNVQ_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQAPlay32 library. (32-Bit protected mode)
*
* FILE
* unvq.h
*
* DESCRIPTION
* VQ frame decompress definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Feburary 8, 1995
*
****************************************************************************/
#ifdef PHARLAP_TNT
#include <pltypes.h>
#endif
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
/* unvqbuff.asm */
#ifndef PHARLAP_TNT
void __cdecl UnVQ_2x2(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void __cdecl UnVQ_2x3(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void __cdecl UnVQ_4x2(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void __cdecl UnVQ_4x4(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void __cdecl UnVQ_4x2_Woofer(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
/* unvqvesa.asm */
void __cdecl UnVQ_4x2_VESA320_32K(unsigned char *codebook,
unsigned char *pointers, unsigned char *palette,
unsigned long grains_per_win,unsigned long dummy1,unsigned long dummy2);
#else /* PHARLAP_TNT */
void __cdecl UnVQ_2x2(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
void __cdecl UnVQ_2x3(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
void __cdecl UnVQ_4x2(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
void __cdecl UnVQ_4x4(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
/* unvqvesa.asm */
void __cdecl UnVQ_4x2_VESA320_32K(unsigned char *codebook,
unsigned char *pointers, FARPTR palette, unsigned long grains_per_win,
unsigned long dummy1, unsigned long dummy2);
#endif /* PHARLAP_TNT */
/* unvqxmde.asm */
void __cdecl UnVQ_4x2_Xmode(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long dummy);
void __cdecl UnVQ_4x2_XmodeCB(unsigned char *cbdummy, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long dummy);
void __cdecl Upload_4x2CB(unsigned char *codebook, unsigned long numentries);
void __cdecl XlatePointers(unsigned char *pointers, unsigned long numpointers);
#ifdef __cplusplus
}
#endif
#endif /* VQAUNVQ_H */

View File

@@ -0,0 +1,197 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAFILE_H
#define VQAFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vqafile.h
*
* DESCRIPTION
* VQA file format definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
****************************************************************************/
#include <vqm32\iff.h>
#ifdef __WATCOMC__
#pragma pack(1);
#endif
/*---------------------------------------------------------------------------
* STRUCTURE DEFINITIONS AND RELATED DEFINES.
*-------------------------------------------------------------------------*/
/* VQAHeader: VQA movie description header. (VQHD)
*
* Version - VQA version.
* Flags - Various flags. (See below)
* ImageWidth - Image width in pixels.
* ImageHeight - Image height in pixels.
* BlockWidth - Block width in pixels.
* BlockHeight - Block height in pixels.
* Frames - Total number of frames in the movie.
* FPS - Playback rate (Frame Per Second).
* Groupsize - Frame grouping size (frames per codebook).
* Num1Colors - Number of 1 color colors.
* CBentries - Number of codebook entries.
* Xpos - X position to draw frames. (-1 = Center)
* Ypos - Y position to draw frames. (-1 = Center)
* MaxFramesize - Size of largest frame.
* SampleRate - Sample rate of primary audio stream.
* Channels - Number of channels in primary audio stream.
* BitsPerSample - Sample bit size in primary audio stream.
* FutureUse - Reserved for future expansion.
*/
typedef struct _VQAHeader {
unsigned short Version;
unsigned short Flags;
unsigned short Frames;
unsigned short ImageWidth;
unsigned short ImageHeight;
unsigned char BlockWidth;
unsigned char BlockHeight;
unsigned char FPS;
unsigned char Groupsize;
unsigned short Num1Colors;
unsigned short CBentries;
unsigned short Xpos;
unsigned short Ypos;
unsigned short MaxFramesize;
unsigned short SampleRate;
unsigned char Channels;
unsigned char BitsPerSample;
unsigned short AltSampleRate;
unsigned char AltChannels;
unsigned char AltBitsPerSample;
unsigned short FutureUse[5];
} VQAHeader;
/* Version type. */
#define VQAHD_VER1 1
#define VQAHD_VER2 2
/* VQA header flag definitions */
#define VQAHDB_AUDIO 0 /* Audio track present. */
#define VQAHDB_ALTAUDIO 1 /* Alternate audio track present. */
#define VQAHDF_AUDIO (1<<VQAHDB_AUDIO)
#define VQAHDF_ALTAUDIO (1<<VQAHDB_ALTAUDIO)
/* Frame information (FINF) chunk definitions
*
* The FINF chunk contains a longword (4 bytes) entry for each
* frame in the movie. This entry is divided into two parts,
* flags (4 bits) and offset (28 bits).
*
* BITS NAME DESCRIPTION
* -----------------------------------------------------------
* 31-28 Flags 4 bitwise boolean flags.
* 27-0 Offset Offset in WORDS from the start of the file.
*/
#define VQAFINB_KEY 31
#define VQAFINB_PAL 30
#define VQAFINB_SYNC 29
#define VQAFINF_KEY (1L<<VQAFINB_KEY)
#define VQAFINF_PAL (1L<<VQAFINB_PAL)
#define VQAFINF_SYNC (1L<<VQAFINB_SYNC)
/* FINF related defines and macros. */
#define VQAFINF_OFFSET 0x0FFFFFFFL
#define VQAFINF_FLAGS 0xF0000000L
#define VQAFRAME_OFFSET(a) (((a & VQAFINF_OFFSET)<<1))
/* VQ vector pointer codes. */
#define VPC_ONE_SINGLE 0xF000 /* One single color block */
#define VPC_ONE_SEMITRANS 0xE000 /* One semitransparent block */
#define VPC_SHORT_DUMP 0xD000 /* Short dump of single color blocks */
#define VPC_LONG_DUMP 0xC000 /* Long dump of single color blocks */
#define VPC_SHORT_RUN 0xB000 /* Short run of single color blocks */
#define VPC_LONG_RUN 0xA000 /* Long run */
/* Long run codes. */
#define LRC_SEMITRANS 0xC000 /* Long run of semitransparent blocks. */
#define LRC_SINGLE 0x8000 /* Long run of single color blocks. */
/* Defines used for Run-Skip-Dump compression. */
#define MIN_SHORT_RUN_LENGTH 2
#define MAX_SHORT_RUN_LENGTH 15
#define MIN_LONG_RUN_LENGTH 2
#define MAX_LONG_RUN_LENGTH 4095
#define MIN_SHORT_DUMP_LENGTH 3
#define MAX_SHORT_DUMP_LENGTH 15
#define MIN_LONG_DUMP_LENGTH 2
#define MAX_LONG_DUMP_LENGTH 4095
#define WORD_HI_BIT 0x8000
/*---------------------------------------------------------------------------
* VQA FILE CHUNK ID DEFINITIONS.
*-------------------------------------------------------------------------*/
#define ID_WVQA MAKE_ID('W','V','Q','A') /* Westwood VQ Animation form. */
#define ID_VQHD MAKE_ID('V','Q','H','D') /* VQ header. */
#define ID_NAME MAKE_ID('N','A','M','E') /* Name string. */
#define ID_FINF MAKE_ID('F','I','N','F') /* Frame information. */
#define ID_VQFR MAKE_ID('V','Q','F','R') /* VQ frame container. */
#define ID_VQFK MAKE_ID('V','Q','F','K') /* VQ key frame container. */
#define ID_CBF0 MAKE_ID('C','B','F','0') /* Full codebook. */
#define ID_CBFZ MAKE_ID('C','B','F','Z') /* Full codebook (compressed). */
#define ID_CBP0 MAKE_ID('C','B','P','0') /* Partial codebook. */
#define ID_CBPZ MAKE_ID('C','B','P','Z') /* Partial codebook (compressed). */
#define ID_VPT0 MAKE_ID('V','P','T','0') /* Vector pointers. */
#define ID_VPTZ MAKE_ID('V','P','T','Z') /* Vector pointers (compressed). */
#define ID_VPTK MAKE_ID('V','P','T','K') /* Vector pointers (Delta Key). */
#define ID_VPTD MAKE_ID('V','P','T','D') /* Vector pointers (Delta). */
#define ID_VPTR MAKE_ID('V','P','T','R') /* Pointers RSD compressed. */
#define ID_VPRZ MAKE_ID('V','P','R','Z') /* Pointers RSD, lcw compressed. */
#define ID_CPL0 MAKE_ID('C','P','L','0') /* Color palette. */
#define ID_CPLZ MAKE_ID('C','P','L','Z') /* Color palette (compressed). */
#define ID_SND0 MAKE_ID('S','N','D','0') /* Sound */
#define ID_SND1 MAKE_ID('S','N','D','1') /* Sound (Zap compressed). */
#define ID_SND2 MAKE_ID('S','N','D','2') /* Sound (ADPCM compressed). */
#define ID_SNDZ MAKE_ID('S','N','D','Z') /* Sound (LCW compression). */
#define ID_SNA0 MAKE_ID('S','N','A','0') /* Sound */
#define ID_SNA1 MAKE_ID('S','N','A','1') /* Sound (Zap compressed). */
#define ID_SNA2 MAKE_ID('S','N','A','2') /* Sound (ADPCM compressed). */
#define ID_SNAZ MAKE_ID('S','N','A','Z') /* Sound (LCW compression). */
#define ID_CAP0 MAKE_ID('C','A','P','0') /* Caption text */
#define ID_EVA0 MAKE_ID('E','V','A','0') /* EVA text */
#ifdef __WATCOMC__
#pragma pack();
#endif
#endif /* VQAFILE_H */

View File

@@ -0,0 +1,355 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAPLAY_H
#define VQAPLAY_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vqaplay.h
*
* DESCRIPTION
* VQAPlay library definitions.
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
****************************************************************************/
/*---------------------------------------------------------------------------
* CONDITIONAL COMPILATION FLAGS
*-------------------------------------------------------------------------*/
// MEG - 11.28.95 - added for debug
extern void Debug_Printf( char *format_string, ... );
#ifdef __WATCOMC__
#define VQASTANDALONE 0 /* Stand alone player */
#define VQAVOC_ON 0 /* Enable VOC file override */
#define VQAMONO_ON 0 /* Mono display output enable/disable */
#define VQADIRECT_SOUND 1 /* Use windows direct sound system */
#define VQAAUDIO_ON 1 /* Audio playback enable/disable */
#define VQAVIDEO_ON 0 /* Video manager enable/disable */
#define VQAMCGA_ON 1 /* MCGA enable/disable */
#define VQAXMODE_ON 0 /* Xmode enable/disable */
#define VQAVESA_ON 0 /* VESA enable/disable */
#define VQABLOCK_2X2 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_2X3 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
#define VQABLOCK_4X4 0 /* 4x4 block decode enable/disable */
#define VQAWOOFER_ON 0
#else
#define VQASTANDALONE 0 /* Stand alone player */
#define VQAVOC_ON 0 /* Enable VOC file override */
#define VQAMONO_ON 1 /* Mono display output enable/disable */
#define VQADIRECT_SOUND 1 /* Use windows direct sound system */
#define VQAAUDIO_ON 1 /* Audio playback enable/disable */
#define VQAVIDEO_ON 0 /* Video manager enable/disable */
#define VQAMCGA_ON 1 /* MCGA enable/disable */
#define VQAXMODE_ON 0 /* Xmode enable/disable */
#define VQAVESA_ON 0 /* VESA enable/disable */
#define VQABLOCK_2X2 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_2X3 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
#define VQABLOCK_4X4 0 /* 4x4 block decode enable/disable */
#define VQAWOOFER_ON 0
#endif
#if (VQAAUDIO_ON && VQADIRECT_SOUND)
#ifndef WIN32
#define WIN32 1
#ifndef _WIN32 // Denzil 6/2/98 Watcom 11.0 complains without this check
#define _WIN32
#endif // _WIN32
#endif
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include "dsound.h"
#endif
/*---------------------------------------------------------------------------
* GENERAL CONSTANT DEFINITIONS
*-------------------------------------------------------------------------*/
/* Playback modes. */
#define VQAMODE_RUN 0 /* Run the movie through the end. */
#define VQAMODE_WALK 1 /* Draw the next frame then return. */
#define VQAMODE_PAUSE 2 /* Suspend movie playback. */
#define VQAMODE_STOP 3 /* Stop the movie. */
/* Playback timer methods */
#define VQA_TMETHOD_DEFAULT -1 /* Use default timer method. */
#define VQA_TMETHOD_DOS 1 /* DOS timer method */
#define VQA_TMETHOD_INT 2 /* Interrupt timer method */
#define VQA_TMETHOD_AUDIO 3 /* Audio timer method */
#define VQA_TIMETICKS 60 /* Clock ticks per second */
/* Error/Status conditions */
#define VQAERR_NONE 0 /* No error */
#define VQAERR_EOF -1 /* Valid end of file */
#define VQAERR_OPEN -2 /* Unable to open */
#define VQAERR_READ -3 /* Read error */
#define VQAERR_WRITE -4 /* Write error */
#define VQAERR_SEEK -5 /* Seek error */
#define VQAERR_NOTVQA -6 /* Not a valid VQA file. */
#define VQAERR_NOMEM -7 /* Unable to allocate memory */
#define VQAERR_NOBUFFER -8 /* No buffer avail for load/draw */
#define VQAERR_NOT_TIME -9 /* Not time for frame yet */
#define VQAERR_SLEEPING -10 /* Function is in a sleep state */
#define VQAERR_VIDEO -11 /* Video related error. */
#define VQAERR_AUDIO -12 /* Audio related error. */
#define VQAERR_PAUSED -13 /* In paused state. */
/* Event flags. */
#define VQAEVENT_PALETTE (1<<0)
#define VQAEVENT_SYNC (1<<1)
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* VQAConfig: Player configuration structure
*
* DrawerCallback - User routine for Drawer to call each frame (NULL = none)
* EventHandler - User routine for notification to client of events.
* NotifyFlags - User specified events to be notified about.
* Vmode - Requested Video mode (May be promoted).
* VBIBit - Vertical blank bit polarity.
* ImageBuf - Pointer to caller's buffer for the Drawer to use as its
* ImageBuf; NULL = player will allocate its own, if
* VQACFGF_BUFFER is set in DrawFlags.
* ImageWidth - Width of Image buffer.
* ImageHeight - Height of Image buffer.
* X1 - Draw window X coordinate (-1 = Center).
* Y1 - Draw window Y coordinate (-1 = Center).
* FrameRate - Desired frames per second (-1 = use VQA header's value).
* DrawRate - Desired drawing frame rate; allows the Drawer to draw at
* a separate rate from the Loader.
* TimerMethod - Timer method to use during playback.
* DrawFlags - Bits control various special drawing options. (See below)
* OptionFlags - Bits control various special misc options. (See below)
* NumFrameBufs - Desired number of frame buffers. (Default = 6)
* NumCBBufs - Desired number of codebook buffers. (Default = 3)
* SoundObject - Ptr to callers Direct Sound Object (Default =NULL)
* PrimaryBufferPtr- Ptr to callers Primary Sound Buffer. (Default = NULL)
* VocFile - Name of VOC file to play instead of VQA audio track.
* AudioBuf - Pointer to audio buffer.
* AudioBufSize - Size of audio buffer. (Default = 32768)
* AudioRate - Audio data playback rate (-1 = use samplerate scaled
* to the frame rate)
* Volume - Audio playback volume. (0x7FFF = max)
* HMIBufSize - Desired HMI buffer size. (Default = 2000)
* DigiHandle - Handle to an initialized sound driver. (-1 = none)
* DigiCard - HMI ID of card to use. (0 = none, -1 = auto-detect)
* DigiPort - Audio port address. (-1 = auto-detect)
* DigiIRQ - Audio IRQ. (-1 = auto-detect)
* DigiDMA - Audio DMA channel. (-1 = auto-detect)
* Language - Language identifier. (Not used)
* CapFont - Pointer to font to use for subtitle text captions.
* EVAFont - Pointer to font to use for E.V.A text cations. (For C&C)
*/
typedef struct _VQAConfig {
long (*DrawerCallback)(unsigned char *screen, long framenum);
long (*EventHandler)(unsigned long event,void *buffer,long nbytes);
unsigned long NotifyFlags;
long Vmode;
long VBIBit;
unsigned char *ImageBuf;
long ImageWidth;
long ImageHeight;
long X1,Y1;
long FrameRate;
long DrawRate;
long TimerMethod;
long DrawFlags;
long OptionFlags;
long NumFrameBufs;
long NumCBBufs;
#if (VQADIRECT_SOUND)
LPDIRECTSOUND SoundObject;
LPDIRECTSOUNDBUFFER PrimaryBufferPtr;
#endif //(VQADIRECT_SOUND)
char *VocFile;
unsigned char *AudioBuf;
long AudioBufSize;
long AudioRate;
long Volume;
long HMIBufSize;
long DigiHandle;
long DigiCard;
long DigiPort;
long DigiIRQ;
long DigiDMA;
long Language;
char *CapFont;
char *EVAFont; /* For C&C Only */
} VQAConfig;
/* Drawer Configuration flags (DrawFlags) */
#define VQACFGB_BUFFER 0 /* Buffer UnVQ enable */
#define VQACFGB_NODRAW 1 /* Drawing disable */
#define VQACFGB_NOSKIP 2 /* Disable frame skipping. */
#define VQACFGB_VRAMCB 3 /* XMode VRAM copy enable */
#define VQACFGB_ORIGIN 4 /* 0,0 origin position */
#define VQACFGB_SCALEX2 6 /* Scale X2 enable (VESA 320x200 to 640x400) */
#define VQACFGB_WOOFER 7
#define VQACFGF_BUFFER (1<<VQACFGB_BUFFER)
#define VQACFGF_NODRAW (1<<VQACFGB_NODRAW)
#define VQACFGF_NOSKIP (1<<VQACFGB_NOSKIP)
#define VQACFGF_VRAMCB (1<<VQACFGB_VRAMCB)
#define VQACFGF_ORIGIN (3<<VQACFGB_ORIGIN)
#define VQACFGF_TOPLEFT (0<<VQACFGB_ORIGIN)
#define VQACFGF_TOPRIGHT (1<<VQACFGB_ORIGIN)
#define VQACFGF_BOTRIGHT (2<<VQACFGB_ORIGIN)
#define VQACFGF_BOTLEFT (3<<VQACFGB_ORIGIN)
#define VQACFGF_SCALEX2 (1<<VQACFGB_SCALEX2)
#define VQACFGF_WOOFER (1<<VQACFGB_WOOFER)
/* Options Configuration (OptionFlags) */
#define VQAOPTB_AUDIO 0 /* Audio enable. */
#define VQAOPTB_STEP 1 /* Single step enable. */
#define VQAOPTB_MONO 2 /* Mono output enable. */
#define VQAOPTB_PALOFF 3 /* Palette set disable. */
#define VQAOPTB_SLOWPAL 4 /* Slow palette enable. */
#define VQAOPTB_HMIINIT 5 /* HMI already initialized by client. */
#define VQAOPTB_ALTAUDIO 6 /* Use alternate audio track. */
#define VQAOPTB_CAPTIONS 7 /* Show captions. */
#define VQAOPTB_EVA 8 /* Show EVA text (For C&C only) */
#define VQAOPTF_AUDIO (1<<VQAOPTB_AUDIO)
#define VQAOPTF_STEP (1<<VQAOPTB_STEP)
#define VQAOPTF_MONO (1<<VQAOPTB_MONO)
#define VQAOPTF_PALOFF (1<<VQAOPTB_PALOFF)
#define VQAOPTF_SLOWPAL (1<<VQAOPTB_SLOWPAL)
#define VQAOPTF_HMIINIT (1<<VQAOPTB_HMIINIT)
#define VQAOPTF_ALTAUDIO (1<<VQAOPTB_ALTAUDIO)
#define VQAOPTF_CAPTIONS (1<<VQAOPTB_CAPTIONS)
#define VQAOPTF_EVA (1<<VQAOPTB_EVA) /* For C&C only */
/* VQAInfo: Information about the VQA movie.
*
* NumFrames - The number of frames contained in the movie.
* ImageHeight - Height of image in pixels.
* ImageWidth - Width of image in pixels.
* ImageBuf - Pointer to the image buffer VQA draw into.
*/
typedef struct _VQAInfo {
long NumFrames;
long ImageWidth;
long ImageHeight;
unsigned char *ImageBuf;
} VQAInfo;
/* VQAStatistics: Statistics about the VQA movie played.
*
* StartTime - Time movie started.
* EndTime - Time movie stoped.
* FramesLoaded - Total number of frames loaded.
* FramesDrawn - Total number of frames drawn.
* FramesSkipped - Total number of frames skipped.
* MaxFrameSize - Size of largest frame.
* SamplesPlayed - Number of sample bytes played.
* MemUsed - Total bytes used. (Low memory)
*/
typedef struct _VQAStatistics {
long StartTime;
long EndTime;
long FramesLoaded;
long FramesDrawn;
long FramesSkipped;
long MaxFrameSize;
unsigned long SamplesPlayed;
unsigned long MemUsed;
} VQAStatistics;
/* VQAHandle: VQA file handle. (Must be obtained by calling VQA_Alloc()
* and freed through VQA_Free(). This is the only legal way
* to obtain and dispose of a VQAHandle.
*
* VQAio - Something meaningful to the IO manager. (See DOCS)
*/
typedef struct _VQAHandle {
unsigned long VQAio;
} VQAHandle;
/* Possible IO command values */
#define VQACMD_INIT 1 /* Prepare the IO for a session */
#define VQACMD_CLEANUP 2 /* Terminate IO session */
#define VQACMD_OPEN 3 /* Open file */
#define VQACMD_CLOSE 4 /* Close file */
#define VQACMD_READ 5 /* Read bytes */
#define VQACMD_WRITE 6 /* Write bytes */
#define VQACMD_SEEK 7 /* Seek */
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
/* Configuration routines. */
void VQA_INIConfig(VQAConfig *config);
void VQA_DefaultConfig(VQAConfig *config);
/* Handle manipulation routines. */
VQAHandle *VQA_Alloc(void);
void VQA_Free(VQAHandle *vqa);
void VQA_Reset(VQAHandle *vqa);
void VQA_InitAsDOS(VQAHandle *vqa);
void VQA_Init(VQAHandle *vqa, long(*iohandler)(VQAHandle *vqa, long action,
void *buffer, long nbytes));
unsigned char *VQA_GetPalette(VQAHandle *vqa);
long VQA_GetPaletteSize(VQAHandle *vqa);
void VQA_Set_DrawBuffer(VQAHandle *vqa, unsigned char *buffer,
unsigned long width, unsigned long height,
long xpos, long ypos);
/* File routines. */
long VQA_Open(VQAHandle *vqa, char const *filename, VQAConfig *config);
void VQA_Close(VQAHandle *vqa);
long VQA_Play(VQAHandle *vqa, long mode);
long VQA_SeekFrame(VQAHandle *vqa, long frame, long fromwhere);
long VQA_SetStop(VQAHandle *vqa, long stop);
/* Information/statistics access routines. */
void VQA_GetInfo(VQAHandle *vqa, VQAInfo *info);
void VQA_GetStats(VQAHandle *vqa, VQAStatistics *stats);
char *VQA_Version(void);
char *VQA_IDString(void);
#endif /* VQAPLAY_H */

View File

@@ -0,0 +1,353 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAPLAY_H
#define VQAPLAY_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vqaplay.h
*
* DESCRIPTION
* VQAPlay library definitions.
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
****************************************************************************/
/*---------------------------------------------------------------------------
* CONDITIONAL COMPILATION FLAGS
*-------------------------------------------------------------------------*/
// MEG - 11.28.95 - added for debug
extern void Debug_Printf( char *format_string, ... );
#ifdef __WATCOMC__
#define VQASTANDALONE 0 /* Stand alone player */
#define VQAVOC_ON 0 /* Enable VOC file override */
#define VQAMONO_ON 0 /* Mono display output enable/disable */
#define VQADIRECT_SOUND 1 /* Use windows direct sound system */
#define VQAAUDIO_ON 1 /* Audio playback enable/disable */
#define VQAVIDEO_ON 0 /* Video manager enable/disable */
#define VQAMCGA_ON 1 /* MCGA enable/disable */
#define VQAXMODE_ON 0 /* Xmode enable/disable */
#define VQAVESA_ON 0 /* VESA enable/disable */
#define VQABLOCK_2X2 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_2X3 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
#define VQABLOCK_4X4 0 /* 4x4 block decode enable/disable */
#define VQAWOOFER_ON 0
#else
#define VQASTANDALONE 0 /* Stand alone player */
#define VQAVOC_ON 0 /* Enable VOC file override */
#define VQAMONO_ON 1 /* Mono display output enable/disable */
#define VQADIRECT_SOUND 1 /* Use windows direct sound system */
#define VQAAUDIO_ON 1 /* Audio playback enable/disable */
#define VQAVIDEO_ON 0 /* Video manager enable/disable */
#define VQAMCGA_ON 1 /* MCGA enable/disable */
#define VQAXMODE_ON 0 /* Xmode enable/disable */
#define VQAVESA_ON 0 /* VESA enable/disable */
#define VQABLOCK_2X2 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_2X3 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
#define VQABLOCK_4X4 0 /* 4x4 block decode enable/disable */
#define VQAWOOFER_ON 0
#endif
#if (VQAAUDIO_ON && VQADIRECT_SOUND)
#ifndef WIN32 1
#define WIN32
#define _WIN32
#endif
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include "dsound.h"
#endif
/*---------------------------------------------------------------------------
* GENERAL CONSTANT DEFINITIONS
*-------------------------------------------------------------------------*/
/* Playback modes. */
#define VQAMODE_RUN 0 /* Run the movie through the end. */
#define VQAMODE_WALK 1 /* Draw the next frame then return. */
#define VQAMODE_PAUSE 2 /* Suspend movie playback. */
#define VQAMODE_STOP 3 /* Stop the movie. */
/* Playback timer methods */
#define VQA_TMETHOD_DEFAULT -1 /* Use default timer method. */
#define VQA_TMETHOD_DOS 1 /* DOS timer method */
#define VQA_TMETHOD_INT 2 /* Interrupt timer method */
#define VQA_TMETHOD_AUDIO 3 /* Audio timer method */
#define VQA_TIMETICKS 60 /* Clock ticks per second */
/* Error/Status conditions */
#define VQAERR_NONE 0 /* No error */
#define VQAERR_EOF -1 /* Valid end of file */
#define VQAERR_OPEN -2 /* Unable to open */
#define VQAERR_READ -3 /* Read error */
#define VQAERR_WRITE -4 /* Write error */
#define VQAERR_SEEK -5 /* Seek error */
#define VQAERR_NOTVQA -6 /* Not a valid VQA file. */
#define VQAERR_NOMEM -7 /* Unable to allocate memory */
#define VQAERR_NOBUFFER -8 /* No buffer avail for load/draw */
#define VQAERR_NOT_TIME -9 /* Not time for frame yet */
#define VQAERR_SLEEPING -10 /* Function is in a sleep state */
#define VQAERR_VIDEO -11 /* Video related error. */
#define VQAERR_AUDIO -12 /* Audio related error. */
#define VQAERR_PAUSED -13 /* In paused state. */
/* Event flags. */
#define VQAEVENT_PALETTE (1<<0)
#define VQAEVENT_SYNC (1<<1)
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* VQAConfig: Player configuration structure
*
* DrawerCallback - User routine for Drawer to call each frame (NULL = none)
* EventHandler - User routine for notification to client of events.
* NotifyFlags - User specified events to be notified about.
* Vmode - Requested Video mode (May be promoted).
* VBIBit - Vertical blank bit polarity.
* ImageBuf - Pointer to caller's buffer for the Drawer to use as its
* ImageBuf; NULL = player will allocate its own, if
* VQACFGF_BUFFER is set in DrawFlags.
* ImageWidth - Width of Image buffer.
* ImageHeight - Height of Image buffer.
* X1 - Draw window X coordinate (-1 = Center).
* Y1 - Draw window Y coordinate (-1 = Center).
* FrameRate - Desired frames per second (-1 = use VQA header's value).
* DrawRate - Desired drawing frame rate; allows the Drawer to draw at
* a separate rate from the Loader.
* TimerMethod - Timer method to use during playback.
* DrawFlags - Bits control various special drawing options. (See below)
* OptionFlags - Bits control various special misc options. (See below)
* NumFrameBufs - Desired number of frame buffers. (Default = 6)
* NumCBBufs - Desired number of codebook buffers. (Default = 3)
* SoundObject - Ptr to callers Direct Sound Object (Default =NULL)
* PrimaryBufferPtr- Ptr to callers Primary Sound Buffer. (Default = NULL)
* VocFile - Name of VOC file to play instead of VQA audio track.
* AudioBuf - Pointer to audio buffer.
* AudioBufSize - Size of audio buffer. (Default = 32768)
* AudioRate - Audio data playback rate (-1 = use samplerate scaled
* to the frame rate)
* Volume - Audio playback volume. (0x7FFF = max)
* HMIBufSize - Desired HMI buffer size. (Default = 2000)
* DigiHandle - Handle to an initialized sound driver. (-1 = none)
* DigiCard - HMI ID of card to use. (0 = none, -1 = auto-detect)
* DigiPort - Audio port address. (-1 = auto-detect)
* DigiIRQ - Audio IRQ. (-1 = auto-detect)
* DigiDMA - Audio DMA channel. (-1 = auto-detect)
* Language - Language identifier. (Not used)
* CapFont - Pointer to font to use for subtitle text captions.
* EVAFont - Pointer to font to use for E.V.A text cations. (For C&C)
*/
typedef struct _VQAConfig {
long (*DrawerCallback)(unsigned char *screen, long framenum);
long (*EventHandler)(unsigned long event,void *buffer,long nbytes);
unsigned long NotifyFlags;
long Vmode;
long VBIBit;
unsigned char *ImageBuf;
long ImageWidth;
long ImageHeight;
long X1,Y1;
long FrameRate;
long DrawRate;
long TimerMethod;
long DrawFlags;
long OptionFlags;
long NumFrameBufs;
long NumCBBufs;
#if (VQADIRECT_SOUND)
LPDIRECTSOUND SoundObject;
LPDIRECTSOUNDBUFFER PrimaryBufferPtr;
#endif //(VQADIRECT_SOUND)
char *VocFile;
unsigned char *AudioBuf;
long AudioBufSize;
long AudioRate;
long Volume;
long HMIBufSize;
long DigiHandle;
long DigiCard;
long DigiPort;
long DigiIRQ;
long DigiDMA;
long Language;
char *CapFont;
char *EVAFont; /* For C&C Only */
} VQAConfig;
/* Drawer Configuration flags (DrawFlags) */
#define VQACFGB_BUFFER 0 /* Buffer UnVQ enable */
#define VQACFGB_NODRAW 1 /* Drawing disable */
#define VQACFGB_NOSKIP 2 /* Disable frame skipping. */
#define VQACFGB_VRAMCB 3 /* XMode VRAM copy enable */
#define VQACFGB_ORIGIN 4 /* 0,0 origin position */
#define VQACFGB_SCALEX2 6 /* Scale X2 enable (VESA 320x200 to 640x400) */
#define VQACFGB_WOOFER 7
#define VQACFGF_BUFFER (1<<VQACFGB_BUFFER)
#define VQACFGF_NODRAW (1<<VQACFGB_NODRAW)
#define VQACFGF_NOSKIP (1<<VQACFGB_NOSKIP)
#define VQACFGF_VRAMCB (1<<VQACFGB_VRAMCB)
#define VQACFGF_ORIGIN (3<<VQACFGB_ORIGIN)
#define VQACFGF_TOPLEFT (0<<VQACFGB_ORIGIN)
#define VQACFGF_TOPRIGHT (1<<VQACFGB_ORIGIN)
#define VQACFGF_BOTRIGHT (2<<VQACFGB_ORIGIN)
#define VQACFGF_BOTLEFT (3<<VQACFGB_ORIGIN)
#define VQACFGF_SCALEX2 (1<<VQACFGB_SCALEX2)
#define VQACFGF_WOOFER (1<<VQACFGB_WOOFER)
/* Options Configuration (OptionFlags) */
#define VQAOPTB_AUDIO 0 /* Audio enable. */
#define VQAOPTB_STEP 1 /* Single step enable. */
#define VQAOPTB_MONO 2 /* Mono output enable. */
#define VQAOPTB_PALOFF 3 /* Palette set disable. */
#define VQAOPTB_SLOWPAL 4 /* Slow palette enable. */
#define VQAOPTB_HMIINIT 5 /* HMI already initialized by client. */
#define VQAOPTB_ALTAUDIO 6 /* Use alternate audio track. */
#define VQAOPTB_CAPTIONS 7 /* Show captions. */
#define VQAOPTB_EVA 8 /* Show EVA text (For C&C only) */
#define VQAOPTF_AUDIO (1<<VQAOPTB_AUDIO)
#define VQAOPTF_STEP (1<<VQAOPTB_STEP)
#define VQAOPTF_MONO (1<<VQAOPTB_MONO)
#define VQAOPTF_PALOFF (1<<VQAOPTB_PALOFF)
#define VQAOPTF_SLOWPAL (1<<VQAOPTB_SLOWPAL)
#define VQAOPTF_HMIINIT (1<<VQAOPTB_HMIINIT)
#define VQAOPTF_ALTAUDIO (1<<VQAOPTB_ALTAUDIO)
#define VQAOPTF_CAPTIONS (1<<VQAOPTB_CAPTIONS)
#define VQAOPTF_EVA (1<<VQAOPTB_EVA) /* For C&C only */
/* VQAInfo: Information about the VQA movie.
*
* NumFrames - The number of frames contained in the movie.
* ImageHeight - Height of image in pixels.
* ImageWidth - Width of image in pixels.
* ImageBuf - Pointer to the image buffer VQA draw into.
*/
typedef struct _VQAInfo {
long NumFrames;
long ImageWidth;
long ImageHeight;
unsigned char *ImageBuf;
} VQAInfo;
/* VQAStatistics: Statistics about the VQA movie played.
*
* StartTime - Time movie started.
* EndTime - Time movie stoped.
* FramesLoaded - Total number of frames loaded.
* FramesDrawn - Total number of frames drawn.
* FramesSkipped - Total number of frames skipped.
* MaxFrameSize - Size of largest frame.
* SamplesPlayed - Number of sample bytes played.
* MemUsed - Total bytes used. (Low memory)
*/
typedef struct _VQAStatistics {
long StartTime;
long EndTime;
long FramesLoaded;
long FramesDrawn;
long FramesSkipped;
long MaxFrameSize;
unsigned long SamplesPlayed;
unsigned long MemUsed;
} VQAStatistics;
/* VQAHandle: VQA file handle. (Must be obtained by calling VQA_Alloc()
* and freed through VQA_Free(). This is the only legal way
* to obtain and dispose of a VQAHandle.
*
* VQAio - Something meaningful to the IO manager. (See DOCS)
*/
typedef struct _VQAHandle {
unsigned long VQAio;
} VQAHandle;
/* Possible IO command values */
#define VQACMD_INIT 1 /* Prepare the IO for a session */
#define VQACMD_CLEANUP 2 /* Terminate IO session */
#define VQACMD_OPEN 3 /* Open file */
#define VQACMD_CLOSE 4 /* Close file */
#define VQACMD_READ 5 /* Read bytes */
#define VQACMD_WRITE 6 /* Write bytes */
#define VQACMD_SEEK 7 /* Seek */
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
/* Configuration routines. */
void VQA_INIConfig(VQAConfig *config);
void VQA_DefaultConfig(VQAConfig *config);
/* Handle manipulation routines. */
VQAHandle *VQA_Alloc(void);
void VQA_Free(VQAHandle *vqa);
void VQA_Reset(VQAHandle *vqa);
void VQA_InitAsDOS(VQAHandle *vqa);
void VQA_Init(VQAHandle *vqa, long(*iohandler)(VQAHandle *vqa, long action,
void *buffer, long nbytes));
unsigned char *VQA_GetPalette(VQAHandle *vqa);
long VQA_GetPaletteSize(VQAHandle *vqa);
void VQA_Set_DrawBuffer(VQAHandle *vqa, unsigned char *buffer,
unsigned long width, unsigned long height,
long xpos, long ypos);
/* File routines. */
long VQA_Open(VQAHandle *vqa, char const *filename, VQAConfig *config);
void VQA_Close(VQAHandle *vqa);
long VQA_Play(VQAHandle *vqa, long mode);
long VQA_SeekFrame(VQAHandle *vqa, long frame, long fromwhere);
long VQA_SetStop(VQAHandle *vqa, long stop);
/* Information/statistics access routines. */
void VQA_GetInfo(VQAHandle *vqa, VQAInfo *info);
void VQA_GetStats(VQAHandle *vqa, VQAStatistics *stats);
char *VQA_Version(void);
char *VQA_IDString(void);
#endif /* VQAPLAY_H */

View File

@@ -0,0 +1,540 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAPLAYP_H
#define VQAPLAYP_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vqaplayp.h
*
* DESCRIPTION
* VQAPlay private library definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
* Bill Randolph
*
* DATE
* August 21, 1995
*
****************************************************************************/
#include <vqm32\video.h>
#include <vqm32\soscomp.h>
#include <vqm32\captoken.h>
#include "vqafile.h"
#include "vqaplay.h"
#include "caption.h"
#if(VQAAUDIO_ON)
#if(VQADIRECT_SOUND)
extern HWND MainWindow;
#else
#include "sos.h"
#endif
#endif
/*---------------------------------------------------------------------------
* GENERAL CONSTANT DEFINITIONS
*-------------------------------------------------------------------------*/
/* Internal library version. */
#define VQA_VERSION "2.42"
#define VQA_DATE __DATE__" "__TIME__
#define VQA_IDSTRING "VQA32 "VQA_VERSION" ("VQA_DATE")"
#define VQA_REQUIRES "VQM32 2.12 or better."
/* Block dimensions macro and identifiers. */
#define BLOCK_DIM(a,b) (((a&0xFF)<<8)|(b&0xFF))
#define BLOCK_2X2 BLOCK_DIM(2,2)
#define BLOCK_2X3 BLOCK_DIM(2,3)
#define BLOCK_4X2 BLOCK_DIM(4,2)
#define BLOCK_4X4 BLOCK_DIM(4,4)
/* Memory limits */
#define VQA_MAX_CBBUFS 10 /* Maximum number of codebook buffers */
#define VQA_MAX_FRAMEBUFS 30 /* Maximum number of frame buffers */
/* Special Constants */
#define VQA_MASK_POINTER 0x8000 /* Pointer value to use for masking. */
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* ChunkHeader: IFF chunk identifier header.
*
* id - 4 Byte chunk id.
* size - Size of chunk.
*/
typedef struct _ChunkHeader {
unsigned long id;
unsigned long size;
} ChunkHeader;
/* ZAPHeader: ZAP audio compression header. NOTE: If the uncompressed size
* and the compressed size are equal then the audio frame is RAW
* (NOT COMPRESSED).
*
* UnCompSize - Uncompressed size in bytes.
* CompSize - Compressed size in bytes.
*/
typedef struct _ZAPHeader {
unsigned short UnCompSize;
unsigned short CompSize;
} ZAPHeader;
/* VQACBNode: A circular list of codebook buffers, used by the load task.
* If the data is compressed, it is loaded into the end of the
* buffer and the compression flags is set. Otherwise the data
* is loaded into the start of the buffer.
* (Make sure this structure's size is always DWORD aligned.)
*
* Buffer - Pointer to Codebook data.
* Next - Pointer to next VQACBNode in the codebook list.
* Flags - Used by the drawer to tell if certain operations have been
* performed on this codebook, such as downloading to VRAM,
* or pre-scaling it. This field is cleared by the Loader when a
* new codebook is loaded.
* CBOffset - Offset into the buffer of the compressed data.
*/
typedef struct _VQACBNode {
unsigned char *Buffer;
struct _VQACBNode *Next;
unsigned long Flags;
unsigned long CBOffset;
} VQACBNode;
/* VQACBNode flags */
#define VQACBB_DOWNLOADED 0 /* Download codebook to VRAM (XMODE VRAM) */
#define VQACBB_CBCOMP 1 /* Codebook is compressed */
#define VQACBF_DOWNLOADED (1<<VQACBB_DOWNLOADED)
#define VQACBF_CBCOMP (1<<VQACBB_CBCOMP)
/* VQAFrameNode: A circular list of frame buffers, filled in by the load
* task. If the data is compressed, it is loaded into the end
* of the buffer and the compress flag is set. Otherwise, it's
* loaded into the start of the buffer.
* (Make sure this structure's size is always DWORD aligned.)
*
* Pointers - Pointer to the vector pointer data.
* Codebook - Pointer to VQACBNode list entry for this frame.
* Palette - Pointer to an array of palette colors (R,G,B).
* Next - Pointer to the next entry in the Frame Buffer List.
* Flags - Inter-process communication flags for this frame (see below)
* set by Loader, cleared by Flipper.
* FrameNum - Number of this frame in the animation.
* PtrOffset - Offset into buffer of the compressed vector pointer data.
* PalOffset - Offset into buffer of the compressed palette data.
* PaletteSize - Size of the palette for this frame (in bytes).
*/
typedef struct _VQAFrameNode {
unsigned char *Pointers;
VQACBNode *Codebook;
unsigned char *Palette;
struct _VQAFrameNode *Next;
unsigned long Flags;
long FrameNum;
long PtrOffset;
long PalOffset;
long PaletteSize;
} VQAFrameNode;
/* FrameNode flags */
#define VQAFRMB_LOADED 0 /* Frame loaded */
#define VQAFRMB_KEY 1 /* Key Frame (must be drawn) */
#define VQAFRMB_PALETTE 2 /* Palette needs set */
#define VQAFRMB_PALCOMP 3 /* Palette is compressed */
#define VQAFRMB_PTRCOMP 4 /* Vector pointer data is compressed */
#define VQAFRMF_LOADED (1<<VQAFRMB_LOADED)
#define VQAFRMF_KEY (1<<VQAFRMB_KEY)
#define VQAFRMF_PALETTE (1<<VQAFRMB_PALETTE)
#define VQAFRMF_PALCOMP (1<<VQAFRMB_PALCOMP)
#define VQAFRMF_PTRCOMP (1<<VQAFRMB_PTRCOMP)
/* VQALoader: Data needed exclusively by the Loader.
* (Make sure this structure's size is always DWORD aligned.)
*
* CurCB - Pointer to the current codebook node to load data into.
* FullCB - Pointer to the last fully-loaded codebook node.
* CurFrame - Pointer to the current frame node to load data into.
* NumPartialCB - Number of partial codebooks accumulated.
* PartialCBSize - Size of partial codebook (LCW'd or not), in bytes
* CurFrameNum - The number of the frame being loaded by the Loader.
* LastCBFrame - Last frame in the animation that contains a partial CB
* LastFrameNum - Number of the last loaded frame
* WaitsOnDrawer - Number of wait states Loader hits waiting on the Drawer
* WaitsOnAudio - Number of wait states Loader hits waiting on HMI
* FrameSize - Size of the last frame in bytes.
* MaxFrameSize - Size of the largest frame in the animation.
* CurChunkHdr - Chunk header of the chunk currently being processed.
*/
typedef struct _VQALoader {
VQACBNode *CurCB;
VQACBNode *FullCB;
VQAFrameNode *CurFrame;
long NumPartialCB;
long PartialCBSize;
long CurFrameNum;
long LastCBFrame;
long LastFrameNum;
long WaitsOnDrawer;
long WaitsOnAudio;
long FrameSize;
long MaxFrameSize;
ChunkHeader CurChunkHdr;
} VQALoader;
/* VQADrawer: Data needed exclusively by the Drawer.
* (Make sure this structure's size is always DWORD aligned.)
*
* CurFrame - Pointer to the current frame to draw.
* Flags - Flags for the draw routines (IE: VQADRWF_SETPAL)
* Display - Pointer to DisplayInfo structure for active video mode.
* ImageBuf - Buffer to un-vq into, must be DWORD aligned.
* ImageWidth - Width of Image buffer (in pixels).
* ImageHeight - Height of Image buffer (in pixels).
* X1,Y1,X2,Y2 - Coordinates of image corners (in pixels).
* ScreenOffset - Offset into screen memory, for centering small images.
* CurPalSize - Size of the current palette in bytes.
* Palette_24 - Copy of the last-loaded palette
* Palette_15 - 15-bit version of Palette_24, for 32K-color modes
* BlocksPerRow - # of VQ blocks per row for this resolution/block width.
* NumRows - # of rows of VQ blocks for this resolution/block height.
* NumBlocks - Total number of blocks in the image.
* MaskStart - Pointer index of start of mask rectangle.
* MaskWidth - Width of mask rectangle, in blocks.
* MaskHeight - Height of mask rectangle, in blocks.
* LastTime - The time when that last frame was drawn.
* LastFrame - The number of the last frame selected.
* LastFrameNum - Number of the last frame drawn.
* DesiredFrame - The number of the frame that should be drawn.
* NumSkipped - Number of frames skipped.
* WaitsOnFlipper - Number of wait states Drawer hits waiting on the Flipper.
* WaitsOnLoader - Number of wait states Drawer hits waiting on the Loader.
*/
typedef struct _VQADrawer {
VQAFrameNode *CurFrame;
unsigned long Flags;
DisplayInfo *Display;
unsigned char *ImageBuf;
long ImageWidth;
long ImageHeight;
long X1,Y1,X2,Y2;
long ScreenOffset;
long CurPalSize;
unsigned char Palette_24[768];
unsigned char Palette_15[512];
long BlocksPerRow;
long NumRows;
long NumBlocks;
long MaskStart;
long MaskWidth;
long MaskHeight;
long LastTime;
long LastFrame;
long LastFrameNum;
long DesiredFrame;
long NumSkipped;
long WaitsOnFlipper;
long WaitsOnLoader;
} VQADrawer;
/* Drawer flags */
#define VQADRWB_SETPAL 0 /* Set palette */
#define VQADRWF_SETPAL (1<<VQADRWB_SETPAL)
/* VQAFlipper: Data needed exclusively by the page-flipper.
* (Make sure this structure's size is always DWORD aligned.)
*
* CurFrame - Pointer to current flipper frame.
* LastFrameNum - Number of last flipped frame
* pad - DWORD alignment padding.
*/
typedef struct _VQAFlipper {
VQAFrameNode *CurFrame;
long LastFrameNum;
} VQAFlipper;
#if(VQAAUDIO_ON)
#ifdef __WATCOMC__
#pragma pack(4);
#endif
/* VQAAudio: Data needed exclusively by audio playback.
* (Make sure this structure's size is always DWORD aligned.)
*
* Buffer - Pointer to the audio buffer.
* AudBufPos - Current audio buffer position, for copying data in buffer.
* IsLoaded - Inter-process communication flag:
* 0 = is loadable, 1 = is not. Loader sets it when it
* loads, audio callback clears it when it plays one.
* NumAudBlocks - Number of HMI blocks in the audio buffer.
* CurBlock - Current audio block
* NextBlock - Next audio block
* TempBuf - Pointer to temp buffer for loading/decompressing audio
* data.
* TempBufLen - Number of bytes loaded into temp buffer.
* TempBufSize - Size of temp buffer in bytes.
* Flags - Various audio flags. (See below)
* PlayPosition - HMI's current buffer position.
* SamplesPlayed - Total samples played.
* NumSkipped - Count of buffers missed.
* SampleRate - Recorded sampling rate of the track.
* Channels - Number of channels in the track.
* BitsPerSample - Bit resolution size of sample (8,16)
* BytesPerSec - Recorded data transfer for one second.
* ADPCM_Info - ADPCM decompression information structure.
* DigiHandle - HMI digital device handle.
* SampleHandle - HMI sample handle.
* DigiTimer - HMI digital fill handler timer handle.
* sSOSSampleData - HMI sample structure.
* DigiCaps - HMI sound card digital capabilities.
* DigiHardware - HMI sound card digital hardware settings.
* sSOSInitDriver - HMI driver initialization structure.
* TimerHandle - Handle to Windows multi-media timer
* SoundTimerHandle- Handle to extra Windows mm timer req. for direct sound
* SecondaryBufferPtr - Pointer to out direct sound secondary buffer
* DSBuffFormat - WAVEFORMATEX structure for direct sound
* BufferDesc - Description structure for setting up direct sound buffers
* SecondaryBufferSize - length in bytes of our secondary sound buffer
* EndLastAudioChunk - Offset into secondary buffer of the end of the last chunk of audio copied in
* ChunksMovedToAudioBuffer - Total number of HMIBufSize chunks moved into the secondary buffer
* LastChunkPosition - Offset position of last chunk copied to secondary buffer
* CreatedSoundObject - True if we had to create our own direct sound object
* CreatedSoundBuffer - True if we had to create out own direct sound primary buffer
*/
typedef struct _VQAAudio {
unsigned char *Buffer;
unsigned long AudBufPos;
short *IsLoaded;
unsigned long NumAudBlocks;
unsigned long CurBlock;
unsigned long NextBlock;
unsigned char *TempBuf;
unsigned long TempBufLen;
unsigned long TempBufSize;
unsigned long Flags;
unsigned long PlayPosition;
unsigned long SamplesPlayed;
unsigned long NumSkipped;
unsigned short SampleRate;
unsigned char Channels;
unsigned char BitsPerSample;
unsigned long BytesPerSec;
_SOS_COMPRESS_INFO ADPCM_Info;
#if (!VQADIRECT_SOUND)
WORD DigiHandle;
WORD SampleHandle;
WORD DigiTimer;
_SOS_START_SAMPLE sSOSSampleData;
_SOS_CAPABILITIES DigiCaps;
_SOS_HARDWARE DigiHardware;
_SOS_INIT_DRIVER sSOSInitDriver;
#else
unsigned TimerHandle;
unsigned SoundTimerHandle;
LPDIRECTSOUNDBUFFER SecondaryBufferPtr;
WAVEFORMATEX DsBuffFormat;
DSBUFFERDESC BufferDesc;
unsigned SecondaryBufferSize;
unsigned EndLastAudioChunk;
unsigned ChunksMovedToAudioBuffer;
unsigned LastChunkPosition;
BOOL CreatedSoundObject;
BOOL CreatedSoundBuffer;
#endif
} VQAAudio;
/* Audio flags. */
#define VQAAUDB_DIGIINIT 0 /* HMI digital driver initialized (2 bits) */
#define VQAAUDB_TIMERINIT 2 /* HMI timer system initialized (2 bits) */
#define VQAAUDB_HMITIMER 4 /* HMI timer callback initialized (2 bits) */
#define VQAAUDB_ISPLAYING 6 /* Audio playing flag. */
#define VQAAUDB_MEMLOCKED 30 /* Audio memory page locked. */
#define VQAAUDB_MODLOCKED 31 /* Audio module page locked. */
#define VQAAUDF_DIGIINIT (3<<VQAAUDB_DIGIINIT)
#define VQAAUDF_TIMERINIT (3<<VQAAUDB_TIMERINIT)
#define VQAAUDF_HMITIMER (3<<VQAAUDB_HMITIMER)
#define VQAAUDF_ISPLAYING (1<<VQAAUDB_ISPLAYING)
#define VQAAUDF_MEMLOCKED (1<<VQAAUDB_MEMLOCKED)
#define VQAAUDF_MODLOCKED (1<<VQAAUDB_MODLOCKED)
/* HMI device initialization conditions. (DIGIINIT, TIMERINIT, HMITIMER) */
#define HMI_UNINIT 0 /* Unitialize state. */
#define HMI_VQAINIT 1 /* VQA initialized */
#define HMI_APPINIT 2 /* Application initialized */
#ifdef __WATCOMC__
#pragma pack(1);
#endif
#endif /* VQAAUDIO_ON */
/* VQAData: This stucture contains all the data used for playing a VQA.
*
* Draw_Frame - Pointer to the draw-frame routine for this video mode.
* Page_Flip - Pointer to the page flip function for this video mode.
* UnVQ - Pointer to the UnVQ routine for this vid mode & blk size.
* FrameData - Frame buffer circular list head.
* CBData - Codebook circular list head.
* Audio - Audio buffer
* Loader - Loader's data
* Drawer - Drawer's data
* Flipper - Flipper's data
* Flags - Flags used by the player.
* Foff - Pointer to frame offset table.
* VBIBit - Vertical blank bit polarity.
* Max_CB_Size - Maximum size of an uncompressed codebook
* Max_Pal_Size - Maximum size of an uncompressed palette
* Max_Ptr_Size - Maximum size of uncompressed pointer data
* LoadedFrames - Number of frames loaded
* DrawnFrames - Number of frames drawn
* StartTime - Start time in VQA time ticks
* EndTime - Stop time in VQA time ticks
* MemUsed - Number of bytes allocated by VQA_AllocBuffers
*/
typedef struct _VQAData {
long (*Draw_Frame)(VQAHandle *vqa);
long (*Page_Flip)(VQAHandle *vqa);
#ifndef PHARLAP_TNT
void __cdecl (*UnVQ)(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
#else
void __cdecl (*UnVQ)(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
#endif
VQAFrameNode *FrameData;
VQACBNode *CBData;
#if(VQAAUDIO_ON)
VQAAudio Audio;
#endif
VQALoader Loader;
VQADrawer Drawer;
VQAFlipper Flipper;
unsigned long Flags;
long *Foff;
long VBIBit;
long Max_CB_Size;
long Max_Pal_Size;
long Max_Ptr_Size;
long LoadedFrames;
long DrawnFrames;
long StartTime;
long EndTime;
long MemUsed;
} VQAData;
/* VQAData flags */
#define VQADATB_UPDATE 0 /* Update the display. */
#define VQADATB_DSLEEP 1 /* Drawer sleep state. */
#define VQADATB_LSLEEP 2 /* Loader sleep state. */
#define VQADATB_DDONE 3 /* Drawer done flag. (0 = done) */
#define VQADATB_LDONE 4 /* Loader done flag. (0 = done) */
#define VQADATB_PRIMED 5 /* Buffers are primed. */
#define VQADATB_PAUSED 6 /* The player is paused. */
#define VQADATF_UPDATE (1<<VQADATB_UPDATE)
#define VQADATF_DSLEEP (1<<VQADATB_DSLEEP)
#define VQADATF_LSLEEP (1<<VQADATB_LSLEEP)
#define VQADATF_DDONE (1<<VQADATB_DDONE)
#define VQADATF_LDONE (1<<VQADATB_LDONE)
#define VQADATF_PRIMED (1<<VQADATB_PRIMED)
#define VQADATF_PAUSED (1<<VQADATB_PAUSED)
/* VQAHandleP: Private VQA file handle. Must be obtained by calling
* VQA_Alloc() and freed through VQA_Free(). This is the only
* legal way to obtain and dispose of a VQAHandle.
*
* VQAio - Something meaningful to the IO manager. (See DOCS)
* IOHandler - IO handler callback.
* VQABuf - Pointer to internal data buffers.
* Config - Configuration structure.
* Header - VQA header structure.
* vocfh - Override audiotrack file handle.
*/
typedef struct _VQAHandleP {
unsigned long VQAio;
long (*IOHandler)(VQAHandle *vqa, long action, void *buffer,
long nbytes);
VQAData *VQABuf;
VQAConfig Config;
VQAHeader Header;
long vocfh;
CaptionInfo *Caption;
CaptionInfo *EVA;
} VQAHandleP;
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
/* Loader/Drawer system. */
long VQA_LoadFrame(VQAHandle *vqa);
void VQA_Configure_Drawer(VQAHandleP *vqap);
long User_Update(VQAHandle *vqa);
/* Timer system. */
long VQA_StartTimerInt(VQAHandleP *vqap, long init);
void VQA_StopTimerInt(VQAHandleP *vqap);
void VQA_SetTimer(VQAHandleP *vqap, long time, long method);
unsigned long VQA_GetTime(VQAHandleP *vqap);
long VQA_TimerMethod(void);
/* Audio system. */
#if(VQAAUDIO_ON)
long VQA_OpenAudio(VQAHandleP *vqap , HWND window);
void VQA_CloseAudio(VQAHandleP *vqap);
long VQA_StartAudio(VQAHandleP *vqap);
void VQA_StopAudio(VQAHandleP *vqap);
long CopyAudio(VQAHandleP *vqap);
#endif
/* Debugging system. */
void VQA_InitMono(VQAHandleP *vqap);
void VQA_UpdateMono(VQAHandleP *vqap);
#endif /* VQAPLAYP_H */

118
WINVQ/INCLUDE/VQFILE.H Normal file
View File

@@ -0,0 +1,118 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQFILE_H
#define VQFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* VQFile.h
*
* DESCRIPTION
* VQ file format definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* September 27, 1995
*
****************************************************************************/
#include <vqm32\iff.h>
/* Disable Watcom structure alignment. */
#ifdef __WATCOMC__
#pragma pack(1);
#endif
/*---------------------------------------------------------------------------
* STRUCTURE DEFINITIONS AND RELATED INFORMATION
*-------------------------------------------------------------------------*/
/* VQHeader: VQ header.
*
* Version - VQ file version
* Flags - Various flags (see below)
* ImageWidth - Width of constructed image in pixels.
* ImageHeight - Height of contructed image in pixels.
* BlockType - Type of codebook block. (EX: rectangle)
* BlockWidth - Width of a codebook block in pixels.
* BlockHeight - Height of a codebook block in pixels.
* BlockDepth - Depth of a codebook block in bits.
* CBEntries - Number of entries in the codebook.
* VPtrType - Vector pointer type. (IE: Banked)
* PalStart - Starting entry position of palette.
* PalLength - Number of palette entries the palette.
* PalDepth - Depth of palette entries in bits.
* ColorModel - Color model of this VQ
*/
typedef struct _VQHeader {
short Version;
short Flags;
short ImageWidth;
short ImageHeight;
short BlockType;
short BlockWidth;
short BlockHeight;
short BlockDepth;
short CBEntries;
short VPtrType;
short PalStart;
short PalLengh;
short PalDepth;
short ColorModel;
} VQHeader;
/* VQ file flags */
#define VQHB_CBCOMP 0 /* Codebook compressed */
#define VQHB_CTCOMP 1 /* Color table compressed */
#define VQHB_VPCOMP 2 /* Vector pointers compressed */
#define VQHF_CBCOMP (1<<VQHB_CBCOMP)
#define VQHF_CTCOMP (1<<VQHB_CTCOMP)
#define VQHF_VPCOMP (1<<VQHB_VPCOMP)
/* Block types */
#define VQBT_RECT 0 /* Rectangle Width X Height */
/* Color models */
#define VQCM_PALETTED 0 /* Palette (8 bit indices) */
#define VQCM_RGBTRUE 1 /* RBG truecolor (24 bit) */
#define VQCM_YBRTRUE 2 /* YCbCr truecolor */
/*---------------------------------------------------------------------------
* VQ FILE CHUNK ID DEFINITIONS
*-------------------------------------------------------------------------*/
#define ID_VQHR MAKE_ID('V','Q','H','R') /* VQ Header */
#define ID_VQCB MAKE_ID('V','Q','C','B') /* VQ Codebook */
#define ID_VQCT MAKE_ID('V','Q','C','T') /* VQ Color Table (palette) */
#define ID_VQVP MAKE_ID('V','Q','V','P') /* VQ Vector pointers */
#ifdef __WATCOMC__
#pragma pack();
#endif
#endif /* VQFILE_H */

58
WINVQ/INCLUDE/VQM32/ALL.H Normal file
View File

@@ -0,0 +1,58 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMALL_H
#define VQMALL_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* all.h
*
* DESCRIPTION
* All VQMisc32 library definitions. (32-Bit protected mode)
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 5, 1995
*
****************************************************************************/
#include <vqm32\iff.h>
#include <vqm32\mono.h>
#include <vqm32\portio.h>
#include <vqm32\profile.h>
#include <vqm32\targa.h>
#include <vqm32\compress.h>
#include <vqm32\video.h>
#include <vqm32\palette.h>
#include <vqm32\vesavid.h>
#include <vqm32\vesablit.h>
#include <vqm32\graphics.h>
#include <vqm32\mixfile.h>
#include <vqm32\crc.h>
#include <vqm32\huffman.h>
#include <vqm32\mem.h>
#endif /* VQMALL_H */

View File

@@ -0,0 +1,80 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMCAPTOKEN_H
#define VQMCAPTOKEN_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* captoken.h
*
* DESCRIPTION
* Text caption script definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 26, 1995
*
****************************************************************************/
/* CaptionText: This structure describes a line of text to be displayed
* with the video/audio.
*
* Size - Size of caption in bytes.
* OnFrame - Frame number to display caption.
* OffFrame - Frame number to clear caption.
* Flags - Display modifiers.
* CPF - Characters to draw per frame.
* Xpos - X pixel position to display caption.
* Ypos - Y pixel position to display caption.
* BgPen - Background pen to use.
* FgPen - Foreground pen to use.
* Text - Text string to display. (WORD aligned)
*/
typedef struct _CaptionText {
unsigned short Size;
unsigned short OnFrame;
unsigned short OffFrame;
unsigned char Flags;
char CPF;
unsigned short Xpos;
unsigned short Ypos;
char BgPen;
char FgPen;
char Text[];
} CaptionText;
/* CaptionText flag definitions. */
#define CTF_JUSTIFY (3<<0) /* Justification field. */
#define CTF_ABS (0<<0) /* Use absolute X,Y positions. */
#define CTF_CENTER (1<<0) /* Justify on Center */
#define CTF_LEFT (2<<0) /* Justify on left */
#define CTF_RIGHT (3<<0) /* Justify on right */
#define CTF_FLASH (1<<4) /* Flash text. */
/* Function prototypes. */
long BuildCaptions(char *name, char *buffer);
#endif /* VQMCAPTOKEN_H */

View File

@@ -0,0 +1,59 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMCOMP_H
#define VQMCOMP_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* compress.h
*
* DESCRIPTION
* Compression definitions. (32-Bit protected mode)
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* January 26, 1995
*
****************************************************************************/
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
unsigned long __cdecl LCW_Compress(char const *source, char *dest,
unsigned long length);
unsigned long __cdecl LCW_Uncompress(char const *source, char *dest,
unsigned long length);
long AudioZap(void *source, void *dest, long size);
long __cdecl AudioUnzap(void *source, void *dest, long);
#ifdef __cplusplus
}
#endif
#endif /* VQMCOMP_H */

51
WINVQ/INCLUDE/VQM32/CRC.H Normal file
View File

@@ -0,0 +1,51 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMCRC_H
#define VQMCRC_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* CRC.h
*
* DESCRIPTION
* CRC calculation definitions.
*
* PROGRAMMER
* Joe L. Bostic
*
* DATE
* January 26, 1995
*
****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
long __cdecl Calculate_CRC(void const *buffer, long length);
#ifdef __cplusplus
}
#endif
#endif /* VQMCRC_H */

105
WINVQ/INCLUDE/VQM32/FONT.H Normal file
View File

@@ -0,0 +1,105 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMFONT_H
#define VQMFONT_H
/****************************************************************************
*
* 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
*
*---------------------------------------------------------------------------
*
* FILE
* font.h
*
* DESCRIPTION
* Font definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* March 9, 1995
*
****************************************************************************/
/* Font: A Westwood style font.
*
* Size - Size of font.
* CompMethod - Compression method of font. (0 = none)
* NumBlks - Number of data blocks.
* InfoBlk - Offset to font information block.
* OffsetBlk - Offset to character offset block.
* WidthBlk - Offset to character width block.
* DataBlk - Offset to character data block.
* HeightBlk - Offset to character height block.
*/
typedef struct _Font {
unsigned short Size;
unsigned char CompMethod;
unsigned char NumBlks;
unsigned short InfoBlk;
unsigned short OffsetBlk;
unsigned short WidthBlk;
unsigned short DataBlk;
unsigned short HeightBlk;
} Font;
typedef struct _FontInfo {
long huh;
unsigned char MaxHeight;
unsigned char MaxWidth;
} FontInfo;
#ifdef __cplusplus
extern "C" {
#endif
extern void const *FontPtr;
extern int FontXSpacing;
extern int FontYSpacing;
#ifdef __cplusplus
}
#endif
extern char FontWidth;
extern char FontHeight;
extern char *FontWidthBlockPtr;
/* Function prototypes. */
void *cdecl Load_Font(char const *name);
void *cdecl Set_Font(void const *font);
unsigned short __cdecl String_Pixel_Width(char const *string);
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __WATCOMC__
long __cdecl __saveregs Char_Pixel_Width(char chr);
#else
long __cdecl Char_Pixel_Width(char chr);
#endif
#ifdef __cplusplus
}
#endif
#endif /* VQMFONT_H */

View File

@@ -0,0 +1,55 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMGRAPHICS_H
#define VQMGRAPHICS_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* graphics.h
*
* DESCRIPTION
* Graphic rendering and manipulation definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* April 27, 1995
*
****************************************************************************/
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl Eor_Region(long sx, long sy, long dx, long dy, long color);
void __cdecl Fill_Rect(long x1, long y1, long x2, long y2, long color);
#ifdef __cplusplus
}
#endif
#endif /* VQMGRAPHICS_H */

View File

@@ -0,0 +1,99 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HUFFMAN_H
#define HUFFMAN_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* huffman.h
*
* DESCRIPTION
* Huffman order 0 compress/decompress definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* May 19, 1995
*
****************************************************************************/
/* TreeNode: Huffman decoding tree node.
*
* count - Weight of the node in the tree.
* child0 - Child node 0
* child1 - Child node 1
*/
typedef struct _TreeNode {
unsigned long count;
unsigned short child0;
unsigned short child1;
} TreeNode;
/* HuffCode: This structure is used for storing the code for each symbol
* during encoding. A table of codes for each symbol is built
* from the Huffman tree.
*
* code - Code used to represent a symbol.
* bits - Length of code in bits.
*/
typedef struct _HuffCode {
unsigned short code;
short bits;
} HuffCode;
#define HUFF_EOS 256 /* End of stream symbol */
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
long __cdecl HuffCompress(unsigned char *data, unsigned char *buffer,
long length, char *work);
long __cdecl HuffDecompress(unsigned char *data, unsigned char *buffer,
long length, char *work);
void __cdecl HuffCount(unsigned char *data, TreeNode *nodes, long length,
long zero);
void __cdecl HuffScaleCounts(TreeNode *nodes);
long __cdecl RLEHuffCounts(TreeNode *nodes, unsigned char *buffer);
long __cdecl BuildHuffTree(TreeNode *nodes);
void __cdecl ConvertToCodes(TreeNode *nodes, HuffCode *codes,
unsigned short code, short bits, short node);
long __cdecl HuffEncode(unsigned char *data, unsigned char *buffer,
HuffCode *codes, long length);
#ifdef __cplusplus
}
#endif
#endif /* HUFFMAN_H */

141
WINVQ/INCLUDE/VQM32/IFF.H Normal file
View File

@@ -0,0 +1,141 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMIFF_H
#define VQMIFF_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* iff.h
*
* DESCRIPTION
* IFF (Interchange File Format) manager definitions.
* (32-Bit protected mode)
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* January 26, 1995
*
****************************************************************************/
/* FormHeader - Structure associated with IFF forms.
*
* id - IFF form id (IE: "FORM")
* size - Length of IFF in bytes
* type - Form type (IE: "ILBM")
*/
typedef struct _FormHeader {
long id;
long size;
long type;
} FormHeader;
/* Context - Structure associated with chunks.
*
* id - Chunk identifier.
* size - Size of chunk in bytes.
* scan - Bytes read/written.
*/
typedef struct _Context {
long id;
long size;
long scan;
} Context;
/* IFFHandle - Structure associated with an active IFF read\write session.
*
* fh - DOS filehandle
* flags - Internal flags used by IFF routines.
* form - IFF form information.
* scan - Bytes read/written
* cn - Context of current chunk.
*/
typedef struct _IFFHandle {
long fh;
long flags;
FormHeader form;
long scan;
Context cn;
} IFFHandle;
/* bit masks for "flags" field. */
#define IFFB_READ 0
#define IFFB_WRITE 1
#define IFFF_READ (1<<IFFB_READ)
#define IFFF_WRITE (1<<IFFB_WRITE)
/* IFF return codes. Most functions return either zero for success or
* one of these codes. The exceptions are the read/write functions which,
* return positive values for number of bytes read or written, or a negative
* error code.
*
* IFFERR_EOF - End of file.
* IFFERR_READ - Read error.
* IFFERR_WRITE - Write error.
* IFFERR_NOMEM - Unable to allocate memory.
*/
#define IFFERR_EOF -1
#define IFFERR_READ -2
#define IFFERR_WRITE -3
#define IFFERR_NOMEM -4
/* Macros to make things easier. */
#define REVERSE_LONG(id) (unsigned long)((((unsigned long)(id)>>24) \
&0x000000FFL)|(((unsigned long)(id)>>8) \
&0x0000FF00L)|(((unsigned long)(id)<<8) \
&0x00FF0000L)|(((unsigned long)(id)<<24)&0xFF000000L))
#define REVERSE_WORD(id) ((unsigned short)((((unsigned short)(id)<<8) \
&0x00FF00)|(((unsigned short)(id)>>8)&0x0FF)))
#define PADSIZE(size) (((size)+1)&(~1))
#ifndef MAKE_ID
#define MAKE_ID(a,b,c,d) ((long)((long)(d)<<24)|((long)(c)<<16)| \
((long)(b)<<8)|(long)(a))
#endif
/* Universal IFF identifiers */
#define ID_FORM MAKE_ID('F','O','R','M')
#define ID_LIST MAKE_ID('L','I','S','T')
#define ID_PROP MAKE_ID('P','R','O','P')
#define ID_NULL MAKE_ID(' ',' ',' ',' ')
/* Prototypes */
IFFHandle *OpenIFF(char *, long);
void CloseIFF(IFFHandle *);
long ReadForm(IFFHandle *, FormHeader *);
long WriteForm(IFFHandle *, FormHeader *);
long ReadChunkHeader(IFFHandle *);
long WriteChunkHeader(IFFHandle *, long, long);
long WriteChunk(IFFHandle *, long, char *, long);
long WriteChunkBytes(IFFHandle *, char *, long);
long ReadChunkBytes(IFFHandle *, char *, long);
long SkipChunkBytes(IFFHandle *, long);
long FindChunk(IFFHandle *, long);
char *IDtoStr(long, char *);
long CurrentFilePos(IFFHandle *);
#endif /* VQMIFF_H */

56
WINVQ/INCLUDE/VQM32/MEM.H Normal file
View File

@@ -0,0 +1,56 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAMEM_H
#define VQAMEM_H
/****************************************************************************
*
* 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
*
*---------------------------------------------------------------------------
*
* FILE
* mem.h
*
* DESCRIPTION
* Memory management definitions.
*
* PROGRAMMER
* Phil Gorrow
* Denzil E. Long, Jr.
*
* DATE
* July 5, 1995
*
****************************************************************************/
/* Definitions */
#define DPMI_INT 0x0031
#define DPMI_LOCK 0x0600
#define DPMI_UNLOCK 0x0601
/* Prototypes */
#ifdef __WATCOMC__
void DPMI_Lock(void const *ptr, long const size);
void DPMI_Unlock(void const *ptr, long const size);
#else
#define DPMI_Lock(a,b)
#define DPMI_Unlock(a,b)
#endif
#endif /* VQAMEM_H */

View File

@@ -0,0 +1,105 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMMIXFILE_H
#define VQMMIXFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* mixfile.h
*
* DESCRIPTION
* A mix file is basically a group of files concatinated together
* proceeded by a header describing where in the file each individual
* entry is located. These definitions are provided to simplify the access
* to these file entries.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* January 26, 1995
*
****************************************************************************/
/* Disable structure alignment.*/
#ifdef __WATCOMC__
#pragma pack(1);
#endif
/*---------------------------------------------------------------------------
* STRUCTURE DEFINITIONS
*-------------------------------------------------------------------------*/
/* MIXHeader: Mix file data header.
*
* Count - Number of entries contained in this mix file.
* Size - Size of Mix file.
*/
typedef struct _MIXHeader {
short Count;
long Size;
} MIXHeader;
/* MIXSubBlock: Mix file entry descriptor.
*
* CRC - Unique entry identifier.
* Offset - Offset from beginning of data segment to entry.
* Size - Size of entry.
*/
typedef struct _MIXSubBlock {
long CRC;
long Offset;
long Size;
} MIXSubBlock;
/* MIXHandle: Mix file handle.
*
* Name - Pointer to the name of the mix file this handle is for.
* Size - Size of entire mix file.
* FH - DOS file handle of opened entry.
* Count - Number of files contained in this mix.
* Entries - Array of 'Count' MIXSubBlock structure entries.
*/
typedef struct _MIXHandle {
char *Name;
long Size;
long FH;
long Count;
MIXSubBlock Entries[];
} MIXHandle;
/*---------------------------------------------------------------------------
* PROTOTYPES
*-------------------------------------------------------------------------*/
MIXHandle *OpenMix(char *name);
void CloseMix(MIXHandle *mix);
long OpenMixEntry(MIXHandle *mix, char *name);
/* Restore original alignment */
#ifdef __WATCOMC__
#pragma pack();
#endif
#endif /* VQMMIXFILE_H */

View File

@@ -0,0 +1,66 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMMONO_H
#define VQMMONO_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* mono.h
*
* DESCRIPTION
* Mono screen definitions. (32-Bit protected mode)
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Feburary 8, 1995
*
****************************************************************************/
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl Mono_Enable(void);
void __cdecl Mono_Disable(void);
void __cdecl Mono_Set_Cursor(long x, long y);
void __cdecl Mono_Clear_Screen(void);
void __cdecl Mono_Scroll(long lines);
void __cdecl Mono_Put_Char(long character, long attrib);
void __cdecl Mono_Draw_Rect(long x, long y, long w, long h, long attrib,
long thick);
void __cdecl Mono_Text_Print(void const *text, long x, long y, long attrib);
void __cdecl Mono_Print(void const *text);
short __cdecl Mono_View_Page(long page);
short __cdecl Mono_X(void);
short __cdecl Mono_Y(void);
#ifdef __cplusplus
}
#endif
#endif /* VQMMONO_H */

View File

@@ -0,0 +1,59 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMPALETTE_H
#define VQMPALETTE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* Palette.h (32-Bit protected mode)
*
* DESCRIPTION
* Palette definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Febuary 3, 1995
*
****************************************************************************/
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl SetPalette(unsigned char *palette,long numbytes,unsigned long slowpal);
void __cdecl ReadPalette(void *palette);
void __cdecl SetDAC(long color, long red, long green, long blue);
void __cdecl TranslatePalette(void *pal24, void *pal15, long numbytes);
#ifdef __cplusplus
}
#endif
void SortPalette(unsigned char *pal, long numcolors);
#endif /* VQMPALETTE_H */

View File

@@ -0,0 +1,57 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMPORTIO_H
#define VQMPORTIO_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* Portio.h (32-Bit protected mode)
*
* DESCRIPTION
* Hardware port I/O
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Febuary 3, 1995
*
****************************************************************************/
#ifdef __BORLANDC__
#ifdef __cplusplus
extern "C" {
#endif
short __cdecl inp(unsigned short portid);
void __cdecl outp(unsigned short portid, short value);
#ifdef __cplusplus
}
#endif
#endif /* __BORLANDC__ */
#endif /* VQMPORTIO_H */

View File

@@ -0,0 +1,52 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMPROFILE_H
#define VQMPROFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* Profile.h (32-Bit protected mode)
*
* DESCRIPTION
* INI file profiling definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* January 26, 1995
*
****************************************************************************/
/* Prototypes */
long GetINIInt(char const *section, char const *entry,
long deflt, char *fname);
long GetINIString(char const *section, char const *entry,
char const *def, char *retbuffer, long retlen, char *fname);
long Get_Frame_Pathname(char *inifile,long anim_frame,char *ext,
char *outbuf);
#endif /* VQMPROFILE_H */

View File

@@ -0,0 +1,82 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMREALMODE_H
#define VQMREALMODE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* realmode.h
*
* DESCRIPTION
* Real-mode interfacing definitions and equates. Many of the definitions
* and descriptions in this file were taken from other sources and
* compiled here for use in MISC32 library.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Febuary 6, 1995
*
****************************************************************************/
/* REALPTR: Real-mode pointer (segment:offset16).
*
* The REALPTR data type is used in protected mode to hold real-mode
* pointers. The type is an unsigned long value, were the upper 16 bits
* are the segment number and the lower 16 bit are an offset. This type
* and the associated macros are identical to that of the PHARLAP "pltypes.h"
* definitions for easy of conversion to WATCOM/4GW.
*/
typedef unsigned long REALPTR;
#define RP_OFF(rp) ((unsigned short)(((unsigned long)(rp)) & 0xFFFF))
#define RP_SEG(rp) ((unsigned short)(((unsigned long)(rp)) >> 16))
#define RP_SET(rp, off, seg) (rp = ((unsigned long)(seg) << 16) + (off))
#define RP_INCR(rp, incr) (rp += ((unsigned long)(incr)) & 0xFFFF)
#define MK_PTR(off, seg) (void *)((((unsigned long)seg&0xFFFF)<<4)+off)
/* RMInfo: Real-mode interrupt call structure.
*
* Information that needs to be passed down to the real-mode interrupt is
* transfered using this structure. The address to this protected-mode
* structure (allocated by user) is passed into DPMI function 0x300. DOS/4GW
* will then use this information to set up the real-mode registers, switch
* to real-mode and then execute the interrupt in real-mode.
*/
typedef struct _RMInfo {
long edi;
long esi;
long ebp;
long reservedbysystem;
long ebx;
long edx;
long ecx;
long eax;
short flags;
short es,ds,fs,gs,ip,cs,sp,ss;
} RMInfo;
#endif /* VQMREALMODE_H */

View File

@@ -0,0 +1,90 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* File : soscomp.h
* Date Created : 6/1/94
* Description :
*
* Programmer(s) : Nick Skrepetos
* Last Modification : 10/1/94 - 11:37:9 AM
* Additional Notes : Modified by Denzil E. Long, Jr.
*
*****************************************************************************
* Copyright (c) 1994, HMI, Inc. All Rights Reserved *
****************************************************************************/
#ifndef _SOS_COMPRESS
#define _SOS_COMPRESS
/* compression types */
enum {
_ADPCM_TYPE_1,
};
/* define compression structure */
typedef struct _tagCOMPRESS_INFO {
char *lpSource;
char *lpDest;
unsigned long dwCompSize;
unsigned long dwUnCompSize;
short wBitSize;
short wChannels;
unsigned long dwSampleIndex;
long dwPredicted;
long dwDifference;
short wCodeBuf;
short wCode;
short wStep;
short wIndex;
unsigned long dwSampleIndex2; //added BP for channel 2
long dwPredicted2; //added BP for channel 2
long dwDifference2; //added BP for channel 2
short wCodeBuf2; //added BP for channel 2
short wCode2; //added BP for channel 2
short wStep2; //added BP for channel 2
short wIndex2; //added BP for channel 2
} _SOS_COMPRESS_INFO;
/* compressed file type header */
typedef struct _tagCOMPRESS_HEADER {
unsigned long dwType; // type of compression
unsigned long dwCompressedSize; // compressed file size
unsigned long dwUnCompressedSize; // uncompressed file size
unsigned long dwSourceBitSize; // original bit size
char szName[16]; // file type, for error checking
} _SOS_COMPRESS_HEADER;
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl VQA_sosCODECInitStream(_SOS_COMPRESS_INFO *);
unsigned long __cdecl VQA_sosCODECCompressData(_SOS_COMPRESS_INFO *,unsigned long);
unsigned long __cdecl VQA_sosCODECDecompressData(_SOS_COMPRESS_INFO *,unsigned long);
#ifdef __cplusplus
}
#endif
#endif

130
WINVQ/INCLUDE/VQM32/TARGA.H Normal file
View File

@@ -0,0 +1,130 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMTARGA_H
#define VQMTARGA_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* Targa.h (32-Bit protected mode)
*
* DESCRIPTION
* Targa Image File definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* January 26, 1995
*
****************************************************************************/
/*---------------------------------------------------------------------------
* Targa Header definitions
*-------------------------------------------------------------------------*/
/* TGAHeader - Targa Image File header.
*
* IDLength - Size of Image ID field
* ColorMapType - Color map type.
* ImageType - Image type code.
* CMapStart - Color map origin.
* CMapLength - Color map length.
* CMapDepth - Depth of color map entries.
* XOffset - X origin of image.
* YOffset - Y origin of image.
* Width - Width of image.
* Height - Height of image.
* PixelDepth - Image pixel size
* ImageDescriptor - Image descriptor byte.
*/
typedef struct _TGAHeader {
char IDLength;
char ColorMapType;
char ImageType;
short CMapStart;
short CMapLength;
char CMapDepth;
short XOffset;
short YOffset;
short Width;
short Height;
char PixelDepth;
char ImageDescriptor;
} TGAHeader;
/* ImageType definiton */
#define TGA_NOIMAGE 0 /* No image data included in file */
#define TGA_CMAPPED 1 /* Color-mapped image data */
#define TGA_TRUECOLOR 2 /* Truecolor image data */
#define TGA_MONO 3 /* Monochrome image data */
#define TGA_CMAPPED_ENCODED 9 /* Color-mapped image data (Encoded) */
#define TGA_TRUECOLOR_ENCODED 10 /* Truecolor image data (Encoded) */
#define TGA_MONO_ENCODED 11 /* Monochrome image data (Encoded) */
/* ImageDescriptor definition */
#define TGAF_ATTRIB_BITS (0x0F<<0) /* Number of attribute bits per pixel */
#define TGAF_XORIGIN (1<<4)
#define TGAF_YORIGIN (1<<5)
/*---------------------------------------------------------------------------
* Targa Handle definitions
*-------------------------------------------------------------------------*/
/* TGAHandle - Targa Image File handle.
*
* fh - File handle returned by open().
* mode - Access mode.
* header - TGAHeader structure.
*/
typedef struct _TGAHandle {
short fh;
unsigned short mode;
TGAHeader header;
} TGAHandle;
/* Access modes. */
#define TGA_READMODE 0
#define TGA_WRITEMODE 1
#define TGA_RDWRMODE 2
/* Error codes */
#define TGAERR_OPEN -1
#define TGAERR_READ -2
#define TGAERR_WRITE -3
#define TGAERR_SYNTAX -4
#define TGAERR_NOMEM -5
#define TGAERR_NOTSUPPORTED -6
/*---------------------------------------------------------------------------
* Function prototypes
*-------------------------------------------------------------------------*/
TGAHandle *OpenTarga(char *, unsigned short);
void CloseTarga(TGAHandle *);
long LoadTarga(char *, char *, char *);
long SaveTarga(char *, TGAHeader *, char *, char *);
void XFlipTarga(TGAHeader *, char *);
void YFlipTarga(TGAHeader *, char *);
#endif /* VQMTARGA_H */

View File

@@ -0,0 +1,56 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMTEXT_H
#define VQMTEXT_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* text.h
*
* DESCRIPTION
* Text printing definitions. (32-Bit protected mode)
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* March 13, 1995
*
****************************************************************************/
/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif
long __cdecl Text_Print(char *string, long x, long y, long fcol, long bcol);
void __cdecl Draw_Char(long character, long x, long y);
void __cdecl Set_Font_Palette_Range(void *palette, long start, long end);
#ifdef __cplusplus
}
#endif
#endif /* VQMTEXT_H */

View File

@@ -0,0 +1,71 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMVESABLIT_H
#define VQMVESABLIT_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* VESABlit.h (32-Bit protected mode)
*
* DESCRIPTION
* VESA bitblit routines.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Febuary 3, 1995
*
****************************************************************************/
#include <vqm32\video.h>
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
void VESA_Blit_640x480(DisplayInfo *disp,unsigned char *buf,long x1,
long y1,long width,long height);
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl Blit_VESA640x480(DisplayInfo *disp,unsigned char *buf,long x1,
long y1,long width,long height);
void __cdecl Buf_320x200_To_VESA_320x200(unsigned char *buffer, long grain);
void __cdecl Buf_320x200_To_VESA_640x400(unsigned char *buffer, long grain);
void __cdecl Buf_320x200_To_VESA_32K(unsigned char *buffer,
unsigned char *palette, long grain);
void __cdecl Copy_Row(char *, char *, long);
void __cdecl Copy_Word_Row(char *source, char *dest, char *palette,
long numbytes);
#ifdef __cplusplus
}
#endif
#endif /* VQMVESABLIT_H */

View File

@@ -0,0 +1,182 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMVESAVID_H
#define VQMVESAVID_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* VESAVid.h (32-Bit protected mode)
*
* DESCRIPTION
* VESA video manager definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Febuary 3, 1995
*
****************************************************************************/
#ifndef __WATCOMC__
#include <pharlap.h>
#else
#include "realmode.h"
#endif
/*---------------------------------------------------------------------------
* VESA Video Modes
*-------------------------------------------------------------------------*/
#define VESA_640X400_256 0x100
#define VESA_640X480_256 0x101
#define VESA_800X600_16 0x102
#define VESA_800X600_256 0x103
#define VESA_1024X768_16 0x104
#define VESA_1024X768_256 0x105
#define VESA_1280X400_16 0x106
#define VESA_1280X400_256 0x107
#define VESA_TEXT_80X60 0x108
#define VESA_TEXT_132X25 0x109
#define VESA_TEXT_132X60 0x10C
#define VESA_320X200_32K_1 0x10D
#define VESA_320X200_32K_2 0x10E
#define VESA_640X480_32K 0x110
#define VESA_640X480_65K 0x111
#define VESA_640X480_16M 0x112
#define VESA_800X600_32K 0x113
#define VESA_800X600_65K 0x114
#define VESA_1024X768_32K 0x116
#define VESA_1024X768_65K 0x117
#define VESA_MIN VESA_640X400_256
#define VESA_MAX VESA_1024X768_65K
/*---------------------------------------------------------------------------
* Structure definitions
*-------------------------------------------------------------------------*/
/* VESAInfo - General information about this VESA implementation.
* (Filled in by VESA BIOS Function 0)
*
* Signature - Will always be 'VESA'
* Version - Version #
* OEMString - OEM ID string
* Capabilities - Not defined by VESA yet
* AvailModes - List of available modes; terminated with -1 (0xffff)
* TotalMemory - ???
* Reserved - Pads structure to 256 bytes total
*/
typedef struct _VESAInfo {
char Signature[4];
unsigned short Version;
REALPTR OEMString;
unsigned long Capabilities;
REALPTR AvailModes;
unsigned short TotalMemory;
unsigned char Reserved[236];
} VESAInfo;
/* VESAModeInfo - Information about this VESA mode.
* (Filled in by VESA BIOS Function 1)
*
* Attributes - bit 0: 1 = mode is supported
* bit 1: 1 = optional info available
* bit 2: 1 = std BIOS output functions valid in this mode
* bit 3: 0 = monochrome, 1 = color
* bit 4: 0 = text mode, 1 = graphics
* WinA_Attributes - bit 0 = window exists, bit 1=readable, bit 2= writable
* WinB_Attributes - bit 0 = window exists, bit 1=readable, bit 2= writable
* WinGranularity - smallest address boundary window can be placed upon;
* size is in KB (ie 64, 32, 4)
* WinSize - size of windows in KB (ie 64, 32)
* WinA_Segment - location of Window A in CPU space (usually 0xa000)
* WinB_Segment - location of Window B in CPU space (usually 0xb000)
* WinFunc - address of window-setting function (This is provided
* as an alternative to Int 10 for speed.)
* BytesPerScanline - # bytes per scan line
*
* Optional info (available if bit 1 of Attributes is set):
*
* XRes - X-resolution
* YRes - Y-resolution
* XCharSize - Horizontal size of char cell
* YCharSize - Vertical size of char cell
* NumPlanes - # of memory planes (???)
* BitsPerPixel - # bites per pixel
* NumBanks - # of banks (ie planes)
* MemoryModel - 00h = Text mode
* 01h = CGA mode
* 02h = Hercules
* 03h = 4 plane planar mode
* 04h = packed pixel mode (1 byte/pixel)
* 05h = non-chain 4, 256-color mode
* 06-0Fh =
* 10-FFh = OEM-specific
* BankSize - Bank size in KB
*/
typedef struct _VESAModeInfo {
unsigned short Attributes;
unsigned char WinA_Attributes;
unsigned char WinB_Attributes;
unsigned short WinGranularity;
unsigned short WinSize;
unsigned short WinA_Segment;
unsigned short WinB_Segment;
REALPTR WinFunc;
unsigned short BytesPerScanline;
unsigned short XRes;
unsigned short YRes;
unsigned char XCharSize;
unsigned char YCharSize;
unsigned char NumPlanes;
unsigned char BitsPerPixel;
unsigned char NumBanks;
unsigned char MemoryModel;
unsigned char BankSize;
unsigned char NumInputPages;
unsigned char Reserved;
unsigned char RedMaskSize;
unsigned char RedFieldPosition;
unsigned char GreenMaskSize;
unsigned char GreenFieldPosition;
unsigned char BlueMaskSize;
unsigned char BlueFieldPosition;
unsigned char RsvdMaskSize;
unsigned char RsvdFieldPosition;
unsigned char DirectColorModeInfo;
unsigned char pad[216];
} VESAModeInfo;
/*---------------------------------------------------------------------------
* Function prototypes
*-------------------------------------------------------------------------*/
long InitVESA(void);
void UninitVESA(void);
VESAModeInfo *SetVESAMode(long mode);
VESAModeInfo *ReadVESAModeInfo(long mode);
void SetVESAWindow(long grain_num);
#endif /* VQMVESAVID_H */

View File

@@ -0,0 +1,203 @@
;
; Command & Conquer Red Alert(tm)
; Copyright 2025 Electronic Arts Inc.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;****************************************************************************
;*
;* 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
;*
;*----------------------------------------------------------------------------
;*
;* FILE
;* vesavid.i
;*
;* DESCRIPTION
;* VESA video manager definitions. (32-Bit protected mode)
;*
;* PROGRAMMER
;* Denzil E. Long, Jr.
;*
;* DATE
;* January 26, 1995
;*
;****************************************************************************
;----------------------------------------------------------------------------
; VESA video modes
;----------------------------------------------------------------------------
VESA_640X400_256 EQU 0x100
VESA_640X480_256 EQU 0x101
VESA_800X600_16 EQU 0x102
VESA_800X600_256 EQU 0x103
VESA_1024X768_16 EQU 0x104
VESA_1024X768_256 EQU 0x105
VESA_1280X400_16 EQU 0x106
VESA_1280X400_256 EQU 0x107
VESA_TEXT_80X60 EQU 0x108
VESA_TEXT_132X25 EQU 0x109
VESA_TEXT_132X60 EQU 0x10C
VESA_320X200_32K_1 EQU 0x10D
VESA_320X200_32K_2 EQU 0x10E
VESA_640X480_32K EQU 0x110
VESA_640X480_65K EQU 0x111
VESA_640X480_16M EQU 0x112
VESA_800X600_32K EQU 0x113
VESA_800X600_65K EQU 0x114
VESA_1024X768_32K EQU 0x116
VESA_1024X768_65K EQU 0x117
VESA_MIN EQU VESA_640X400_256
VESA_MAX EQU VESA_1024X768_65K
;----------------------------------------------------------------------------
; Structure definitions
;----------------------------------------------------------------------------
; VESAInfo - General information about this VESA implementation.
; (Filled in by VESA BIOS Function 0)
;
; Signature - Will always be 'VESA'
; Ver - Version #
; OEMString - OEM ID string
; Capabilities - Not defined by VESA yet
; AvailModes - List of available modes; terminated with -1 (0xffff)
; TotalMemory - ???
; Reserved - Pads structure to 256 bytes total
STRUC VESAInfo
Signature DD ?
Ver DW ?
OEMString DD ?
Capabilities DD ?
AvailModes DD ?
TotalMemory DW ?
Reserved DB 236 DUP (?)
ENDS VESAInfo
; VESAModeInfo - Information about this VESA mode.
; (Filled in by VESA BIOS Function 1)
;
; Attributes - bit 0: 1 = mode is supported
; bit 1: 1 = optional info available
; bit 2: 1 = std BIOS output functions valid in this mode
; bit 3: 0 = monochrome, 1 = color
; bit 4: 0 = text mode, 1 = graphics
; WinA_Attributes - bit 0 = window exists, bit 1=readable, bit 2= writable
; WinB_Attributes - bit 0 = window exists, bit 1=readable, bit 2= writable
; WinGranularity - smallest address boundary window can be placed upon;
; size is in KB (ie 64, 32, 4)
; WinSize - size of windows in KB (ie 64, 32)
; WinA_Segment - location of Window A in CPU space (usually 0xa000)
; WinB_Segment - location of Window B in CPU space (usually 0xb000)
; WinFunc - address of window-setting function (This is provided
; as an alternative to Int 10 for speed.)
; BytesPerScanline - # bytes per scan line
;
; Optional info (available if bit 1 of Attributes is set):
;
; XRes - X-resolution
; YRes - Y-resolution
; XCharSize - Horizontal size of char cell
; YCharSize - Vertical size of char cell
; NumPlanes - # of memory planes (???)
; BitsPerPixel - # bites per pixel
; NumBanks - # of banks (ie planes)
; MemoryModel - 00h = Text mode
; 01h = CGA mode
; 02h = Hercules
; 03h = 4 plane planar mode
; 04h = packed pixel mode (1 byte/pixel)
; 05h = non-chain 4, 256-color mode
; 06-0Fh =
; 10-FFh = OEM-specific
; BankSize - Bank size in KB
STRUC VESAModeInfo
Attributes DW ?
WinA_Attributes DB ?
WinB_Attributes DB ?
WinGranularity DW ?
WinSize DW ?
WinA_Segment DW ?
WinB_Segment DW ?
WinFunc DD ?
BytesPerScanline DW ?
XRes DW ?
YRes DW ?
XCharSize DB ?
YCharSize DB ?
NumPlanes DB ?
BitsPerPixel DB ?
NumBanks DB ?
MemoryModel DB ?
BankSize DB ?
NumInputPages DB ?
Reserved DB ?
RedMaskSize DB ?
RedFieldPosition DB ?
GreenMaskSize DB ?
GreenFieldPosition DB ?
BlueMaskSize DB ?
BlueFieldPosition DB ?
RsvdMaskSize DB ?
RsvdFieldPosition DB ?
DirectColorModeInfo DB ?
pad DB 216 DUP (?)
ENDS VESAModeInfo
;----------------------------------------------------------------------------
; Function definitions
;----------------------------------------------------------------------------
GLOBAL C InitVESA:PROC
GLOBAL C UninitVESA:PROC
GLOBAL C SetVESAMode:PROC
GLOBAL C ReadVESAModeInfo:PROC
GLOBAL C SetVESAWindow:PROC
;----------------------------------------------------------------------------
;
; NAME
; SET_WINDOW - Sets window A to the specified bank.
;
; SYNOPSIS
; SET_WINDOW GrainNum
;
; FUNCTION
; This routine uses the C Set_Window function rather than going through
; the BIOS, for two reasons: (1) Speed, and (2) On the Cirrus Logic 54xx
; VESA cards, BIOS calls make noise while playing digital audio.
;
; INPUTS
; GrainNum - Granularity number.
;
; RESULT
; NONE
;
;----------------------------------------------------------------------------
MACRO SET_WINDOW grain_num
push esi
push edi
push es
call SetVESAWindow C,grain_num
pop es
pop edi
pop esi
ENDM

217
WINVQ/INCLUDE/VQM32/VGA.I Normal file
View File

@@ -0,0 +1,217 @@
;
; Command & Conquer Red Alert(tm)
; Copyright 2025 Electronic Arts Inc.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;****************************************************************************
;*
;* 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
;*
;*---------------------------------------------------------------------------
;*
;* FILE
;* vga.i
;*
;* DESCRIPTION
;* VGA hardware definitions. (32-Bit protected mode)
;*
;* PROGRAMMER
;* Denzil E. Long, Jr.
;*
;* DATE
;* January 26, 1995
;*
;****************************************************************************
;----------------------------------------------------------------------------
; VGA Registers
;----------------------------------------------------------------------------
R_SEQUENCER EQU 03C4h ;Sequencer Controller Index reg
SEQ_RESET EQU 00h ;Reset
SEQ_MAP_MASK EQU 02h ;Index in Sequencer of Map Mask reg
SEQ_MEMORY_MODE EQU 04h ;Memory Mode
R_GRAPHICS_CONTROLLER EQU 03CEh ;Graphics Controller Index reg
GC_READ_MAP EQU 04h ;Index in GController of Read Map reg
GC_MODE EQU 05h ;Read/Write Modes
GC_MISC EQU 06h ;Read/Write Modes
GC_BITMASK EQU 08h ;Index in GController of BitMask reg
R_CRT_CONTROLLER EQU 03D4h ;CRT Controller Index reg
CRT_VERT_TOTAL EQU 06h ;Vertical total
CRT_OVERFLOW EQU 07h ;Overflow
CRT_MAX_SCANLINE EQU 09h ;Max scan line
CRT_STARTADDR_HIGH EQU 0Ch ;Bitmap start address high byte
CRT_STARTADDR_LOW EQU 0Dh ;Bitmap start address low byte
CRT_VERTRET_START EQU 010h ;Vertical retrace pulse start
CRT_VERTRET_END EQU 011h ;Vertical retrace pulse end
CRT_VERTDISP_END EQU 012h ;Vertical display end
CRT_UNDERLINE EQU 014h ;Underline location
CRT_START_VB EQU 015h ;Start vertical blank
CRT_END_VB EQU 016h ;End vertical blank
CRT_MODE_CONTROL EQU 017h ;Mode control
R_MISC_OUTPUT EQU 03C2h ;Miscellaneous Output reg
;----------------------------------------------------------------------------
; Palette Registers
;----------------------------------------------------------------------------
PEL_READ_ADDR EQU 03C7h
PEL_WRITE_ADDR EQU 03C8h
PEL_DATA EQU 03C9h
;----------------------------------------------------------------------------
; XMode planes, for the Map Mask register
;----------------------------------------------------------------------------
XPLANE_1 EQU 1
XPLANE_2 EQU 2
XPLANE_3 EQU 4
XPLANE_4 EQU 8
;----------------------------------------------------------------------------
;
; NAME
; SET_PLANE - Set an XMode plane.
;
; SYNOPSIS
; SET_PLANE plane
;
; INPUTS
; plane - Number of Xmode plane to set.
;
; USES
; eax, edx
;
;----------------------------------------------------------------------------
MACRO SET_PLANE plane
mov edx,R_SEQUENCER
mov eax,SEQ_MAP_MASK
out dx,al
inc edx
mov eax,plane
out dx,al
ENDM
;----------------------------------------------------------------------------
;
; NAME
; SET_BITMASK - Set the BitMask register.
;
; SYNOPSIS
; SET_BITMASK mask
;
; INPUTS
; mask - Bitmask to use.
;
; USES
; eax, edx
;
;----------------------------------------------------------------------------
MACRO SET_BITMASK mask
mov edx,R_GRAPHICS_CONTROLLER
mov eax,GC_BITMASK
out dx,al
inc edx
mov eax,mask
out dx,al
ENDM
;----------------------------------------------------------------------------
;
; NAME
; SET_WRITEMODE - Set the VGA writemode.
;
; SYNOPSIS
; SET_WRITEMODE mode
;
; INPUTS
; mode - Write mode.
;
; USES
; eax, edx
;
;----------------------------------------------------------------------------
MACRO SET_WRITEMODE mode
mov edx,R_GRAPHICS_CONTROLLER
mov eax,GC_MODE
out dx,al
inc edx
in al,dx ;Read the register
and al,0FCh ;Turn off 2 lower bits
or al,mode ;Set write mode
out dx,al
ENDM
;----------------------------------------------------------------------------
;
; NAME
; OUTPORT - Output data to a VGA register.
;
; SYNOPSIS
; OUTPORT port,register,data
;
; INPUTS
; port - Port address.
; register - Register to write to.
; data - Data to write.
;
; USES
; eax, edx
;
;----------------------------------------------------------------------------
MACRO OUTPORT port,register,data
mov edx,port
mov al,register
out dx,al
inc edx
mov al,data
out dx,al
ENDM
;----------------------------------------------------------------------------
;
; NAME
; INPORT - Input data from a VGA register.
;
; SYNOPSIS
; data = INPORT port,register
;
; INPUTS
; port - Port address.
; register - Register to read from.
;
; RESULT
; data - Value read from port in AL.
;
; USES
; eax, edx
;
;----------------------------------------------------------------------------
MACRO INPORT port,register
mov edx,port
mov al,register
out dx,al
inc edx
in al,dx
ENDM

115
WINVQ/INCLUDE/VQM32/VIDEO.H Normal file
View File

@@ -0,0 +1,115 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQMVIDEO_H
#define VQMVIDEO_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* Video.h (32-Bit protected mode)
*
* DESCRIPTION
* Video manager definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Febuary 3, 1995
*
****************************************************************************/
#include <vqm32\vesavid.h>
/*---------------------------------------------------------------------------
* VGA video modes
*-------------------------------------------------------------------------*/
#define TEXT_VIDEO 0x02
#define MCGA 0x13
#define XMODE_320X200 0x50
#define XMODE_320X240 0x51
#define XMODE_320X400 0x52
#define XMODE_320X480 0x53
#define XMODE_360X400 0x54
#define XMODE_360X480 0x55
#define XMODE_MIN 0x50
#define XMODE_MAX 0x55
/*---------------------------------------------------------------------------
* Structure definitions
*-------------------------------------------------------------------------*/
/* DisplayInfo - Information about the current display.
*
* Mode - Mode identification.
* XRes - X resolution of mode.
* YRes - Y resolution of mode.
* VBIbit - Polarity of vertical blank bit.
* Extended - Pointer to mode specific data structure.
*/
typedef struct _DisplayInfo {
long Mode;
long XRes;
long YRes;
long VBIbit;
void *Extended;
} DisplayInfo;
/*---------------------------------------------------------------------------
* Function prototypes
*-------------------------------------------------------------------------*/
DisplayInfo *SetVideoMode(long mode);
DisplayInfo *GetDisplayInfo(void);
long TestVBIBit(void);
long GetVBIBit(void);
void SetupXPaging(void);
void FlipXPage(void);
unsigned char *GetXHidPage(void);
unsigned char *GetXSeenPage(void);
void DisplayXPage(long page);
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl WaitNoVB(short vbibit);
void __cdecl WaitVB(short vbibit);
void __cdecl ClearVRAM(void);
long __cdecl SetXMode(long mode);
void __cdecl ClearXMode(void);
void __cdecl ShowXPage(unsigned long StartOffset);
void __cdecl Xmode_BufferCopy_320x200(void *buff, void *screen);
void __cdecl Xmode_Blit(void *buffer, void *screen, long imgwidth, long imgheight);
void __cdecl MCGA_BufferCopy(unsigned char *buffer, unsigned char *dummy);
void __cdecl MCGA_Blit(unsigned char *buffer, unsigned char *screen,
long imgwidth, long imgheight);
#ifdef __cplusplus
}
#endif
#endif /* VQMVIDEO_H */

View File

@@ -0,0 +1,80 @@
;
; Command & Conquer Red Alert(tm)
; Copyright 2025 Electronic Arts Inc.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;****************************************************************************
;*
;* 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
;*
;*----------------------------------------------------------------------------
;*
;* FILE
;* video.i
;*
;* DESCRIPTION
;* Video manager definitions. (32-Bit protected mode)
;*
;* PROGRAMMER
;* Denzil E. Long, Jr.
;*
;* DATE
;* January 26, 1995
;*
;****************************************************************************
INCLUDE "vesavid.i"
;----------------------------------------------------------------------------
; Video Modes
;----------------------------------------------------------------------------
TEXT EQU 002h
MCGA EQU 013h
XMODE_320X200 EQU 050h
XMODE_320X240 EQU 051h
XMODE_320X400 EQU 052h
XMODE_320X480 EQU 053h
XMODE_360X400 EQU 054h
XMODE_360X480 EQU 055h
;----------------------------------------------------------------------------
; Structure definitions
;----------------------------------------------------------------------------
; DisplayInfo - Information about the current display.
;
; Mode - Mode identification
; XRes - X resolution
; YRes - Y resolution
; VBIbit - Polarity of vertical blank bit.
; Extended - Pointer to mode specified data structure.
STRUC DisplayInfo
Mode DD ?
XRes DD ?
YRes DD ?
VBIbit DD ?
Extended DD ?
ENDS DisplayInfo
;----------------------------------------------------------------------------
; Function definitions
;----------------------------------------------------------------------------
GLOBAL C GetDisplayInfo:NEAR
GLOBAL C GetVBIBit:NEAR

73
WINVQ/INCLUDE/WAVEFILE.H Normal file
View File

@@ -0,0 +1,73 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WAVEFILE_H
#define WAVEFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILE
* wavefile.c
*
* DESCRIPTION
* WAVE file format definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* February 21, 1995
*
****************************************************************************/
/* WAVHeader: WAVE file header.
*
* RIFF - 4 byte identifier (always "RIFF").
* Size - Size in bytes of entire file.
* WAVE - 4 byte identifier (always "WAVE").
*/
typedef struct _WAVHeader {
long RIFF;
long Size;
long WAVE;
} WAVHeader;
/* WAVFormat: This structure describes the format of the audio data contained
* in the WAV file.
*
* FormatTag -
* Channels - Number of channels (1 = mono, 2 = stereo).
* SamplesPerSec - Sampling rate.
* AvgBytesPerSec - Bytes in 1 second of audio (Rate * SampleSize * Channels)
* BlockAlign - padding.
* BitsPerSample - Number of bits per sample (8, 16).
*/
typedef struct _WAVFormat {
short FormatTag;
short Channels;
long SamplesPerSec;
long AvgBytesPerSec;
short BlockAlign;
short BitsPerSample;
} WAVFormat;
#endif /* WAVEFILE_H */

54
WINVQ/INCLUDE/WWTYPES.H Normal file
View File

@@ -0,0 +1,54 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WWTYPES_H
#define WWTYPES_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* FILENAME
* wwtypes.h
*
* DESCRIPTION
* Westwood standard types definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
****************************************************************************/
#define TRUE 1
#define FALSE 0
#define VOID void
#define PRIVATE static
#define PUBLIC
#define BOOL short
#define BYTE char
#define UBYTE unsigned char
#define WORD signed short
#define UWORD unsigned short
#define LONG signed long
#define ULONG unsigned long
#endif /* WWTYPES_H */

10
WINVQ/LIB/README.TXT Normal file
View File

@@ -0,0 +1,10 @@
Library naming convention.
nnnssctm.lib
Where:
nnn = ID (such as 'VQA') 3 characters
ss = Size field (32bit / 16bit) 2 characters
c = Compiler name (W = Watcom, B = Borland)
t = Compiler type (P = "C++", C = Standard "C")
m = Memory model (F = flat, T = TNT)

BIN
WINVQ/LIB/SOSDBLC.LIB Normal file

Binary file not shown.

BIN
WINVQ/LIB/SOSDW1CR.LIB Normal file

Binary file not shown.

BIN
WINVQ/LIB/SOSDW1CS.LIB Normal file

Binary file not shown.

BIN
WINVQ/LIB/SOSDW1PR.LIB Normal file

Binary file not shown.

BIN
WINVQ/LIB/SOSDW1PS.LIB Normal file

Binary file not shown.

BIN
WINVQ/LIB/SOSMBLC.LIB Normal file

Binary file not shown.

9
WINVQ/VPLAY32/BCC32.CFG Normal file
View File

@@ -0,0 +1,9 @@
-c
-3
-d
-H=c:\projects\vplay32\obj\headers.sym
-wpro
-weas
-wpre
-IC:\PROJECTS\INCLUDE;C:\DEV\BC4\INCLUDE;C:\DEV\TNT\INCLUDE
-DPHARLAP_TNT=1

BIN
WINVQ/VPLAY32/CAPTION.FNT Normal file

Binary file not shown.

BIN
WINVQ/VPLAY32/EVA.FNT Normal file

Binary file not shown.

165
WINVQ/VPLAY32/MAKEFILE Normal file
View File

@@ -0,0 +1,165 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for test program
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!ifndef %PRJ || %PRJVCS || %WATCOM
!error Environment not configured.
!endif
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECT DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = VPLAY4GW
PRJDIR = $(%PRJ)\VPLAY32
OBJECTS = &
plyvqa32.obj
#LIBRARYS = vqm32w.lib vqa32w.lib sosdw1cs.lib
LIBRARYS = vqm32wp.lib vqa32wp.lib sosdw1ps.lib
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(%PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(%PRJ)\LIB;$(%WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(%PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# TOOLS, COMMANDS AND CONFIGURATIONS
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5s -mf -oaeilrt -s -zq -d2
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q /t
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(LINK_CFG) $(PRJNAME).exe .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
.asm.obj :
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
#----------------------------------------------------------------------------
# BUILD THE APPLICATION
#----------------------------------------------------------------------------
$(PRJNAME).exe : $(OBJECTS) $(LIBRARYS) $(LINK_CFG)
$(LINK_CMD) @$(LINK_CFG)
#----------------------------------------------------------------------------
# LINKER CONFIGURATION
#----------------------------------------------------------------------------
$(LINK_CFG) : makefile
@echo Updating $(LINK_CFG)!
@%create $(LINK_CFG)
@%write $(LINK_CFG) SYSTEM dos4g
@%write $(LINK_CFG) OPTION map
@%write $(LINK_CFG) NAME $(PRJNAME)
@%write $(LINK_CFG) DEBUG ALL
@%write $(LINK_CFG) LIBPATH $(LIBPATH)
@for %i in ($(OBJECTS)) do @%write $(LINK_CFG) FILE $(path_obj)\%i
@for %i in ($(LIBRARYS)) do @%write $(LINK_CFG) LIBRARY %i

217
WINVQ/VPLAY32/MAKEFILE.BOR Normal file
View File

@@ -0,0 +1,217 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VPlay32 - VQA player (32-bit protected mode)
#
# FILE
# Makefile
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 9, 1995
#
# ENVIROMENT
# PRJ = Root projects path
# PRJVCS = Root path for projects version control archive
# BCDIR = Root Borland installation path
# TNTDIR = Root Pharlap TNT-DOS Extender path
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!if !$d(PRJ) || !$d(PRJVCS) || !$d(BCDIR) || !$d(TNTDIR)
!error Environment not configured.
!endif
.AUTODEPEND
#----------------------------------------------------------------------------
# PROJECT DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = vplaytnt
PRJDIR = $(PRJ)\VPLAY32
OBJECTS = \
obj\plyvqa32.obj \
PRJLIBS = \
vqa32bp.lib \
vqm32bp.lib \
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!if $d(LIB)
LIBPATH = $(PRJ)\LIB;$(LIB)
!else
LIBPATH = $(PRJ)\LIB;$(TNTDIR)\LIB;$(BCDIR)\LIB
!endif
!if $d(INCLUDE)
INCLUDEPATH = $(PRJ)\INCLUDE;$(INCLUDE)
!else
INCLUDEPATH = $(PRJ)\INCLUDE;$(TNTDIR)\INCLUDE;$(BCDIR)\INCLUDE
!endif
.path.asm = $(PRJDIR)
.path.c = $(PRJDIR)
.path.cpp = $(PRJDIR)
.path.h = $(PRJDIR)
.path.def = $(PRJDIR)
.path.exe = $(PRJDIR)
.path.obj = $(PRJDIR)\OBJ
.path.sym = $(PRJDIR)\OBJ
.path.map = $(PRJDIR)\OBJ
.path.lib = $(PRJ)\LIB
#----------------------------------------------------------------------------
# TOOLS, COMMANDS AND CONFIGURATIONS
#----------------------------------------------------------------------------
CC_CMD = bcc32
ASM_CMD = tasm32
LINK_CMD = tlink32
LIB_CMD = tlib
TNT_CMD = cfig386
CC_CFG = bcc32.cfg
ASM_CFG = tasm32.cfg
LINK_CFG = tlink32.cfg
LIB_CFG = tlib.cfg
CFG_FILES = $(CC_CFG) $(ASM_CFG) $(LINK_CFG) $(LIB_CFG)
TNT_FLAGS = -minreal 256
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all: $(PRJNAME).exe
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj:
$(CC_CMD) -P- -n$(.path.obj) {$< }
.cpp.obj:
$(CC_CMD) -P -n$(.path.obj) {$< }
.asm.obj:
$(ASM_CMD) @$(ASM_CFG) $<,$(.path.obj)\$&
#----------------------------------------------------------------------------
# BUILD THE APPLICATION
#----------------------------------------------------------------------------
$(PRJNAME).exe: $(OBJECTS) $(PRJLIBS) $(PRJNAME).def
$(LINK_CMD) @&&|
c0x32.obj+
$(OBJECTS)
$(.path.exe)\$(PRJNAME).exe
$(.path.map)\$(PRJNAME).map
$(PRJLIBS)+
dos32.lib+
dosx32.lib+
errno.lib+
import32.lib+
cw32.lib
$(.path.def)\$(PRJNAME).def
|
$(TNT_CMD) $(PRJNAME) $(TNT_FLAGS)
#----------------------------------------------------------------------------
# ALL OBJECTS DEPEND ON THE CONFIGURATION FILES
#----------------------------------------------------------------------------
$(OBJECTS): $(CFG_FILES)
#----------------------------------------------------------------------------
# COMPILER CONFIGURATION
#----------------------------------------------------------------------------
$(CC_CFG): makefile
copy &&|
-c
-3
-d
-H=$(.path.sym)\headers.sym
-wpro
-weas
-wpre
-I$(INCLUDEPATH)
-DPHARLAP_TNT=1
#-v
| $(CC_CFG)
#----------------------------------------------------------------------------
# ASSEMBLER CONFIGURATION
#----------------------------------------------------------------------------
$(ASM_CFG): makefile
copy &&|
/la
/t
/m
/w+
/jJUMPS
/ml
/p
/z
/i$(PRJ)\INCLUDE
/zi
| $(ASM_CFG)
#----------------------------------------------------------------------------
# LINKER CONFIGURATION
#----------------------------------------------------------------------------
$(LINK_CFG): makefile
copy &&|
/c
/m
/Gm
-L$(LIBPATH)
-v
| $(LINK_CFG)
#----------------------------------------------------------------------------
# LIBRARIAN CONFIGURATION
#----------------------------------------------------------------------------
$(LIB_CFG): makefile
copy &&|
/C /E
| $(LIB_CFG)

165
WINVQ/VPLAY32/MAKEFILE.WAT Normal file
View File

@@ -0,0 +1,165 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for test program
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!ifndef %PRJ || %PRJVCS || %WATCOM
!error Environment not configured.
!endif
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECT DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = VPLAY4GW
PRJDIR = $(%PRJ)\VPLAY32
OBJECTS = &
plyvqa32.obj
#LIBRARYS = vqm32w.lib vqa32w.lib sosdw1cs.lib
LIBRARYS = vqm32wp.lib vqa32wp.lib sosdw1ps.lib
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(%PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(%PRJ)\LIB;$(%WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(%PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# TOOLS, COMMANDS AND CONFIGURATIONS
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5s -mf -oaeilrt -s -zq
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q /t
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(LINK_CFG) $(PRJNAME).exe .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
.asm.obj :
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
#----------------------------------------------------------------------------
# BUILD THE APPLICATION
#----------------------------------------------------------------------------
$(PRJNAME).exe : $(OBJECTS) $(LIBRARYS) $(LINK_CFG)
$(LINK_CMD) @$(LINK_CFG)
#----------------------------------------------------------------------------
# LINKER CONFIGURATION
#----------------------------------------------------------------------------
$(LINK_CFG) : makefile
@echo Updating $(LINK_CFG)!
@%create $(LINK_CFG)
@%write $(LINK_CFG) SYSTEM dos4g
@%write $(LINK_CFG) OPTION map
@%write $(LINK_CFG) NAME $(PRJNAME)
@%write $(LINK_CFG) DEBUG ALL
@%write $(LINK_CFG) LIBPATH $(LIBPATH)
@for %i in ($(OBJECTS)) do @%write $(LINK_CFG) FILE $(path_obj)\%i
@for %i in ($(LIBRARYS)) do @%write $(LINK_CFG) LIBRARY %i

1019
WINVQ/VPLAY32/PLYVQA32.CPP Normal file

File diff suppressed because it is too large Load Diff

10
WINVQ/VPLAY32/TASM32.CFG Normal file
View File

@@ -0,0 +1,10 @@
/la
/t
/m
/w+
/jJUMPS
/ml
/p
/z
/iC:\PROJECTS\INCLUDE
/zi

1
WINVQ/VPLAY32/TLIB.CFG Normal file
View File

@@ -0,0 +1 @@
/C /E

View File

@@ -0,0 +1,5 @@
/c
/m
/Gm
-LC:\PROJECTS\LIB;C:\DEV\BC4\LIB
-v

View File

@@ -0,0 +1 @@
stub 'gotnt.exe'

2285
WINVQ/VQA32/AUDIO.CPP Normal file

File diff suppressed because it is too large Load Diff

9
WINVQ/VQA32/BCC32.CFG Normal file
View File

@@ -0,0 +1,9 @@
-c
-3
-d
-H=c:\projects\vqa32\obj\headers.sym
-wpro
-weas
-wpre
-IC:\PROJECTS\INCLUDE;C:\DEV\BC4\INCLUDE;C:\DEV\TNT\INCLUDE
-DPHARLAP_TNT=1

403
WINVQ/VQA32/CAPTION.CPP Normal file
View File

@@ -0,0 +1,403 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library (32 bit protected mode)
*
* FILE
* caption.c
*
* DESCRIPTION
* Text caption process/display manager.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 26, 1995
*
****************************************************************************/
#include <mem.h>
#include <malloc.h>
#include <vqm32\font.h>
#include <vqm32\text.h>
#include <vqm32\graphics.h>
#include <vqm32\captoken.h>
#include "caption.h"
#if( VQACAPTIONS_ON )
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
#define NUM_NODES 3
/* Function prototypes. */
static CaptionNode *AddCaptionNode(CaptionList *list, CaptionText *captext);
static void RemCaptionNode(CaptionList *list, CaptionNode *node);
/****************************************************************************
*
* NAME
* OpenCaptions - Initialize the caption system.
*
* SYNOPSIS
* OpenCaptions(Captions, Font)
*
* CaptionInfo *OpenCaptions(void *, void *);
*
* FUNCTION
* Allocate and initialize resources used by the caption system.
*
* INPUTS
* Captions - Captions to process.
* Font - Font to use to display captions.
*
* RESULT
* CaptionInfo - Caption information structure.
*
* SEE ALSO
* CloseCaption
*
****************************************************************************/
CaptionInfo *OpenCaptions(void *captions, void *font)
{
CaptionInfo *cap = NULL;
CaptionNode *node;
FontInfo *fi;
long i;
/* Allocate memory for the captioning system. */
cap = (CaptionInfo *)malloc(sizeof(CaptionInfo) + (sizeof(CaptionNode)
* NUM_NODES));
if (cap != NULL) {
memset(cap,0,(sizeof(CaptionInfo) + (sizeof(CaptionNode) * NUM_NODES)));
cap->Buffer = captions;
cap->Next = (CaptionText *)captions;
/* Initialize font */
fi = (FontInfo *)((char *)font + ((Font *)font)->InfoBlk);
cap->Font = font;
cap->FontHeight = fi->MaxHeight;
cap->FontWidth = fi->MaxWidth;
/* Initialize list header. */
cap->List.Head = (CaptionNode *)&cap->List.Tail;
cap->List.Tail = NULL;
cap->List.TailPred = (CaptionNode *)&cap->List.Head;
/* Link nodes. */
node = (CaptionNode *)((char *)cap + sizeof(CaptionInfo));
for (i = 0; i < NUM_NODES; i++) {
node->Succ = cap->List.Head;
cap->List.Head = node;
node->Pred = (CaptionNode *)&cap->List.Head;
node->Succ->Pred = node;
/* Next node. */
node = (CaptionNode *)((char *)node + sizeof(CaptionNode));
}
}
return (cap);
}
/****************************************************************************
*
* NAME
* CloseCaptions - Shutdown the caption system.
*
* SYNOPSIS
* CloseCaptions(CaptionInfo)
*
* void CloseCaptions(CaptionInfo *);
*
* FUNCTION
* Free the resources allocated by the caption system.
*
* INPUTS
* CaptionInfo - Caption information structure.
*
* RESULT
* NONE
*
* SEE ALSO
* OpenCaptions
*
****************************************************************************/
void CloseCaptions(CaptionInfo *cap)
{
free(cap);
}
/****************************************************************************
*
* NAME
* DoCaption - Process and display caption text.
*
* SYNOPSIS
* DoCaption(Captions, Frame)
*
* void DoCaption(CaptionInfo *, unsigned long);
*
* FUNCTION
* Process the caption events.
*
* INPUTS
* Captions - Pointer to CaptionInfo structure.
* Frame - Current frame number being processed.
*
* RESULT
* NONE
*
****************************************************************************/
void DoCaptions(CaptionInfo *cap, unsigned long frame)
{
CaptionText *captext;
CaptionNode *node;
void const *oldfont;
long width;
long i;
/* Initialize variables. */
oldfont = Set_Font((char *)cap->Font);
/*-------------------------------------------------------------------------
* Process the captions that are on the active queue.
*-----------------------------------------------------------------------*/
node = cap->List.Head;
while ((node->Succ != NULL) && (node->Flags & CNF_USED)) {
captext = node->Captext;
/* Clear the any previous captions that have expired. */
if (captext->OffFrame <= frame) {
Fill_Rect(captext->Xpos, captext->Ypos,
(captext->Xpos + node->BoundW - 1),
(captext->Ypos + node->BoundH - 1), 0);
/* Remove the caption from the active list. */
node = node->Pred;
RemCaptionNode(&cap->List, node->Succ);
} else {
if (captext->CPF != 0) {
/* If a NULL terminator is not found then display the next set of
* characters, otherwise remove the node.
*/
if (*node->Char != 0) {
Set_Font_Palette_Range(&captext->BgPen, 0, 1);
for (i = 0; i < captext->CPF; i++) {
/* Check for terminator. */
if (*node->Char == 0) {
captext->CPF = 0;
break;
}
/* Check for newline. */
else if (*node->Char == 0x0D) {
node->Char++;
node->CurX = captext->Xpos;
node->CurY += cap->FontHeight;
node->BoundH += cap->FontHeight;
}
Draw_Char(*node->Char, node->CurX, node->CurY);
node->CurX += Char_Pixel_Width(*node->Char);
node->Char++;
}
}
} else if (captext->Flags & CTF_FLASH) {
if (frame & 4) {
Fill_Rect(captext->Xpos, captext->Ypos,
(captext->Xpos + node->BoundW - 1),
(captext->Ypos + node->BoundH - 1), 0);
} else {
Text_Print(captext->Text, captext->Xpos, captext->Ypos,
captext->FgPen, captext->BgPen);
}
}
}
/* Next node. */
node = node->Succ;
}
/*-------------------------------------------------------------------------
* Process any captions that are waiting to be activated.
*-----------------------------------------------------------------------*/
captext = cap->Next;
while (captext->OnFrame <= frame) {
width = String_Pixel_Width(captext->Text);
switch (captext->Flags & CTF_JUSTIFY) {
case CTF_RIGHT:
captext->Xpos = (319 - width);
break;
case CTF_LEFT:
captext->Xpos = 0;
break;
case CTF_CENTER:
captext->Xpos = (160 - (width / 2));
break;
default:
break;
}
/* Display the text and record its bounding box. */
if (captext->CPF == 0) {
i = Text_Print(captext->Text, captext->Xpos, captext->Ypos,
captext->FgPen, captext->BgPen);
node = AddCaptionNode(&cap->List, captext);
node->BoundW = width;
node->BoundH = (cap->FontHeight * i);
} else {
node = AddCaptionNode(&cap->List, captext);
node->BoundW = width;
node->BoundH = cap->FontHeight;
}
/* Next */
cap->Next = (CaptionText *)(((char *)captext) + captext->Size);
captext = cap->Next;
}
Set_Font(oldfont);
}
/****************************************************************************
*
* NAME
* AddCaptionNode - Add a caption to the processing list.
*
* SYNOPSIS
* Node = AddCaptionNode(List, Caption)
*
* CaptionNode *AddCaptionNode(CaptionList *, CaptionText *);
*
* FUNCTION
* Add a caption the caption processing list.
*
* INPUTS
* List - Caption processing list.
* Caption - Caption to add to the list.
*
* RESULT
* Node - Pointer to node, otherwise NULL if error.
*
****************************************************************************/
static CaptionNode *AddCaptionNode(CaptionList *list, CaptionText *captext)
{
CaptionNode *node = NULL;
/* If this list is not full. */
node = list->TailPred;
if (!(node->Flags & CNF_USED)) {
/* Remove the node from the tail. */
node->Pred->Succ = node->Succ;
list->TailPred = node->Pred;
node->Flags |= CNF_USED;
node->Captext = captext;
node->Char = captext->Text;
node->CurX = captext->Xpos;
node->CurY = captext->Ypos;
/* Add the node to the head. */
node->Succ = list->Head;
list->Head = node;
node->Pred = (CaptionNode *)&list->Head;
node->Succ->Pred = node;
}
return (node);
}
/****************************************************************************
*
* NAME
* RemCaptionNode - Remove a caption from the processing list.
*
* SYNOPSIS
* RemCaptionNode(List, Node)
*
* void RemCaptionNode(CaptionList *, CaptionNode *);
*
* FUNCTION
* Remove the caption from the processing list. Mark the node as unused
* and put it at the tail of the list.
*
* INPUTS
* List - Caption processing list.
* Node - Caption node to remove.
*
* RESULT
* NONE
*
****************************************************************************/
static void RemCaptionNode(CaptionList *list, CaptionNode *node)
{
/* If the nodes successor is null then we are at the tail. */
if (node->Succ != NULL) {
/* Mark the node as unused. */
node->Flags = 0;
/* Relink the node to the tail. */
node->Succ->Pred = node->Pred;
node->Pred->Succ = node->Succ;
node->Succ = (CaptionNode *)&list->Tail;
node->Pred = list->TailPred;
list->TailPred->Succ = node;
list->TailPred = node;
}
}
#endif // VQACAPTIONS_ON


124
WINVQ/VQA32/CAPTION.H Normal file
View File

@@ -0,0 +1,124 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQACAPTION_H
#define VQACAPTION_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library (32 bit protected mode)
*
* FILE
* caption.h
*
* DESCRIPTION
* Text caption definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 26, 1995
*
****************************************************************************/
#define VQACAPTIONS_ON 0
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* CaptionNode: Node describing a caption to process.
*
* Succ - Pointer to the next node in the list (successor).
* Pred - Pointer to the previous node in the list (predecessor).
* Flags - Status flags.
* CapText - Pointer to the CaptionText being processed.
* Char - Pointer to current character in the string.
* CurX - Current X position.
* CurY - Current Y position.
* BoundW - Bounding width of text.
* BoundH - Bounding height of text.
*/
typedef struct _CaptionNode {
struct _CaptionNode *Succ;
struct _CaptionNode *Pred;
unsigned short Flags;
CaptionText *Captext;
char *Char;
unsigned short CurX;
unsigned short CurY;
unsigned short BoundW;
unsigned short BoundH;
} CaptionNode;
/* CaptionNode flag definitions. */
#define CNB_USED 0 /* This node is being used. */
#define CNF_USED (1<<CNB_USED)
/* CaptionList: Double linked list of outstanding captions to process.
*
* Head - Pointer to the first node in the list.
* Tail - Always NULL
* TailPred - Pointer to the last node in the list.
*/
typedef struct _CaptionList {
CaptionNode *Head;
CaptionNode *Tail;
CaptionNode *TailPred;
} CaptionList;
/* CaptionInfo:
*
* Next - Pointer to the next caption to be processed.
* List - List of pending captions to process.
* Font - Font to use for this caption.
* BoundX - X position of bounding box.
* BoundY - Y position of bounding box.
* BoundW - Width of bounding box.
* BoundH - Height of bounding box.
* Buffer - Caption chunk buffer.
*/
typedef struct _CaptionInfo {
CaptionText *Next;
CaptionList List;
void *Font;
char FontHeight;
char FontWidth;
void *Buffer;
} CaptionInfo;
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
CaptionInfo *OpenCaptions(void *captions, void *font);
void CloseCaptions(CaptionInfo *cap);
void DoCaptions(CaptionInfo *cap, unsigned long frame);
#endif /* VQACAPTION_H */


519
WINVQ/VQA32/CONFIG.CPP Normal file
View File

@@ -0,0 +1,519 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* config.c
*
* DESCRIPTION
* Player configuration routines.
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_INIConfig - Initialize VQAConfig structure with INI settings.
* VQA_DefaultConfig - Initialize VQAConfig structure with defaults.
*
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vqaplayp.h"
#include <vqm32\all.h>
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
/* Default configuration structure. */
static VQAConfig _defaultconfig = {
/* DrawerCallback: This is a function that is called for every frame
* in the movie.
*/
NULL,
/* EventHandler: This is a function that is called for every event that
* the client requested to be notified about.
*/
NULL,
/* NotifyFlags: Flags representing the events the client wishes to be
* notified about during playback.
*/
NULL,
/* Vmode: Video mode to use. */
MCGA,
/* VBIBit: Vertical blank bit polarity. */
-1,
/* ImageBuf: Pointer to image buffer to draw into. */
NULL,
/* ImageWidth, ImageHeight: Width and height dimensions of image buffer.
* A width and height value of -1 tells the player to consider the image
* buffer as having the same dimensions as the frames in the movie.
*/
320, 200, /* Image width and height */
/* X1, Y1: These are the coordinates to put the movies frame in the image
* buffer. Values of -1 tell the drawer to center the frames in the buffer.
*/
-1, -1,
/* FrameRate: The rate to load the frames at. A value of -1 tells the
* player to use the framerate of the movie.
*/
-1,
/* DrawRate: The rate to draw the frames at. A value of -1 tells the
* player to use the framerate of the movie. A value of 0 tells the player
* to use a fixed rate based on the frame size.
*/
-1,
/* TimerMethod: Timer method to use for playback. */
-1,
/* DrawFlags: Various drawing related flags. */
0,
/* OptionFlags: Various player options. */
VQAOPTF_AUDIO,
/* NumFrameBufs: The number of frame buffers to allocate/use. */
6,
/* NumCBBufs: The number of codebook buffers to allocate/use. */
3,
#if (VQADIRECT_SOUND)
/* -----------------12/15/95 10:40AM-----------------
* SoundObject - ptr to games direct sound object. Null if VQ should create
* --------------------------------------------------*/
NULL,
/* -----------------12/15/95 10:41AM-----------------
* PrimaryBufferPtr - ptr to games primary sound buffer. Null if VQ should create
* --------------------------------------------------*/
NULL,
#endif //(VQADIRECT_SOUND)
/* VocFile: Filename of audio track override. A value of 0 tells the
* player not to override the movies audio track.
*/
NULL,
/* AudioBuf: Audio buffer to use. A value of 0 tells the player that
* it has to allocate a buffer itself.
*/
NULL,
/* AudioBufSize: Size of audio buffer to use/allocate. A value of -1
* tells the player to compute the buffer size from the audio
* information in the movie.
*/
-1,
/* AudioRate: Audio playback rate in samples per second. A value of -1
* tells the player to use the audio rate of the movie.
*/
-1,
/* Volume: Volume level to playback audio track. */
0x00FF,
/* HMIBufSize: Size of HMIs internal buffer. */
#if (VQADIRECT_SOUND)
8192L,
#else
2048L,
#endif
/* DigiHandle: Handle to an initialized HMI sound driver. A value of -1
* tells the player it must initialize the HMI sound driver itself.
*/
-1,
/* DigiCard: HMI ID of audio card to use. A value of 0 tells the player
* not to use any card. A value of -1 tells the player to autodetect the
* card in the system.
*/
-1,
/* DigiPort: Port address of the sound card. A value of -1 tells the player
* to autodetect this address.
*/
-1,
/* DigiIRQ: Interrupt number of sound card. A value of -1 tells the player
* to autodetect the interrupt used by the card.
*/
-1,
/* DigiDMA: DMA channel of the sound card. A value of -1 tells the player
* to autodetect the channel used by the card.
*/
-1,
/* Language: Prefered language. */
0,
/* CaptionFont: Caption text font. */
NULL,
/* EVAFont: EVA text font. */
NULL,
};
/* Supported video modes. */
#if(VQAVIDEO_ON)
enum VMTAGS {
VMTAG_NONE = 0,
#if(VQAMCGA_ON)
VMTAG_MCGA,
VMTAG_MCGA_BUF,
#endif
#if(VQAXMODE_ON)
VMTAG_XMODE320X200,
VMTAG_XMODE320X200_BUF,
VMTAG_XMODE320X200_VRAM,
VMTAG_XMODE320X240,
VMTAG_XMODE320X240_BUF,
VMTAG_XMODE320X240_VRAM,
#endif
#if(VQAVESA_ON)
VMTAG_VESA640X480_BUF,
VMTAG_VESA640X480_X2,
VMTAG_VESA320X200,
VMTAG_VESA320X200_BUF,
#endif
};
typedef struct _VideoModeTag {
char const *token;
long id;
} VideoModeTag;
VideoModeTag VideoModeTags[] = {
{"NONE",VMTAG_NONE},
#if(VQAMCGA_ON)
{"MCGA", VMTAG_MCGA},
{"MCGA_BUF",VMTAG_MCGA_BUF},
#endif /* VQAMCGA_ON */
#if(VQAXMODE_ON)
{"XMODE_320X200", VMTAG_XMODE320X200},
{"XMODE_320X200_BUF", VMTAG_XMODE320X200_BUF},
{"XMODE_320X200_VRAM",VMTAG_XMODE320X200_VRAM},
{"XMODE_320X240", VMTAG_XMODE320X240},
{"XMODE_320X240_BUF", VMTAG_XMODE320X240_BUF},
{"XMODE_320X240_VRAM",VMTAG_XMODE320X240_VRAM},
#endif /* VQAXMODE_ON */
#if(VQAVESA_ON)
{"VESA_640X480_BUF",VMTAG_VESA640X480_BUF},
{"VESA_640X480_X2", VMTAG_VESA640X480_X2},
{"VESA_320X200", VMTAG_VESA320X200},
{"VESA_320X200_BUF",VMTAG_VESA320X200_BUF},
#endif /* VQAVESA_ON */
{NULL, NULL}
};
#endif /* VQAVIDEO_ON */
/****************************************************************************
*
* NAME
* VQA_INIConfig - Initialize VQAConfig structure with INI settings.
*
* SYNOPSIS
* VQA_INIConfig(Config)
*
* void VQA_INIConfig(VQAConfig *);
*
* FUNCTION
* Initializes the configuration structure from the player INI file.
*
* INPUTS
* Config - Pointer to VQAConfig structure.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_INIConfig(VQAConfig *config)
{
char *ininame;
char buf[80];
long i;
/* Set all Config entries to 0. */
memset(config, 0, sizeof(VQAConfig));
/* Retrieve player INI filename from an enviroment variable if
* it is provided.
*/
if ((ininame = getenv("VQACFG")) == NULL) {
ininame = "PLAYER.INI";
}
/*-------------------------------------------------------------------------
* VIDEO MODE AND DRAW FLAGS
*-----------------------------------------------------------------------*/
#if(VQAVIDEO_ON)
/* Get video mode from INI */
GetINIString("Player", "PlayerMode", "MCGA", buf, 80, ininame);
/* Search supported modes for a match. */
i = 0;
while (VideoModeTags[i].token != NULL) {
if (stricmp(buf, VideoModeTags[i].token) == 0) {
break;
}
i++;
}
/* Setup for requested mode */
switch (VideoModeTags[i].id) {
/* MCGA direct */
#if(VQAMONO_ON)
case VMTAG_MCGA:
config->Vmode = MCGA;
break;
/* MCGA buffered */
case VMTAG_MCGA_BUF:
config->Vmode = MCGA;
config->DrawFlags |= VQACFGF_BUFFER;
break;
#endif /* VQAMCGA_ON */
/* XMODE direct (320x200) */
#if(VQAXMODE_ON)
case VMTAG_XMODE320X200:
config->Vmode = XMODE_320X200;
break;
/* XMODE buffered (320x200) */
case VMTAG_XMODE320X200_BUF:
config->Vmode = XMODE_320X200;
config->DrawFlags |= VQACFGF_BUFFER;
break;
/* XMODE VRAM codebook (320x200) */
case VMTAG_XMODE320X200_VRAM:
config->Vmode = XMODE_320X200;
config->DrawFlags |= VQACFGF_VRAMCB;
break;
/* XMODE direct (320x240) */
case VMTAG_XMODE320X240:
config->Vmode = XMODE_320X240;
break;
/* XMODE buffered (320x240) */
case VMTAG_XMODE320X240_BUF:
config->Vmode = XMODE_320X240;
config->DrawFlags |= VQACFGF_BUFFER;
break;
/* XMODE VRAM codebook (320x240) */
case VMTAG_XMODE320X240_VRAM:
config->Vmode = XMODE_320X240;
config->DrawFlags |= VQACFGF_VRAMCB;
break;
#endif /* VQAXMODE_ON */
/* VESA buffered (640x480_256) */
#if(VQAVESA_ON)
case VMTAG_VESA640X480_BUF:
config->Vmode = VESA_640X480_256;
config->DrawFlags |= VQACFGF_BUFFER;
break;
/* VESA buffered scaled (640x480_256) */
case VMTAG_VESA640X480_X2:
config->Vmode = VESA_640X480_256;
config->DrawFlags |= (VQACFGF_BUFFER|VQACFGF_SCALEX2);
break;
/* VESA direct (320x200_32k) */
case VMTAG_VESA320X200:
config->Vmode = VESA_320X200_32K_1;
break;
/* VESA buffered (320x200_32k) */
case VMTAG_VESA320X200_BUF:
config->Vmode = VESA_320X200_32K_1;
config->DrawFlags |= VQACFGF_BUFFER;
break;
#endif /* VQAVESA_ON */
/* Default to MCGA direct */
VMTAG_NONE:
default:
config->Vmode = MCGA;
break;
}
#endif /* VQAVIDEO_ON */
/* Get framerate and drawrate. */
GetINIString("Player", "FrameRate", "-1", buf, 80, ininame);
config->FrameRate = atoi(buf);
GetINIString("Player", "DrawRate", "Variable", buf, 80, ininame);
if (!stricmp(buf, "Variable")) {
config->DrawRate = -1;
} else {
config->DrawRate = 0;
}
/*-------------------------------------------------------------------------
* AUDIO SETTINGS
*-----------------------------------------------------------------------*/
GetINIString("Player", "AudioRate", "-1", buf, 80, ininame);
config->AudioRate = atoi(buf);
/* OptionFlags */
GetINIString("Player", "SoundEnabled", "True", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_AUDIO;
} else {
config->OptionFlags &= (~VQAOPTF_AUDIO);
}
/* Default audio settings. */
config->AudioBufSize = 32768U;
config->HMIBufSize = 2048;
config->DigiHandle = -1;
config->Volume = 0x00FF;
config->DigiCard = 0xFFFF;
config->DigiPort = -1;
config->DigiIRQ = -1;
config->DigiDMA = -1;
/* Configure sound hardware */
GetINIString("Player", "Port", "-1", buf, 80, ininame);
if (!stricmp(buf, "-1")) {
config->DigiPort = -1;
} else {
sscanf(buf, "%x", &config->DigiPort);
}
GetINIString("Player", "IRQ", "-1", buf, 80, ininame);
config->DigiIRQ = atoi(buf);
GetINIString("Player", "DMA", "-1", buf, 80, ininame);
config->DigiDMA = atoi(buf);
/*-------------------------------------------------------------------------
* GENERAL OPTIONS
*-----------------------------------------------------------------------*/
/* Enable/Disable single stepping */
GetINIString("Player", "SingleStep", "False", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_STEP;
config->DrawFlags |= VQACFGF_NOSKIP;
} else {
config->OptionFlags &= (~VQAOPTF_STEP);
}
/* Enable/Disable Slowpalette */
GetINIString("Player", "SlowPalette", "False", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_SLOWPAL;
} else {
config->OptionFlags &= (~VQAOPTF_SLOWPAL);
}
/* Enable/Disable monochrome display */
GetINIString("Player", "MonoOutput", "False", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_MONO;
} else {
config->OptionFlags &= (~VQAOPTF_MONO);
}
/* Frame and codebook buffers */
config->NumFrameBufs = 6;
config->NumCBBufs = 3;
}
/****************************************************************************
*
* NAME
* VQA_DefaultConfig - Initialize VQAConfig structure with defaults.
*
* SYNOPSIS
* VQA_DefaultConfig(Config);
*
* void VQA_DefaultConfig(VQAConfig *);
*
* FUNCTION
* Initialize configuration with default settings.
*
* INPUTS
* Config - Pointer to VQA configuration structure.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_DefaultConfig(VQAConfig *config)
{
memcpy(config, &_defaultconfig, sizeof(VQAConfig));
}

2442
WINVQ/VQA32/DRAWER.CPP Normal file

File diff suppressed because it is too large Load Diff

188
WINVQ/VQA32/DSTREAM.CPP Normal file
View File

@@ -0,0 +1,188 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQAPlay32 library.
*
* FILE
* dstream.c
*
* DESCRIPTION
* DOS IO handler.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_InitAsDOS - Initialize IO with the standard DOS handler.
*
* PRIVATE
* VQADOSHandler - Standard DOS IO handler.
*
****************************************************************************/
#include <fcntl.h>
#include <io.h>
#include "vqaplayp.h"
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
static long VQADOSHandler(VQAHandle *vqa, long action, void *buffer,
long nbytes);
/****************************************************************************
*
* NAME
* VQA_InitAsDOS - Initialize IO with the standard DOS handler.
*
* SYNOPSIS
* VQA_InitAsDOS(VQA)
*
* VQA_InitAsDOS(VQAHandle *);
*
* FUNCTION
* Initialize the IO of the specified handle as a standard DOS access.
*
* INPUTS
* VQA - Pointer to VQAHandle to initialize as DOS.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_InitAsDOS(VQAHandle *vqa)
{
((VQAHandleP *)vqa)->IOHandler = VQADOSHandler;
}
/****************************************************************************
*
* NAME
* VQADOSHandler - Standard DOS IO handler.
*
* SYNOPSIS
* Error = VQADOSHandler(VQA, Action, Buffer, NBytes)
*
* unsigned long VQADOSHandler(VQAHandle *, long, long, long);
*
* FUNCTION
* Perform the requested action on the standard DOS file system.
*
* INPUTS
* VQA - VQAHandle to operate on.
* Action - Action to perform.
* Buffer - Buffer to Read/Write to/from.
* NBytes - Number of bytes to operate on.
*
* RESULT
* Error - 0 if successful, otherwise error.
*
****************************************************************************/
static long VQADOSHandler(VQAHandle *vqa, long action, void *buffer,
long nbytes)
{
long fh;
long error;
fh = vqa->VQAio;
/* Perform the action specified by the IO command */
switch (action) {
/* VQACMD_READ means read NBytes and place it in the memory
* pointed to by Buffer.
*
* Any error code returned will be remapped by VQA library into
* VQAERR_READ.
*/
case VQACMD_READ:
error = (read(fh, buffer, nbytes) != nbytes);
break;
/* VQACMD_WRITE is analogous to VQACMD_READ.
*
* Writing is not allowed to the VQA file, VQA library will remap the
* error into VQAERR_WRITE.
*/
case VQACMD_WRITE:
error = 1;
break;
/* VQACMD_SEEK asks that you perform a seek relative to the current
* position. NBytes is a signed number, indicating seek direction
* (positive for forward, negative for backward). Buffer has no meaning
* here.
*
* Any error code returned will be remapped by VQA library into
* VQAERR_SEEK.
*/
case VQACMD_SEEK:
error = (lseek(fh, nbytes, (long)buffer) == -1);
break;
/* VQACMD_OPEN asks that you open the file for access. */
case VQACMD_OPEN:
error = open((char *)buffer, (O_RDONLY|O_BINARY));
if (error != -1) {
vqa->VQAio = error;
error = 0;
}
break;
case VQACMD_CLOSE:
close(fh);
error = 0;
break;
/* VQACMD_INIT means to prepare your IO for reading. This is used for
* certain IOs that can't be read immediately upon opening, and need
* further preparation. This operation is allowed to fail; the error code
* will be returned directly to the client.
*/
case VQACMD_INIT:
/* IFFCMD_CLEANUP means to terminate the transaction with the associated
* IO. This is used for IOs that can't simply be closed. This operation
* is not allowed to fail; any error returned will be ignored.
*/
case VQACMD_CLEANUP:
error = 0;
break;
}
return (error);
}

2953
WINVQ/VQA32/LOADER.CPP Normal file

File diff suppressed because it is too large Load Diff

161
WINVQ/VQA32/MAKEFILE Normal file
View File

@@ -0,0 +1,161 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay 32-bit library.
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJ = ..
WATCOM = C:\WATCOM
PRJNAME = vqa32wp
PRJDIR = $(PRJ)\VQA32
OBJECTS = &
config.obj &
task.obj &
loader.obj &
drawer.obj &
audio.obj &
monodisp.obj &
dstream.obj &
unvqbuff.obj &
unvqvesa.obj &
vertag.obj &
caption.obj &
# unvqxmde.obj
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(PRJ)\LIB;$(WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(PRJ)\INCLUDE;$(WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# Tools/commands & configurations
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5r -mf -oaeilrt -s -zq -d1
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /i$(PRJ)\INCLUDE\VQM32 /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(PRJNAME).lib .SYMBOLIC
$(PRJNAME).lib : $(OBJECTS) .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.asm.obj:
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
update: .SYMBOLIC
@echo Updating VQAPlay32 header files!
@copy vqaplay.h ..\include\vqa32 >NUL
@copy vqafile.h ..\include\vqa32 >NUL

162
WINVQ/VQA32/MAKEFILE.BAK Normal file
View File

@@ -0,0 +1,162 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay 32-bit library.
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJ = ..
WATCOM = C:\WATCOM
PRJNAME = vqa32wp
PRJDIR = $(PRJ)\VQA32
OBJECTS = &
config.obj &
task.obj &
loader.obj &
drawer.obj &
audio.obj &
monodisp.obj &
dstream.obj &
unvqbuff.obj &
unvqvesa.obj &
vertag.obj &
caption.obj &
# unvqxmde.obj
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(PRJ)\LIB;$(WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(PRJ)\INCLUDE;$(WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# Tools/commands & configurations
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5r -mf -oaeilrt -s -zq -d2
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /i$(PRJ)\INCLUDE\VQM32 /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(PRJNAME).lib .SYMBOLIC
$(PRJNAME).lib : $(OBJECTS) .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.asm.obj:
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
update: .SYMBOLIC
@echo Updating VQAPlay32 header files!
@copy vqaplay.h ..\include\vqa32 >NUL
@copy vqafile.h ..\include\vqa32 >NUL


216
WINVQ/VQA32/MAKEFILE.BOR Normal file
View File

@@ -0,0 +1,216 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay32 library.
#
# FILE
# makefile (Borland/TNT)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# Feburary 7, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# BCDIR - Borland C installation path.
# TNTDIR - Pharlap/TNT installation path.
#
#****************************************************************************
.AUTODEPEND
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!if !$d(PRJ) || !$d(PRJVCS) || !$d(BCDIR) || !$d(TNTDIR)
!error Environment not configured.
!endif
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = vqa32bp
PRJDIR = $(PRJ)\VQA32
OBJECTS = \
config.obj \
task.obj \
loader.obj \
drawer.obj \
audio.obj \
monodisp.obj \
dstream.obj \
unvqbuff.obj \
unvqvesa.obj \
vertag.obj \
caption.obj \
# unvqxmde.obj \
PRJLIBS = \
vqm32bp.lib \
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!if $d(LIB)
LIBPATH = $(PRJ)\LIB;$(LIB)
!else
LIBPATH = $(PRJ)\LIB;$(TNTDIR)\LIB;$(BCDIR)\LIB
!endif
!if $d(INCLUDE)
INCLUDEPATH = $(PRJ)\INCLUDE;$(INCLUDE)
!else
INCLUDEPATH = $(PRJ)\INCLUDE;$(TNTDIR)\INCLUDE;$(BCDIR)\INCLUDE
!endif
.path.asm = $(PRJDIR)
.path.c = $(PRJDIR)
.path.cpp = $(PRJDIR)
.path.h = $(PRJDIR)
.path.exe = $(PRJDIR)
.path.obj = $(PRJDIR)\OBJ
.path.sym = $(PRJDIR)\OBJ
.path.lib = $(PRJ)\LIB
#----------------------------------------------------------------------------
# TOOLS, COMMAND AND CONFIGURATIONS
#----------------------------------------------------------------------------
CC_CMD = bcc32
ASM_CMD = tasm32
LINK_CMD = tlink32
LIB_CMD = tlib
CC_CFG = bcc32.cfg
ASM_CFG = tasm32.cfg
LINK_CFG = tlink32.cfg
LIB_CFG = tlib.cfg
CFG_FILES = $(CC_CFG) $(ASM_CFG) $(LINK_CFG) $(LIB_CFG)
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all: $(PRJNAME).lib
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj:
$(CC_CMD) -P- -n$(.path.obj) {$< }
.cpp.obj:
$(CC_CMD) -P -n$(.path.obj) {$< }
.asm.obj:
$(ASM_CMD) @$(ASM_CFG) $<,$(.path.obj)\$&
#----------------------------------------------------------------------------
# BUILD LIBRARY
#----------------------------------------------------------------------------
$(PRJNAME).lib: $(OBJECTS)
- @del $(.path.lib)\$(PRJNAME).lib >&NUL
$(LIB_CMD) $(.path.lib)\$(PRJNAME).lib @$(LIB_CFG) @&&|
-+$(**: = -+)
|
- @copy vqaplay.h $(PRJ)\INCLUDE\VQA32 >&NUL
- @copy vqafile.h $(PRJ)\INCLUDE\VQA32 >&NUL
#----------------------------------------------------------------------------
# ALL OBJECTS DEPEND ON THE CONFIGURATION FILES
#----------------------------------------------------------------------------
$(OBJECTS): $(CFG_FILES)
#----------------------------------------------------------------------------
# COMPILER CONFIGURATION
#----------------------------------------------------------------------------
$(CC_CFG): makefile
copy &&|
-c
-3
-d
-H=$(.path.sym)\headers.sym
-wpro
-weas
-wpre
-I$(INCLUDEPATH)
-DPHARLAP_TNT=1
#-v
| $(CC_CFG)
#----------------------------------------------------------------------------
# ASSEMBLER CONFIGURATION
#----------------------------------------------------------------------------
$(ASM_CFG): makefile
copy &&|
/t
/m
/w+
/jJUMPS
/ml
/p
/z
/i$(PRJ)\INCLUDE\VQM32
/zi
/dPHARLAP_TNT=1
| $(ASM_CFG)
#----------------------------------------------------------------------------
# LINKER CONFIGURATION
#----------------------------------------------------------------------------
$(LINK_CFG): makefile
copy &&|
/c
/m
/Gm
-L$(LIBPATH)
-v
| $(LINK_CFG)
#----------------------------------------------------------------------------
# LIBRARIAN CONFIGURATION
#----------------------------------------------------------------------------
$(LIB_CFG): makefile
copy &&|
/C /E
| $(LIB_CFG)

163
WINVQ/VQA32/MAKEFILE.WAT Normal file
View File

@@ -0,0 +1,163 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay 32-bit library.
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!ifndef %PRJ || %PRJVCS || %WATCOM
!error Environment not configured.
!endif
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = vqa32wp
PRJDIR = $(%PRJ)\VQA32
OBJECTS = &
config.obj &
task.obj &
loader.obj &
drawer.obj &
audio.obj &
monodisp.obj &
dstream.obj &
unvqbuff.obj &
unvqvesa.obj &
vertag.obj &
caption.obj &
# unvqxmde.obj
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(%PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(%PRJ)\LIB;$(%WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(%PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# Tools/commands & configurations
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5s -mf -oaeilrt -s -zq
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /i$(%PRJ)\INCLUDE\VQM32 /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(PRJNAME).lib .SYMBOLIC
$(PRJNAME).lib : $(OBJECTS) .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.asm.obj:
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
update: .SYMBOLIC
@echo Updating VQAPlay32 header files!
@copy vqaplay.h ..\include\vqa32 >NUL
@copy vqafile.h ..\include\vqa32 >NUL

512
WINVQ/VQA32/MONODISP.CPP Normal file
View File

@@ -0,0 +1,512 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* monodisp.c
*
* DESCRIPTION
* Monochrome display (debug)
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 6, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_InitMono - Initialize the player's mono screen.
* VQA_UpdateMono - Update the player's mono output.
*
****************************************************************************/
#include <stdio.h>
#include <string.h>
#include "vq.h"
#include "vqaplayp.h"
#include <vqm32\all.h>
#if(VQAMONO_ON)
/* Main window */
#define MAIN_WX1 0
#define MAIN_WX2 79
#define MAIN_WY1 0
#define MAIN_WY2 9
#define MAIN_TITLE "VQA Player"
/* Loader data window */
#define LOADER_WX1 0
#define LOADER_WX2 39
#define LOADER_WY1 10
#define LOADER_WY2 20
#define LOADER_TITLE " Frame Loader "
/* Drawer data window */
#define DRAWER_WX1 40
#define DRAWER_WX2 79
#define DRAWER_WY1 10
#define DRAWER_WY2 20
#define DRAWER_TITLE " Frame Drawer "
/* Audio data window */
#define AUDIO_WX1 0
#define AUDIO_WX2 39
#define AUDIO_WY1 21
#define AUDIO_WY2 24
#define AUDIO_TITLE " Audio Callback "
/* Flipper data window */
#define FLIPPER_WX1 40
#define FLIPPER_WX2 79
#define FLIPPER_WY1 21
#define FLIPPER_WY2 24
#define FLIPPER_TITLE " Frame Flipper "
extern char *HMIDevName;
/****************************************************************************
*
* NAME
* VQA_InitMono - Initialize the player's mono screen.
*
* SYNOPSIS
* VQA_InitMono(VQA)
*
* void VQA_InitMono(VQAHandleP *);
*
* FUNCTION
*
* INPUTS
* VQA - Pointer to private VQA handle.
*
* RESULT
* NONE
*
****************************************************************************/
#pragma argsused
void VQA_InitMono(VQAHandleP *vqap)
{
VQAData *vqabuf;
VQAConfig *config;
char txt[80];
/* Dereference commonly used data members of quick access. */
vqabuf = vqap->VQABuf;
config = &vqap->Config;
/* Enable and clear the mono screen */
Mono_Enable();
Mono_Clear_Screen();
/* Init main window */
Mono_Draw_Rect(MAIN_WX1, MAIN_WY1, (MAIN_WX2 - MAIN_WX1 + 1),
(MAIN_WY2 - MAIN_WY1 + 1), 2, 1);
Mono_Set_Cursor((MAIN_WX2 + MAIN_WX1 - strlen(MAIN_TITLE)) / 2, MAIN_WY1);
Mono_Print(MAIN_TITLE);
/* Video mode */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 1);
Mono_Print("Video Mode: ");
switch (config->Vmode) {
#if(VQAMONO_ON)
case MCGA:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("MCGA Buffered");
} else {
Mono_Print("MCGA Direct to screen");
}
break;
#endif
#if(VQAXMODE_ON)
case XMODE_320X200:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("XMODE 320x200 Buffered");
} else {
if (config->DrawFlags & VQACFGF_VRAMCB) {
Mono_Print("XMODE 320x200 VRAM Copy");
} else {
Mono_Print("XMODE 320x200 Linear->Banked");
}
}
break;
case XMODE_320X240:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("XMODE 320x240 Buffered");
} else {
if (config->DrawFlags & VQACFGF_VRAMCB) {
Mono_Print("XMODE 320x240 VRAM Copy");
} else {
Mono_Print("XMODE 320x240 Linear->Banked");
}
}
break;
#endif
#if(VQAVESA_ON)
case VESA_640X480_256:
Mono_Print("VESA 640x480");
break;
case VESA_320X200_32K_1:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("VESA 320x200 Buffered");
} else {
Mono_Print("VESA 320x200 Direct to screen");
}
break;
#endif
default:
Mono_Print("UNKNOWN");
break;
}
/* Sound status */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 2);
Mono_Print(" Sound: ");
if (config->OptionFlags & VQAOPTF_AUDIO) {
sprintf(txt,"%u Hz", config->AudioRate);
Mono_Print(txt);
} else {
Mono_Print("OFF");
}
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 3);
Mono_Print(" Driver Name: ");
Mono_Print(HMIDevName);
/* Frame rates */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 4);
sprintf(txt," Load Frame Rate: %d", config->FrameRate);
Mono_Print(txt);
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 5);
sprintf(txt," Draw Frame Rate: %d", config->DrawRate);
Mono_Print(txt);
/* Slow palette */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 6);
Mono_Print(" Slow palette: ");
if (config->OptionFlags & VQAOPTF_SLOWPAL) {
Mono_Print("ON");
} else {
Mono_Print("OFF");
}
/* Memory Usage */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 7);
sprintf(txt," Memory Used: %ld", vqabuf->MemUsed);
Mono_Print(txt);
/* Timer Method */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 8);
if (VQA_TimerMethod() == VQA_TMETHOD_DOS) {
Mono_Print(" DOS Timer:");
} else if (VQA_TimerMethod() == VQA_TMETHOD_INT) {
Mono_Print(" Interrupt Timer:");
} else if (VQA_TimerMethod() == VQA_TMETHOD_AUDIO) {
Mono_Print(" Audio DMA Timer:");
} else {
Mono_Print(" Defualt:");
}
/* Init loader data window */
Mono_Draw_Rect(LOADER_WX1, LOADER_WY1, (LOADER_WX2 - LOADER_WX1 + 1),
(LOADER_WY2 - LOADER_WY1 + 1), 2, 1);
Mono_Set_Cursor((LOADER_WX2 + LOADER_WX1 - strlen(LOADER_TITLE)) / 2,
LOADER_WY1);
Mono_Print(LOADER_TITLE);
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 1);
Mono_Print(" Current Frame #:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 2);
Mono_Print("# Waits on Drawer:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 3);
Mono_Print(" # Waits on Audio:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 4);
Mono_Print(" Frame Size:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 5);
Mono_Print(" Max Frame Size:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY2 - 2);
Mono_Print("Audio:");
/* Init drawer data window */
Mono_Draw_Rect(DRAWER_WX1, DRAWER_WY1, (DRAWER_WX2 - DRAWER_WX1 + 1),
(DRAWER_WY2 - DRAWER_WY1 + 1), 2, 1);
Mono_Set_Cursor((DRAWER_WX2 + DRAWER_WX1 - strlen(DRAWER_TITLE)) / 2,
DRAWER_WY1);
Mono_Print(DRAWER_TITLE);
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 1);
Mono_Print(" Current Frame #:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 2);
Mono_Print(" Desired Frame #:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 3);
Mono_Print("# Waits on Flipper:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 4);
Mono_Print(" # Waits on Loader:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 5);
Mono_Print(" # Frames Skipped:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 6);
Mono_Print(" VQ Block Size:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY2 - 2);
Mono_Print("Frames: Cbooks:");
/* Init audio data window */
Mono_Draw_Rect(AUDIO_WX1, AUDIO_WY1, (AUDIO_WX2 - AUDIO_WX1 + 1),
(AUDIO_WY2 - AUDIO_WY1 + 1), 2, 1);
Mono_Set_Cursor((AUDIO_WX2 + AUDIO_WX1 - strlen(AUDIO_TITLE)) / 2,
AUDIO_WY1);
Mono_Print(AUDIO_TITLE);
Mono_Set_Cursor(AUDIO_WX1 + 2, AUDIO_WY1 + 1);
Mono_Print("# Repeated Buffers:");
/* Init flipper data window */
Mono_Draw_Rect(FLIPPER_WX1, FLIPPER_WY1, (FLIPPER_WX2 - FLIPPER_WX1 + 1),
(FLIPPER_WY2 - FLIPPER_WY1 + 1), 2, 1);
Mono_Set_Cursor((FLIPPER_WX2 + FLIPPER_WX1 - strlen(FLIPPER_TITLE)) / 2,
FLIPPER_WY1);
Mono_Print(FLIPPER_TITLE);
Mono_Set_Cursor(FLIPPER_WX1 + 2, FLIPPER_WY1 + 1);
Mono_Print("Current Frame #:");
}
/****************************************************************************
*
* NAME
* VQA_UpdateMono - Update the player's mono output.
*
* SYNOPSIS
* VQA_UpdateMono(VQA)
*
* void VQA_UpdateMono(VQAHandleP *);
*
* FUNCTION
*
* INPUTS
* VQA - Pointer to private VQA handle.
*
* RESULT
* NONE
*
****************************************************************************/
#pragma argsused
void VQA_UpdateMono(VQAHandleP *vqap)
{
VQAData *vqabuf;
VQAConfig *config;
VQAFrameNode *frame;
VQACBNode *cbook;
long frameindex = -1;
long loadcb = -1;
long drawcb = -1;
long i;
unsigned long curtime;
char txt[80];
/* Dereference commonly used data members for quick access. */
vqabuf = vqap->VQABuf;
config = &vqap->Config;
/* Timer value */
curtime = VQA_GetTime(vqap);
Mono_Set_Cursor(MAIN_WX1 + 40, MAIN_WY1 + 8);
sprintf(txt,"%02ld:%02ld.%02ld",curtime / (VQA_TIMETICKS * VQA_TIMETICKS),
curtime / VQA_TIMETICKS,((curtime * 100L) / VQA_TIMETICKS)
-((curtime / VQA_TIMETICKS) * 100L));
Mono_Print(txt);
/* Loader data */
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 1);
sprintf(txt,"%4d",vqabuf->Loader.LastFrameNum);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 2);
sprintf(txt,"%4ld",vqabuf->Loader.WaitsOnDrawer);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 3);
sprintf(txt,"%4ld",vqabuf->Loader.WaitsOnAudio);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 4);
sprintf(txt,"%5u",vqabuf->Loader.FrameSize);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 5);
sprintf(txt,"%5u",vqabuf->Loader.MaxFrameSize);
Mono_Print(txt);
#if(VQAAUDIO_ON)
/* Draw a picture of the audio buffers */
for (i = 0; i < vqabuf->Audio.NumAudBlocks; i++) {
if (vqabuf->Audio.IsLoaded[i] == 0) {
txt[i] = '_';
} else {
txt[i] = 'X';
}
}
txt[i] = 0;
Mono_Set_Cursor(LOADER_WX1 + 9,LOADER_WY2 - 2);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 9,LOADER_WY2-1);
Mono_Print(" ");
Mono_Set_Cursor(LOADER_WX1 + 9 + vqabuf->Audio.PlayPosition
/ config->HMIBufSize,LOADER_WY2 - 1);
Mono_Print("P");
Mono_Set_Cursor(LOADER_WX1 + 9 + vqabuf->Audio.AudBufPos
/ config->HMIBufSize,LOADER_WY2 - 1);
Mono_Print("L");
#endif /* VQAAUDIO_ON */
/* Drawer data */
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 1);
sprintf(txt,"%4d", vqabuf->Drawer.LastFrameNum);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 2);
sprintf(txt,"%4d", vqabuf->Drawer.DesiredFrame);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 3);
sprintf(txt,"%4ld", vqabuf->Drawer.WaitsOnFlipper);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 4);
sprintf(txt,"%4ld", vqabuf->Drawer.WaitsOnLoader);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 5);
sprintf(txt,"%4d", vqabuf->Drawer.NumSkipped);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 6);
sprintf(txt," %dx%d", vqap->Header.BlockWidth, vqap->Header.BlockHeight);
Mono_Print(txt);
/* Draw a picture of the frame buffers */
frame = vqabuf->FrameData;
for (i = 0; i < config->NumFrameBufs; i++) {
if (frame->Flags & VQAFRMF_LOADED) {
txt[i] = 'X';
} else {
txt[i] = '_';
}
if (vqabuf->Flipper.CurFrame == frame) {
frameindex = i;
}
frame = frame->Next;
}
txt[i] = 0;
Mono_Set_Cursor(DRAWER_WX1 + 10,DRAWER_WY2 - 2);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 10,DRAWER_WY2 - 1);
Mono_Print(" ");
Mono_Set_Cursor(DRAWER_WX1 + 10 + frameindex,DRAWER_WY2 - 1);
Mono_Print("^");
/* Draw a picture of the codebook buffers */
cbook = vqabuf->CBData;
for (i = 0; i < config->NumCBBufs; i++) {
if (vqabuf->Loader.CurCB == cbook) {
loadcb = i;
}
if (vqabuf->Flipper.CurFrame->Codebook == cbook) {
drawcb = i;
}
cbook = cbook->Next;
}
Mono_Set_Cursor(DRAWER_WX1 + 34,DRAWER_WY2 - 2);
Mono_Print("___");
Mono_Set_Cursor(DRAWER_WX1 + 34,DRAWER_WY2 - 1);
Mono_Print(" ");
Mono_Set_Cursor(DRAWER_WX1 + 34 + loadcb,DRAWER_WY2 - 1);
Mono_Print("L");
Mono_Set_Cursor(DRAWER_WX1 + 34 + drawcb,DRAWER_WY2 - 1);
Mono_Print("D");
/* Audio data */
#if(VQAAUDIO_ON)
Mono_Set_Cursor(AUDIO_WX1 + 22, AUDIO_WY1 + 1);
sprintf(txt,"%4ld", vqabuf->Audio.NumSkipped);
Mono_Print(txt);
#endif
/* Flipper data */
Mono_Set_Cursor(FLIPPER_WX1 + 22,FLIPPER_WY1 + 1);
sprintf(txt,"%4d", vqabuf->Flipper.LastFrameNum);
Mono_Print(txt);
Mono_Set_Cursor(0,0);
}
#endif /* VQAMONO_ON */

1332
WINVQ/VQA32/OLD/AUDIO.CPP Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
-c
-3
-d
-H=c:\projects\vqa32\obj\headers.sym
-wpro
-weas
-wpre
-IC:\PROJECTS\INCLUDE;C:\DEV\BC4\INCLUDE;C:\DEV\TNT\INCLUDE
-DPHARLAP_TNT=1

403
WINVQ/VQA32/OLD/CAPTION.CPP Normal file
View File

@@ -0,0 +1,403 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library (32 bit protected mode)
*
* FILE
* caption.c
*
* DESCRIPTION
* Text caption process/display manager.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 26, 1995
*
****************************************************************************/
#include <mem.h>
#include <malloc.h>
#include <vqm32\font.h>
#include <vqm32\text.h>
#include <vqm32\graphics.h>
#include <vqm32\captoken.h>
#include "caption.h"
#if( VQACAPTIONS_ON )
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
#define NUM_NODES 3
/* Function prototypes. */
static CaptionNode *AddCaptionNode(CaptionList *list, CaptionText *captext);
static void RemCaptionNode(CaptionList *list, CaptionNode *node);
/****************************************************************************
*
* NAME
* OpenCaptions - Initialize the caption system.
*
* SYNOPSIS
* OpenCaptions(Captions, Font)
*
* CaptionInfo *OpenCaptions(void *, void *);
*
* FUNCTION
* Allocate and initialize resources used by the caption system.
*
* INPUTS
* Captions - Captions to process.
* Font - Font to use to display captions.
*
* RESULT
* CaptionInfo - Caption information structure.
*
* SEE ALSO
* CloseCaption
*
****************************************************************************/
CaptionInfo *OpenCaptions(void *captions, void *font)
{
CaptionInfo *cap = NULL;
CaptionNode *node;
FontInfo *fi;
long i;
/* Allocate memory for the captioning system. */
cap = (CaptionInfo *)malloc(sizeof(CaptionInfo) + (sizeof(CaptionNode)
* NUM_NODES));
if (cap != NULL) {
memset(cap,0,(sizeof(CaptionInfo) + (sizeof(CaptionNode) * NUM_NODES)));
cap->Buffer = captions;
cap->Next = (CaptionText *)captions;
/* Initialize font */
fi = (FontInfo *)((char *)font + ((Font *)font)->InfoBlk);
cap->Font = font;
cap->FontHeight = fi->MaxHeight;
cap->FontWidth = fi->MaxWidth;
/* Initialize list header. */
cap->List.Head = (CaptionNode *)&cap->List.Tail;
cap->List.Tail = NULL;
cap->List.TailPred = (CaptionNode *)&cap->List.Head;
/* Link nodes. */
node = (CaptionNode *)((char *)cap + sizeof(CaptionInfo));
for (i = 0; i < NUM_NODES; i++) {
node->Succ = cap->List.Head;
cap->List.Head = node;
node->Pred = (CaptionNode *)&cap->List.Head;
node->Succ->Pred = node;
/* Next node. */
node = (CaptionNode *)((char *)node + sizeof(CaptionNode));
}
}
return (cap);
}
/****************************************************************************
*
* NAME
* CloseCaptions - Shutdown the caption system.
*
* SYNOPSIS
* CloseCaptions(CaptionInfo)
*
* void CloseCaptions(CaptionInfo *);
*
* FUNCTION
* Free the resources allocated by the caption system.
*
* INPUTS
* CaptionInfo - Caption information structure.
*
* RESULT
* NONE
*
* SEE ALSO
* OpenCaptions
*
****************************************************************************/
void CloseCaptions(CaptionInfo *cap)
{
free(cap);
}
/****************************************************************************
*
* NAME
* DoCaption - Process and display caption text.
*
* SYNOPSIS
* DoCaption(Captions, Frame)
*
* void DoCaption(CaptionInfo *, unsigned long);
*
* FUNCTION
* Process the caption events.
*
* INPUTS
* Captions - Pointer to CaptionInfo structure.
* Frame - Current frame number being processed.
*
* RESULT
* NONE
*
****************************************************************************/
void DoCaptions(CaptionInfo *cap, unsigned long frame)
{
CaptionText *captext;
CaptionNode *node;
void const *oldfont;
long width;
long i;
/* Initialize variables. */
oldfont = Set_Font((char *)cap->Font);
/*-------------------------------------------------------------------------
* Process the captions that are on the active queue.
*-----------------------------------------------------------------------*/
node = cap->List.Head;
while ((node->Succ != NULL) && (node->Flags & CNF_USED)) {
captext = node->Captext;
/* Clear the any previous captions that have expired. */
if (captext->OffFrame <= frame) {
Fill_Rect(captext->Xpos, captext->Ypos,
(captext->Xpos + node->BoundW - 1),
(captext->Ypos + node->BoundH - 1), 0);
/* Remove the caption from the active list. */
node = node->Pred;
RemCaptionNode(&cap->List, node->Succ);
} else {
if (captext->CPF != 0) {
/* If a NULL terminator is not found then display the next set of
* characters, otherwise remove the node.
*/
if (*node->Char != 0) {
Set_Font_Palette_Range(&captext->BgPen, 0, 1);
for (i = 0; i < captext->CPF; i++) {
/* Check for terminator. */
if (*node->Char == 0) {
captext->CPF = 0;
break;
}
/* Check for newline. */
else if (*node->Char == 0x0D) {
node->Char++;
node->CurX = captext->Xpos;
node->CurY += cap->FontHeight;
node->BoundH += cap->FontHeight;
}
Draw_Char(*node->Char, node->CurX, node->CurY);
node->CurX += Char_Pixel_Width(*node->Char);
node->Char++;
}
}
} else if (captext->Flags & CTF_FLASH) {
if (frame & 4) {
Fill_Rect(captext->Xpos, captext->Ypos,
(captext->Xpos + node->BoundW - 1),
(captext->Ypos + node->BoundH - 1), 0);
} else {
Text_Print(captext->Text, captext->Xpos, captext->Ypos,
captext->FgPen, captext->BgPen);
}
}
}
/* Next node. */
node = node->Succ;
}
/*-------------------------------------------------------------------------
* Process any captions that are waiting to be activated.
*-----------------------------------------------------------------------*/
captext = cap->Next;
while (captext->OnFrame <= frame) {
width = String_Pixel_Width(captext->Text);
switch (captext->Flags & CTF_JUSTIFY) {
case CTF_RIGHT:
captext->Xpos = (319 - width);
break;
case CTF_LEFT:
captext->Xpos = 0;
break;
case CTF_CENTER:
captext->Xpos = (160 - (width / 2));
break;
default:
break;
}
/* Display the text and record its bounding box. */
if (captext->CPF == 0) {
i = Text_Print(captext->Text, captext->Xpos, captext->Ypos,
captext->FgPen, captext->BgPen);
node = AddCaptionNode(&cap->List, captext);
node->BoundW = width;
node->BoundH = (cap->FontHeight * i);
} else {
node = AddCaptionNode(&cap->List, captext);
node->BoundW = width;
node->BoundH = cap->FontHeight;
}
/* Next */
cap->Next = (CaptionText *)(((char *)captext) + captext->Size);
captext = cap->Next;
}
Set_Font(oldfont);
}
/****************************************************************************
*
* NAME
* AddCaptionNode - Add a caption to the processing list.
*
* SYNOPSIS
* Node = AddCaptionNode(List, Caption)
*
* CaptionNode *AddCaptionNode(CaptionList *, CaptionText *);
*
* FUNCTION
* Add a caption the caption processing list.
*
* INPUTS
* List - Caption processing list.
* Caption - Caption to add to the list.
*
* RESULT
* Node - Pointer to node, otherwise NULL if error.
*
****************************************************************************/
static CaptionNode *AddCaptionNode(CaptionList *list, CaptionText *captext)
{
CaptionNode *node = NULL;
/* If this list is not full. */
node = list->TailPred;
if (!(node->Flags & CNF_USED)) {
/* Remove the node from the tail. */
node->Pred->Succ = node->Succ;
list->TailPred = node->Pred;
node->Flags |= CNF_USED;
node->Captext = captext;
node->Char = captext->Text;
node->CurX = captext->Xpos;
node->CurY = captext->Ypos;
/* Add the node to the head. */
node->Succ = list->Head;
list->Head = node;
node->Pred = (CaptionNode *)&list->Head;
node->Succ->Pred = node;
}
return (node);
}
/****************************************************************************
*
* NAME
* RemCaptionNode - Remove a caption from the processing list.
*
* SYNOPSIS
* RemCaptionNode(List, Node)
*
* void RemCaptionNode(CaptionList *, CaptionNode *);
*
* FUNCTION
* Remove the caption from the processing list. Mark the node as unused
* and put it at the tail of the list.
*
* INPUTS
* List - Caption processing list.
* Node - Caption node to remove.
*
* RESULT
* NONE
*
****************************************************************************/
static void RemCaptionNode(CaptionList *list, CaptionNode *node)
{
/* If the nodes successor is null then we are at the tail. */
if (node->Succ != NULL) {
/* Mark the node as unused. */
node->Flags = 0;
/* Relink the node to the tail. */
node->Succ->Pred = node->Pred;
node->Pred->Succ = node->Succ;
node->Succ = (CaptionNode *)&list->Tail;
node->Pred = list->TailPred;
list->TailPred->Succ = node;
list->TailPred = node;
}
}
#endif // VQACAPTIONS_ON


124
WINVQ/VQA32/OLD/CAPTION.H Normal file
View File

@@ -0,0 +1,124 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQACAPTION_H
#define VQACAPTION_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library (32 bit protected mode)
*
* FILE
* caption.h
*
* DESCRIPTION
* Text caption definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* July 26, 1995
*
****************************************************************************/
#define VQACAPTIONS_ON 0
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* CaptionNode: Node describing a caption to process.
*
* Succ - Pointer to the next node in the list (successor).
* Pred - Pointer to the previous node in the list (predecessor).
* Flags - Status flags.
* CapText - Pointer to the CaptionText being processed.
* Char - Pointer to current character in the string.
* CurX - Current X position.
* CurY - Current Y position.
* BoundW - Bounding width of text.
* BoundH - Bounding height of text.
*/
typedef struct _CaptionNode {
struct _CaptionNode *Succ;
struct _CaptionNode *Pred;
unsigned short Flags;
CaptionText *Captext;
char *Char;
unsigned short CurX;
unsigned short CurY;
unsigned short BoundW;
unsigned short BoundH;
} CaptionNode;
/* CaptionNode flag definitions. */
#define CNB_USED 0 /* This node is being used. */
#define CNF_USED (1<<CNB_USED)
/* CaptionList: Double linked list of outstanding captions to process.
*
* Head - Pointer to the first node in the list.
* Tail - Always NULL
* TailPred - Pointer to the last node in the list.
*/
typedef struct _CaptionList {
CaptionNode *Head;
CaptionNode *Tail;
CaptionNode *TailPred;
} CaptionList;
/* CaptionInfo:
*
* Next - Pointer to the next caption to be processed.
* List - List of pending captions to process.
* Font - Font to use for this caption.
* BoundX - X position of bounding box.
* BoundY - Y position of bounding box.
* BoundW - Width of bounding box.
* BoundH - Height of bounding box.
* Buffer - Caption chunk buffer.
*/
typedef struct _CaptionInfo {
CaptionText *Next;
CaptionList List;
void *Font;
char FontHeight;
char FontWidth;
void *Buffer;
} CaptionInfo;
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
CaptionInfo *OpenCaptions(void *captions, void *font);
void CloseCaptions(CaptionInfo *cap);
void DoCaptions(CaptionInfo *cap, unsigned long frame);
#endif /* VQACAPTION_H */


500
WINVQ/VQA32/OLD/CONFIG.CPP Normal file
View File

@@ -0,0 +1,500 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* config.c
*
* DESCRIPTION
* Player configuration routines.
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_INIConfig - Initialize VQAConfig structure with INI settings.
* VQA_DefaultConfig - Initialize VQAConfig structure with defaults.
*
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vqaplayp.h"
#include <vqm32\all.h>
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
/* Default configuration structure. */
static VQAConfig _defaultconfig = {
/* DrawerCallback: This is a function that is called for every frame
* in the movie.
*/
NULL,
/* EventHandler: This is a function that is called for every event that
* the client requested to be notified about.
*/
NULL,
/* NotifyFlags: Flags representing the events the client wishes to be
* notified about during playback.
*/
NULL,
/* Vmode: Video mode to use. */
MCGA,
/* VBIBit: Vertical blank bit polarity. */
-1,
/* ImageBuf: Pointer to image buffer to draw into. */
NULL,
/* ImageWidth, ImageHeight: Width and height dimensions of image buffer.
* A width and height value of -1 tells the player to consider the image
* buffer as having the same dimensions as the frames in the movie.
*/
320, 200, /* Image width and height */
/* X1, Y1: These are the coordinates to put the movies frame in the image
* buffer. Values of -1 tell the drawer to center the frames in the buffer.
*/
-1, -1,
/* FrameRate: The rate to load the frames at. A value of -1 tells the
* player to use the framerate of the movie.
*/
-1,
/* DrawRate: The rate to draw the frames at. A value of -1 tells the
* player to use the framerate of the movie. A value of 0 tells the player
* to use a fixed rate based on the frame size.
*/
-1,
/* TimerMethod: Timer method to use for playback. */
-1,
/* DrawFlags: Various drawing related flags. */
0,
/* OptionFlags: Various player options. */
VQAOPTF_AUDIO,
/* NumFrameBufs: The number of frame buffers to allocate/use. */
6,
/* NumCBBufs: The number of codebook buffers to allocate/use. */
3,
/* VocFile: Filename of audio track override. A value of 0 tells the
* player not to override the movies audio track.
*/
NULL,
/* AudioBuf: Audio buffer to use. A value of 0 tells the player that
* it has to allocate a buffer itself.
*/
NULL,
/* AudioBufSize: Size of audio buffer to use/allocate. A value of -1
* tells the player to compute the buffer size from the audio
* information in the movie.
*/
-1,
/* AudioRate: Audio playback rate in samples per second. A value of -1
* tells the player to use the audio rate of the movie.
*/
-1,
/* Volume: Volume level to playback audio track. */
0x00FF,
/* HMIBufSize: Size of HMIs internal buffer. */
2048L,
/* DigiHandle: Handle to an initialized HMI sound driver. A value of -1
* tells the player it must initialize the HMI sound driver itself.
*/
-1,
/* DigiCard: HMI ID of audio card to use. A value of 0 tells the player
* not to use any card. A value of -1 tells the player to autodetect the
* card in the system.
*/
-1,
/* DigiPort: Port address of the sound card. A value of -1 tells the player
* to autodetect this address.
*/
-1,
/* DigiIRQ: Interrupt number of sound card. A value of -1 tells the player
* to autodetect the interrupt used by the card.
*/
-1,
/* DigiDMA: DMA channel of the sound card. A value of -1 tells the player
* to autodetect the channel used by the card.
*/
-1,
/* Language: Prefered language. */
0,
/* CaptionFont: Caption text font. */
NULL,
};
/* Supported video modes. */
#if(VQAVIDEO_ON)
enum VMTAGS {
VMTAG_NONE = 0,
#if(VQAMCGA_ON)
VMTAG_MCGA,
VMTAG_MCGA_BUF,
#endif
#if(VQAXMODE_ON)
VMTAG_XMODE320X200,
VMTAG_XMODE320X200_BUF,
VMTAG_XMODE320X200_VRAM,
VMTAG_XMODE320X240,
VMTAG_XMODE320X240_BUF,
VMTAG_XMODE320X240_VRAM,
#endif
#if(VQAVESA_ON)
VMTAG_VESA640X480_BUF,
VMTAG_VESA640X480_X2,
VMTAG_VESA320X200,
VMTAG_VESA320X200_BUF,
#endif
};
typedef struct _VideoModeTag {
char const *token;
long id;
} VideoModeTag;
VideoModeTag VideoModeTags[] = {
{"NONE",VMTAG_NONE},
#if(VQAMCGA_ON)
{"MCGA", VMTAG_MCGA},
{"MCGA_BUF",VMTAG_MCGA_BUF},
#endif /* VQAMCGA_ON */
#if(VQAXMODE_ON)
{"XMODE_320X200", VMTAG_XMODE320X200},
{"XMODE_320X200_BUF", VMTAG_XMODE320X200_BUF},
{"XMODE_320X200_VRAM",VMTAG_XMODE320X200_VRAM},
{"XMODE_320X240", VMTAG_XMODE320X240},
{"XMODE_320X240_BUF", VMTAG_XMODE320X240_BUF},
{"XMODE_320X240_VRAM",VMTAG_XMODE320X240_VRAM},
#endif /* VQAXMODE_ON */
#if(VQAVESA_ON)
{"VESA_640X480_BUF",VMTAG_VESA640X480_BUF},
{"VESA_640X480_X2", VMTAG_VESA640X480_X2},
{"VESA_320X200", VMTAG_VESA320X200},
{"VESA_320X200_BUF",VMTAG_VESA320X200_BUF},
#endif /* VQAVESA_ON */
{NULL, NULL}
};
#endif /* VQAVIDEO_ON */
/****************************************************************************
*
* NAME
* VQA_INIConfig - Initialize VQAConfig structure with INI settings.
*
* SYNOPSIS
* VQA_INIConfig(Config)
*
* void VQA_INIConfig(VQAConfig *);
*
* FUNCTION
* Initializes the configuration structure from the player INI file.
*
* INPUTS
* Config - Pointer to VQAConfig structure.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_INIConfig(VQAConfig *config)
{
char *ininame;
char buf[80];
long i;
/* Set all Config entries to 0. */
memset(config, 0, sizeof(VQAConfig));
/* Retrieve player INI filename from an enviroment variable if
* it is provided.
*/
if ((ininame = getenv("VQACFG")) == NULL) {
ininame = "PLAYER.INI";
}
/*-------------------------------------------------------------------------
* VIDEO MODE AND DRAW FLAGS
*-----------------------------------------------------------------------*/
#if(VQAVIDEO_ON)
/* Get video mode from INI */
GetINIString("Player", "PlayerMode", "MCGA", buf, 80, ininame);
/* Search supported modes for a match. */
i = 0;
while (VideoModeTags[i].token != NULL) {
if (stricmp(buf, VideoModeTags[i].token) == 0) {
break;
}
i++;
}
/* Setup for requested mode */
switch (VideoModeTags[i].id) {
/* MCGA direct */
#if(VQAMONO_ON)
case VMTAG_MCGA:
config->Vmode = MCGA;
break;
/* MCGA buffered */
case VMTAG_MCGA_BUF:
config->Vmode = MCGA;
config->DrawFlags |= VQACFGF_BUFFER;
break;
#endif /* VQAMCGA_ON */
/* XMODE direct (320x200) */
#if(VQAXMODE_ON)
case VMTAG_XMODE320X200:
config->Vmode = XMODE_320X200;
break;
/* XMODE buffered (320x200) */
case VMTAG_XMODE320X200_BUF:
config->Vmode = XMODE_320X200;
config->DrawFlags |= VQACFGF_BUFFER;
break;
/* XMODE VRAM codebook (320x200) */
case VMTAG_XMODE320X200_VRAM:
config->Vmode = XMODE_320X200;
config->DrawFlags |= VQACFGF_VRAMCB;
break;
/* XMODE direct (320x240) */
case VMTAG_XMODE320X240:
config->Vmode = XMODE_320X240;
break;
/* XMODE buffered (320x240) */
case VMTAG_XMODE320X240_BUF:
config->Vmode = XMODE_320X240;
config->DrawFlags |= VQACFGF_BUFFER;
break;
/* XMODE VRAM codebook (320x240) */
case VMTAG_XMODE320X240_VRAM:
config->Vmode = XMODE_320X240;
config->DrawFlags |= VQACFGF_VRAMCB;
break;
#endif /* VQAXMODE_ON */
/* VESA buffered (640x480_256) */
#if(VQAVESA_ON)
case VMTAG_VESA640X480_BUF:
config->Vmode = VESA_640X480_256;
config->DrawFlags |= VQACFGF_BUFFER;
break;
/* VESA buffered scaled (640x480_256) */
case VMTAG_VESA640X480_X2:
config->Vmode = VESA_640X480_256;
config->DrawFlags |= (VQACFGF_BUFFER|VQACFGF_SCALEX2);
break;
/* VESA direct (320x200_32k) */
case VMTAG_VESA320X200:
config->Vmode = VESA_320X200_32K_1;
break;
/* VESA buffered (320x200_32k) */
case VMTAG_VESA320X200_BUF:
config->Vmode = VESA_320X200_32K_1;
config->DrawFlags |= VQACFGF_BUFFER;
break;
#endif /* VQAVESA_ON */
/* Default to MCGA direct */
VMTAG_NONE:
default:
config->Vmode = MCGA;
break;
}
#endif /* VQAVIDEO_ON */
/* Get framerate and drawrate. */
GetINIString("Player", "FrameRate", "-1", buf, 80, ininame);
config->FrameRate = atoi(buf);
GetINIString("Player", "DrawRate", "Variable", buf, 80, ininame);
if (!stricmp(buf, "Variable")) {
config->DrawRate = -1;
} else {
config->DrawRate = 0;
}
/*-------------------------------------------------------------------------
* AUDIO SETTINGS
*-----------------------------------------------------------------------*/
GetINIString("Player", "AudioRate", "-1", buf, 80, ininame);
config->AudioRate = atoi(buf);
/* OptionFlags */
GetINIString("Player", "SoundEnabled", "True", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_AUDIO;
} else {
config->OptionFlags &= (~VQAOPTF_AUDIO);
}
/* Default audio settings. */
config->AudioBufSize = 32768U;
config->HMIBufSize = 2048;
config->DigiHandle = -1;
config->Volume = 0x00FF;
config->DigiCard = 0xFFFF;
config->DigiPort = -1;
config->DigiIRQ = -1;
config->DigiDMA = -1;
/* Configure sound hardware */
GetINIString("Player", "Port", "-1", buf, 80, ininame);
if (!stricmp(buf, "-1")) {
config->DigiPort = -1;
} else {
sscanf(buf, "%x", &config->DigiPort);
}
GetINIString("Player", "IRQ", "-1", buf, 80, ininame);
config->DigiIRQ = atoi(buf);
GetINIString("Player", "DMA", "-1", buf, 80, ininame);
config->DigiDMA = atoi(buf);
/*-------------------------------------------------------------------------
* GENERAL OPTIONS
*-----------------------------------------------------------------------*/
/* Enable/Disable single stepping */
GetINIString("Player", "SingleStep", "False", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_STEP;
config->DrawFlags |= VQACFGF_NOSKIP;
} else {
config->OptionFlags &= (~VQAOPTF_STEP);
}
/* Enable/Disable Slowpalette */
GetINIString("Player", "SlowPalette", "False", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_SLOWPAL;
} else {
config->OptionFlags &= (~VQAOPTF_SLOWPAL);
}
/* Enable/Disable monochrome display */
GetINIString("Player", "MonoOutput", "False", buf, 80, ininame);
if (!stricmp(buf, "True") || !stricmp(buf, "1")) {
config->OptionFlags |= VQAOPTF_MONO;
} else {
config->OptionFlags &= (~VQAOPTF_MONO);
}
/* Frame and codebook buffers */
config->NumFrameBufs = 6;
config->NumCBBufs = 3;
}
/****************************************************************************
*
* NAME
* VQA_DefaultConfig - Initialize VQAConfig structure with defaults.
*
* SYNOPSIS
* VQA_DefaultConfig(Config);
*
* void VQA_DefaultConfig(VQAConfig *);
*
* FUNCTION
* Initialize configuration with default settings.
*
* INPUTS
* Config - Pointer to VQA configuration structure.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_DefaultConfig(VQAConfig *config)
{
memcpy(config, &_defaultconfig, sizeof(VQAConfig));
}

2418
WINVQ/VQA32/OLD/DRAWER.CPP Normal file

File diff suppressed because it is too large Load Diff

188
WINVQ/VQA32/OLD/DSTREAM.CPP Normal file
View File

@@ -0,0 +1,188 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQAPlay32 library.
*
* FILE
* dstream.c
*
* DESCRIPTION
* DOS IO handler.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_InitAsDOS - Initialize IO with the standard DOS handler.
*
* PRIVATE
* VQADOSHandler - Standard DOS IO handler.
*
****************************************************************************/
#include <fcntl.h>
#include <io.h>
#include "vqaplayp.h"
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
static long VQADOSHandler(VQAHandle *vqa, long action, void *buffer,
long nbytes);
/****************************************************************************
*
* NAME
* VQA_InitAsDOS - Initialize IO with the standard DOS handler.
*
* SYNOPSIS
* VQA_InitAsDOS(VQA)
*
* VQA_InitAsDOS(VQAHandle *);
*
* FUNCTION
* Initialize the IO of the specified handle as a standard DOS access.
*
* INPUTS
* VQA - Pointer to VQAHandle to initialize as DOS.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_InitAsDOS(VQAHandle *vqa)
{
((VQAHandleP *)vqa)->IOHandler = VQADOSHandler;
}
/****************************************************************************
*
* NAME
* VQADOSHandler - Standard DOS IO handler.
*
* SYNOPSIS
* Error = VQADOSHandler(VQA, Action, Buffer, NBytes)
*
* unsigned long VQADOSHandler(VQAHandle *, long, long, long);
*
* FUNCTION
* Perform the requested action on the standard DOS file system.
*
* INPUTS
* VQA - VQAHandle to operate on.
* Action - Action to perform.
* Buffer - Buffer to Read/Write to/from.
* NBytes - Number of bytes to operate on.
*
* RESULT
* Error - 0 if successful, otherwise error.
*
****************************************************************************/
static long VQADOSHandler(VQAHandle *vqa, long action, void *buffer,
long nbytes)
{
long fh;
long error;
fh = vqa->VQAio;
/* Perform the action specified by the IO command */
switch (action) {
/* VQACMD_READ means read NBytes and place it in the memory
* pointed to by Buffer.
*
* Any error code returned will be remapped by VQA library into
* VQAERR_READ.
*/
case VQACMD_READ:
error = (read(fh, buffer, nbytes) != nbytes);
break;
/* VQACMD_WRITE is analogous to VQACMD_READ.
*
* Writing is not allowed to the VQA file, VQA library will remap the
* error into VQAERR_WRITE.
*/
case VQACMD_WRITE:
error = 1;
break;
/* VQACMD_SEEK asks that you perform a seek relative to the current
* position. NBytes is a signed number, indicating seek direction
* (positive for forward, negative for backward). Buffer has no meaning
* here.
*
* Any error code returned will be remapped by VQA library into
* VQAERR_SEEK.
*/
case VQACMD_SEEK:
error = (lseek(fh, nbytes, (long)buffer) == -1);
break;
/* VQACMD_OPEN asks that you open the file for access. */
case VQACMD_OPEN:
error = open((char *)buffer, (O_RDONLY|O_BINARY));
if (error != -1) {
vqa->VQAio = error;
error = 0;
}
break;
case VQACMD_CLOSE:
close(fh);
error = 0;
break;
/* VQACMD_INIT means to prepare your IO for reading. This is used for
* certain IOs that can't be read immediately upon opening, and need
* further preparation. This operation is allowed to fail; the error code
* will be returned directly to the client.
*/
case VQACMD_INIT:
/* IFFCMD_CLEANUP means to terminate the transaction with the associated
* IO. This is used for IOs that can't simply be closed. This operation
* is not allowed to fail; any error returned will be ignored.
*/
case VQACMD_CLEANUP:
error = 0;
break;
}
return (error);
}

2826
WINVQ/VQA32/OLD/LOADER.CPP Normal file

File diff suppressed because it is too large Load Diff

162
WINVQ/VQA32/OLD/MAKEFILE Normal file
View File

@@ -0,0 +1,162 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay 32-bit library.
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJ = ..
WATCOM = C:\WATCOM
PRJNAME = vqa32wp
PRJDIR = $(PRJ)\VQA32
OBJECTS = &
config.obj &
task.obj &
loader.obj &
drawer.obj &
audio.obj &
monodisp.obj &
dstream.obj &
unvqbuff.obj &
unvqvesa.obj &
vertag.obj &
caption.obj &
# unvqxmde.obj
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(PRJ)\LIB;$(WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(PRJ)\INCLUDE;$(WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# Tools/commands & configurations
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5r -mf -oaeilrt -s -zq -d2
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /i$(PRJ)\INCLUDE\VQM32 /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(PRJNAME).lib .SYMBOLIC
$(PRJNAME).lib : $(OBJECTS) .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.asm.obj:
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
update: .SYMBOLIC
@echo Updating VQAPlay32 header files!
@copy vqaplay.h ..\include\vqa32 >NUL
@copy vqafile.h ..\include\vqa32 >NUL


View File

@@ -0,0 +1,216 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay32 library.
#
# FILE
# makefile (Borland/TNT)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# Feburary 7, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# BCDIR - Borland C installation path.
# TNTDIR - Pharlap/TNT installation path.
#
#****************************************************************************
.AUTODEPEND
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!if !$d(PRJ) || !$d(PRJVCS) || !$d(BCDIR) || !$d(TNTDIR)
!error Environment not configured.
!endif
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = vqa32bp
PRJDIR = $(PRJ)\VQA32
OBJECTS = \
config.obj \
task.obj \
loader.obj \
drawer.obj \
audio.obj \
monodisp.obj \
dstream.obj \
unvqbuff.obj \
unvqvesa.obj \
vertag.obj \
caption.obj \
# unvqxmde.obj \
PRJLIBS = \
vqm32bp.lib \
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!if $d(LIB)
LIBPATH = $(PRJ)\LIB;$(LIB)
!else
LIBPATH = $(PRJ)\LIB;$(TNTDIR)\LIB;$(BCDIR)\LIB
!endif
!if $d(INCLUDE)
INCLUDEPATH = $(PRJ)\INCLUDE;$(INCLUDE)
!else
INCLUDEPATH = $(PRJ)\INCLUDE;$(TNTDIR)\INCLUDE;$(BCDIR)\INCLUDE
!endif
.path.asm = $(PRJDIR)
.path.c = $(PRJDIR)
.path.cpp = $(PRJDIR)
.path.h = $(PRJDIR)
.path.exe = $(PRJDIR)
.path.obj = $(PRJDIR)\OBJ
.path.sym = $(PRJDIR)\OBJ
.path.lib = $(PRJ)\LIB
#----------------------------------------------------------------------------
# TOOLS, COMMAND AND CONFIGURATIONS
#----------------------------------------------------------------------------
CC_CMD = bcc32
ASM_CMD = tasm32
LINK_CMD = tlink32
LIB_CMD = tlib
CC_CFG = bcc32.cfg
ASM_CFG = tasm32.cfg
LINK_CFG = tlink32.cfg
LIB_CFG = tlib.cfg
CFG_FILES = $(CC_CFG) $(ASM_CFG) $(LINK_CFG) $(LIB_CFG)
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all: $(PRJNAME).lib
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj:
$(CC_CMD) -P- -n$(.path.obj) {$< }
.cpp.obj:
$(CC_CMD) -P -n$(.path.obj) {$< }
.asm.obj:
$(ASM_CMD) @$(ASM_CFG) $<,$(.path.obj)\$&
#----------------------------------------------------------------------------
# BUILD LIBRARY
#----------------------------------------------------------------------------
$(PRJNAME).lib: $(OBJECTS)
- @del $(.path.lib)\$(PRJNAME).lib >&NUL
$(LIB_CMD) $(.path.lib)\$(PRJNAME).lib @$(LIB_CFG) @&&|
-+$(**: = -+)
|
- @copy vqaplay.h $(PRJ)\INCLUDE\VQA32 >&NUL
- @copy vqafile.h $(PRJ)\INCLUDE\VQA32 >&NUL
#----------------------------------------------------------------------------
# ALL OBJECTS DEPEND ON THE CONFIGURATION FILES
#----------------------------------------------------------------------------
$(OBJECTS): $(CFG_FILES)
#----------------------------------------------------------------------------
# COMPILER CONFIGURATION
#----------------------------------------------------------------------------
$(CC_CFG): makefile
copy &&|
-c
-3
-d
-H=$(.path.sym)\headers.sym
-wpro
-weas
-wpre
-I$(INCLUDEPATH)
-DPHARLAP_TNT=1
#-v
| $(CC_CFG)
#----------------------------------------------------------------------------
# ASSEMBLER CONFIGURATION
#----------------------------------------------------------------------------
$(ASM_CFG): makefile
copy &&|
/t
/m
/w+
/jJUMPS
/ml
/p
/z
/i$(PRJ)\INCLUDE\VQM32
/zi
/dPHARLAP_TNT=1
| $(ASM_CFG)
#----------------------------------------------------------------------------
# LINKER CONFIGURATION
#----------------------------------------------------------------------------
$(LINK_CFG): makefile
copy &&|
/c
/m
/Gm
-L$(LIBPATH)
-v
| $(LINK_CFG)
#----------------------------------------------------------------------------
# LIBRARIAN CONFIGURATION
#----------------------------------------------------------------------------
$(LIB_CFG): makefile
copy &&|
/C /E
| $(LIB_CFG)

View File

@@ -0,0 +1,163 @@
#
# Command & Conquer Red Alert(tm)
# Copyright 2025 Electronic Arts Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#****************************************************************************
#
# 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
#
#----------------------------------------------------------------------------
#
# PROJECT
# VQAPlay 32-bit library.
#
# FILE
# makefile (Watcom C/C++ 10.0a)
#
# DESCRIPTION
# Makefile for generating the 32-bit VQAPlay library.
#
# PROGRAMMER
# Denzil E. Long, Jr.
#
# DATE
# February 10, 1995
#
# ENVIROMENT
# PRJ - Projects path.
# PRJVCS - Version control archive path.
# WATCOM - Watcom C installation path.
#
#****************************************************************************
#----------------------------------------------------------------------------
# VERIFY ENVIROMENT
#----------------------------------------------------------------------------
!ifndef %PRJ || %PRJVCS || %WATCOM
!error Environment not configured.
!endif
.OPTIMIZE
.ERASE
#----------------------------------------------------------------------------
# PROJECTS DEPENDENT MACROS
#----------------------------------------------------------------------------
PRJNAME = vqa32wp
PRJDIR = $(%PRJ)\VQA32
OBJECTS = &
config.obj &
task.obj &
loader.obj &
drawer.obj &
audio.obj &
monodisp.obj &
dstream.obj &
unvqbuff.obj &
unvqvesa.obj &
vertag.obj &
caption.obj &
# unvqxmde.obj
#----------------------------------------------------------------------------
# PATH MACROS
#----------------------------------------------------------------------------
!ifdef %LIB
LIBPATH = $(%PRJ)\LIB;$(%LIB)
!else
LIBPATH = $(%PRJ)\LIB;$(%WATCOM)\LIB386
!endif
!ifdef %INCLUDE
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%INCLUDE)
!else
INCLUDEPATH = $(%PRJ)\INCLUDE;$(%WATCOM)\H
!endif
path_c = .\
path_cpp = .\
path_h = .\
path_asm = .\
path_i = .\
path_obj = .\O
path_lib = $(%PRJ)\LIB
path_exe = .\
#----------------------------------------------------------------------------
# IMPLICIT RULE EXTENSIONS AND PATHS
#----------------------------------------------------------------------------
.EXTENSIONS :
.EXTENSIONS : .exe .lib .obj .c .cpp .asm .h .i
.c : $(path_c)
.cpp : $(path_cpp)
.h : $(path_h)
.asm : $(path_asm)
.i : $(path_i)
.obj : $(path_obj)
.lib : $(path_lib)
.exe : $(path_exe)
#----------------------------------------------------------------------------
# Tools/commands & configurations
#----------------------------------------------------------------------------
CC_CMD = wcc386
CCP_CMD = wpp386
ASM_CMD = tasm32
LINK_CMD = wlink
LIB_CMD = wlib
CC_OPTS = -i$(INCLUDEPATH) -j -zp1 -5s -mf -oaeilrt -s -zq
ASM_OPTS = /t /m /w+ /jJUMPS /ml /p /z /i$(%PRJ)\INCLUDE\VQM32 /dPHARLAP_TNT=0
LIB_OPTS = /b /c /q
LINK_CFG = $(PRJNAME).lnk
#----------------------------------------------------------------------------
# DEFAULT TARGET
#----------------------------------------------------------------------------
all : $(PRJNAME).lib .SYMBOLIC
$(PRJNAME).lib : $(OBJECTS) .SYMBOLIC
#----------------------------------------------------------------------------
# IMPLICIT RULES
#----------------------------------------------------------------------------
.c.obj :
$(CC_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.cpp.obj :
$(CCP_CMD) $(CC_OPTS) -fo=$(PATH_OBJ)\$^. $<
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
.asm.obj:
$(ASM_CMD) $(ASM_OPTS) $<,$(path_obj)\$^.
$(LIB_CMD) $(LIB_OPTS) $(path_lib)\$(PRJNAME).lib -+$(path_obj)\$]&
update: .SYMBOLIC
@echo Updating VQAPlay32 header files!
@copy vqaplay.h ..\include\vqa32 >NUL
@copy vqafile.h ..\include\vqa32 >NUL

View File

@@ -0,0 +1,512 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* monodisp.c
*
* DESCRIPTION
* Monochrome display (debug)
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 6, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_InitMono - Initialize the player's mono screen.
* VQA_UpdateMono - Update the player's mono output.
*
****************************************************************************/
#include <stdio.h>
#include <string.h>
#include "vq.h"
#include "vqaplayp.h"
#include <vqm32\all.h>
#if(VQAMONO_ON)
/* Main window */
#define MAIN_WX1 0
#define MAIN_WX2 79
#define MAIN_WY1 0
#define MAIN_WY2 9
#define MAIN_TITLE "VQA Player"
/* Loader data window */
#define LOADER_WX1 0
#define LOADER_WX2 39
#define LOADER_WY1 10
#define LOADER_WY2 20
#define LOADER_TITLE " Frame Loader "
/* Drawer data window */
#define DRAWER_WX1 40
#define DRAWER_WX2 79
#define DRAWER_WY1 10
#define DRAWER_WY2 20
#define DRAWER_TITLE " Frame Drawer "
/* Audio data window */
#define AUDIO_WX1 0
#define AUDIO_WX2 39
#define AUDIO_WY1 21
#define AUDIO_WY2 24
#define AUDIO_TITLE " Audio Callback "
/* Flipper data window */
#define FLIPPER_WX1 40
#define FLIPPER_WX2 79
#define FLIPPER_WY1 21
#define FLIPPER_WY2 24
#define FLIPPER_TITLE " Frame Flipper "
extern char *HMIDevName;
/****************************************************************************
*
* NAME
* VQA_InitMono - Initialize the player's mono screen.
*
* SYNOPSIS
* VQA_InitMono(VQA)
*
* void VQA_InitMono(VQAHandleP *);
*
* FUNCTION
*
* INPUTS
* VQA - Pointer to private VQA handle.
*
* RESULT
* NONE
*
****************************************************************************/
#pragma argsused
void VQA_InitMono(VQAHandleP *vqap)
{
VQAData *vqabuf;
VQAConfig *config;
char txt[80];
/* Dereference commonly used data members of quick access. */
vqabuf = vqap->VQABuf;
config = &vqap->Config;
/* Enable and clear the mono screen */
Mono_Enable();
Mono_Clear_Screen();
/* Init main window */
Mono_Draw_Rect(MAIN_WX1, MAIN_WY1, (MAIN_WX2 - MAIN_WX1 + 1),
(MAIN_WY2 - MAIN_WY1 + 1), 2, 1);
Mono_Set_Cursor((MAIN_WX2 + MAIN_WX1 - strlen(MAIN_TITLE)) / 2, MAIN_WY1);
Mono_Print(MAIN_TITLE);
/* Video mode */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 1);
Mono_Print("Video Mode: ");
switch (config->Vmode) {
#if(VQAMONO_ON)
case MCGA:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("MCGA Buffered");
} else {
Mono_Print("MCGA Direct to screen");
}
break;
#endif
#if(VQAXMODE_ON)
case XMODE_320X200:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("XMODE 320x200 Buffered");
} else {
if (config->DrawFlags & VQACFGF_VRAMCB) {
Mono_Print("XMODE 320x200 VRAM Copy");
} else {
Mono_Print("XMODE 320x200 Linear->Banked");
}
}
break;
case XMODE_320X240:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("XMODE 320x240 Buffered");
} else {
if (config->DrawFlags & VQACFGF_VRAMCB) {
Mono_Print("XMODE 320x240 VRAM Copy");
} else {
Mono_Print("XMODE 320x240 Linear->Banked");
}
}
break;
#endif
#if(VQAVESA_ON)
case VESA_640X480_256:
Mono_Print("VESA 640x480");
break;
case VESA_320X200_32K_1:
if (config->DrawFlags & VQACFGF_BUFFER) {
Mono_Print("VESA 320x200 Buffered");
} else {
Mono_Print("VESA 320x200 Direct to screen");
}
break;
#endif
default:
Mono_Print("UNKNOWN");
break;
}
/* Sound status */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 2);
Mono_Print(" Sound: ");
if (config->OptionFlags & VQAOPTF_AUDIO) {
sprintf(txt,"%u Hz", config->AudioRate);
Mono_Print(txt);
} else {
Mono_Print("OFF");
}
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 3);
Mono_Print(" Driver Name: ");
Mono_Print(HMIDevName);
/* Frame rates */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 4);
sprintf(txt," Load Frame Rate: %d", config->FrameRate);
Mono_Print(txt);
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 5);
sprintf(txt," Draw Frame Rate: %d", config->DrawRate);
Mono_Print(txt);
/* Slow palette */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 6);
Mono_Print(" Slow palette: ");
if (config->OptionFlags & VQAOPTF_SLOWPAL) {
Mono_Print("ON");
} else {
Mono_Print("OFF");
}
/* Memory Usage */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 7);
sprintf(txt," Memory Used: %ld", vqabuf->MemUsed);
Mono_Print(txt);
/* Timer Method */
Mono_Set_Cursor(MAIN_WX1 + 18, MAIN_WY1 + 8);
if (VQA_TimerMethod() == VQA_TMETHOD_DOS) {
Mono_Print(" DOS Timer:");
} else if (VQA_TimerMethod() == VQA_TMETHOD_INT) {
Mono_Print(" Interrupt Timer:");
} else if (VQA_TimerMethod() == VQA_TMETHOD_AUDIO) {
Mono_Print(" Audio DMA Timer:");
} else {
Mono_Print(" Defualt:");
}
/* Init loader data window */
Mono_Draw_Rect(LOADER_WX1, LOADER_WY1, (LOADER_WX2 - LOADER_WX1 + 1),
(LOADER_WY2 - LOADER_WY1 + 1), 2, 1);
Mono_Set_Cursor((LOADER_WX2 + LOADER_WX1 - strlen(LOADER_TITLE)) / 2,
LOADER_WY1);
Mono_Print(LOADER_TITLE);
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 1);
Mono_Print(" Current Frame #:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 2);
Mono_Print("# Waits on Drawer:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 3);
Mono_Print(" # Waits on Audio:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 4);
Mono_Print(" Frame Size:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY1 + 5);
Mono_Print(" Max Frame Size:");
Mono_Set_Cursor(LOADER_WX1 + 2, LOADER_WY2 - 2);
Mono_Print("Audio:");
/* Init drawer data window */
Mono_Draw_Rect(DRAWER_WX1, DRAWER_WY1, (DRAWER_WX2 - DRAWER_WX1 + 1),
(DRAWER_WY2 - DRAWER_WY1 + 1), 2, 1);
Mono_Set_Cursor((DRAWER_WX2 + DRAWER_WX1 - strlen(DRAWER_TITLE)) / 2,
DRAWER_WY1);
Mono_Print(DRAWER_TITLE);
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 1);
Mono_Print(" Current Frame #:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 2);
Mono_Print(" Desired Frame #:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 3);
Mono_Print("# Waits on Flipper:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 4);
Mono_Print(" # Waits on Loader:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 5);
Mono_Print(" # Frames Skipped:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY1 + 6);
Mono_Print(" VQ Block Size:");
Mono_Set_Cursor(DRAWER_WX1 + 2, DRAWER_WY2 - 2);
Mono_Print("Frames: Cbooks:");
/* Init audio data window */
Mono_Draw_Rect(AUDIO_WX1, AUDIO_WY1, (AUDIO_WX2 - AUDIO_WX1 + 1),
(AUDIO_WY2 - AUDIO_WY1 + 1), 2, 1);
Mono_Set_Cursor((AUDIO_WX2 + AUDIO_WX1 - strlen(AUDIO_TITLE)) / 2,
AUDIO_WY1);
Mono_Print(AUDIO_TITLE);
Mono_Set_Cursor(AUDIO_WX1 + 2, AUDIO_WY1 + 1);
Mono_Print("# Repeated Buffers:");
/* Init flipper data window */
Mono_Draw_Rect(FLIPPER_WX1, FLIPPER_WY1, (FLIPPER_WX2 - FLIPPER_WX1 + 1),
(FLIPPER_WY2 - FLIPPER_WY1 + 1), 2, 1);
Mono_Set_Cursor((FLIPPER_WX2 + FLIPPER_WX1 - strlen(FLIPPER_TITLE)) / 2,
FLIPPER_WY1);
Mono_Print(FLIPPER_TITLE);
Mono_Set_Cursor(FLIPPER_WX1 + 2, FLIPPER_WY1 + 1);
Mono_Print("Current Frame #:");
}
/****************************************************************************
*
* NAME
* VQA_UpdateMono - Update the player's mono output.
*
* SYNOPSIS
* VQA_UpdateMono(VQA)
*
* void VQA_UpdateMono(VQAHandleP *);
*
* FUNCTION
*
* INPUTS
* VQA - Pointer to private VQA handle.
*
* RESULT
* NONE
*
****************************************************************************/
#pragma argsused
void VQA_UpdateMono(VQAHandleP *vqap)
{
VQAData *vqabuf;
VQAConfig *config;
VQAFrameNode *frame;
VQACBNode *cbook;
long frameindex = -1;
long loadcb = -1;
long drawcb = -1;
long i;
unsigned long curtime;
char txt[80];
/* Dereference commonly used data members for quick access. */
vqabuf = vqap->VQABuf;
config = &vqap->Config;
/* Timer value */
curtime = VQA_GetTime(vqap);
Mono_Set_Cursor(MAIN_WX1 + 40, MAIN_WY1 + 8);
sprintf(txt,"%02ld:%02ld.%02ld",curtime / (VQA_TIMETICKS * VQA_TIMETICKS),
curtime / VQA_TIMETICKS,((curtime * 100L) / VQA_TIMETICKS)
-((curtime / VQA_TIMETICKS) * 100L));
Mono_Print(txt);
/* Loader data */
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 1);
sprintf(txt,"%4d",vqabuf->Loader.LastFrameNum);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 2);
sprintf(txt,"%4ld",vqabuf->Loader.WaitsOnDrawer);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 3);
sprintf(txt,"%4ld",vqabuf->Loader.WaitsOnAudio);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 4);
sprintf(txt,"%5u",vqabuf->Loader.FrameSize);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 22, LOADER_WY1 + 5);
sprintf(txt,"%5u",vqabuf->Loader.MaxFrameSize);
Mono_Print(txt);
#if(VQAAUDIO_ON)
/* Draw a picture of the audio buffers */
for (i = 0; i < vqabuf->Audio.NumAudBlocks; i++) {
if (vqabuf->Audio.IsLoaded[i] == 0) {
txt[i] = '_';
} else {
txt[i] = 'X';
}
}
txt[i] = 0;
Mono_Set_Cursor(LOADER_WX1 + 9,LOADER_WY2 - 2);
Mono_Print(txt);
Mono_Set_Cursor(LOADER_WX1 + 9,LOADER_WY2-1);
Mono_Print(" ");
Mono_Set_Cursor(LOADER_WX1 + 9 + vqabuf->Audio.PlayPosition
/ config->HMIBufSize,LOADER_WY2 - 1);
Mono_Print("P");
Mono_Set_Cursor(LOADER_WX1 + 9 + vqabuf->Audio.AudBufPos
/ config->HMIBufSize,LOADER_WY2 - 1);
Mono_Print("L");
#endif /* VQAAUDIO_ON */
/* Drawer data */
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 1);
sprintf(txt,"%4d", vqabuf->Drawer.LastFrameNum);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 2);
sprintf(txt,"%4d", vqabuf->Drawer.DesiredFrame);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 3);
sprintf(txt,"%4ld", vqabuf->Drawer.WaitsOnFlipper);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 4);
sprintf(txt,"%4ld", vqabuf->Drawer.WaitsOnLoader);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 5);
sprintf(txt,"%4d", vqabuf->Drawer.NumSkipped);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 22,DRAWER_WY1 + 6);
sprintf(txt," %dx%d", vqap->Header.BlockWidth, vqap->Header.BlockHeight);
Mono_Print(txt);
/* Draw a picture of the frame buffers */
frame = vqabuf->FrameData;
for (i = 0; i < config->NumFrameBufs; i++) {
if (frame->Flags & VQAFRMF_LOADED) {
txt[i] = 'X';
} else {
txt[i] = '_';
}
if (vqabuf->Flipper.CurFrame == frame) {
frameindex = i;
}
frame = frame->Next;
}
txt[i] = 0;
Mono_Set_Cursor(DRAWER_WX1 + 10,DRAWER_WY2 - 2);
Mono_Print(txt);
Mono_Set_Cursor(DRAWER_WX1 + 10,DRAWER_WY2 - 1);
Mono_Print(" ");
Mono_Set_Cursor(DRAWER_WX1 + 10 + frameindex,DRAWER_WY2 - 1);
Mono_Print("^");
/* Draw a picture of the codebook buffers */
cbook = vqabuf->CBData;
for (i = 0; i < config->NumCBBufs; i++) {
if (vqabuf->Loader.CurCB == cbook) {
loadcb = i;
}
if (vqabuf->Flipper.CurFrame->Codebook == cbook) {
drawcb = i;
}
cbook = cbook->Next;
}
Mono_Set_Cursor(DRAWER_WX1 + 34,DRAWER_WY2 - 2);
Mono_Print("___");
Mono_Set_Cursor(DRAWER_WX1 + 34,DRAWER_WY2 - 1);
Mono_Print(" ");
Mono_Set_Cursor(DRAWER_WX1 + 34 + loadcb,DRAWER_WY2 - 1);
Mono_Print("L");
Mono_Set_Cursor(DRAWER_WX1 + 34 + drawcb,DRAWER_WY2 - 1);
Mono_Print("D");
/* Audio data */
#if(VQAAUDIO_ON)
Mono_Set_Cursor(AUDIO_WX1 + 22, AUDIO_WY1 + 1);
sprintf(txt,"%4ld", vqabuf->Audio.NumSkipped);
Mono_Print(txt);
#endif
/* Flipper data */
Mono_Set_Cursor(FLIPPER_WX1 + 22,FLIPPER_WY1 + 1);
sprintf(txt,"%4d", vqabuf->Flipper.LastFrameNum);
Mono_Print(txt);
Mono_Set_Cursor(0,0);
}
#endif /* VQAMONO_ON */

565
WINVQ/VQA32/OLD/SOS.H Normal file
View File

@@ -0,0 +1,565 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sos.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOS_DEFINED
#define _SOS_DEFINED
#include "sosdefs.h"
#pragma pack(4)
// error definition for sound operating system
#define _SOS_ERR -1
// number of drivers allowed to be open at one time
#define _SOS_MAX_DRIVERS 5
// structure definition for the capabilities
typedef struct _tagCAPABILITIES
{
BYTE szDeviceName[ 32 ]; // device name
WORD wDeviceVersion; // device version
WORD wBitsPerSample; // bits per sound sample
WORD wChannels; // stereo/mono sound card
WORD wMinRate; // minimum rate
WORD wMaxRate; // maximum rate
WORD wMixerOnBoard; // board contains mixer
WORD wMixerFlags; // mixer capabilities
WORD wFlags; // miscellaneous flags
short far * lpPortList; // list of usable ports
short far * lpDMAList; // list of usable dma channels
short far * lpIRQList; // list of usable irq channels
short far * lpRateList; // list of usable rates, -1 if any in min to max
WORD fBackground; // foreground or background driver
WORD wDeviceID; // ID for the device
WORD wTimerID; // ID for the timer
} _SOS_CAPABILITIES;
// far pointer to the device capabilities structure
typedef _SOS_CAPABILITIES far * LPSOSDEVICECAPS;
// flag types for driver
#define _FLAGS_SIGNED 0x8000
// devices that can be loaded
#define _SOUND_BLASTER_8_MONO 0xe000
#define _SOUND_BLASTER_8_ST 0xe001
#define _SBPRO_8_ST _SOUND_BLASTER_8_ST
#define _SBPRO_8_MONO 0xe00f
#define _SOUND_MASTER_II_8_MONO 0xe002
#define _MV_PAS_8_MONO 0xe003
#define _MV_PAS_16_MONO 0xe004
#define _MV_PAS_8_ST 0xe005
#define _MV_PAS_16_ST 0xe006
#define _ADLIB_GOLD_8_ST 0xe007
#define _ADLIB_GOLD_16_ST 0xe008
#define _ADLIB_GOLD_8_MONO 0xe009
#define _ADLIB_GOLD_16_MONO 0xe00a
#define _MICROSOFT_8_MONO 0xe00b
#define _MICROSOFT_8_ST 0xe00c
#define _MICROSOFT_16_MONO 0xe00d
#define _MICROSOFT_16_ST 0xe00e
#define _SOUND_SOURCE_8_MONO_PC 0xe010
#define _SOUND_SOURCE_8_MONO_TANDY 0xe011
#define _GENERAL_PORT_8_MONO 0xe012
#define _GENERAL_PORT_8_MONO_R 0xe013
#define _SIERRA_8_MONO 0xe014
#define _SB16_8_MONO 0xe015
#define _SB16_8_ST 0xe016
#define _SB16_16_MONO 0xe017
#define _SB16_16_ST 0xe018
#define _ESS_AUDIODRIVE_8_MONO 0xe019
#define _ESS_AUDIODRIVE_8_ST 0xe01a
#define _ESS_AUDIODRIVE_16_MONO 0xe01b
#define _ESS_AUDIODRIVE_16_ST 0xe01c
#define _SOUNDSCAPE_8_MONO 0xe01d
#define _SOUNDSCAPE_8_ST 0xe01e
#define _SOUNDSCAPE_16_MONO 0xe01f
#define _SOUNDSCAPE_16_ST 0xe020
#define _RAP10_8_MONO 0xe021
#define _RAP10_16_MONO 0xe022
#define _GUS_8_MONO 0xe023
#define _GUS_8_ST 0xe024
#define _GUS_16_MONO 0xe025
#define _GUS_16_ST 0xe026
#define _GUS_MAX_8_MONO 0xe027
#define _GUS_MAX_8_ST 0xe028
#define _GUS_MAX_16_MONO 0xe029
#define _GUS_MAX_16_ST 0xe02a
#define _WAVEJAMMER_8_MONO 0xe02b
#define _WAVEJAMMER_8_ST 0xe02c
#define _WAVEJAMMER_16_MONO 0xe02d
#define _WAVEJAMMER_16_ST 0xe02e
#define _TEMPOCS_8_MONO 0xe02f
#define _TEMPOCS_8_ST 0xe030
#define _TEMPOCS_16_MONO 0xe031
#define _TEMPOCS_16_ST 0xe032
#define _WAVEJAMMERCD_8_MONO 0xe033
#define _WAVEJAMMERCD_8_ST 0xe034
#define _WAVEJAMMERCD_16_MONO 0xe035
#define _WAVEJAMMERCD_16_ST 0xe036
#define _SOUND_BLASTER_8_MONO_R 0xe050
#define _MICROSOFT_8_MONO_R 0xe051
#define _SOUND_MASTER_II_8_MONO_R 0xe052
#define _ADLIB_GOLD_8_MONO_R 0xe053
#define _MV_PAS_8_MONO_R 0xe054
#define _RAP10_8_MONO_R 0xe058
#define _RAP10_16_MONO_R 0xe059
#define _SB16_8_MONO_R 0xe05a
#define _SB16_8_ST_R 0xe05b
#define _SB16_16_MONO_R 0xe05c
#define _SB16_16_ST_R 0xe05d
#define _MV_PAS_16_MONO_R 0xe060
#define _SOUNDSCAPE_8_MONO_R 0xe061
#define _SOUNDSCAPE_8_ST_R 0xe062
#define _SOUNDSCAPE_16_MONO_R 0xe063
#define _SOUNDSCAPE_16_ST_R 0xe064
#define _ESS_AUDIODRIVE_8_MONO_R 0xe065
#define _ESS_AUDIODRIVE_8_ST_R 0xe066
#define _ESS_AUDIODRIVE_16_MONO_R 0xe067
#define _ESS_AUDIODRIVE_16_ST_R 0xe068
#define _SPEECH_THING_8_MONO 0xe090
#define _YAMAHA_8_MONO 0xe106
#define _INT_SPEAKER_8_MONO 0xe107
// call indexes for the loadable drivers
enum
{
_DRV_INIT,
_DRV_UNINIT,
_DRV_SETRATE,
_DRV_SETACTION,
_DRV_START,
_DRV_STOP,
_DRV_PAUSE,
_DRV_RESUME,
_DRV_CAPABILITIES,
_DRV_PLAY_FOREGROUND,
_DRV_GET_FILL_INFO,
_DRV_GET_CALL_FUNCTIONS,
_DRV_SET_CALL_FUNCTIONS
};
// fill info
typedef struct _tagFillInfo
{
LPSTR lpFillHandler; // pointer to fill handler
LPWORD lpDMAFillCount; // pointer to dma count
LPSTR lpSampleList; // pointer to sample list
LPWORD lpDMAMasterVolume; // pointer to dma count
} _SOS_FILL_INFO;
// caps info structure
typedef struct _tagCapsInfo
{
LPSTR lpPortList; // pointer to port list
LPSTR lpDMAList; // pointer to DMA list
LPSTR lpIRQList; // pointer to IRQ list
LPSTR lpRateList; // pointer to rate list
} _SOS_CAPS_INFO;
// maximum number of available voice
#define _MAX_VOICES 32
// structure definition
typedef struct _tagSAMPLE
{
LPSTR samplePtr; // pointer to data buffer
LPSTR sampleData; // pointer to active data
LPSTR sampleLoopPtr; // pointer for loop back
WORD sampleLength; // length of sample
WORD sampleIndex; // index into sample
WORD sampleLoopLength; // length of loop
WORD sampleBytesLeft; // bytes left to play in sample
WORD sampleLoopPoint; // byte count for loop point
WORD sampleLoopEndLength; // length of remaining chunk
short sampleFlags; // control sample
short sampleVolume; // volume control
short sampleID; // sample ID
short sampleChannel; // channel to play sample on
short sampleLoopCount; // loop count
short sampleLastFill; // last fill position
VOID ( far cdecl * sampleCallback )( WORD, WORD, WORD ); // callback function for sample
WORD samplePitchAdd;
short samplePitchFraction;
short samplePort; // port to use for non-dma digitized
WORD sampleTotalBytes;
WORD sampleByteLength;
short samplePanLocation;
short samplePanSpeed;
short samplePanDirection;
short samplePanStart;
short samplePanEnd;
short sampleDelayBytes;
short sampleDelayRepeat;
WORD sampleADPCMPredicted;
short sampleADPCMIndex;
short sampleRootNoteMIDI;
WORD sampleTemp1;
} _SOS_SAMPLE;
// enumeration for left or right channel
enum
{
_LEFT_CHANNEL,
_RIGHT_CHANNEL,
_CENTER_CHANNEL,
_INTERLEAVED
};
// enumeration for foreground and background
enum
{
_FOREGROUND,
_BACKGROUND
};
// defines for the sample flags
#define _ACTIVE 0x8000
#define _LOOPING 0x4000
#define _FIRST_TIME 0x2000
#define _PENDING_RELEASE 0x1000
#define _CONTINUE_BLOCK 0x0800
#define _PITCH_SHIFT 0x0400
#define _PANNING 0x0200
#define _VOLUME 0x0100
#define _TRANSLATE16TO8 0x0080
#define _STAGE_LOOP 0x0040
#define _TRANSLATE8TO16 0x0020
#define _STEREOTOMONO 0x0010
// defines for the wParam flags
#define _SINGLE_SAMPLE 0x01
#define _SOS_DCAPS_AUTO_REINIT 0x01
#define _SOS_DCAPS_MPU_401 0x02
#define _SOS_DCAPS_OPL2 0x04
#define _SOS_DCAPS_OPL3 0x08
#define _SOS_DCAPS_OPL4 0x10
#define _SOS_DCAPS_WAVETABLE 0x20
#define _SOS_DCAPS_DL_SAMPLES 0x40
#define _SOS_DCAPS_FIFO_DEVICE 0x80
#define _SOS_DCAPS_ENV_NEEDED 0x100
#define _SOS_DCAPS_PSEUDO_DMA1 0x200
#define _SOS_DCAPS_SIGNED_DATA 0x8000
// file header structure
typedef struct
{
// name ID
BYTE szName[ 32 ];
// number of drivers in the file
WORD wDrivers;
// offset of first driver
WORD lOffset;
// size of the file
WORD lFileSize;
} _FILEHEADER;
// driver header structure
typedef struct
{
// name ID
BYTE szName[ 32 ];
// offset of next driver
WORD lNextDriver;
// size of current driver
WORD wSize;
// id for the current device
WORD wDeviceID;
// id for the type of DOS extender
WORD wExtenderType;
} _DRIVERHEADER;
// device hardware information
typedef struct
{
// port to be used
WORD wPort;
// irq to use
WORD wIRQ;
// dma channel to se
WORD wDMA;
// extra parameter
WORD wParam;
} _SOS_HARDWARE;
// structure definition for start sample
typedef struct
{
// pointer to sample
LPSTR lpSamplePtr;
// size of the sample
WORD dwSampleSize;
// number of times to loop the sample -1 is infinite
WORD wLoopCount;
// channel to play sample on
WORD wChannel;
// volume to play sample at
WORD wVolume;
// id for the sample
WORD wSampleID;
// far pointer to the callback function
VOID ( far cdecl *lpCallback )( WORD, WORD, WORD );
// port to use if driver is a non-dma background driver
WORD wSamplePort;
// flags field
WORD wSampleFlags;
// total length of sample including loops, etc..
WORD dwSampleByteLength;
// loop point for the sample
WORD dwSampleLoopPoint;
WORD dwSampleLoopLength;
// pitch shifting components
WORD dwSamplePitchAdd;
WORD wSamplePitchFraction;
// pan components
WORD wSamplePanLocation;
WORD wSamplePanSpeed;
WORD wSamplePanDirection;
WORD wSamplePanStart;
WORD wSamplePanEnd;
// delay parts
WORD wSampleDelayBytes;
WORD wSampleDelayRepeat;
// compression components
WORD dwSampleADPCMPredicted;
WORD wSampleADPCMIndex;
// root note for pitch shifting
WORD wSampleRootNoteMIDI;
// filler for future upgrades
WORD dwSampleTemp1;
WORD dwSampleTemp2;
WORD dwSampleTemp3;
} _SOS_START_SAMPLE;
// structure for initializing a driver
typedef struct
{
WORD wBufferSize;
LPSTR lpBuffer;
BOOL wAllocateBuffer;
WORD wSampleRate;
WORD wParam;
LONG dwParam;
VOID ( far *lpFillHandler )( VOID );
LPSTR lpDriverMemory;
LPSTR lpDriverMemoryCS;
LPSTR lpTimerMemory;
LPSTR lpTimerMemoryCS;
WORD wTimerID;
WORD wPhysical;
} _SOS_INIT_DRIVER;
// define for the timer types to use
#define _SOS_NORMAL_TIMER 0x00
// enumeration for the timer types
enum
{
_TIMER_8_MONO = 0x1000,
_TIMER_8_ST,
_TIMER_16_MONO,
_TIMER_16_ST,
_TIMER_8_MONO_ULAW,
_TIMER_8_ST_ULAW,
_TIMER_16_MONO_ULAW,
_TIMER_16_ST_ULAW,
_TIMER_8_MONO_REC,
_TIMER_8_MONO_ULAW_REC,
_TIMER_UNDEFINED_1,
_TIMER_UNDEFINED_2,
_TIMER_UNDEFINED_3,
_TIMER_UNDEFINED_4,
_TIMER_UNDEFINED_5,
_TIMER_UNDEFINED_6,
_TIMER_UNDEFINED_7,
_TIMER_UNDEFINED_8,
_TIMER_UNDEFINED_9,
_TIMER_UNDEFINED_A,
_TIMER_UNDEFINED_B,
_TIMER_UNDEFINED_C,
_TIMER_UNDEFINED_D,
_TIMER_UNDEFINED_E,
_TIMER_UNDEFINED_F,
_TIMER_UNDEFINED_10,
_TIMER_UNDEFINED_11,
_TIMER_UNDEFINED_12,
_TIMER_UNDEFINED_13,
_TIMER_UNDEFINED_14,
_TIMER_UNDEFINED_15,
_TIMER_UNDEFINED_16,
_TIMER_8_SOUND_SOURCE,
_TIMER_8_SOUND_SOURCE_TANDY,
_TIMER_8_GENERAL_PORT,
_TIMER_8_GENERAL_PORT_REC
};
// define for no slots available
#define _ERR_NO_SLOTS ( WORD )-1
// error codes for the system
enum
{
_ERR_NO_ERROR,
_ERR_DRIVER_NOT_LOADED,
_ERR_INVALID_POINTER,
_ERR_DETECT_INITIALIZED,
_ERR_FAIL_ON_FILE_OPEN,
_ERR_MEMORY_FAIL,
_ERR_INVALID_DRIVER_ID,
_ERR_NO_DRIVER_FOUND,
_ERR_DETECTION_FAILURE,
_ERR_DRIVER_LOADED,
_ERR_INVALID_HANDLE,
_ERR_NO_HANDLES,
_ERR_PAUSED,
_ERR_NOT_PAUSED,
_ERR_INVALID_DATA,
_ERR_DRV_FILE_FAIL,
_ERR_INVALID_PORT,
_ERR_INVALID_IRQ,
_ERR_INVALID_DMA,
_ERR_INVALID_DMA_IRQ
};
// maximum number of timer events that can be registered
#define _TIMER_MAX_EVENTS 0x10
// flags for the debugging system
#define _SOS_DEBUG_NORMAL 0x0000
#define _SOS_DEBUG_NO_TIMER 0x0001
#define _SOS_TIMER_DPMI 0x0002
// define for types of DOS extenders
#define _SOS_RATIONAL 0x8000
#define _SOS_FLASHTECK 0x4000
// defines for the types of timers for different
// dos extenders
#define _SOS_TIMER_NEAR 0x8000
#define _SOS_TIMER_FAR 0x4000
// values for callback information
enum
{
_SAMPLE_PROCESSED,
_SAMPLE_LOOPING,
_SAMPLE_DONE
};
// define for special 18.2 callback rate to dos
#define _TIMER_DOS_RATE 0xff00
#pragma pack()
#pragma aux int_3 = "int 3"
#pragma pack( 1 )
typedef struct
{
unsigned region_size;
unsigned offset;
unsigned segment;
unsigned short number_available;
unsigned short number_used;
unsigned page0;
} EVDS_STRUCT;
typedef struct
{
unsigned region_size;
unsigned offset;
unsigned short segment;
unsigned short ID;
unsigned physical;
} VDS_STRUCT;
#pragma pack()
#include "sosdata.h"
#include "sosfnct.h"
#endif

128
WINVQ/VQA32/OLD/SOSDATA.H Normal file
View File

@@ -0,0 +1,128 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosdata.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOS_DATA
#define _SOS_DATA
#include <stddef.h>
#pragma pack(4)
extern WORD _sosDIGIData_Start;
extern WORD _sosDIGIData_End;
extern WORD _wSOSDriverLinear[];
extern WORD _wSOSTimerLinear[];
extern LPSTR _lpSOSDriver[];
extern LPSTR _lpSOSTimer[];
extern LPSTR _lpSOSDriverCS[];
extern LPSTR _lpSOSTimerCS[];
extern BOOL _wSOSDriverLoaded[];
extern BOOL _wSOSTimerLoaded[];
extern BOOL _wSOSDriverInitialized[];
extern WORD _wSOSOutputRate[];
extern WORD _wSOSDMABuffersize[];
extern LONG _dwSOSDMABufferPhysical[];
extern LPSTR _lpSOSDMABuffer[];
extern BOOL _wTimerUsed;
extern VOID ( far *_lpSOSFillHandler[] )( VOID );
extern WORD _wSOSTimerType[];
extern WORD _wSOSDriverType[];
extern _SOS_SAMPLE far * _lpSOSSampleList[][ _MAX_VOICES ];
extern LPWORD _lpSOSDMAIrqCount[];
extern LPWORD _lpSOSDMAFillCount[];
extern WORD _wSOSTmrNextCount;
extern VOID ( interrupt far *_lpSOSOldTimer )( VOID );
extern WORD _wSOSDriverID[];
extern _SOS_CAPABILITIES _sSOSDriverCaps[];
extern WORD _wSOSDMAPortList[];
extern BYTE _bSOSDMAChannel[];
extern _SOS_INIT_DRIVER _sSOSDIGIInitDriver[];
extern BYTE _pSOSDriverPath[];
extern BYTE _pSOSTempDriverPath[];
extern BOOL _wTIMERUsed;
extern WORD _wTIMERValue;
extern VOID ( far * _lpTIMEREvents[] )( VOID );
extern WORD _wTIMEREventRate[];
extern WORD _dwTIMEREventFraction[];
extern WORD _dwTIMEREventFractionCurrent[];
extern BYTE _bSOSMIDITimerSongHandler[];
extern BYTE _bSOSMIDISongHandle;
extern WORD _wSOSTimerMemHandle[];
extern WORD _wSOSDriverMemHandle[];
extern WORD _wSOSRealSeg[];
extern _FILEHEADER _sDETFileHeader;
extern _DRIVERHEADER _sDETDriverHeader;
extern _FILEHEADER sLOADFileHeader;
extern _DRIVERHEADER sLOADDriverHeader;
extern BOOL _wDETInitialized;
extern WORD _wDETLinear;
extern LPSTR _lpDETDriverBuffer;
extern LPSTR _lpDETDriverBufferCS;
extern WORD _hDETFile;
extern DWORD _dwDETDriverIndex;
extern WORD _wDETDriverIndexCur;
extern WORD _wDETMemHandle;
extern LPSOSDEVICECAPS _lpDETDeviceCaps;
extern _SOS_CAPABILITIES _sDETCaps;
extern PSTR _pSOSErrorStrings[];
extern BOOL _wSOSBufferAllocated[];
extern BOOL _wSOSSystemInitialized;
extern VDS_STRUCT _sSOSVDSInfo;
extern _SOS_FILL_INFO _sSOSFillInfo;
extern WORD _wSOSTimerEventIndex;
extern WORD _wSOSTimerEntered;
extern WORD _wSOSDriverSize[];
extern WORD _wSOSTimerSize[];
#ifdef __cplusplus
extern "C" {
#endif
extern WORD _sosDIGIData1_Start;
extern WORD _sosDIGIData1_End;
extern WORD _sosDIGIData2_Start;
extern WORD _sosDIGIData2_End;
extern BYTE _bTIMERInstalled;
extern BYTE _bTIMERDPMI;
extern WORD wDetectPort;
extern WORD wDetectIRQ;
extern WORD wDetectDMA;
extern WORD wDetectParam;
#ifdef __cplusplus
}
#endif
#pragma pack()
#endif


83
WINVQ/VQA32/OLD/SOSDEFS.H Normal file
View File

@@ -0,0 +1,83 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosdefs.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOSDEFS_DEFINED
#define _SOSDEFS_DEFINED
#undef _TRUE
#undef _FALSE
#undef _NULL
enum
{
_FALSE,
_TRUE
};
#define _NULL 0
#ifndef VOID
#define VOID void
#endif
typedef int BOOL;
typedef unsigned int UINT;
typedef unsigned char BYTE;
typedef unsigned WORD;
#ifndef LONG
typedef signed long LONG;
#endif
typedef unsigned long DWORD;
typedef BYTE * PBYTE;
typedef char near * PSTR;
typedef WORD * PWORD;
typedef LONG * PLONG;
typedef VOID * PVOID;
typedef BYTE far * LPBYTE;
typedef BYTE far * LPSTR;
typedef WORD far * LPWORD;
typedef LONG far * LPLONG;
typedef VOID far * LPVOID;
typedef BYTE huge * HPBYTE;
typedef BYTE huge * HPSTR;
typedef WORD huge * HPWORD;
typedef LONG huge * HPLONG;
typedef VOID huge * HPVOID;
typedef unsigned HANDLE;
#endif


218
WINVQ/VQA32/OLD/SOSFNCT.H Normal file
View File

@@ -0,0 +1,218 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosfnct.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#ifndef _SOS_FUNCTIONS
#define _SOS_FUNCTIONS
#pragma pack(4)
WORD sosDIGILockMemory ( VOID );
WORD sosDIGIUnLockMemory ( VOID );
WORD sosDIGIInitSystem ( LPSTR, WORD );
WORD sosDIGIUnInitSystem ( VOID );
WORD sosDIGIInitDriver ( WORD, _SOS_HARDWARE far *,
_SOS_INIT_DRIVER far *, WORD far * );
WORD sosDIGIUnInitDriver ( WORD, BOOL, BOOL );
WORD sosDIGILoadDriver ( WORD, WORD, LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
WORD sosDIGIUnLoadDriver ( WORD );
WORD sosDIGIGetDeviceCaps ( WORD, LPSOSDEVICECAPS );
#ifdef PHARLAP
LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
#else
LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
#endif
WORD sosDIGIStopSample ( WORD, WORD );
WORD sosDIGISamplesPlaying ( WORD );
BOOL sosDIGISampleDone ( WORD, WORD );
BOOL sosDIGISampleFilling ( WORD, WORD );
WORD sosDIGIStartSample ( WORD, _SOS_START_SAMPLE far * );
WORD sosDIGIContinueSample ( WORD, WORD, _SOS_START_SAMPLE far * );
WORD sosDIGIDetectInit ( LPSTR );
WORD sosDIGIDetectUnInit ( VOID );
WORD sosDIGIDetectFindHardware ( WORD, _SOS_CAPABILITIES far *, WORD far * );
WORD sosDIGIDetectFindFirst ( _SOS_CAPABILITIES far *, WORD far * );
WORD sosDIGIDetectFindNext ( _SOS_CAPABILITIES far *, WORD far * );
WORD sosDIGIDetectGetSettings ( _SOS_HARDWARE far * );
WORD sosDIGIDetectGetCaps ( WORD, _SOS_CAPABILITIES far * );
WORD sosDIGIDetectVerifySettings( _SOS_HARDWARE far * );
PSTR sosGetErrorString ( WORD );
WORD sosDIGILoadTimer ( WORD , LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
WORD sosDIGIUnLoadTimer ( WORD );
WORD sosTIMERRegisterEvent ( WORD wCallRate, VOID ( far * lpTimerEvent )( VOID ), WORD far *lpTimerHandle );
WORD sosTIMERInitSystem ( WORD, WORD );
WORD sosTIMERUnInitSystem ( WORD );
WORD sosTIMERSetRate ( WORD );
WORD sosTIMERRemoveEvent ( WORD );
WORD sosTIMERAlterEventRate ( WORD, WORD );
WORD sosTIMERGetEventRate ( WORD );
VOID far sosTIMEROldHandler ( VOID );
VOID far sosTIMERHandler ( VOID );
// functions in soscntl.c
WORD sosDIGISetSampleVolume ( WORD, WORD, WORD );
WORD sosDIGIGetSampleVolume ( WORD, WORD );
WORD sosDIGISetChannel ( WORD, WORD, WORD );
WORD sosDIGIGetChannel ( WORD, WORD );
WORD sosDIGIGetBytesProcessed ( WORD, WORD );
WORD sosDIGIGetLoopCount ( WORD, WORD );
WORD sosDIGISetPanLocation ( WORD, WORD, WORD );
WORD sosDIGIGetPanLocation ( WORD, WORD );
DWORD sosDIGISetPitch ( WORD, WORD, DWORD );
DWORD sosDIGIGetPitch ( WORD, WORD );
WORD sosDIGIGetDMAPosition ( WORD );
WORD sosDIGISetPanSpeed ( WORD, WORD, WORD );
WORD sosDIGIGetPanSpeed ( WORD, WORD );
WORD sosDIGIGetSampleID ( WORD, WORD );
WORD sosDIGIGetSampleHandle ( WORD, WORD );
WORD sosDIGISetMasterVolume ( WORD, WORD );
#ifdef PHARLAP
VOID sosFreeVDSPage ( unsigned short, unsigned short, DWORD );
WORD sosAllocVDSPage ( unsigned short *, unsigned short *, DWORD * );
#else
WORD sosAllocVDSPage ( LPSTR *, WORD *, WORD * );
VOID sosFreeVDSPage ( WORD, WORD, LONG );
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef PHARLAP
extern int cdecl sosRealFree ( int );
extern BOOL cdecl _sos_read( WORD, LPSTR, WORD, WORD * );
extern int cdecl sosRealAlloc( int, int *, int * );
extern void cdecl sosDRVFarMemCopy( LPSTR, LPSTR, WORD );
extern int cdecl sosGetCS( VOID );
extern int cdecl sosGetES( VOID );
#else
extern int cdecl sosRealAlloc ( int, int *, int * );
extern int cdecl sosRealFree ( int );
#endif
// sos driver functions
extern WORD cdecl sosDRVLockMemory ( DWORD, DWORD );
extern WORD cdecl sosDRVUnLockMemory ( DWORD, DWORD );
extern void cdecl sosDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
extern void cdecl sosDetDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
extern void cdecl sosDRVGetCapsPtr ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
extern void cdecl sosDRVInit ( LPSTR, LPSTR, int, int, int, int, int, int );
extern void cdecl sosDRVStart ( LPSTR, LPSTR, int, int );
extern void cdecl sosDRVSetRate ( LPSTR, LPSTR, int );
extern void cdecl sosDRVSetAction ( LPSTR, LPSTR );
extern void cdecl sosDRVStop ( LPSTR, LPSTR );
extern void cdecl sosDRVUnInit ( LPSTR, LPSTR );
extern void cdecl sosDRVGetFillInfo ( LPSTR, LPSTR, LPSTR, int, int, int, _SOS_FILL_INFO * );
extern void cdecl sosFillSampleStructs ( PSTR, LPSTR );
extern WORD cdecl sosDetDRVExist ( LPSTR, LPSTR );
extern WORD cdecl sosDetDRVGetSettings ( LPSTR, LPSTR );
extern WORD cdecl sosDetDRVVerifySettings( LPSTR, WORD, WORD, WORD, LPSTR );
extern WORD cdecl sosDIGIInitForWindows( WORD );
extern WORD cdecl sosDIGIUnInitForWindows( WORD );
extern LPSTR cdecl sosAllocateFarMem ( WORD, PSTR, WORD * );
extern LPSTR cdecl sosCreateAliasCS ( LPSTR );
extern VOID cdecl sosFreeSelector ( LPSTR, DWORD );
extern LPSTR cdecl sosMAKEDOSPtr ( PSTR );
extern VOID cdecl sosDetDRVSetEnvString ( DWORD, PSTR );
extern PSTR cdecl sosDetDRVGetEnvString ( DWORD );
extern VOID cdecl sosDetDRVEnvStringInit ( LPSTR, LPSTR );
extern VOID cdecl sosDRVSetupCallFunctions( LPSTR, LPSTR, LPSTR, LPSTR );
extern WORD cdecl sosDRVGetFreeMemory ( VOID );
extern WORD cdecl sosDRVAllocVDSStruct ( WORD, WORD *, WORD * );
extern WORD cdecl sosDRVFreeVDSStruct ( WORD, WORD );
extern WORD cdecl sosDRVIsWindowsActive ( VOID );
extern WORD cdecl sosDRVVDSGetBuffer ( WORD );
extern WORD cdecl sosDRVVDSFreeBuffer ( WORD );
extern WORD cdecl getDS( VOID );
extern WORD cdecl sosDRVMakeDMASelector ( WORD );
extern WORD cdecl sosDRVFreeDMASelector ( WORD );
extern void cdecl sosTIMERDRVInit( int wRate, void ( far * )( void ) );
extern void cdecl sosTIMERDRVUnInit( void );
extern void cdecl sosTIMERDRVHandler( void );
extern void cdecl sosTIMERDRVFHandler( void );
extern void cdecl sosTIMERDRVEnable( void );
extern void cdecl sosTIMERDRVDisable( void );
extern void cdecl sosTIMERDRVCallOld( void );
extern void cdecl sosTIMERDRVSetRate( WORD );
extern void cdecl sosDIGITimer_Start( void );
extern void cdecl sosDIGITimer_End( void );
extern void cdecl sosDIGIDrv_Start( void );
extern void cdecl sosDIGIDrv_End( void );
#ifdef __cplusplus
}
#endif
// external functions for handling system initialization and
// uninitialization
WORD sosEXDIGInitDriver ( WORD, WORD, WORD, LPSTR,
_SOS_HARDWARE far *, WORD * );
WORD sosEXDIGIUnInitDriver ( VOID );
WORD sosEXDETFindDriver ( WORD, LPSTR, _SOS_HARDWARE far *,
_SOS_CAPABILITIES far * );
// memory locking prototypes
VOID sosDIGICaps_Start( VOID );
VOID sosDIGICaps_End( VOID );
VOID sosDIGIErr_Start( VOID );
VOID sosDIGIErr_End( VOID );
VOID sosDIGITmr_Start( VOID );
VOID sosDIGITmr_End( VOID );
VOID sosDIGIStart_Start( VOID );
VOID sosDIGIStart_End( VOID );
VOID sosDIGIPlyng_Start( VOID );
VOID sosDIGIPlyng_End( VOID );
VOID sosDIGIRate_Start( VOID );
VOID sosDIGIRate_End( VOID );
VOID sosDIGIDone_Start( VOID );
VOID sosDIGIDone_End( VOID );
VOID sosDIGIDetec_Start( VOID );
VOID sosDIGIDetec_End( VOID );
VOID sosDIGIInit_Start( VOID );
VOID sosDIGIInit_End( VOID );
VOID sosDIGILoad_Start( VOID );
VOID sosDIGILoad_End( VOID );
VOID sosDIGICntl_Start( VOID );
VOID sosDIGICntl_End( VOID );
#pragma pack()
#endif

129
WINVQ/VQA32/OLD/SOSRES.H Normal file
View File

@@ -0,0 +1,129 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
File : sosres.h
Programmer(s) : Don Fowler, Nick Skrepetos
Date :
Purpose : Include Files For Zortech C++ Compiler
Last Updated :
****************************************************************************
Copyright(c) 1993,1994 Human Machine Interfaces
All Rights Reserved
****************************************************************************/
#define _SOS_RESOURCE
#ifndef _SOS_RESOURCE
#define _SOS_RESOURCE
// structure for resource file header
typedef struct
{
// file version
WORD wVersion;
// file size
LONG dwFileSize;
// number of resources in file
WORD wResCount;
// offset of resource data from top of file
LONG dwResOffset;
// offset of sync track from top of file
LONG dwSyncTrackOffset;
} _RES_FILE_HEADER;
// structure for resource block header
typedef struct
{
// resource id
WORD wID;
// resource type
WORD wResType;
// offset of next block
LONG dwNextBlock;
// size of the current resource information
LONG dwResSize;
// rate to play block at
WORD wBlockRate;
// id for the sync track to use
WORD wSyncTrackID;
} _RES_BLOCK_HEADER;
// structure for sync mark tag
typedef struct _tagSYNCMARK
{
// ID of the type of mark being used
WORD wID;
// location in data of sync mark
LONG dwSyncOffset;
// length of sync block
LONG dwSyncSize;
// start sample data
_SOS_START_SAMPLE sampleData;
} _RES_SYNCMARK;
typedef union
{
// structure for sync mark tag
_RES_SYNCMARK syncMark;
} _RES_TAG;
// union for filter information for prepareWave
typedef union
{
// filter type
WORD wFilterID;
// structure for volume
struct volume
{
WORD wVolume;
};
// structure for delay
struct delay
{
WORD wDelaySamples;
};
} _SOS_FILTER;
#endif


639
WINVQ/VQA32/OLD/TASK.CPP Normal file
View File

@@ -0,0 +1,639 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* task.c
*
* DESCRIPTION
* Loading and drawing delegation
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* July 25, 1995
*
*----------------------------------------------------------------------------
*
* PUBLIC
* VQA_Alloc - Allocate a VQAHandle to use.
* VQA_Free - Free a VQAHandle.
* VQA_Init - Initialize the VQAHandle IO.
* VQA_Play - Play the VQA movie.
* VQA_SetStop - Set the frame the player should stop on.
* VQA_GetInfo - Get VQA movie information.
* VQA_GetStats - Get VQA movie statistics.
* VQA_Version - Get VQA library version number.
* VQA_IDString - Get the VQA player library's ID string.
*
* PRIVATE
* VQA_IO_Task - Loader task for multitasking.
* VQA_Rendering_Task - Drawer task for multitasking.
* User_Update - Page flip routine called by the task interrupt.
*
****************************************************************************/
#include <stdio.h>
#include <malloc.h>
#include <dos.h>
#include <mem.h>
#include <conio.h>
#include <sys\timeb.h>
#include <vqm32\all.h>
#include "vqaplayp.h"
#include <vqm32\font.h>
/*---------------------------------------------------------------------------
* PRIVATE DECLARATIONS
*-------------------------------------------------------------------------*/
/* Externals */
#ifdef __cplusplus
extern "C" {
#endif
extern int __cdecl Check_Key(void);
extern int __cdecl Get_Key(void);
#ifdef __cplusplus
}
#endif
/****************************************************************************
*
* NAME
* VQA_Alloc - Allocate a VQAHandle to use.
*
* SYNOPSIS
* VQAHandle = VQA_Alloc()
*
* VQAHandle *VQA_Alloc(void);
*
* FUNCTION
* Obtain a VQAHandle. This handle is used by most VQA library functions,
* and contains the current position in the file. This is the only legal
* way to obtain a VQAHandle.
*
* INPUTS
* NONE
*
* RESULT
* VQA - Handle of a VQA.
*
****************************************************************************/
VQAHandle *VQA_Alloc(void)
{
VQAHandleP *vqa;
if ((vqa = (VQAHandleP *)malloc(sizeof(VQAHandleP))) != NULL) {
memset(vqa, 0, sizeof(VQAHandleP));
}
return ((VQAHandle *)vqa);
}
/****************************************************************************
*
* NAME
* VQA_Free - Free a VQAHandle.
*
* SYNOPSIS
* VQA_Free(VQA)
*
* void VQA_Free(VQAHandle *);
*
* FUNCTION
* Dispose of a VQAHandle. This is the only legal way to dispose of a
* VQAHandle.
*
* INPUTS
* VQA - Pointer to VQAHandle to dispose of.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_Free(VQAHandle *vqa)
{
if (vqa) free(vqa);
}
/****************************************************************************
*
* NAME
* VQA_Init - Initialize the VQAHandle IO handler.
*
* SYNOPSIS
* VQA_Init(VQA, IOHandler)
*
* void VQA_Init(VQAHandle *, IOHandler *);
*
* FUNCTION
* Initialize the specified VQAHandle IO with the client provided custom
* IO handler.
*
* INPUTS
* VQA - Pointer to VQAHandle to initialize.
* IOHandler - Pointer to custom file I/O handler function.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_Init(VQAHandle *vqa, long(*iohandler)(VQAHandle *vqa, long action,
void *buffer, long nbytes))
{
((VQAHandleP *)vqa)->IOHandler = iohandler;
}
/****************************************************************************
*
* NAME
* VQA_Reset - Reset the VQAHandle.
*
* SYNOPSIS
* VQA_Reset(VQA)
*
* void VQA_Reset(VQAHandle *);
*
* FUNCTION
*
* INPUTS
* VQA - VQAHandle to reset.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_Reset(VQAHandle *vqa)
{
VQAData *vqabuf;
/* Dereference data members for quick access */
vqabuf = ((VQAHandleP *)vqa)->VQABuf;
vqabuf->Flags = 0;
vqabuf->LoadedFrames = 0;
vqabuf->DrawnFrames = 0;
vqabuf->StartTime = 0;
vqabuf->EndTime = 0;
}
/****************************************************************************
*
* NAME
* VQA_Play - Play the VQA movie.
*
* SYNOPSIS
* Error = VQA_Play(VQA, Mode)
*
* long VQA_Play(VQAHandle *, long);
*
* FUNCTION
* Playback the movie associated with the specified VQAHandle.
*
* INPUTS
* VQA - Pointer to handle of movie to play.
* Mode - Playback mode.
* VQAMODE_RUN - Run the movie until completion.
* VQAMODE_WALK - Walk the movie frame by frame.
* VQAMODE_PAUSE - Pause the movie.
* VQAMODE_STOP - Stop the movie (Shutdown).
*
* RESULT
* Error - 0 if successful, or error code.
*
****************************************************************************/
long VQA_Play(VQAHandle *vqa, long mode)
{
VQAData *vqabuf;
VQAConfig *config;
VQADrawer *drawer;
long rc;
long i;
long key;
/* Dereference commonly used data members for quick access. */
vqabuf = ((VQAHandleP *)vqa)->VQABuf;
drawer = &vqabuf->Drawer;
config = &((VQAHandleP *)vqa)->Config;
/* One time player priming. */
if (!(vqabuf->Flags & VQADATF_PRIMED)) {
/* Init the Drawer's configuration */
VQA_Configure_Drawer((VQAHandleP *)vqa);
/* If audio enabled & loaded, start playing */
#if(VQAAUDIO_ON)
if ((config->OptionFlags & VQAOPTF_AUDIO) && vqabuf->Audio.IsLoaded[0]) {
VQA_StartAudio((VQAHandleP *)vqa);
}
#endif
/* Initialize the timer */
i = ((vqabuf->Drawer.CurFrame->FrameNum * VQA_TIMETICKS)
/ config->DrawRate);
VQA_SetTimer((VQAHandleP *)vqa, i, config->TimerMethod);
vqabuf->StartTime = VQA_GetTime((VQAHandleP *)vqa);
/* Set up the Mono screen */
#if(VQAMONO_ON)
if (config->OptionFlags & VQAOPTF_MONO) {
VQA_InitMono((VQAHandleP *)vqa);
}
#endif
/* Priming is complete. */
vqabuf->Flags |= VQADATF_PRIMED;
}
/* Main Player Loop */
switch (mode) {
case VQAMODE_PAUSE:
if ((vqabuf->Flags & VQADATF_PAUSED) == 0) {
vqabuf->Flags |= VQADATF_PAUSED;
vqabuf->EndTime = VQA_GetTime((VQAHandleP *)vqa);
/* Stop the audio while the movie is paused. */
#if(VQAAUDIO_ON)
if (vqabuf->Audio.Flags & VQAAUDF_ISPLAYING) {
VQA_StopAudio((VQAHandleP *)vqa);
}
#endif
}
rc = VQAERR_PAUSED;
break;
case VQAMODE_RUN:
case VQAMODE_WALK:
default:
/* Start up the movie if is it currently paused. */
if (vqabuf->Flags & VQADATF_PAUSED) {
vqabuf->Flags &= ~VQADATF_PAUSED;
/* Start the audio if it was previously on. */
#if(VQAAUDIO_ON)
if (config->OptionFlags & VQAOPTF_AUDIO) {
VQA_StartAudio((VQAHandleP *)vqa);
}
#endif
VQA_SetTimer((VQAHandleP *)vqa, vqabuf->EndTime, config->TimerMethod);
}
/* Load, Draw, Load, Draw, Load, Draw ... */
while ((vqabuf->Flags & (VQADATF_DDONE|VQADATF_LDONE))
!= (VQADATF_DDONE|VQADATF_LDONE)) {
/* Load a frame */
if (!(vqabuf->Flags & VQADATF_LDONE)) {
if ((rc = VQA_LoadFrame(vqa)) == 0) {
vqabuf->LoadedFrames++;
}
else if ((rc != VQAERR_NOBUFFER) && (rc != VQAERR_SLEEPING)) {
vqabuf->Flags |= VQADATF_LDONE;
rc = 0;
}
}
/* Draw a frame */
if ((config->DrawFlags & VQACFGF_NODRAW) == 0) {
if ((rc = (*(vqabuf->Draw_Frame))(vqa)) == 0) {
vqabuf->DrawnFrames++;
rc = vqabuf->Drawer.LastFrameNum;
if (User_Update(vqa)) {
vqabuf->Flags |= (VQADATF_DDONE|VQADATF_LDONE);
}
}
else if ((vqabuf->Flags & VQADATF_LDONE)
&& (rc == VQAERR_NOBUFFER)) {
vqabuf->Flags |= VQADATF_DDONE;
}
} else {
vqabuf->Flags |= VQADATF_DDONE;
drawer->CurFrame->Flags = 0L;
drawer->CurFrame = drawer->CurFrame->Next;
}
/* Update Mono output */
#if(VQAMONO_ON)
if (config->OptionFlags & VQAOPTF_MONO) {
VQA_UpdateMono((VQAHandleP *)vqa);
}
#endif
if (mode == VQAMODE_WALK) {
break;
}
#if(VQASTANDALONE)
else {
/* Do single-stepping check. */
if (config->OptionFlags & VQAOPTF_STEP) {
while ((key = Check_Key()) == 0);
Get_Key();
/* Escape key still quits. */
if (key == 27) {
break;
}
}
/* Check for ESC */
if ((key = Check_Key()) != 0) {
mode = VQAMODE_STOP;
break;
}
}
#endif
}
break;
}
/* If the movie is finished or we are requested to stop then shutdown. */
if (((vqabuf->Flags & (VQADATF_DDONE|VQADATF_LDONE))
== (VQADATF_DDONE|VQADATF_LDONE)) || (mode == VQAMODE_STOP)) {
/* Record the end time; must be done before stopping audio, since we're
* getting the elapsed time from the audio DMA position.
*/
vqabuf->EndTime = VQA_GetTime((VQAHandleP *)vqa);
/* Stop audio, if it's playing. */
#if(VQAAUDIO_ON)
if (vqabuf->Audio.Flags & VQAAUDF_ISPLAYING) {
VQA_StopAudio((VQAHandleP *)vqa);
}
#endif
/* Movie is finished. */
rc = VQAERR_EOF;
}
return (rc);
}
/****************************************************************************
*
* NAME
* VQA_SetStop - Set the frame the player should stop on.
*
* SYNOPSIS
* OldStop = VQA_SetStop(VQA, Frame)
*
* long = VQA_SetStop(VQAHandle *, long);
*
* FUNCTION
* Set the frame that the player should stop on. This function will only
* work on movies that are already open.
*
* INPUTS
* VQA - VQAHandle of movie to set the stop frame for.
* Frame - Frame number to stop on.
*
* RESULT
* OldStop - Previous stop frame. (-1 = invalid stop frame)
*
****************************************************************************/
long VQA_SetStop(VQAHandle *vqa, long stop)
{
long oldstop = -1;
VQAHeader *header;
/* Get a local pointer to the header. */
header = &((VQAHandleP *)vqa)->Header;
if ((stop > 0) && (header->Frames >= stop)) {
oldstop = header->Frames;
header->Frames = stop;
}
return (oldstop);
}
/****************************************************************************
*
* NAME
* VQA_GetInfo - Get VQA movie information.
*
* SYNOPSIS
* VQA_GetInfo(VQA, Info)
*
* void VQA_GetInfo(VQAHandle *, VQAInfo *);
*
* FUNCTION
* Retrieve information about the opened movie.
*
* INPUTS
* VQA - Pointer to VQAHandle of opened movie.
* Info - Pointer to VQAInfo structure to fill.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_GetInfo(VQAHandle *vqa, VQAInfo *info)
{
VQAHeader *header;
/* Dereference header structure. */
header = &((VQAHandleP *)vqa)->Header;
info->NumFrames = header->Frames;
info->ImageHeight = header->ImageHeight;
info->ImageWidth = header->ImageWidth;
info->ImageBuf = ((VQAHandleP *)vqa)->VQABuf->Drawer.ImageBuf;
}
/****************************************************************************
*
* NAME
* VQA_GetStats - Get VQA movie statistics.
*
* SYNOPSIS
* VQA_GetStats(VQA, Stats)
*
* void VQA_GetStats(VQAHandle *, VQAStatistics *);
*
* FUNCTION
* Retrieve the statistics for the VQA movie.
*
* INPUTS
* VQA - Handle of VQA movie to get statistics for.
* Stats - Pointer to VQAStatistics to fill.
*
* RESULT
* NONE
*
****************************************************************************/
void VQA_GetStats(VQAHandle *vqa, VQAStatistics *stats)
{
VQAData *vqabuf;
/* Dereference VQAData structure from VQAHandle */
vqabuf = ((VQAHandleP *)vqa)->VQABuf;
stats->MemUsed = vqabuf->MemUsed;
stats->StartTime = vqabuf->StartTime;
stats->EndTime = vqabuf->EndTime;
stats->FramesLoaded = vqabuf->LoadedFrames;
stats->FramesDrawn = vqabuf->DrawnFrames;
stats->FramesSkipped = vqabuf->Drawer.NumSkipped;
stats->MaxFrameSize = vqabuf->Loader.MaxFrameSize;
#if(VQAAUDIO_ON)
stats->SamplesPlayed = vqabuf->Audio.SamplesPlayed;
#else
stats->SamplesPlayed = 0;
#endif
}
/****************************************************************************
*
* NAME
* VQA_Version - Get VQA library version number.
*
* SYNOPSIS
* Version = VQA_Version()
*
* char *VQA_Version(void);
*
* FUNCTION
* Return the version of the VQA player library.
*
* INPUTS
* NONE
*
* RESULT
* Version - Pointer to version number string.
*
****************************************************************************/
char *VQA_Version(void)
{
return(VQA_VERSION);
}
/****************************************************************************
*
* NAME
* VQA_IDString - Get the VQA player library's ID string.
*
* SYNOPSIS
* IDString = VQA_IDString()
*
* char *VQA_IDString(void);
*
* FUNCTION
* Return the ID string of this VQA player library.
*
* INPUTS
* NONE
*
* RESULT
* IDString - Pointer to ID string.
*
****************************************************************************/
char *VQA_IDString(void)
{
return (VQA_IDSTRING);
}
/****************************************************************************
*
* NAME
* User_Update - Page flip routine called by the task interrupt.
*
* SYNOPSIS
* User_Update(VQA)
*
* long User_Update(VQAHandle *);
*
* FUNCTION
*
* INPUTS
* VQA - Handle of VQA movie.
*
* RESULT
* NONE
*
****************************************************************************/
long User_Update(VQAHandle *vqa)
{
VQAData *vqabuf;
long rc = 0;
/* Dereference data members for quicker access. */
vqabuf = ((VQAHandleP *)vqa)->VQABuf;
if (vqabuf->Flags & VQADATF_UPDATE) {
/* Invoke the page flip routine */
rc = (*(vqabuf->Page_Flip))(vqa);
/* Update data for mono output */
vqabuf->Flipper.LastFrameNum = vqabuf->Flipper.CurFrame->FrameNum;
/* Mark the frame as loadable */
vqabuf->Flipper.CurFrame->Flags = 0L;
vqabuf->Flags &= (~VQADATF_UPDATE);
}
return (rc);
}
void VQA_Dummy(void)
{
Set_Font(NULL);
}

View File

@@ -0,0 +1,10 @@
/t
/m
/w+
/jJUMPS
/ml
/p
/z
/iC:\PROJECTS\INCLUDE\VQM32
/zi
/dPHARLAP_TNT=1

1
WINVQ/VQA32/OLD/TLIB.CFG Normal file
View File

@@ -0,0 +1 @@
/C /E

View File

@@ -0,0 +1,5 @@
/c
/m
/Gm
-LC:\PROJECTS\LIB;C:\DEV\BC4\LIB
-v

124
WINVQ/VQA32/OLD/UNVQ.H Normal file
View File

@@ -0,0 +1,124 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAUNVQ_H
#define VQAUNVQ_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQAPlay32 library. (32-Bit protected mode)
*
* FILE
* unvq.h
*
* DESCRIPTION
* VQ frame decompress definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* Feburary 8, 1995
*
****************************************************************************/
#ifdef PHARLAP_TNT
#include <pltypes.h>
#endif
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
/* unvqbuff.asm */
#ifndef PHARLAP_TNT
void cdecl UnVQ_2x2(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void cdecl UnVQ_2x3(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void cdecl UnVQ_4x2(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void cdecl UnVQ_4x4(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
void cdecl UnVQ_4x2_Woofer(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long bufwidth);
/* unvqvesa.asm */
void cdecl UnVQ_4x2_VESA320_32K(unsigned char *codebook,
unsigned char *pointers, unsigned char *palette,
unsigned long grains_per_win,unsigned long dummy1,unsigned long dummy2);
#else /* PHARLAP_TNT */
void cdecl UnVQ_2x2(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
void cdecl UnVQ_2x3(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
void cdecl UnVQ_4x2(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
void cdecl UnVQ_4x4(unsigned char *codebook, unsigned char *pointers,
FARPTR buffer, unsigned long blocksperrow, unsigned long numrows,
unsigned long bufwidth);
/* unvqvesa.asm */
void cdecl UnVQ_4x2_VESA320_32K(unsigned char *codebook,
unsigned char *pointers, FARPTR palette, unsigned long grains_per_win,
unsigned long dummy1, unsigned long dummy2);
#endif /* PHARLAP_TNT */
/* unvqxmde.asm */
void cdecl UnVQ_4x2_Xmode(unsigned char *codebook, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long dummy);
void cdecl UnVQ_4x2_XmodeCB(unsigned char *cbdummy, unsigned char *pointers,
unsigned char *buffer, unsigned long blocksperrow,
unsigned long numrows, unsigned long dummy);
void cdecl Upload_4x2CB(unsigned char *codebook, unsigned long numentries);
void cdecl XlatePointers(unsigned char *pointers, unsigned long numpointers);
#ifdef __cplusplus
}
#endif
#endif /* VQAUNVQ_H */

1153
WINVQ/VQA32/OLD/UNVQBUFF.ASM Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,380 @@
;
; Command & Conquer Red Alert(tm)
; Copyright 2025 Electronic Arts Inc.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;****************************************************************************
;*
;* 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
;*
;*---------------------------------------------------------------------------
;*
;* PROJECT
;* VQAPlay32 library.
;*
;* FILE
;* unvqvesa.asm
;*
;* DESCRIPTION
;* VESA VQ decompress/draw routines. (32-Bit protected mode)
;*
;* PROGRAMMER
;* Denzil E. Long, Jr.
;*
;*---------------------------------------------------------------------------
;*
;* PUBLIC
;* UnVQ_4x2_VESA320_32K - Draw 4x2 VQ frame to VESA320 32k color.
;*
;****************************************************************************
IDEAL
P386
MODEL USE32 FLAT
LOCALS ??
INCLUDE "vga.i"
INCLUDE "vesavid.i"
INCLUDE "vqaplay.i"
CODESEG
SKIP_PTR EQU 8000h
IF VQAVESA_ON
IF VQABLOCK_4X2
;****************************************************************************
;*
;* NAME
;* UnVQ_4x2_VESA320_32K - Draw 4x2 VQ frame to VESA320 32k color.
;*
;* SYNOPSIS
;* UnVQ_4x2_VESA320_32K(Codebook, Pointers, Palette, GrainPerWin)
;*
;* void UnVQ_4x2_VESA320_32K(char *, char *, char *, long);
;*
;* FUNCTION
;*
;* INPUTS
;* Codebook - Pointer to codebook.
;* Pointers - Pointer to vector pointer data to unvq.
;* Palette - Pointer to 15-bit palette.
;* GrainPerWin - Granularity units for 64k window.
;*
;* RESULT
;* NONE
;*
;****************************************************************************
;---------------------------------------------------------------------------
; SET_2_PIXELS:
; - Loads 2 bytes from codebook, expands them into words in eax
; - Sets them on the screen
; cb_index: offset into codebook of start of 2 bytes to load
; di_index: offset from current di to draw 2 pixels
; BX: offset into codebook of this block
; Uses: EAX, DX, SI!
;---------------------------------------------------------------------------
MACRO SET_2_PIXELS cb_index,edi_index
xor edx,edx
mov dl,[BYTE PTR ebx+1+cb_index]
shl edx,1
add edx,[palette]
mov esi,edx
mov ax,[WORD PTR esi]
shl eax,16
xor edx,edx
mov dl,[BYTE PTR ebx+cb_index]
shl edx,1
add edx,[palette]
mov esi,edx
mov ax,[WORD PTR esi]
IF PHARLAP_TNT
mov [DWORD PTR es:edi+edi_index],eax
ELSE
mov [DWORD PTR edi+edi_index],eax
ENDIF
ENDM
;---------------------------------------------------------------------------
; DRAW_BLOCK_ROWS macro:
; Draws 'numrows' rows of 'blocksperrow' blocks each
;---------------------------------------------------------------------------
MACRO DRAW_BLOCK_ROWS numrows,blocksperrow
LOCAL ??Start_row
LOCAL ??Not_finished_a_line
LOCAL ??One_color
LOCAL ??Draw_One_Color
LOCAL ??Next_row
LOCAL ??Done
mov [rowcount],numrows ; initialize row counter
;---------------------------------------- Start a new row:
??Start_row:
mov ecx,blocksperrow ; # blocks to fill a line
;---------------------------------------- Start a new block:
??Not_finished_a_line:
;........................................ Get next pointer word:
xor ebx,ebx
mov bx,[WORD PTR esi] ; BX = pointer word
add esi,2
;........................................ Check for a 1-color block:
or bx,bx ; see if high bit is set
js ??One_color
;---------------------------------------- Multi-color block:
mov [esi_save],esi ; save current SI
add ebx,[cb_offset] ; get codebook offset
SET_2_PIXELS 0,0
SET_2_PIXELS 2,4
SET_2_PIXELS 4,640
SET_2_PIXELS 6,644
add edi,8 ; next block position
mov esi,[esi_save] ; get current SI
;........................................ Check block count
dec ecx ; decrement block count
jnz ??Not_finished_a_line
;---------------------------------------- Next block row:
add edi,640
;
;............ see if we're past the end of the ptr data ............
;
dec [rowcount]
jnz ??Start_row
jmp ??Done
;---------------------------------------- 1-color block:
??One_color:
;................... skip ptr value SKIP_PTR .......................
cmp bx,SKIP_PTR
jne ??Draw_One_Color
add edi,8
dec ecx
jnz ??Not_finished_a_line
jmp ??Next_row
??Draw_One_Color:
not bx ; get palette index
shl bx,1 ; convert to WORD offset
add ebx,[palette]
mov ax,[WORD PTR ebx] ; get 15-bit palette value
mov dx,ax ; copy it into dx
shl eax,16
mov ax,dx ; eax = 2 pixels, same color
mov edx,eax ; edx = 2 pixels, same color
IF PHARLAP_TNT
mov [DWORD PTR es:edi],eax ; set 2 pixels
mov [DWORD PTR es:edi+4],edx ; set 2 pixels
mov [DWORD PTR es:edi+640],eax ; set 2 pixels
mov [DWORD PTR es:edi+644],edx ; set 2 pixels
ELSE
mov [DWORD PTR edi],eax ; set 2 pixels
mov [DWORD PTR edi+4],edx ; set 2 pixels
mov [DWORD PTR edi+640],eax ; set 2 pixels
mov [DWORD PTR edi+644],edx ; set 2 pixels
ENDIF
add edi,8 ; next block position
;........................................ Check block count
dec ecx ; decrement block count
jnz ??Not_finished_a_line
;---------------------------------------- Next block row:
??Next_row:
add edi,640
;
;............ see if we're past the end of the ptr data ............
;
dec [rowcount]
jnz ??Start_row
??Done:
ENDM
;---------------------------------------------------------------------------
; DRAW_BLOCK_PART_ROW macro:
; Draws top or bottom half of blocks on a row
; 'numblocks' = # blocks to draw
; 'cb_add' = amt to add to codebook (0=top half, 4=bottom half)
;---------------------------------------------------------------------------
MACRO DRAW_BLOCK_PART_ROW numblocks,cb_add
LOCAL ??Not_finished_a_line
LOCAL ??One_color
LOCAL ??Draw_One_Color
LOCAL ??Done
mov ecx,numblocks
;---------------------------------------- Start a new block:
??Not_finished_a_line:
;........................................ Get next pointer word:
xor ebx,ebx
mov bx,[WORD PTR esi] ; BX = pointer word
add esi,2
;........................................ Check for a 1-color block:
or bx,bx ; see if high bit is set
js short ??One_color
;---------------------------------------- Multi-color block:
mov [esi_save],esi ; save current SI
add ebx,[cb_offset] ; get codebook offset
SET_2_PIXELS cb_add,0
SET_2_PIXELS cb_add+2,4
add edi,8 ; next block position
mov esi,[esi_save] ; get current SI
;........................................ Check block count
dec ecx ; decrement block count
jnz short ??Not_finished_a_line
jmp ??Done
;---------------------------------------- 1-color block:
??One_color:
;................... skip ptr value SKIP_PTR .......................
cmp bx,SKIP_PTR
jne ??Draw_One_Color
add edi,8
dec ecx
jnz short ??Not_finished_a_line
jmp ??Done
??Draw_One_Color:
not bx ; get palette index
shl bx,1 ; convert to WORD offset
add ebx,[palette]
mov ax,[WORD PTR ebx] ; get 15-bit palette value
mov dx,ax ; copy it into dx
shl eax,16
mov ax,dx ; eax = 2 pixels, same color
mov edx,eax ; edx = 2 pixels, same color
IF PHARLAP_TNT
mov [DWORD PTR es:edi],eax ; set 2 pixels
mov [DWORD PTR es:edi+4],edx ; set 2 pixels
ELSE
mov [DWORD PTR edi],eax ; set 2 pixels
mov [DWORD PTR edi+4],edx ; set 2 pixels
ENDIF
add edi,8 ; next block position
;........................................ Check block count
dec ecx ; decrement block count
jnz ??Not_finished_a_line
??Done:
ENDM
;===========================================================================
; The actual procedure:
;===========================================================================
GLOBAL C UnVQ_4x2_VESA320_32K:NEAR
PROC UnVQ_4x2_VESA320_32K C NEAR
ARG codebook:NEAR PTR
ARG pointers:NEAR PTR
IF PHARLAP_TNT
ARG pal:QWORD ;KLUDGE - bcc32 pads FARPTR
ELSE
ARG palette:NEAR PTR
ENDIF
ARG grains_per_win:DWORD
ARG dummy1:DWORD
ARG dummy2:DWORD
LOCAL rowcount:DWORD ; # rows drawn
LOCAL esi_save:DWORD
LOCAL cb_offset:DWORD
IF PHARLAP_TNT
LOCAL palette:NEAR PTR
ENDIF
;-------------------------------------------------------------------
; Save registers
;-------------------------------------------------------------------
pushad
;-------------------------------------------------------------------
; Set GS:[cb_offset] to codebook
;-------------------------------------------------------------------
mov eax,[codebook]
sub eax,4
mov [cb_offset],eax
mov esi,[pointers]
;-------------------------------------------------------------------
; Set ES:DI to screen
;-------------------------------------------------------------------
IF PHARLAP_TNT
push es
les edi,[FWORD pal]
mov [palette],edi
mov eax,01Ch
mov es,ax
mov edi,0
ELSE
mov edi,0A0000h
ENDIF
;-------------------------------------------------------------------
; Do Bank 0:
; - 102 full scanlines (51 rows of blocks)
; - 128 pixels of the top half of blocks (32 top-half blocks)
;-------------------------------------------------------------------
SET_WINDOW 0
DRAW_BLOCK_ROWS 51,80
DRAW_BLOCK_PART_ROW 32,0 ; do top half
;-------------------------------------------------------------------
; Do Bank 1:
; - 128 pixels of the bottom half of the previous 32 blocks
; - 192 pixels of full blocks (1 row of 48 blocks)
; - 96 full scanlines (48 rows of blocks)
;-------------------------------------------------------------------
SET_WINDOW [grains_per_win]
sub esi,64 ; subtract word size of last 32 blks
mov edi,384
DRAW_BLOCK_PART_ROW 32,4 ; do bottom half
mov edi,0
DRAW_BLOCK_ROWS 1,48 ; draw one row of 48 full blocks
DRAW_BLOCK_ROWS 48,80 ; draw 48 full block rows
??End_of_data:
IF PHARLAP_TNT
pop es
ENDIF
popad
ret
ENDP UnVQ_4x2_VESA320_32K
ENDIF ;VQABLOCK_4X2
ENDIF ;VQAVESA_ON
END

View File

@@ -0,0 +1,724 @@
;
; Command & Conquer Red Alert(tm)
; Copyright 2025 Electronic Arts Inc.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;****************************************************************************
;*
;* 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
;*
;*---------------------------------------------------------------------------
;*
;* PROJECT
;* VQAPlay library.
;*
;* FILE
;* UnVQxmde.asm
;*
;* DESCRIPTION
;* XMode VQ decompress/draw routines.
;*
;* PROGRAMMER
;* Denzil E. Long, Jr.
;*
;* DATE
;* May 18, 1995
;*
;*---------------------------------------------------------------------------
;*
;* PUBLIC
;* UnVQ_4x2_Xmode - Draw 4x2 VQ frame directly to Xmode.
;* UnVQ_4x2_XmodeCB - Draw 4x2 VQ frame to Xmode from VRAM codebook.
;* Upload_4x2CB - Upload 4x2 codebook into XMode VRAM.
;* UnVQ_4x2_VESA320_32K - Draw 4x2 VQ frame to VESA320 32k color.
;* XlatePointers - Translate pointer to optimal XMode format.
;*
;****************************************************************************
IDEAL
P386
MODEL USE32 FLAT
LOCALS ??
INCLUDE "vga.i"
INCLUDE "vesavid.i"
INCLUDE "vqaplay.i"
CODESEG
IF VQAXMODE_ON
SKIP_PTR EQU 8000h
CBOOK_SEG EQU (0B0000h - 270h)
IF VQABLOCK_4X2
;****************************************************************************
;*
;* NAME
;* UnVQ_4x2_Xmode - Draw 4x2 VQ frame directly to Xmode.
;*
;* SYNOPSIS
;* UnVQ_4x2_Xmode(Codebook, Pointers, Buffer, BPR, Rows, Dummy)
;*
;* void UnVQ_4x2_Xmode(unsigned char *, unsigned char *, unsigned char *,
;* unsigned short, unsigned short, unsigned short);
;*
;* FUNCTION
;* This function draws an image to the Xmode display from the pointers
;* and codebook provided. This routine has been optimized for a 320x200
;* image.
;*
;* INPUTS
;* Codebook - Pointer to codebook used to draw image.
;* Pointers - Pointer to vector pointer data.
;* Buffer - Pointer to buffer to draw image into.
;* BPR - Number of blocks per row.
;* Rows - Number of rows.
;* Dummy - Not used (prototype placeholder)
;*
;* RESULT
;* NONE
;*
;****************************************************************************
GLOBAL C UnVQ_4x2_Xmode:NEAR
PROC UnVQ_4x2_Xmode C NEAR USES
ARG codebook:NEAR PTR
ARG pointers:NEAR PTR
IF PHARLAP_TNT
ARG buffer:QWORD ;KLUDGE - bcc32 pads FARPTR
ELSE
ARG buffer:NEAR PTR
ENDIF
ARG blocksperrow:DWORD
ARG numrows:DWORD
ARG bufwidth:DWORD
LOCAL data_end:DWORD
LOCAL cb_offset:DWORD
LOCAL edi_startval:DWORD
LOCAL rowoffset:DWORD
;----------------------------------------------------------------------------
; Initialize
;----------------------------------------------------------------------------
mov eax,[codebook] ;Adjust the codebook address so
sub eax,4 ; that the pointer offsets will
mov [cb_offset],eax ; point directly at the codeword.
mov eax,[bufwidth] ;Compute the offset to the next
shl eax,1 ; row of blocks.
mov [rowoffset],eax
mov esi,[pointers]
mov eax,[numrows] ;Compute the end address of the
mul [blocksperrow] ; pointer data.
shl eax,1
add eax,esi
mov [data_end],eax
IF PHARLAP_TNT
push es
les edi,[FWORD buffer] ;KLUDGE - bcc32 pads FARPTR
ELSE
mov edi,[buffer]
ENDIF
mov [edi_startval],edi
;----------------------------------------------------------------------------
; Drawing loop
;----------------------------------------------------------------------------
SET_PLANE XPLANE_1
??Start_row:
mov ecx,[blocksperrow] ;Number of blocks in a line
??Not_finished_a_line1:
sub ebx,ebx
mov bx,[WORD PTR esi] ;Get the codebook pointer value
add esi,2 ; then advance to the next one.
or bx,bx ;Is it a one color block?
js short ??One_color1
; Draw multi-color block
add ebx,[cb_offset] ;Codeword address
mov eax,[ebx] ;Read 1st row of codeword
mov edx,[ebx+4] ;Read 2nd row of codeword
; mov ebx,[bufwidth]
IF PHARLAP_TNT
mov [es:edi],eax ;Write 1st row to dest
mov [es:edi+ebx],edx ;Write 2nd row to dest
ELSE
mov [edi],al ;Write 1st row to dest
mov [edi+80],dl ;Write 2nd row to dest
ENDIF
; add edi,4 ;Next dest block position
inc edi ;Next dest block position
dec ecx ;More blocks for this row?
jnz short ??Not_finished_a_line
; Advance to the next destination row of blocks.
mov edi,[edi_startval]
add edi,[rowoffset]
mov [edi_startval],edi
cmp esi,[data_end] ;Have we reached the end of the
jnb short ??End_of_data ; pointers buffer?
jmp ??Start_row
; Draw 1-color block
??One_color1:
cmp bx,SKIP_PTR ;Is this a skip block?
jne ??Draw_One_Color
add edi,4 ;Move to next dest block position
dec ecx ;More blocks for this row?
jnz short ??Not_finished_a_line
jmp ??Next_row
??Draw_One_Color:
not bx ;NOT pointer value to get color
mov bh,bl ;Duplicate color through the
mov ax,bx ; entire dword register.
rol eax,16
mov ax,bx
; mov ebx,[bufwidth]
IF PHARLAP_TNT
mov [es:edi],eax ;Write 1st row to dest
mov [es:edi+ebx],eax ;Write 2nd row to dest
ELSE
mov [edi],al ;Write 1st row to dest
mov [edi+80],al ;Write 2nd row to dest
ENDIF
add edi,4 ;Next dest block positionw
dec ecx ;More blocks for this row?
jnz short ??Not_finished_a_line
; Advance to the next destination row of blocks.
??Next_row:
mov edi,[edi_startval]
add edi,[rowoffset]
mov [edi_startval],edi
cmp esi,[data_end] ;Have we reached the end of the
jnb short ??End_of_data ; pointers buffer?
jmp ??Start_row
??End_of_data:
IF PHARLAP_TNT
pop es
ENDIF
ret
ENDP UnVQ_4x2_Xmode
;****************************************************************************
;*
;* NAME
;* UnVQ_4x2_XmodeCB - Draw 4x2 VQ frame to Xmode from VRAM codebook.
;*
;* SYNOPSIS
;* UnVQ_4x2_XmodeCB(Dummy, Pointers, Buffer, BPR, Rows)
;*
;* void UnVQ_4x2_XmodeCB(unsigned char *, unsigned char *,
;* unsigned char *, unsigned short,
;* unsigned short);
;*
;* FUNCTION
;* This routine copies codebook entries from video RAM to video RAM.
;* The procedure for Write Mode 1 is:
;*
;* - Perform a CPU read at the address of the 4-byte codebook entry;
;* this will load each byte at that address from all 4 bitplanes
;* into the VGA's internal latches.
;*
;* - Perform a CPU write at the destination address, with the BitMask
;* register set to 0 (this tells the VGA hardware to only use the
;* data stored in the latches to write with), and the Map Mask
;* register set to 0Fh (all bitplanes enabled).
;*
;* Optimized for 320x200.
;* The codebook must have been downloaded to video RAM before this
;* routine is called. This routine assumes the multicolor block pointers
;* have been pre-divided by 4, and have a total of 512 added to them, so
;* the pointer is an exact offset into the codebook.
;*
;* INPUTS
;* Dummy - Not used (prototype placeholder)
;* Pointers - Pointer to vector pointer data.
;* Buffer - Pointer to Xmode buffer.
;* BPR - Number of blocks per row.
;* Rows - Number of rows.
;*
;* RESULT
;* NONE
;*
;****************************************************************************
GLOBAL C UnVQ_4x2_XmodeCB:NEAR
PROC UnVQ_4x2_XmodeCB C NEAR USES
ARG cbdummy:FAR PTR
ARG pointers:FAR PTR
ARG buffer:FAR PTR
ARG blocksperrow:WORD
ARG numrows:WORD
; ;-------------------------------------------------------------------
; ; Local variables:
; ;-------------------------------------------------------------------
; LOCAL di_startval:WORD ; init value for DI, for new row
;
; ;===================================================================
; ; Initialization
; ;===================================================================
; ;-------------------------------------------------------------------
; ; Save our registers
; ;-------------------------------------------------------------------
; push ds
; push es
; push fs
; pushad
;
; ;-------------------------------------------------------------------
; ; Save codebook's segment in DS
; ;-------------------------------------------------------------------
; mov ax,CBOOK_SEG
; mov ds,ax
;
; ;-------------------------------------------------------------------
; ; Load pointers into FS:BX
; ;-------------------------------------------------------------------
; les di,[pointers]
; mov ax,es
; mov fs,ax
; mov bx,di
;
; ;-------------------------------------------------------------------
; ; Load screen address into ES:DI
; ;-------------------------------------------------------------------
; les di, [buffer] ; point ES:DI to dest
; mov [di_startval],di ; store it
;
; ;-------------------------------------------------------------------
; ; Initialize VGA registers:
; ; - Enable all bitplanes for writing
; ; - Set the BitMask register to 0, so only the data from the
; ; VGA latches is written into the bitplanes
; ;-------------------------------------------------------------------
; SET_PLANE 0fh ; enable all planes for write
; SET_WRITEMODE 1
;
; ;===================================================================
; ; The drawing loop:
; ; DS:SI = codebook
; ; ES:DI = drawing buffer
; ; FS:BX = pointers
; ;===================================================================
; ;-------------------------------------------------------------------
; ; Start a new row of drawing
; ;-------------------------------------------------------------------
;??Start_row:
; mov cx,[blocksperrow] ; # blocks to fill a line
;
; ;-------------------------------------------------------------------
; ; Start a new block
; ;-------------------------------------------------------------------
;??Not_finished_a_line:
; ;
; ;..................... get next pointer word .......................
; ;
; mov si,[WORD PTR fs:bx] ; SI = ptr word (cbook offset)
; add bx,2 ; next ptr word
; ;
; ;................... skip ptr value SKIP_PTR .......................
; ;
; cmp si,SKIP_PTR
; jne ??Draw_Block
; inc di
; dec cx
; jnz short ??Not_finished_a_line
; jmp ??Next_row
;
; ;-------------------------------------------------------------------
; ; Draw a block via the VGA internal latches:
; ; DS:SI = codebook address
; ; ES:DI = buffer position to draw at
; ; - Load the VGA latches from the 1st 4 codebook bytes
; ; - write 4 pixels with one CPU write
; ; - If this is a one-color block, skip the next codebook read
; ; (Video RAM reads are very slow); otherwise, latch the next 4
; ; codebook bytes
; ; - write the next 4 pixels
; ;-------------------------------------------------------------------
; ;
; ;..................... draw 1st 4 pixels ...........................
; ;
;??Draw_Block:
; mov al,[ds:si] ; latch 1st 4 cbook bytes
; mov [es:di],al ; write 4 pixels
; ;
; ;.................. check for 1-color block ........................
; ;
; cmp si,512 ; if 1color blk, don't read
; jb ??One_Color
; ;
; ;..................... draw next 4 pixels ..........................
; ;
; mov al,[ds:si+1] ; latch next 4 cbook bytes
;??One_Color:
; mov [es:di+80],al ; write next 4 pixels
; inc di ; next block position
; ;
; ;...................... check block count ..........................
; ;
; dec cx ; decrement block count
; jnz short ??Not_finished_a_line
;
; ;-------------------------------------------------------------------
; ; Go to the next block row:
; ; - Add (80*2/16) to ES, and set DI to its start-row value
; ; (Incrementing the segment allows us to unpack up to 1MB of data)
; ;-------------------------------------------------------------------
; ;
; ;...................... add (320*2/16) to ES .......................
; ;
;??Next_row:
; mov ax,es
; add ax,10 ; add 80*2/16
; mov es,ax
; ;
; ;.................. set DI to its start-row value ..................
; ;
; mov di,[di_startval]
; ;
; ;............ see if we're past the end of the ptr data ............
; ;
; dec [numrows]
; jg ??Start_row
;
;??End_of_data:
; ;-------------------------------------------------------------------
; ; Restore VGA Write Mode to 0
; ;-------------------------------------------------------------------
; SET_WRITEMODE 0
;
; popad
; pop fs
; pop es
; pop ds
ret
ENDP UnVQ_4x2_XmodeCB
;****************************************************************************
;*
;* NAME
;* Upload_4x2CB - Upload 4x2 codebook into XMode VRAM.
;*
;* SYNOPSIS
;* Upload_4x2CB(Codebook, Entries)
;*
;* void Upload_4x2CB(unsigned char *, unsigned short);
;*
;* FUNCTION
;* This routine copies the given codebook into Xmode VRAM, so that it
;* can be used later for direct video-to-video copies. The address used
;* is the end of video memory minus 02700h (10K). This should be plenty
;* for a 3000-entry codebook; each 4x2 codebook entry will take up 8
;* 8 bytes, or 2 addresses in XMode (6000 addresses).
;*
;* The routine also creates a 1-color-block table in VRAM, so the 1-color
;* blocks can be generated the same way as the multicolor blocks.
;*
;* XMode 320x200 uses 320x200/4 addresses per page, for a total of 32000
;* addresses. XMode 320x240 uses 320x240/4 addresses per page, for a
;* total of 38400 addresses. This leaves 27136 addresses unused.
;*
;* INPUTS
;* Codebook - Pointer to codebook to copy.
;* Entries - Number of codebook entries to copy.
;*
;* RESULT
;* NONE
;*
;****************************************************************************
GLOBAL C Upload_4x2CB:NEAR
PROC Upload_4x2CB C NEAR USES
ARG codebook:NEAR PTR
ARG numentries:DWORD
; ;===================================================================
; ; Generate the 1-color block table by writing each color value from
; ; 0-255 into all 4 bitplanes, at 256 consecutive addresses:
; ;===================================================================
; SET_PLANE 0fh ; enable all bitplanes for writing
; ;...................................................................
; ; Set ES:DI to destination address, set up CX for the loop
; ;...................................................................
; mov ax,CBOOK_SEG
; mov es,ax
; mov di,0
; mov cx,256
; mov ax,0
;??1_Color_Loop:
; mov [es:di],al ; write 4 bytes
; inc di ; next 4-byte position
; mov [es:di],al ; write 4 bytes
; inc di ; next 4-byte position
; inc ax ; next color #
; dec cx ; decrement loop counter
; jnz ??1_Color_Loop
;
; ;===================================================================
; ; Copy the codebook into video RAM, one plane at a time:
; ;===================================================================
; ;-------------------------------------------------------------------
; ; Copy codebook byte 0 into Plane 1
; ;-------------------------------------------------------------------
; ;...................................................................
; ; Set DS:SI to codebook address, ES:DI to screen address
; ; (Codebook is stored at offset 1, so the pointers will point at
; ; exactly the right offset.)
; ;...................................................................
; lds si, [codebook] ; DS:SI = codebook
; mov ax,CBOOK_SEG
; mov es,ax
; mov di,512
;
; ;...................................................................
; ; Set up the loop
; ;...................................................................
; SET_PLANE XPLANE_1
; mov cx,[numentries] ; set loop counter
; shl cx,1 ; do 2 DWORDS per cbook entry
;
; ;...................................................................
; ; Loop through codebook entries
; ;...................................................................
;??CB_Loop_1:
; mov al,[ds:si]
; mov [es:di],al
; add si,4
; inc di
; dec cx
; jnz ??CB_Loop_1
;
; ;-------------------------------------------------------------------
; ; Copy codebook byte 1 Plane 2
; ;-------------------------------------------------------------------
; ;...................................................................
; ; Set DS:SI to codebook address, ES:DI to screen address
; ; (Codebook is stored at offset 1, so the pointers will point at
; ; exactly the right offset.)
; ;...................................................................
; lds si, [codebook] ; DS:SI = codebook
; mov ax,CBOOK_SEG
; mov es,ax
; mov di,512
; add si,1 ; use 2nd byte value
;
; ;...................................................................
; ; Set up the loop
; ;...................................................................
; SET_PLANE XPLANE_2
; mov cx,[numentries] ; set loop counter
; shl cx,1 ; do 2 DWORDS per cbook entry
;
; ;...................................................................
; ; Loop through codebook entries
; ;...................................................................
;??CB_Loop_2:
; mov al,[ds:si]
; mov [es:di],al
; add si,4
; inc di
; dec cx
; jnz ??CB_Loop_2
;
; ;-------------------------------------------------------------------
; ; Copy codebook byte 2 Plane 3
; ;-------------------------------------------------------------------
; ;...................................................................
; ; Set DS:SI to codebook address, ES:DI to screen address
; ; (Codebook is stored at offset 1, so the pointers will point at
; ; exactly the right offset.)
; ;...................................................................
; lds si, [codebook] ; DS:SI = codebook
; mov ax,CBOOK_SEG
; mov es,ax
; mov di,512
; add si,2 ; use 3rd byte value
;
; ;...................................................................
; ; Set up the loop
; ;...................................................................
; SET_PLANE XPLANE_3
; mov cx,[numentries] ; set loop counter
; shl cx,1 ; do 2 DWORDS per cbook entry
;
; ;...................................................................
; ; Loop through codebook entries
; ;...................................................................
;??CB_Loop_3:
; mov al,[ds:si]
; mov [es:di],al
; add si,4
; inc di
; dec cx
; jnz ??CB_Loop_3
;
; ;-------------------------------------------------------------------
; ; Copy codebook byte 3 Plane 4
; ;-------------------------------------------------------------------
; ;...................................................................
; ; Set DS:SI to codebook address, ES:DI to screen address
; ; (Codebook is stored at offset 1, so the pointers will point at
; ; exactly the right offset.)
; ;...................................................................
; lds si, [codebook] ; DS:SI = codebook
; mov ax,CBOOK_SEG
; mov es,ax
; mov di,512
; add si,3 ; use 4th byte value
;
; ;...................................................................
; ; Set up the loop
; ;...................................................................
; SET_PLANE XPLANE_4
; mov cx,[numentries] ; set loop counter
; shl cx,1 ; do 2 DWORDS per cbook entry
;
; ;...................................................................
; ; Loop through codebook entries
; ;...................................................................
;??CB_Loop_4:
; mov al,[ds:si]
; mov [es:di],al
; add si,4
; inc di
; dec cx
; jnz ??CB_Loop_4
;
ret
ENDP Upload_4x2CB
ENDIF ;VQABLOCK_4X2
;****************************************************************************
;*
;* NAME
;* XlatePointers - Translate pointer to optimal XMode format.
;*
;* SYNOPSIS
;* XlatePointers(Pointers, Entries)
;*
;* void XlatePointers(unsigned char *, unsigned short);
;*
;* FUNCTION
;*
;* INPUTS
;* Pointers - Pointer to vector pointers to translate.
;* Entries - Number of pointer entries.
;*
;* RESULT
;* NONE
;*
;****************************************************************************
GLOBAL C XlatePointers:NEAR
PROC XlatePointers C NEAR USES
ARG pointers:NEAR PTR
ARG numpointers:DWORD
; ;-------------------------------------------------------------------
; ; Load pointers into DS:SI
; ;-------------------------------------------------------------------
; lds si,[pointers]
;
; mov cx,[numpointers] ; init to # pointers on scrn
;
;??Process_pointer:
; ;
; ;..................... get next pointer word .......................
; ;
; mov ax,[WORD PTR ds:si] ; SI = ptr word (cbook offset)
; ;
; ;.................... check for a 1-color block ....................
; ;
; or ax,ax ; check to see if high bit set
; js short ??One_color
; ;
; ;....................... multi-color pointer .......................
; ;
; sub ax,4 ; subtract 4
; shr ax,2 ; divide by 4
; add ax,512 ; add 512
; mov [WORD PTR ds:si],ax ; save new value
; add si,2 ; next ptr word
; ;
; ;....................... see if we're done .........................
; ;
; dec cx
; jnz ??Process_pointer
; jmp ??Done
;
;??One_color:
; ;
; ;......................... 1-color pointer .........................
; ;
; not ax ; get actual color value
; shl ax,1 ; multiply by 2
; mov [WORD PTR ds:si],ax ; save new value
; add si,2 ; next ptr word
; ;
; ;....................... see if we're done .........................
; ;
; dec cx
; jnz ??Process_pointer
;
;??Done:
ret
ENDP XlatePointers
ENDIF ;VQAXMODE_ON
END

View File

@@ -0,0 +1,52 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vertag.c
*
* DESCRIPTION
* Version Tag
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* February 23, 1995
*
****************************************************************************/
#include "vqaplayp.h"
#ifdef __WATCOMC__
#define DEVNAME "Watcom/4GW"
#else
#define DEVNAME "Borland/TNT"
#endif
char VerTag[] = {"$VER$" VQA_IDSTRING" "DEVNAME" ("VQA_DATE")"};
char ReqTag[] = {"$REQ$" VQA_REQUIRES};

196
WINVQ/VQA32/OLD/VQAFILE.H Normal file
View File

@@ -0,0 +1,196 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAFILE_H
#define VQAFILE_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vqafile.h
*
* DESCRIPTION
* VQA file format definitions.
*
* PROGRAMMER
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
****************************************************************************/
#include <vqm32\iff.h>
#ifdef __WATCOMC__
#pragma pack(1);
#endif
/*---------------------------------------------------------------------------
* STRUCTURE DEFINITIONS AND RELATED DEFINES.
*-------------------------------------------------------------------------*/
/* VQAHeader: VQA movie description header. (VQHD)
*
* Version - VQA version.
* Flags - Various flags. (See below)
* ImageWidth - Image width in pixels.
* ImageHeight - Image height in pixels.
* BlockWidth - Block width in pixels.
* BlockHeight - Block height in pixels.
* Frames - Total number of frames in the movie.
* FPS - Playback rate (Frame Per Second).
* Groupsize - Frame grouping size (frames per codebook).
* Num1Colors - Number of 1 color colors.
* CBentries - Number of codebook entries.
* Xpos - X position to draw frames. (-1 = Center)
* Ypos - Y position to draw frames. (-1 = Center)
* MaxFramesize - Size of largest frame.
* SampleRate - Sample rate of primary audio stream.
* Channels - Number of channels in primary audio stream.
* BitsPerSample - Sample bit size in primary audio stream.
* FutureUse - Reserved for future expansion.
*/
typedef struct _VQAHeader {
unsigned short Version;
unsigned short Flags;
unsigned short Frames;
unsigned short ImageWidth;
unsigned short ImageHeight;
unsigned char BlockWidth;
unsigned char BlockHeight;
unsigned char FPS;
unsigned char Groupsize;
unsigned short Num1Colors;
unsigned short CBentries;
unsigned short Xpos;
unsigned short Ypos;
unsigned short MaxFramesize;
unsigned short SampleRate;
unsigned char Channels;
unsigned char BitsPerSample;
unsigned short AltSampleRate;
unsigned char AltChannels;
unsigned char AltBitsPerSample;
unsigned short FutureUse[5];
} VQAHeader;
/* Version type. */
#define VQAHD_VER1 1
#define VQAHD_VER2 2
/* VQA header flag definitions */
#define VQAHDB_AUDIO 0 /* Audio track present. */
#define VQAHDB_ALTAUDIO 1 /* Alternate audio track present. */
#define VQAHDF_AUDIO (1<<VQAHDB_AUDIO)
#define VQAHDF_ALTAUDIO (1<<VQAHDB_ALTAUDIO)
/* Frame information (FINF) chunk definitions
*
* The FINF chunk contains a longword (4 bytes) entry for each
* frame in the movie. This entry is divided into two parts,
* flags (4 bits) and offset (28 bits).
*
* BITS NAME DESCRIPTION
* -----------------------------------------------------------
* 31-28 Flags 4 bitwise boolean flags.
* 27-0 Offset Offset in WORDS from the start of the file.
*/
#define VQAFINB_KEY 31
#define VQAFINB_PAL 30
#define VQAFINB_SYNC 29
#define VQAFINF_KEY (1L<<VQAFINB_KEY)
#define VQAFINF_PAL (1L<<VQAFINB_PAL)
#define VQAFINF_SYNC (1L<<VQAFINB_SYNC)
/* FINF related defines and macros. */
#define VQAFINF_OFFSET 0x0FFFFFFFL
#define VQAFINF_FLAGS 0xF0000000L
#define VQAFRAME_OFFSET(a) (((a & VQAFINF_OFFSET)<<1))
/* VQ vector pointer codes. */
#define VPC_ONE_SINGLE 0xF000 /* One single color block */
#define VPC_ONE_SEMITRANS 0xE000 /* One semitransparent block */
#define VPC_SHORT_DUMP 0xD000 /* Short dump of single color blocks */
#define VPC_LONG_DUMP 0xC000 /* Long dump of single color blocks */
#define VPC_SHORT_RUN 0xB000 /* Short run of single color blocks */
#define VPC_LONG_RUN 0xA000 /* Long run */
/* Long run codes. */
#define LRC_SEMITRANS 0xC000 /* Long run of semitransparent blocks. */
#define LRC_SINGLE 0x8000 /* Long run of single color blocks. */
/* Defines used for Run-Skip-Dump compression. */
#define MIN_SHORT_RUN_LENGTH 2
#define MAX_SHORT_RUN_LENGTH 15
#define MIN_LONG_RUN_LENGTH 2
#define MAX_LONG_RUN_LENGTH 4095
#define MIN_SHORT_DUMP_LENGTH 3
#define MAX_SHORT_DUMP_LENGTH 15
#define MIN_LONG_DUMP_LENGTH 2
#define MAX_LONG_DUMP_LENGTH 4095
#define WORD_HI_BIT 0x8000
/*---------------------------------------------------------------------------
* VQA FILE CHUNK ID DEFINITIONS.
*-------------------------------------------------------------------------*/
#define ID_WVQA MAKE_ID('W','V','Q','A') /* Westwood VQ Animation form. */
#define ID_VQHD MAKE_ID('V','Q','H','D') /* VQ header. */
#define ID_NAME MAKE_ID('N','A','M','E') /* Name string. */
#define ID_FINF MAKE_ID('F','I','N','F') /* Frame information. */
#define ID_VQFR MAKE_ID('V','Q','F','R') /* VQ frame container. */
#define ID_VQFK MAKE_ID('V','Q','F','K') /* VQ key frame container. */
#define ID_CBF0 MAKE_ID('C','B','F','0') /* Full codebook. */
#define ID_CBFZ MAKE_ID('C','B','F','Z') /* Full codebook (compressed). */
#define ID_CBP0 MAKE_ID('C','B','P','0') /* Partial codebook. */
#define ID_CBPZ MAKE_ID('C','B','P','Z') /* Partial codebook (compressed). */
#define ID_VPT0 MAKE_ID('V','P','T','0') /* Vector pointers. */
#define ID_VPTZ MAKE_ID('V','P','T','Z') /* Vector pointers (compressed). */
#define ID_VPTK MAKE_ID('V','P','T','K') /* Vector pointers (Delta Key). */
#define ID_VPTD MAKE_ID('V','P','T','D') /* Vector pointers (Delta). */
#define ID_VPTR MAKE_ID('V','P','T','R') /* Pointers RSD compressed. */
#define ID_VPRZ MAKE_ID('V','P','R','Z') /* Pointers RSD, lcw compressed. */
#define ID_CPL0 MAKE_ID('C','P','L','0') /* Color palette. */
#define ID_CPLZ MAKE_ID('C','P','L','Z') /* Color palette (compressed). */
#define ID_SND0 MAKE_ID('S','N','D','0') /* Sound */
#define ID_SND1 MAKE_ID('S','N','D','1') /* Sound (Zap compressed). */
#define ID_SND2 MAKE_ID('S','N','D','2') /* Sound (ADPCM compressed). */
#define ID_SNDZ MAKE_ID('S','N','D','Z') /* Sound (LCW compression). */
#define ID_SNA0 MAKE_ID('S','N','A','0') /* Sound */
#define ID_SNA1 MAKE_ID('S','N','A','1') /* Sound (Zap compressed). */
#define ID_SNA2 MAKE_ID('S','N','A','2') /* Sound (ADPCM compressed). */
#define ID_SNAZ MAKE_ID('S','N','A','Z') /* Sound (LCW compression). */
#define ID_CAP0 MAKE_ID('C','A','P','0') /* Caption text */
#ifdef __WATCOMC__
#pragma pack();
#endif
#endif /* VQAFILE_H */

328
WINVQ/VQA32/OLD/VQAPLAY.H Normal file
View File

@@ -0,0 +1,328 @@
/*
** Command & Conquer Red Alert(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VQAPLAY_H
#define VQAPLAY_H
/****************************************************************************
*
* 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
*
*----------------------------------------------------------------------------
*
* PROJECT
* VQA player library. (32-Bit protected mode)
*
* FILE
* vqaplay.h
*
* DESCRIPTION
* VQAPlay library definitions.
*
* PROGRAMMER
* Bill Randolph
* Denzil E. Long, Jr.
*
* DATE
* April 10, 1995
*
****************************************************************************/
/*---------------------------------------------------------------------------
* CONDITIONAL COMPILATION FLAGS
*-------------------------------------------------------------------------*/
// MEG - 11.28.95 - added for debug
extern void Debug_Printf( char *format_string, ... );
#ifdef __WATCOMC__
#define VQASTANDALONE 0 /* Stand alone player */
#define VQAVOC_ON 0 /* Enable VOC file override */
#define VQAMONO_ON 0 /* Mono display output enable/disable */
#define VQAAUDIO_ON 0 /* Audio playback enable/disable */
#define VQAVIDEO_ON 0 /* Video manager enable/disable */
#define VQAMCGA_ON 1 /* MCGA enable/disable */
#define VQAXMODE_ON 0 /* Xmode enable/disable */
#define VQAVESA_ON 0 /* VESA enable/disable */
#define VQABLOCK_2X2 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_2X3 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
#define VQABLOCK_4X4 0 /* 4x4 block decode enable/disable */
#define VQAWOOFER_ON 0
#else
#define VQASTANDALONE 0 /* Stand alone player */
#define VQAVOC_ON 0 /* Enable VOC file override */
#define VQAMONO_ON 1 /* Mono display output enable/disable */
#define VQAAUDIO_ON 0 /* Audio playback enable/disable */
#define VQAVIDEO_ON 0 /* Video manager enable/disable */
#define VQAMCGA_ON 1 /* MCGA enable/disable */
#define VQAXMODE_ON 0 /* Xmode enable/disable */
#define VQAVESA_ON 0 /* VESA enable/disable */
#define VQABLOCK_2X2 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_2X3 0 /* 2x2 block decode enable/disable */
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
#define VQABLOCK_4X4 0 /* 4x4 block decode enable/disable */
#define VQAWOOFER_ON 0
#endif
/*---------------------------------------------------------------------------
* GENERAL CONSTANT DEFINITIONS
*-------------------------------------------------------------------------*/
/* Playback modes. */
#define VQAMODE_RUN 0 /* Run the movie through the end. */
#define VQAMODE_WALK 1 /* Draw the next frame then return. */
#define VQAMODE_PAUSE 2 /* Suspend movie playback. */
#define VQAMODE_STOP 3 /* Stop the movie. */
/* Playback timer methods */
#define VQA_TMETHOD_DEFAULT -1 /* Use default timer method. */
#define VQA_TMETHOD_DOS 1 /* DOS timer method */
#define VQA_TMETHOD_INT 2 /* Interrupt timer method */
#define VQA_TMETHOD_AUDIO 3 /* Audio timer method */
#define VQA_TIMETICKS 60 /* Clock ticks per second */
/* Error/Status conditions */
#define VQAERR_NONE 0 /* No error */
#define VQAERR_EOF -1 /* Valid end of file */
#define VQAERR_OPEN -2 /* Unable to open */
#define VQAERR_READ -3 /* Read error */
#define VQAERR_WRITE -4 /* Write error */
#define VQAERR_SEEK -5 /* Seek error */
#define VQAERR_NOTVQA -6 /* Not a valid VQA file. */
#define VQAERR_NOMEM -7 /* Unable to allocate memory */
#define VQAERR_NOBUFFER -8 /* No buffer avail for load/draw */
#define VQAERR_NOT_TIME -9 /* Not time for frame yet */
#define VQAERR_SLEEPING -10 /* Function is in a sleep state */
#define VQAERR_VIDEO -11 /* Video related error. */
#define VQAERR_AUDIO -12 /* Audio related error. */
#define VQAERR_PAUSED -13 /* In paused state. */
/* Event flags. */
#define VQAEVENT_PALETTE (1<<0)
#define VQAEVENT_SYNC (1<<1)
/*---------------------------------------------------------------------------
* STRUCTURES AND RELATED DEFINITIONS
*-------------------------------------------------------------------------*/
/* VQAConfig: Player configuration structure
*
* DrawerCallback - User routine for Drawer to call each frame (NULL = none)
* EventHandler - User routine for notification to client of events.
* NotifyFlags - User specified events to be notified about.
* Vmode - Requested Video mode (May be promoted).
* VBIBit - Vertical blank bit polarity.
* ImageBuf - Pointer to caller's buffer for the Drawer to use as its
* ImageBuf; NULL = player will allocate its own, if
* VQACFGF_BUFFER is set in DrawFlags.
* ImageWidth - Width of Image buffer.
* ImageHeight - Height of Image buffer.
* X1 - Draw window X coordinate (-1 = Center).
* Y1 - Draw window Y coordinate (-1 = Center).
* FrameRate - Desired frames per second (-1 = use VQA header's value).
* DrawRate - Desired drawing frame rate; allows the Drawer to draw at
* a separate rate from the Loader.
* TimerMethod - Timer method to use during playback.
* DrawFlags - Bits control various special drawing options. (See below)
* OptionFlags - Bits control various special misc options. (See below)
* NumFrameBufs - Desired number of frame buffers. (Default = 6)
* NumCBBufs - Desired number of codebook buffers. (Default = 3)
* VocFile - Name of VOC file to play instead of VQA audio track.
* AudioBuf - Pointer to audio buffer.
* AudioBufSize - Size of audio buffer. (Default = 32768)
* AudioRate - Audio data playback rate (-1 = use samplerate scaled
* to the frame rate)
* Volume - Audio playback volume. (0x7FFF = max)
* HMIBufSize - Desired HMI buffer size. (Default = 2000)
* DigiHandle - Handle to an initialized sound driver. (-1 = none)
* DigiCard - HMI ID of card to use. (0 = none, -1 = auto-detect)
* DigiPort - Audio port address. (-1 = auto-detect)
* DigiIRQ - Audio IRQ. (-1 = auto-detect)
* DigiDMA - Audio DMA channel. (-1 = auto-detect)
* Language - Language identifier. (Not used)
* CapFont - Pointer to font to use for subtitle text captions.
*/
typedef struct _VQAConfig {
long (*DrawerCallback)(unsigned char *screen, long framenum);
long (*EventHandler)(unsigned long event,void *buffer,long nbytes);
unsigned long NotifyFlags;
long Vmode;
long VBIBit;
unsigned char *ImageBuf;
long ImageWidth;
long ImageHeight;
long X1,Y1;
long FrameRate;
long DrawRate;
long TimerMethod;
long DrawFlags;
long OptionFlags;
long NumFrameBufs;
long NumCBBufs;
char *VocFile;
unsigned char *AudioBuf;
long AudioBufSize;
long AudioRate;
long Volume;
long HMIBufSize;
long DigiHandle;
long DigiCard;
long DigiPort;
long DigiIRQ;
long DigiDMA;
long Language;
char *CapFont;
} VQAConfig;
/* Drawer Configuration flags (DrawFlags) */
#define VQACFGB_BUFFER 0 /* Buffer UnVQ enable */
#define VQACFGB_NODRAW 1 /* Drawing disable */
#define VQACFGB_NOSKIP 2 /* Disable frame skipping. */
#define VQACFGB_VRAMCB 3 /* XMode VRAM copy enable */
#define VQACFGB_ORIGIN 4 /* 0,0 origin position */
#define VQACFGB_SCALEX2 6 /* Scale X2 enable (VESA 320x200 to 640x400) */
#define VQACFGB_WOOFER 7
#define VQACFGF_BUFFER (1<<VQACFGB_BUFFER)
#define VQACFGF_NODRAW (1<<VQACFGB_NODRAW)
#define VQACFGF_NOSKIP (1<<VQACFGB_NOSKIP)
#define VQACFGF_VRAMCB (1<<VQACFGB_VRAMCB)
#define VQACFGF_ORIGIN (3<<VQACFGB_ORIGIN)
#define VQACFGF_TOPLEFT (0<<VQACFGB_ORIGIN)
#define VQACFGF_TOPRIGHT (1<<VQACFGB_ORIGIN)
#define VQACFGF_BOTRIGHT (2<<VQACFGB_ORIGIN)
#define VQACFGF_BOTLEFT (3<<VQACFGB_ORIGIN)
#define VQACFGF_SCALEX2 (1<<VQACFGB_SCALEX2)
#define VQACFGF_WOOFER (1<<VQACFGB_WOOFER)
/* Options Configuration (OptionFlags) */
#define VQAOPTB_AUDIO 0 /* Audio enable. */
#define VQAOPTB_STEP 1 /* Single step enable. */
#define VQAOPTB_MONO 2 /* Mono output enable. */
#define VQAOPTB_PALOFF 3 /* Palette set disable. */
#define VQAOPTB_SLOWPAL 4 /* Slow palette enable. */
#define VQAOPTB_HMIINIT 5 /* HMI already initialized by client. */
#define VQAOPTB_ALTAUDIO 6 /* Use alternate audio track. */
#define VQAOPTB_CAPTIONS 7 /* Show captions. */
#define VQAOPTF_AUDIO (1<<VQAOPTB_AUDIO)
#define VQAOPTF_STEP (1<<VQAOPTB_STEP)
#define VQAOPTF_MONO (1<<VQAOPTB_MONO)
#define VQAOPTF_PALOFF (1<<VQAOPTB_PALOFF)
#define VQAOPTF_SLOWPAL (1<<VQAOPTB_SLOWPAL)
#define VQAOPTF_HMIINIT (1<<VQAOPTB_HMIINIT)
#define VQAOPTF_ALTAUDIO (1<<VQAOPTB_ALTAUDIO)
#define VQAOPTF_CAPTIONS (1<<VQAOPTB_CAPTIONS)
/* VQAInfo: Information about the VQA movie.
*
* NumFrames - The number of frames contained in the movie.
* ImageHeight - Height of image in pixels.
* ImageWidth - Width of image in pixels.
* ImageBuf - Pointer to the image buffer VQA draw into.
*/
typedef struct _VQAInfo {
long NumFrames;
long ImageWidth;
long ImageHeight;
unsigned char *ImageBuf;
} VQAInfo;
/* VQAStatistics: Statistics about the VQA movie played.
*
* StartTime - Time movie started.
* EndTime - Time movie stoped.
* FramesLoaded - Total number of frames loaded.
* FramesDrawn - Total number of frames drawn.
* FramesSkipped - Total number of frames skipped.
* MaxFrameSize - Size of largest frame.
* SamplesPlayed - Number of sample bytes played.
* MemUsed - Total bytes used. (Low memory)
*/
typedef struct _VQAStatistics {
long StartTime;
long EndTime;
long FramesLoaded;
long FramesDrawn;
long FramesSkipped;
long MaxFrameSize;
unsigned long SamplesPlayed;
unsigned long MemUsed;
} VQAStatistics;
/* VQAHandle: VQA file handle. (Must be obtained by calling VQA_Alloc()
* and freed through VQA_Free(). This is the only legal way
* to obtain and dispose of a VQAHandle.
*
* VQAio - Something meaningful to the IO manager. (See DOCS)
*/
typedef struct _VQAHandle {
unsigned long VQAio;
} VQAHandle;
/* Possible IO command values */
#define VQACMD_INIT 1 /* Prepare the IO for a session */
#define VQACMD_CLEANUP 2 /* Terminate IO session */
#define VQACMD_OPEN 3 /* Open file */
#define VQACMD_CLOSE 4 /* Close file */
#define VQACMD_READ 5 /* Read bytes */
#define VQACMD_WRITE 6 /* Write bytes */
#define VQACMD_SEEK 7 /* Seek */
/*---------------------------------------------------------------------------
* FUNCTION PROTOTYPES
*-------------------------------------------------------------------------*/
/* Configuration routines. */
void VQA_INIConfig(VQAConfig *config);
void VQA_DefaultConfig(VQAConfig *config);
/* Handle manipulation routines. */
VQAHandle *VQA_Alloc(void);
void VQA_Free(VQAHandle *vqa);
void VQA_Reset(VQAHandle *vqa);
void VQA_InitAsDOS(VQAHandle *vqa);
void VQA_Init(VQAHandle *vqa, long(*iohandler)(VQAHandle *vqa, long action,
void *buffer, long nbytes));
unsigned char *VQA_GetPalette(VQAHandle *vqa);
long VQA_GetPaletteSize(VQAHandle *vqa);
void VQA_Set_DrawBuffer(VQAHandle *vqa, unsigned char *buffer,
unsigned long width, unsigned long height,
long xpos, long ypos);
/* File routines. */
long VQA_Open(VQAHandle *vqa, char const *filename, VQAConfig *config);
void VQA_Close(VQAHandle *vqa);
long VQA_Play(VQAHandle *vqa, long mode);
long VQA_SeekFrame(VQAHandle *vqa, long frame, long fromwhere);
long VQA_SetStop(VQAHandle *vqa, long stop);
/* Information/statistics access routines. */
void VQA_GetInfo(VQAHandle *vqa, VQAInfo *info);
void VQA_GetStats(VQAHandle *vqa, VQAStatistics *stats);
char *VQA_Version(void);
char *VQA_IDString(void);
#endif /* VQAPLAY_H */


76
WINVQ/VQA32/OLD/VQAPLAY.I Normal file
View File

@@ -0,0 +1,76 @@
;
; Command & Conquer Red Alert(tm)
; Copyright 2025 Electronic Arts Inc.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
;****************************************************************************
;*
;* 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
;*
;*---------------------------------------------------------------------------
;*
;* PROJECT
;* VQAPlay 32 library.
;*
;* FILE
;* vqaplay.i
;*
;* DESCRIPTION
;* VQA player definitions.
;*
;* PROGRAMMER
;* Denzil E. Long, Jr.
;*
;* DATE
;* January 30, 1995
;*
;****************************************************************************
;*---------------------------------------------------------------------------
;* CONDITIONAL COMPILATION FLAGS
;*---------------------------------------------------------------------------
IF PHARLAP_TNT
VQASTANDALONE EQU 0 ;Stand alone player
VQAMONO_ON EQU 1 ;Mono display output enable/disable
VQAAUDIO_ON EQU 0 ;Audio playback enable/disable
VQAVIDEO_ON EQU 0 ;Video manager enable/disable
VQAMCGA_ON EQU 1 ;MCGA enable/disable
VQAXMODE_ON EQU 0 ;Xmode enable/disable
VQAVESA_ON EQU 0 ;VESA enable/disable
VQABLOCK_2X2 EQU 0 ;2x2 block decode enable/disable
VQABLOCK_2X3 EQU 0 ;2x3 block decode enable/disable
VQABLOCK_4X2 EQU 1 ;4x2 block decode enable/disable
VQABLOCK_4X4 EQU 0 ;4x4 block decode enable/disable
VQABLOCK_WOOFER EQU 0
ELSE
VQASTANDALONE EQU 0 ;Stand alone player
VQAMONO_ON EQU 0 ;Mono display output enable/disable
VQAAUDIO_ON EQU 1 ;Audio playback enable/disable
VQAVIDEO_ON EQU 0 ;Video manager enable/disable
VQAMCGA_ON EQU 1 ;MCGA enable/disable
VQAXMODE_ON EQU 0 ;Xmode enable/disable
VQAVESA_ON EQU 0 ;VESA enable/disable
VQABLOCK_2X2 EQU 0 ;2x2 block decode enable/disable
VQABLOCK_2X3 EQU 0 ;2x3 block decode enable/disable
VQABLOCK_4X2 EQU 1 ;4x2 block decode enable/disable
VQABLOCK_4X4 EQU 0 ;4x4 block decode enable/disable
VQABLOCK_WOOFER EQU 0
ENDIF

Some files were not shown because too many files have changed in this diff Show More