⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ucode.h

📁 车载电子影音系统dvd播放系统原程序代码
💻 H
字号:
#ifndef __UCODE_H__
#define __UCODE_H__

#ifdef  __cplusplus
        extern "C" {
#endif

// ** TCH1.01-908; Control DSP-ERAM DRAM -> DRAM Copy mechanism.
// It can save the time that switch between different Audio Mode
//#define     NO_BACKUP_ERAM
#define     SUPPORT_DRAM_PROTECTION     //Kevin1.01

// ***** Common Define For UCODE LOAD Area *****
#define     START           2    // 0:date , 1:count number, 2:real data start point

// Brian2.30, move the following define to W99AV.H
/*
#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
// Brian2.30
#if (SDRAM_CONFIGURATION == SDRAM_16M)
#define     ERAM_END_ADDR   0x3C00  // 16M, ERAM is 3K
#else
#define     ERAM_END_ADDR   0x5000      // dsp eram's dram end address //Kevin1.01, add
#endif
*/

// 0x1600 = IRAM_ADDR+5632-512
// 512: the 512n '0' in the IRAM start address, ie 0x200 ~ 0x400 must fill with '0'
#define     IRAMEXT_ADDR    0x1600  // the start address of IRAM extension ucode
#define     CSS_ADDR        IRAMEXT_ADDR    // the start address of css.inc
#define     OGT_ADDR        IRAMEXT_ADDR    // the start address of ogt.inc

// Brian1.10, support using 32M-bit SDRAM case
#define     UCODE_BACKUP_ADDR   ((DWORD)(W99AV_ADDR_UCODE_BACKUP))   

#ifndef SUPPORT_GZIP_COMPRESSION //Kevin1.20
#define     AC3ERAM_ADDR        ((DWORD)(UCODE_BACKUP_ADDR))    // 0x7C000
#define     DTSERAM_ADDR        ((DWORD)(AC3ERAM_ADDR+4096L))    // 0x7D000
#define     DVDERAM_ADDR        ((DWORD)(DTSERAM_ADDR+2048L))    // 0x7D800
#define     MPGERAM_ADDR        ((DWORD)(DVDERAM_ADDR+2048L))    // 0x7E000
#define     MP3ERAM_ADDR        ((DWORD)(MPGERAM_ADDR+2048L))    // 0x7E800
#define     PCMERAM_ADDR        ((DWORD)(MP3ERAM_ADDR+2048L))    // 0x7F000
#define     TONERAM_ADDR        ((DWORD)(PCMERAM_ADDR+2048L))    // 0x7F800
#define     UCODE_BACKUP_END_ADDR ((DWORD)(TONERAM_ADDR+2048L))  // 0x80000 //Kevin1.01, add
#else //Kevin1.20 
#define     UCODE_BACKUP_END_ADDR   ((DWORD)(W99AV_ADDR_UCODE_END_BACKUP))      // Chuan1.21, add
#endif

#define     AC3ERAM             0x1
#define     DTSERAM             0x2
#define     DVDERAM             0x4
#define     MPGERAM             0x8
#define     MP3ERAM             0x10
#define     PCMERAM             0x20
#define     TONERAM             0x40

#ifdef SUPPORT_GZIP_COMPRESSION //Kevin1.20
#include "UcodeSz.def"

#define UCODE2_LoadCode     UCODE_LoadCode
#define UCODE3_LoadCode     UCODE_LoadCode
#define UCODE4_LoadCode     UCODE_LoadCode

#define UCODE2_CheckCode    UCODE_CheckCode
#define UCODE3_CheckCode    UCODE_CheckCode
#define UCODE4_CheckCode    UCODE_CheckCode
#endif

// Chuan2.80, the following code must locate below #include "winav.h" and above #include "ucode.h"
#ifdef INPUT_PATH_HOSTIF
// Chuan2.80p, define it, parser will skip all sync of input-bitstream
// Micky0.83, always input raw data for Emulator and System
#if defined(SYSTEM_8051) || defined(EMULATOR_DOS)
#else
#define BITSTREAM_WITHOUT_SYNC
#endif
#endif
//********************************************************
// **** Define UCODE ID Area *****
// bit[7:4]: desired UCODE type
// bit[3:0]: subtype of the desired UCODE
#define     UCODE_NONE                  0x00
#define     UCODE_IRAM                  0x10
//Kevin1.25, comment
//#define     UCODE_IRAM_JPEG             0x11
#define     UCODE_IRAM_GZIP             0x12    //Kevin1.20, add
#define     UCODE_URAM                  0x20

//alex1.24a , Scan Dram at power on
#ifdef SUPPORT_DRAM_SCAN_POWERON
#define     UCODE_URAM_DRAMTEST			0x22
#define     UCODE_CRAM_DRAMTEST			0x23
#endif //#ifdef SUPPORT_DRAM_SCAN_POWERON

#define     UCODE_PRAM                  0x30
#define     UCODE_ALLPRAM               0x31
#define     UCODE_DVDPRAM               0x32
#define     UCODE_CDROMPRAM             0x33
#define     UCODE_KEYPRAM               0x34
#define     UCODE_DOSJPEG               0x35
// #define     UCODE_TESTJPEG              0x36 //CoCo.testJPEG // Chuan1.10-2nd, Remove TestJPEG case
#define     UCODE_DATPRAM               0x37

#define     UCODE_PRAM_VIDEO_ONLY       UCODE_ALLPRAM
#define     UCDOE_PRAM_AUDIO_ONLY       UCODE_DVDPRAM
#define     UCODE_PRAM_REAL_CDROM       UCODE_CDROMPRAM
#define     UCODE_PRAM_BYPASS_CDROM     UCODE_ALLPRAM
#define     UCODE_PRAM_VCD              UCODE_ALLPRAM
#define     UCODE_PRAM_DVD              UCODE_DVDPRAM
#define     UCODE_PRAM_MP3              UCODE_CDROMPRAM
#ifdef BITSTREAM_WITHOUT_SYNC
#define     UCODE_PRAM_JPEG             UCODE_DOSJPEG
#else
#define     UCODE_PRAM_JPEG             UCODE_CDROMPRAM
#endif
#define     UCODE_PRAM_KEY              UCODE_KEYPRAM
#define     UCODE_PRAM_CDDA             UCODE_CDROMPRAM // Chuan2.80, CDDA move to MP3PRAM from 20030305
// wyc1.10, new define for new parser code.
#define     UCODE_PRAM_DAT       UCODE_DATPRAM

#define     UCODE_DSPRAM                0x40

#define     UCODE_DSPRAM_AC3            0x41
#define     UCODE_DSPRAM_DTS            0x42
#define     UCODE_DSPRAM_DVD            0x43
#define     UCODE_DSPRAM_MP3            0x44
#define     UCODE_DSPRAM_MPG            0x45
#define     UCODE_DSPRAM_PCM            0x46
#define     UCODE_DSPRAM_WMA            0x47 //Kevin1.32

#define     UCODE_DSPRAM_NORMAL         UCODE_DSPRAM_AC3
#define     UCODE_DSPRAM_TONE           0x48

#define     UCODE_DSPRAM_GZIP           0x50    //Kevin1.20      

#define     UCODE_CRAM                  0x60    //Kevin1.20, modify
#define     UCODE_SERVO                 0x70
#define     SETUPICON					0x80	//Kevin2.37
#define     FONTTABLE					0x81	//Kevin2.37
#define     LOCALFONTTABLE0				0x90	//Kevin2.37
#define     LOCALFONTTABLE1				0x91	//Kevin2.37

#define     UCODE_LOAD_FAIL 0
#define     UCODE_LOAD_OK   1
#define     UCODE_LOAD_NONE 2
//********************************************************
// function prototype
BIT     UCODE_Load(void);
BIT     UCODE_Check(void);
BYTE    UCODE_LoadCode (BYTE bRam, BYTE bCode) ;
BYTE    UCODE_CheckCode (BYTE bRam, BYTE bCode) ;
//BYTE    UCODE_VerifyCODE(BYTE bCodeType); //Kevin2.26, comment
BYTE    UCODE2_LoadCode(BYTE bRam, BYTE bCode);
BYTE    UCODE2_CheckCode (BYTE bRam, BYTE bCode);
BYTE    UCODE3_LoadCode(BYTE bRam, BYTE bCode);
BYTE    UCODE3_CheckCode (BYTE bRam, BYTE bCode);
BYTE    UCODE4_LoadCode(BYTE bRam, BYTE bCode);
BYTE    UCODE4_CheckCode (BYTE bRam, BYTE bCode);
BYTE    UCODE5_LoadCode(BYTE bRam, BYTE bCode); //Kevin1.25, load test tone ucode
#ifdef SUPPORT_GZIP_COMPRESSION //Kevin1.20
BYTE	UCODE_Unzip(BYTE bUcode); //Kevin1.32
#endif
//internal function
#ifndef SYSTEM_8051
void _ReadUcode(FILE *stream, DWORD *pdwBuffer);
BYTE   _AllocateBuffer(BYTE bUcodeType);
BYTE   _OpenUCODE ( char * pName );
#endif
//********************************************************
#ifndef SYSTEM_8051
extern DWORD *pdwUcode;
#endif
extern DWORD dwData;
extern DWORD code *dwRAM;
extern DWORD dwTemp;
extern WORD _UCODEIndex;
extern WORD code *wptr;  // Chuan1.21, extern the point
extern BYTE _bDSPramCur; 
extern BYTE _bDSPBackup;
extern BYTE bRet;


#ifdef __cplusplus
        }
#endif

#endif  // __UCODE_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -