Initial commit of Command & Conquer Red Alert source code.
This commit is contained in:
197
VQ/INCLUDE/VQA32/VQAFILE.H
Normal file
197
VQ/INCLUDE/VQA32/VQAFILE.H
Normal 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 */
|
||||
|
282
VQ/INCLUDE/VQA32/VQAPLAY.BAK
Normal file
282
VQ/INCLUDE/VQA32/VQAPLAY.BAK
Normal file
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
** 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
|
||||
* February 23, 1995
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* CONDITIONAL COMPILATION FLAGS
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
#define VQAVOC_ON 0 /* Enable VOC file override */
|
||||
#define VQAMONO_ON 1 /* Mono display output enable/disable */
|
||||
#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 1 /* 2x2 block decode enable/disable */
|
||||
#define VQABLOCK_2X3 1 /* 2x2 block decode enable/disable */
|
||||
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
|
||||
#define VQABLOCK_4X4 1 /* 4x4 block decode enable/disable */
|
||||
#else
|
||||
#define VQAVOC_ON 1 /* 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 1 /* 2x2 block decode enable/disable */
|
||||
#define VQABLOCK_2X3 1 /* 2x2 block decode enable/disable */
|
||||
#define VQABLOCK_4X2 1 /* 4x2 block decode enable/disable */
|
||||
#define VQABLOCK_4X4 1 /* 4x4 block decode enable/disable */
|
||||
#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_STOP 2 /* 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 */
|
||||
|
||||
/* Error/condition values */
|
||||
#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. */
|
||||
|
||||
/* Memory limits */
|
||||
#define VQA_NUM_MAXRATES 5 /* Number of max rates in the Config struct */
|
||||
#define VQA_TIMETICKS 60 /* Clock ticks per second */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* STRUCTURES AND RELATED DEFINITIONS
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
/* VQAConfig: Player configuration structure
|
||||
*
|
||||
* DrawerCallback - User routine for Drawer to call each frame (NULL = none)
|
||||
* 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 22050 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)
|
||||
* MaxRate - Fixed rate playback table.
|
||||
*/
|
||||
typedef struct _VQAConfig {
|
||||
void (*DrawerCallback)(unsigned char *screen, long framenum);
|
||||
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;
|
||||
} 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 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)
|
||||
|
||||
/* 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_FINF 3 /* Frame info chunk enable */
|
||||
#define VQAOPTB_SLOWPAL 4 /* Slow palette enable */
|
||||
#define VQAOPTB_HMIINIT 5 /* HMI already initialized by client. */
|
||||
#define VQAOPTF_AUDIO (1<<VQAOPTB_AUDIO)
|
||||
#define VQAOPTF_STEP (1<<VQAOPTB_STEP)
|
||||
#define VQAOPTF_MONO (1<<VQAOPTB_MONO)
|
||||
#define VQAOPTF_FINF (1<<VQAOPTB_FINF)
|
||||
#define VQAOPTF_SLOWPAL (1<<VQAOPTB_SLOWPAL)
|
||||
#define VQAOPTF_HMIINIT (1<<VQAOPTB_HMIINIT)
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
typedef struct _VQAInfo {
|
||||
long NumFrames;
|
||||
long ImageWidth;
|
||||
long ImageHeight;
|
||||
} 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.
|
||||
*
|
||||
* VQAStream - Something meaningful to the stream manager. (See DOCS)
|
||||
*/
|
||||
typedef struct _VQAHandle {
|
||||
unsigned long VQAStream;
|
||||
} VQAHandle;
|
||||
|
||||
/* Possible stream command values */
|
||||
#define VQACMD_INIT 1 /* Prepare the stream for a session */
|
||||
#define VQACMD_CLEANUP 2 /* Terminate stream session */
|
||||
#define VQACMD_OPEN 3 /* Open stream */
|
||||
#define VQACMD_CLOSE 4 /* Close stream */
|
||||
#define VQACMD_READ 5 /* Read bytes from stream */
|
||||
#define VQACMD_WRITE 6 /* Write bytes to stream */
|
||||
#define VQACMD_SEEK 7 /* Seek on stream */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* FUNCTION PROTOTYPES
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
void VQA_INIConfig(VQAConfig *config);
|
||||
void VQA_DefaultConfig(VQAConfig *config);
|
||||
|
||||
VQAHandle *VQA_Alloc(void);
|
||||
void VQA_Free(VQAHandle *vqa);
|
||||
void VQA_InitAsDOS(VQAHandle *vqa);
|
||||
void VQA_Init(VQAHandle *vqa, unsigned long(*streamhandler)(VQAHandle *vqa,
|
||||
long action, void *buffer, long nbytes));
|
||||
|
||||
long VQA_Open(VQAHandle *vqa, char const *filename, VQAConfig *config);
|
||||
void VQA_Close(VQAHandle *vqa);
|
||||
long VQA_Play(VQAHandle *vqa, long mode);
|
||||
|
||||
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 */
|
||||
|
321
VQ/INCLUDE/VQA32/VQAPLAY.H
Normal file
321
VQ/INCLUDE/VQA32/VQAPLAY.H
Normal file
@@ -0,0 +1,321 @@
|
||||
/*
|
||||
** 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
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
#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 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 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.
|
||||
* 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;
|
||||
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_InitAsDOS(VQAHandle *vqa);
|
||||
void VQA_Init(VQAHandle *vqa, long(*iohandler)(VQAHandle *vqa, long action,
|
||||
void *buffer, long nbytes));
|
||||
|
||||
/* 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);
|
||||
|
||||
/* 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 */
|
||||
|
Reference in New Issue
Block a user