/*
** 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 .
*/
#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
#include
#include
#include "vqafile.h"
#include "vqaplay.h"
#include "caption.h"
#if(VQAAUDIO_ON)
#include "sos.h"
#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<