svcd.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:20k
- /*
- ** FILE
- ** svcd.c
- **
- ** DESCRIPTION
- ** check and return current CD infomation.
- ** manage low-level navigation structure.
- **
- */
- #include "config.h"
- #include "global.h"
- #include "memmap0.h"
- #include "func.h"
- #include "dma.h"
- #include "cdxa.h"
- #include "util.h"
- #include "stdlib.h"
- #include "cdfs.h"
- #include "epp.h"
- #include "cfont.h"
- #include "cd.h"
- #include "svcd.h"
- #include "osd.h"
- #include "user_init.h"
- #include "image.h"
- #include "navdata.h"
- #include "fs96602.h"
- #include "fsNav.h"
- #include "atapi_if.h"
- #ifdef SP1000_NO_DVD
- #include "svcd_null.c"
- #else
- //======================================================
- // debug option
- //======================================================
- #ifndef DVDRELEASE
- //#define SVCD_DBG 1
- #endif
- #ifndef SVCD_DBG
- #undef printf
- #undef print_block
- #define printf(f, a...) do {} while (0)
- #define print_block(x,y) do {} while (0)
- #endif
- //UINT32 dVts_iso9600_addr;
- /*
- **
- ** iso9660_str Tag (at PVD) for CDROM disc
- **
- ** vcd_str Tag (at INFO) for VCD
- ** cvd_str Tag (at INFO) for CVD
- ** svcd_str Tag (at INFO) for SVCD
- */
- static const char iso9660_str[5] = {'C','D','0','0','1'};
- static const char vcd_str[8] = {'V','I','D','E','O','_','C','D'};
- static const char cdi_str[4] = {'C','D','-','I'};
- static const char cvd_str[8] = {'H','Q','-','V','C','D',' ',' '};
- static const char svcd_str[8] = {'S','U','P','E','R','V','C','D'};
- static const char oko_str[6] = {'P','A','-','V','C','D'};
- static const char mpeg_str[4] = {'M','P','E','G'};
- static const char vcd30_str[7] = {'S','_','V','C','D','3','0'};
- void Check9660Init();
- UINT32 Check9660Dir(UINT32);
- void Check9660Files(UINT32);
- UINT32 CheckFileInDir(char* pStr, UINT32 nDirLoc); //wanghaoying 2003-8-12 17:13 added
- extern void save_cmp_disc_info(UINT32 info1); //wanghaoying 2003-8-12 17:15
- extern BYTE DiscType;
- UINT32 nVideoTsLoc;
- //terry,2003/12/25 02:15PM
- #ifdef BBK_DVD
- #define CORRECT_VCD_TYPE
- #endif
- #ifdef CORRECT_VCD_TYPE
- void correct_vcd_type(void)
- {
- if (cd_trk_hi > 1)
- {
- if( M2I(gettrkmsf(cd_trk_lo))<180 )
- cd_trk_lo++;
- }
- }
- #else
- #define correct_vcd_type();
- #endif
- /*
- ** FUNCTION
- ** check_cdtype
- **
- ** DESCRIPTION
- ** this is the routine to check cd-type
- */
- int check_cdtype()
- {
- int Res;
- t_primary_volume_descriptor *v ;
-
- /*
- ** check track 1 coding type
- */
-
- printf("check typen");
-
- cd_type_loaded = CDVCD10;
-
- if ((gettrkcna(1) & CNA_MASK_TYPE) != CNA_DATA)
- {
- cd_type_loaded = CDDA;
- return cd_type_loaded;
- }
- //#ifndef SUPPORT_MIX_MP3_CDDA //linrc change "SUPPORT_MIX_MP3_CDDA" to "SUPPORT_MIX_DATA_CDDA_DISC"
- #ifndef SUPPORT_MIX_DATA_CDDA_DISC //because we not only support this type mix mode disc 2004-12-15 15:53
- // cyue for cd xtra 2000/11/13 11:06AM
- if((cd_trk_hi > 1) && ((gettrkcna(2) & CNA_MASK_TYPE) != CNA_DATA))
- {
- cd_type_loaded = CDDA;
- cd_trk_lo = 2;
- return cd_type_loaded;
- }
- #endif
-
- wb_init(msf2l(MSF_INFO));
-
- if(is_user_opened())
- return -1;
- if(system_state == SYSTEM_POWER)
- return -3;
-
- {
- t_sect_info *p = (t_sect_info *)pwb;
-
- //printf("tag:%s, ver:%xn",p->file_id,p->version);
- printf("tag:%02x%02x%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x, ver:%xn",
- p->file_id[0],p->file_id[1],p->file_id[2],p->file_id[3],p->file_id[4],p->file_id[5],
- p->file_id[6],p->file_id[7],p->file_id[8],p->file_id[9],p->file_id[10],p->file_id[11],
- p->version);
- print_block(p->album_id,10);
- /*
- ** compare TAG
- */
- if(strncmp(p->file_id, vcd_str, 8) == 0)
- {
- /* VCD */
- int ver = getUINT16_bi(&p->version);
-
- //terry,2002/9/6 12:01PM
- //纒