📄 w99av.h
字号:
/***************************************************************************
(C)Copyright Cheertek Inc. 2002-2003,
D300, all right reserved
Product : CT908
Date : 1998.10.1
Author : Cheertek (D300 Chuan)
Purpose : Provide all W99AV information
Sources : w99av.c/ W99av2.c
****************************************************************************/
#ifndef __W99AV_H__
#define __W99AV_H__
#ifdef __cplusplus
extern "C" {
#endif
//*** Brian2.32a, define the value for tuning DRAM clock phase (CT908S only, no effect on CT908B)
#define W99AV_DRAM_CLOCK_PHASE_VALUE 0x04 // System board case (146MHZ or 133MHz)
//#define W99AV_DRAM_CLOCK_PHASE_VALUE 0x08 // Module board OVER_CLOCKING case (146MHZ)
//#define W99AV_DRAM_CLOCK_PHASE_VALUE 0x0C // Module board None OVER_CLOCKING case (133MHZ)
// LLY.045-2, if define it, F/W will dump CDROM decoding data to SP buffer
// others, it will dump to NV buffer while unreset after CDROM decoding case
#define DUMP_CDROM_DATA_TO_SP_BUFFER
// Chuan 172r2 2002/04/02, define it, can support Cache read/write function and instead of burst read/write
#define SUPPORT_CACHE_RW //support cache R/W functions
//#define GLOBAL_BUS_IO
//#define CACHE_RW_ONLY //No burst R/W
// LLY2.80, if define it, SP/OGT run-length table will be set by F/W
// Otherwise, it will be set by RISC command
//#define INITIAL_SPOGT_RL_TALBE_BY_FW
// LLY2.80, define the max number of command argument
// The max one of current used -- Preset Frame Buffer Command
// Notice: Must update this value if necessary command argument become large
#ifdef INITIAL_SPOGT_RL_TALBE_BY_FW
#define MAX_CMD_ARG_NO 13
#else // #ifdef INITIAL_SPOGT_RL_TALBE_BY_FW
#define MAX_CMD_ARG_NO 8
#endif // #ifdef INITIAL_SPOGT_RL_TALBE_BY_FW
// LLY.171, add two global variables
extern DWORD __dwW99AVAudioFreq;
extern WORD __wW99AVSamplesPerFrame;
extern WORD __wW99AVAudioBitrate; //Kevin1.24a
// Brian1.21, add for DVDInfo module
extern DWORD __dwReserveStart;
// Micky2.36, NV buffer address use variable
extern DWORD __dwNVStart;
#if IO == IO_PCI
extern WORD __wW99AVPCIIO; // Base I/O for PCI brideg
extern WORD __wW99AVBaseIO; // Base I/O address for W9922QF dword access
extern WORD __wW99AVBaseIOByte; // Base I/O for W9922QF byte access
extern WORD __wW99AVDACIO ;
extern WORD __wW99AVTVIO ;
#endif
#ifdef USE_INITIAL_FILE
extern char __strW99AVIni[50]; // the ini file name
extern DWORD __dwW99AVDSPArg; // record DSP argument
//extern BIT EA;
extern BYTE __bMpegType; // 1:Still , 0:Motion
extern BYTE __bInPath; // 1:CD interface, 0:Host
extern BYTE __bW99AVAudioType;
#endif
// LLY2.80, create one pointer and two buffer to access the command argument of W99AV_CommandN()
// Let W99AV_CommandN() can be call by ISR and normal API, and don't destroy __dwW99AVCmdArg[]
// record command arguments(ARG0~ARG15)
// __dwW99AVCmdArg[0] is the number of arguments
//extern DWORD __dwW99AVCmdArg[17];
extern DWORD xdata * DATA __dwW99AVCmdArg; // memory-specific pointer, and put in "data" space
extern DWORD __dwW99AVCmdBuffer[MAX_CMD_ARG_NO+1]; // for normal API usage
extern DWORD __dwW99AVCmdBuffer_ISR[MAX_CMD_ARG_NO+1]; // for ISR usage
extern WORD IDATA __wW99AVPCRHigh;
extern WORD IDATA __wW99AVPCRLow;
extern WORD __wW99AVVCRHigh;
extern WORD __wW99AVVCRLow;
extern DWORD __dwW99AVVDRR;
extern WORD __wW99AVCAR;
extern WORD __wW99AVHDSR;
extern WORD __wW99AVHDWR;
extern WORD __wW99AVSPVDS;
extern WORD __wW99AVSPHDS;
extern WORD __wW99AVPARCTLRHigh;
extern WORD __wW99AVPARCTLRLow;
extern WORD __wW99AVPARFIFOCTLRHigh ;
extern WORD __wW99AVPARFIFOCTLRLow ;
extern WORD __wW99AVAVIDRHigh;
extern WORD __wW99AVAVIDRLow;
extern WORD __wW99AVNVSUBIDRHigh;
extern WORD __wW99AVNVSUBIDRLow;
extern DWORD __dwW99AVVBUFFSIZE;
extern DWORD __dwW99AVABUFFSIZE;
extern DWORD __dwW99AVECCBASE;
extern WORD __wW99AVBSFORMATR;
extern WORD __wW99AVGPCRLow, __wW99AVGPCRHigh;
// DVD_173Micky, add two variables for DRAM source and destination.
extern DWORD __dwW99AV_SrcDRAM;
extern DWORD __dwW99AV_DestDRAM;
#ifdef SUPPORT_GZIP_COMPRESSION //Kevin1.20
extern WORD __wW99AV_SizeDRAM;
#endif
extern BYTE __bW99AVSpOgtType ;
extern BYTE __bW99AVABuf2Def;
#define TYPE_UNKNOWN 0
#define TYPE_SP 1
#define TYPE_OGT_SVCD 2
#define TYPE_OGT_CVD 4
//***************************************
// define delay time
#if IO == IO_PCI
#define DELAY 20
#define ACKLOOP 20000 //Kevin1.25, about 10sec (must <65536 (WORD))
#define VSYNCLOOP 10000
#else
#define DELAY 0
#define ACKLOOP 60 //Kevin1.25, not adjust system ACKLOOP, eg. wait no DSP ACK may be too long
#define VSYNCLOOP 1200
#endif
// LLY.276p-4, preset frame buffer command must take more time
// while RISC will service vint during this command
// Chuan0.86, Give the long ACK count.
#if IO == IO_PCI
#define ACKLOOP_PSFB 200000L //Kevin1.25, about 10 sec (must <2^32 (DWORD))
#else // #if IO == IO_PCI
#define ACKLOOP_PSFB 300000L //Kevin1.25, about 10 sec (must <2^32 (DWORD))
#endif // #if IO == IO_PCI
//***************************************
//#ifdef USE_32M_SDRAM
#if (SDRAM_CONFIGURATION == SDRAM_32M) || ( (SDRAM_CONFIGURATION == SDRAM_64M) && !defined(SUPPORT_ANTISHOCK) ) //Kevin2.27, 32M or 64M non-antishock
#define IRAM_ADDR 0x0300 // the start address of iram.inc
#define IRAM_END_ADDR 0x3000 // the end address of iram.inc //Kevin1.01, add
#define ERAM_ADDR 0x3000 // dsp eram's dram address
#define ERAM_END_ADDR 0x5000 // dsp eram's dram end address //Kevin1.01, add
//Kevin2.36, swap buffer/side buffer adjustable
#define W99AV_ADDR_SBUFF_DTS 0x5000L
#define W99AV_ADDR_SBUFF_MP3_WMA 0x5000L
#define W99AV_ADDR_SIDE_INFO_START 0x3F200L // MP3 side information buffer start
#define W99AV_ADDR_SIDE_INFO_LENGTH 0x6400L //MP3 side information buffer size
//**********************************************************************************
// Digest mode buffer adjustment
#define W99AV_ADDR_VBUFF_DIGEST 0x11E31001L // 120.5K DW, move video buffer to bank 2 in digest mode
#define W99AV_ADDR_ABUFF_DIGEST 0x030302E3L // 8K DW (only use 8K for sync issue)
#define W99AV_ADDR_ABUFF2_DIGEST 0x03240304L // 8K DW
// for digest mode, frame buffer starts form end of W99AV_ADDR_PCMBUFF_DIGEST +6K ==> 0x33D00 ==> put at frame buffer's limit 0x33E00
#define W99AV_ADDR_PCMBUFF_DIGEST 0x325 // 8K DW ==> 6K DW
// keep MAD swap buffer plus extra 2K, so we may move W99AV_ADDR_PCMBUFF_DIGEST to here
#define W99AV_ADDR_PCMBUFF2_DIGEST 0x70 // 10K DW, PCM Buffer 2 for Other Mode
// define Frame buffer start address for Digest mode
#define W99AV_ADDR_FRAMEBUFF_DIGEST 0x33E // address >> 8
// For normal A/V buffer size
// Chuan1.00, enlarge Video Buffer size from 86K to 172K
// ** TCH1.01-908; Can't over 0x20000 as RISC limitation ....0x12B11001L
// #define W99AV_ADDR_VBUFF 0x0600041EL // 120.5K DW
#define W99AV_ADDR_VBUFF 0x059B03FEL // 103.25K DW
// reserve 40K from 0x35700~0x3F7FF for all Audio bitstream buffer
//Kevin1.24, increase audio buffer & adjust threshold to avoid DVD audio underflow & VCD audio overflow
//#define W99AV_ADDR_ABUFF 0x03770357L // 8K DW (only use 8K for sync issue)
//#define W99AV_ADDR_ABUFF2 0x03980378L // 8K DW
#define W99AV_ADDR_ABUFF 0x03870357L // 12K DW
#define W99AV_ADDR_ABUFF2 0x03b80388L // 12K DW
// for MP3 A/V buffer size
//#define W99AV_ADDR_VBUFF_MP3 0x05EE0576L // 30K DW
#define W99AV_ADDR_VBUFF_MP3 0x03F10348L // 42.25K DW
#define W99AV_ADDR_ABUFF_MP3 0x05380456L // 56.5K DW
#define W99AV_ADDR_ABUFF2_MP3 0x05750539L // 15K DW
// For MP3 and JPG, and share frame buffer 2
#define W99AV_ADDR_VBUFF_JPEG W99AV_ADDR_VBUFF_MP3 // 30K DW
#define W99AV_ADDR_ABUFF_JPEG W99AV_ADDR_ABUFF_MP3 // 56.5K DW
// For LPCM A/V buffer size
#define W99AV_ADDR_VBUFF_LPCM W99AV_ADDR_VBUFF // 120.5K DW
#define W99AV_ADDR_ABUFF_LPCM 0x03F70357L // 40K DW
// For CDDA buffer size
#define W99AV_ADDR_VBUFF_PCM W99AV_ADDR_VBUFF // 120.5K DW
#define W99AV_ADDR_ABUFF_PCM W99AV_ADDR_ABUFF_LPCM // 40K DW
// LJY1.10, for CDG
#define W99AV_ADDR_VBUFF_CDG 0x00800050 //x00710050L // 18K DW, buffer too small will caue fill logo data failed??? (IFIFO overflow)
#define W99AV_ADDR_ABUFF_CDG W99AV_ADDR_ABUFF_MP3 // 56.5K DW
//LJY1.26, It needs to set YUV buffer start address for new RISC code(20040521). It needs 158KDW for CDG YUV/RGB buffer.
#define W99AV_ADDR_CDG_YUV_START 0x545 // YUV start >> 8
// For CDROM-AC3 used.
#define W99AV_ADDR_ABUFF_AC3 W99AV_ADDR_ABUFF // 8K DW
// for NV buffer start address
// Micky0.83, from 20030514 risc codes, the NV addr will be decided by ucode
#define W99AV_ADDR_NVBUFF 0x9E00L
// Micky0.83b, use 13.25K for SP buffer.(why EPP can't use 13.5K??)
#define W99AV_ADDR_SPBUFF 0x009D0068L // Chuan2.80p, end>>8, start>>8
#define W99AV_ADDR_RTIBUFF 0x32A00L // Chuan2.80p
#define W99AV_ADDR_NV_RTI_BUFF (MAKELONG((W99AV_ADDR_RTIBUFF>>8),(W99AV_ADDR_NVBUFF>>8)))
// LLY.276p-4, define PCM buffer starting address
//#define W99AV_ADDR_PCMBUFF 0x3FE // 8K DW
//#define W99AV_ADDR_PCMBUFF 0x2E3 // 8K DW
// Brian1.22, re-arrange PCM buffer address to provide fixed position for F/W user data
#define W99AV_ADDR_PCMBUFF 0x30E // 8K DW
#define W99AV_ADDR_PCMBUFF2 0x32E // 10K DW, PCM Buffer 2 for Other Mode
//#define W99AV_ADDR_PCMBUFF_MP3 0x70 // 12K DW, (12K for WMA case, 6K for MP3 case)
// Brian1.22, re-aarange to add another F/W user data (2) for FM
#define W99AV_ADDR_PCMBUFF_MP3 0x318 // 12K DW, (12K for WMA case, 6K for MP3 case)
#define W99AV_ADDR_PCMBUFF_JPEG W99AV_ADDR_PCMBUFF_MP3 // JPEG case
// Micky0.86, the write pixel start must be the same bank w/ display buffer.
//#define W99AV_DRAM_ADDR_WPIXEL_START 0x172300L // 512 DW
// Brian1.21
// For BE version, fix digest issue ==> Write Pixel command can only work for Digest mode with this arrangement.
#define W99AV_DRAM_ADDR_WPIXEL_START 0x9900L // 512 DW, after
//#define W99AV_DRAM_ADDR_RESERVE_START 0x172500L // 25K DW, F/W user data
// Brian1.22, find a fixed position for F/W user data
#define W99AV_DRAM_ADDR_RESERVE_START 0x2CE00L // 16K DW, F/W user data
//#define W99AV_DRAM_ADDR_RESERVE_END 0x1063FFL // ** TCH1.61a; Size= 1A00h= 6656. 0x3C00 is KC Buffer
//#define W99AV_DRAM_ADDR_RESERVE_START_FM 0x32300L // 25K DW, F/W user data, for File Manager case
//#define W99AV_DRAM_ADDR_RESERVE_START_FM 0x2E300L // 25K DW, F/W user data, for File Manager case
// Brian1.22, find a fixed position for F/W user data
#define W99AV_DRAM_ADDR_RESERVE_START_FM W99AV_DRAM_ADDR_RESERVE_START // 16K DW, F/W user data, for File Manager case
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -