setup_exe.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:55k
- /*
- * Terry,2004/2/10 03:34PM
- */
- //#include "setup_page.h"//nono mark why add it??
- #ifndef AC3_BASS_MANAGEMENT
- int downmix_off;
- #endif
- #ifdef PULIANG_SETUP_MENU //yaowh add 04-12-15
- int show_menu_setup_flag;
- #endif
- #ifdef SELECT_MEDIA_IN_SETUPMENU
- BYTE media_changed_flag = 0;
- #endif
- void exe_setup_function(UINT8 tt_id, UINT8 sub_id, UINT8 exe);
- #ifdef DVD_SETUP_REENG
- extern void setup_VA2sel(void);
- extern UINT32 setup_getSelPos(UINT8 selection);
- extern UINT16 setup_getItemPos(UINT8 item);
- #endif
- #ifdef SETUP_MENU_TWO_BUTTON_SELECT_TWO_SUBTITLE //added by wangwei,2004-10-24 23:12
- extern int IDTWO;
- UINT8 language_id;
- UINT16 LCD_2; //Language CoDe of the second subtitle.
- #endif
- #ifdef SUPPORT_HD_DVD
- extern void scaler_main(void);
- static inline void exe_setup_function_dvi(UINT8 tt_id, UINT8 sub_id, UINT8 exe)
- {
- #ifdef ADD_DVI311_SETUP
-
- #if 0////Modifed by chenzhao on 2004-12-10 15:39
- static unsigned char init_output=1;
- if(tt_id == STR_OS_DVI311_FORMAT)
- {
- dvi311_format = sub_id;
- if(dvi311_format==STR_OS_ANOLOG_OUTPUT) ////analog kevin0710
- {
- if(init_output==0)
- {
- }
- else
- {
- init_output=0;
- scaler_main();
- }
- close_pll(0x00);
- Power_off_311=1;
- }
- if(dvi311_format==STR_OS_DIGIT_OUTPUT) //digital
- {
- if(Power_off_311==1)
- {
- close_pll(0xff);
- #if 0
- GPIO_O_SET(40, 1);
- delay_1ms(200);
- delay_1ms(200);
- GPIO_O_SET(40, 0); //reset 311
- delay_1ms(600);
- scaler_main();
- #endif //0
- Power_off_311=0;
- }
- init_output=0;
- }
- // scaler_main(); //040512
- printf("set output--kevin");
- psprintf(linebuf, "dvi311_format %xn", dvi311_format);
- epp_write_wait(linebuf);
- }
- #endif
- #ifdef HDCP_CUSTOM//Modifed by chenzhao on 2004-12-1 11:24
- if(tt_id == STR_OS_HDCP)
- {
- if(STR_OS_OFF==sub_id)
- hdcp_mode=HDCP_OFF;
- else
- hdcp_mode=HDCP_ON;
- ResetAuthentStates();
- }
- #endif
- if(tt_id ==STR_OS_TV_SYS)
- {
- if(sub_id!=STR_OS_AUTO)
- dvi311_tv_mode = sub_id;
- #ifdef DVD_SETUP_REENG//Modifed by chenzhao on 2004-11-24 21:8
- dvi311_mode=setup_VA[SETUP_VA_SPV311MODE]-MIN_ITEM_SEL;
- #else
- dvi311_mode=SETUP_DVI_MODE-MIN_ITEM_SEL;//for load saved SETUP_DVI_MODE.added by ChenZhao on 2004-10-19 14:22
- #endif
- //kevin tsest
- //if(tv_out_id!=P_SCAN)//Modifed by chenzhao on 2004-11-25 16:46 //not HD output kevin@2k0708
- //{
- if(dvi311_tv_mode>0x84&&dvi311_mode==Mode_576P)// NTSC and 480P @kevin 2k40708
- dvi311_mode=Mode_480P;
- if(dvi311_tv_mode==0x84&&dvi311_mode==Mode_480P)// PAL and 576P @kevin 2k40708
- dvi311_mode=Mode_576P;
- #if 0//Modifed by chenzhao on 2004-11-25 16:46
- //}
- else if(tv_out_id==P_SCAN) //not HD output kevin@2k0708
- {
- if(dvi311_tv_mode>0x84&&dvi311_mode==Mode_576P)// NTSC and 480P @kevin 2k40708
- dvi311_mode=Mode_480P;
- if(dvi311_tv_mode==0x84&&dvi311_mode==Mode_480P)// PAL and 576P @kevin 2k40708
- dvi311_mode=Mode_576P;
- }
- #endif
- #ifdef DVD_SETUP_REENG//Modifed by chenzhao on 2004-11-24 21:8
- setup_VA[SETUP_VA_SPV311MODE]=dvi311_mode+MIN_ITEM_SEL;
- #else
- //SETUP_DVI_MODE=dvi311_mode+MIN_ITEM_SEL;
- #endif
- if(Power_off_311==1)//for standby powerup start 311.added by ChenZhao on 2004-10-19 16:51
- {
- close_pll(0xff);
- Power_off_311=0;
- }
- scaler_main(); //040512
- psprintf(linebuf, "dvi311_tv_mode %x,exe=%dn", dvi311_tv_mode,exe);
- epp_write_wait(linebuf);
- }
- #endif
- }
- #endif
- #include "str_os_downmix_setup.inc"
- #include "str_os_aud_out.inc"
- #include "str_os_16_9.inc"
- #include "str_os_4_3lb.inc"
- #include "str_os_4_3ps.inc"
- #include "str_os_svideo.inc"
- #include "str_os_ycbcr.inc"
- #include "str_os_tv_rgb.inc"
- #include "str_os_pc_vga.inc"
- #include "str_os_pscan_yuv.inc"
- #ifdef SUPPORT_PROLOGIC_II
- #include "str_os_prologic2.inc"
- #endif
- //added by JS //for setup reengineering //20040817
- #ifdef DVD_SETUP_REENG
- #ifdef SPHE8202_CARD_STORAGE
- extern void Card_power_off();
- #endif
- void exe_setup_function(UINT8 tt_id, UINT8 sub_id, UINT8 exe)
- {
- //language,osd,subtitle,audio
- //printf("tt:%d sub:%d exe:%xn",tt_id,sub_id,exe);
- #ifdef STORE_VIDEO_PARAMETER
- BYTE res;
- #endif
- printf("n exe_setup_function in %d %d %dn", tt_id, sub_id, exe);
-
- #ifdef ADD_DVI311_SETUP
- exe_setup_function_dvi(tt_id, sub_id, exe);
- #endif
- switch(tt_id)
- {
- #ifdef SELECT_MEDIA_IN_SETUPMENU
- case STR_OS_MEDIA_TYPE:
- if(system_state == SYSTEM_OPEN) //Maoyong 2004/8/11 can't switch in OPEN state
- break;
-
- switch(sub_id)
- {
- case STR_OS_MEDIA_DISC:
- if(media_type == MEDIA_CARD)
- {
- #ifdef SPHE8202_CARD_STORAGE
- Card_power_off(); //wthsin, 2004/9/1 10:13am
- #endif
- media_changed_flag = 1;
- SwitchMedia(CARD2CD);
- printf("========= Switch to Disk Media ==========n");
- }
- break;
- case STR_OS_MEDIA_USB:
- if( (media_type == MEDIA_CD) || (storage_type != USB_DEVICE) )
- {
- #ifdef SPHE8202_CARD_STORAGE
- Card_power_off(); //wthsin, 2004/9/1 10:13am
- #endif
- media_changed_flag = 1;
- storage_type = USB_DEVICE;
- SwitchMedia(CD2CARD);
- printf("========= Switch to USB Device ==========n");
- }
- break;
- case STR_OS_MEDIA_CARD: //Maoyong 2004/8/11 for eastech TYPE 3 CARD Storage
- if( (media_type == MEDIA_CD) || ( (storage_type != MS_CARD_DEVICE) && (storage_type != SD_CARD_DEVICE) && (storage_type != SMC_CARD_DEVICE) ) )
- {
- media_changed_flag = 1;
- if(detect_type & MS_CARD_DEVICE)
- storage_type = MS_CARD_DEVICE;
- else if(detect_type & SD_CARD_DEVICE)
- storage_type = SD_CARD_DEVICE;
- else if(detect_type & SMC_CARD_DEVICE)
- storage_type = SMC_CARD_DEVICE;
- SwitchMedia(CD2CARD);
- printf("========= Switch to MS/SD/SMC CARD Device ==========n");
- }
- break;
- }
- break;
- #endif //#ifdef SELECT_MEDIA_IN_SETUPMENU
-
- #ifdef TUNR_OFF_PARENTAL_LVL
- case STR_OS_RATING:
- bTurnOffParentalLVL=0;//terry,2002/9/20 11:40PM
- break;
- #endif
- #ifdef ADD_P_SCAN_ONOFF
- case STR_OS_P_SCAN_YUV: //add by Tom 20040714
- if(sub_id==STR_OS_ON)
- str_os_pscan_yuv();
- else
- str_os_ycbcr();
- break;
- #endif
- case STR_OS_OSD:
- {
- int i;
- for (i=MIN_ITEM_SEL; i<=MAX_ITEM_SEL; i++) {//nono 2-10-30 17:35
- if (sub_id==setup_item[setup_pos[1]][setup_pos[2]][i])
- {
- break;
- }
- }
- /* //marked by JS //20040817
- #ifdef SUPER_DEFAULT_OSD_LANG
- if(page==CUSTMPAGEINDEX)
- {
- UserSet.setup_default_osd_lang = i -2;
- SETUP_OSD_LANG = UserSet.setup_default_osd_lang +2;
- }
- #endif
- */
- //osd_font_mode = i-2;
- osd_font_mode = OSD_LANG_MAP[i-2]; //Jeff 20030217
- }
- break;
- case STR_OS_SUBTITLE_LANG_SETUP:
- UserSet.SPSTN = 0x40|0x3E;//setting sub-picture on
- if(sub_id==STR_OS_AUTO) {
- sub_id=LCD_EN;//'e' * 256 + 'n';
- } else if(sub_id==STR_OS_OFF) {
- //sub_id=LCD_EN;//'e' * 256 + 'n';
- sub_id=0; //Jeff 20020925
- UserSet.SPSTN =0xffbf;//setting sub-picture on
- }
- UserSet.SPST_LCD = lang_639code[sub_id];//trans_lang_id(sub_id);
-
- //#define SETUP_CAN_DIRECT_SEL_SUBTITLE
- #ifdef SETUP_CAN_DIRECT_SEL_SUBTITLE
- dvd_sel_subtitle_right_now();
- #endif
- printf("UserSet.SPST_LCD:%dn",UserSet.SPST_LCD);
- printf("SPTN:%xn",UserSet.SPSTN);
- break;
-
- case STR_OS_SSAVER_SETUP:
- break;
-
- #ifdef SAME_DISC_RESUME
- case STR_OS_RESUME:
- if (sub_id==STR_OS_OFF)
- same_disc_onoff=0;
- else
- same_disc_onoff=1;
- break;
- #endif
-
- #ifdef SUPPORT_ANGLE_MARK//liweihua add 2004-2-4
- case STR_OS_ANGLE_MARK:
- if (sub_id==STR_OS_OFF)
- angleflag=1;
- else
- angleflag=0;
- break;
- #endif
- #ifdef SUPPORT_CC_ONOFF//nono 2004-4-11 19:02
- case STR_OS_CLOSED_CAPTION:
- if (sub_id==STR_OS_OFF)
- tv_l21_enable(0);
- else
- tv_l21_enable(1);
- break;
- #endif//SUPPORT_CC_ONOFF
- #ifdef DYNAMIC_SPECTRUM //fengjl for BBK 3-10-21 20:48
- case STR_OS_BAND:
- if (sub_id==STR_OS_OFF)
- {
- band_onoff=0;
- bEqDisplay=0;
- }
- else
- {
- band_onoff=1;
- // bEqDisplay=1;//zhaoyanhua mask for avoid the bug
- }
- break;
- #endif
-
- #ifdef USER_MPEG_LOGO
- case STR_OS_SELECT_LOGO:
- #ifdef JIEKE_DVD
- if (sub_id==STR_OS_JIEKE_SETUP)
- #elif defined(NINTAUS_DVD)//nono 2004-2-17 17:49
- if (sub_id==STR_OS_RESTORE_SETUP1)
- #else
- if (sub_id==STR_OS_RESTORE_SETUP)
- #endif
- {
- mpeg_logo_onoff=0;
- }
- else
- {
- mpeg_logo_onoff=1;
- }
- Change_User_Logo();
- need_show_logo=1;
- break;
- #endif
- case STR_OS_AUDIO_LANG_SETUP:
- UserSet.AST_LCD = lang_639code[sub_id];
- printf("audio lang id:%dn",UserSet.AST_LCD);
- #ifdef SETUP_CAN_DIRECT_SEL_AUDIO_LANG //axel 2004/9/21
- dvd_sel_language_right_now();
- #endif
- break;
-
- case STR_OS_MENU_LANG_SETUP:
- UserSet.M_LCD = lang_639code[sub_id];;
- #ifdef SETUP_CAN_DIRECT_SEL_MENU_LANG //terry,2004/9/20 09:58PM
- is_reload_dvd_menu();
- #endif
-
- printf("menu language id:%dn",UserSet.M_LCD);
- break;
- #ifdef SOUND_EFFECT_MENU //sunzhh add 2004-4-30 10:36
- case STR_OS_EQ:
- {
- if (sub_id==STR_OS_STANDARD)
- EQ_type=1;
- else if (sub_id==STR_OS_CLASSIC)
- EQ_type=2;
- else if (sub_id==STR_OS_ROCK)
- EQ_type=3;
- else if (sub_id==STR_OS_JAZZ)
- EQ_type=4;
- else if (sub_id==STR_OS_POP)
- EQ_type=5;
- else if (sub_id==STR_OS_ELECTRON)
- EQ_type=6;
- else if (sub_id==STR_OS_LIGHT_MUSIC)
- EQ_type=7;
-
- SetEQ();
- printf("I have finished EQ setting!Haha!n");
- break;
- }
- case STR_OS_SURR:
- {
- if (sub_id==STR_OS_CONCERT)
- surround_type = 2;
- else if (sub_id==STR_OS_CHURCH)
- surround_type = 3;
- else if (sub_id==STR_OS_PASSIVE)
- surround_type = 4;
- else if (sub_id==STR_OS_WIDE)
- surround_type = 5;
- else if (sub_id==STR_OS_LIVE)
- surround_type = 6;
- else if (sub_id==STR_OS_OFF)
- surround_type = 1;
-
- SetSurround();
- printf("I have finished sound field setting!Haha!n");
- break;
- }
- #endif //#ifdef SOUND_EFFECT_MENU
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- case STR_OS_AC3_DIGITAL:
- if(coding_mode_now&(AUDIF_CODING_MODE_AC3) && (cd_type_loaded==CDDVD))
- str_os_ac3_out(sub_id);
- break;
- case STR_OS_DTS_DIGITAL:
- if((coding_mode_now&(AUDIF_CODING_MODE_DTS )&& (cd_type_loaded==CDDVD) )|| ((cd_type_loaded==CDDA) && (cd_subtype==CD_DTS)) )
- str_os_dts_out(sub_id);
- break;
- #endif//DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- case STR_OS_AUD_OUT:
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- if((coding_mode_now!=AUDIF_CODING_MODE_AC3)&& (coding_mode_now!=AUDIF_CODING_MODE_DTS) && (cd_subtype!=CD_DTS))
- #endif
- str_os_aud_out(sub_id);
-
- //yanlb added 2004/07/07
- #ifdef REMB_3DSOUND
- {
- exe_3Dsound(sound_sel,user_osd_set);
- }
- #endif
-
- break;
- //20041222 JSLIN //case for STR_OS_FREQ_MASK should always exist
- case STR_OS_FREQ_MASK:
- {
- //2004AUDDRV audif_set_frequency_mask(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- //AUDIF_Set_FrqMsk(setup_VA[SETUP_VA_FREQ_MASK] - MIN_ITEM_SEL);
- setup_SetFreqMaskConfig();
- break;
- }
-
- #ifndef NO_MIC
- case STR_OS_MIC_ONOFF:
- if (sub_id==STR_OS_AUTO) {
- AUDIF_Set_MICStatus(STATUS_AUTO, 0);//2004AUDDRV AudioSetMIC(2, 0); //Set MIC auto detect
- } else if (sub_id==STR_OS_ON) {
- AUDIF_Set_MICStatus(STATUS_ON, 0);//2004AUDDRV AudioSetMIC(1, 0); //Set MIC on(the second parameter:unsed now)
- } else {
- AUDIF_Set_MICStatus(STATUS_OFF, 0);//2004AUDDRV AudioSetMIC(0, 0); //Set MIC off(the second parameter:unsed now)
- }
- break;
- #endif
-
- case STR_OS_DOWNMIX_SETUP:
- str_os_downmix_setup(sub_id);
- break;
- case STR_OS_SUBWOOFER:
- if (sub_id==STR_OS_ON) {
- //sub-woof on command to DSP
- AUDIF_Set_SubWoof(STATUS_ON);//2004AUDDRV AudioSetSubWoof(1);
- } else {
- //sub-woof on command to DSP
- AUDIF_Set_SubWoof(STATUS_OFF);//2004AUDDRV AudioSetSubWoof(0);
- }
- //#ifdef TEST_BASS_MANAGEMENT
- // #ifdef TEST_BASS_COMMAND
- // AudioSetBassMag(SetBassConfig());
- // #else
- // DSPReset();
- // #endif
- //#endif
- break;
- case STR_OS_DOLBY_OP_SETUP:
- printf("ac3: op moden");
- if(sub_id==STR_OS_DOLBY_LINE_SETUP) {
- printf("ac3: line op moden");
- AUDIF_Set_OutputMode(OUT_LineModeK2, 0);//2004AUDDRV AudioSetOutputMode(0x20, 0); //Set Output mode(0x20:AC3 line mode)
- } else
- if(sub_id==STR_OS_DOLBY_RF_SETUP) {
- printf("ac3: RF op moden");
- AUDIF_Set_OutputMode(OUT_RFModeK3, 0);//2004AUDDRV AudioSetOutputMode(0x10, 0); //Set Output mode(0x10:AC3 RF mode)
- }
- #ifndef NO_AC3_DYNAMIC_RANGE
- if (full_scrn & SETUP)
- setup_ShowAC3DynamicRange(); //Jeff 20020621
- set_AC3DynamicRange();
- #endif //#ifndef NO_AC3_DYNAMIC_RANGE
- break;
-
- case STR_OS_DUAL_MONO_SETUP:
- printf("ac3: dual mono moden");
- if(sub_id==STR_OS_STEREO) {
- printf("ac3: stereo moden");
- AUDIF_Set_OutputMode(OUT_NoVocal, 0);//2004AUDDRV AudioSetOutputMode(0x30, 0); //Set Output mode(0x30:AC3 no vocal)
- } else if(sub_id==STR_OS_CHL) {
- printf("ac3: ch L moden");
- AUDIF_Set_OutputMode(OUT_LeftVocal, 0);//2004AUDDRV AudioSetOutputMode(0x40, 0); //Set Output mode(0x40:AC3 left vocal)
- } else if(sub_id==STR_OS_CHR) {
- printf("ac3: ch R moden");
- AUDIF_Set_OutputMode(OUT_RightVocal, 0);//2004AUDDRV AudioSetOutputMode(0x50, 0); //Set Output mode(0x50:AC3 right vocal)
- } else {
- //STR_OS_MIX_MONO_SETUP
- printf("ac3: down-mix moden");
- AUDIF_Set_OutputMode(OUT_BothVocal, 0);//2004AUDDRV AudioSetOutputMode(0x60, 0); //Set Output mode(0x60:AC3 both vocal)
- }
- break;
- #ifdef AC3_BASS_MANAGEMENT
- case STR_OS_BASS_MANAGEMENT: // Robert 021016
- #ifndef SPHE8202//def DESAY_DVD //fengjl edit it to avoid noise when change bass mode between "ALL LG SPK" and "MIXED SPK" 2004-06-24 13:50
- if ( (GetCurrentFileType() != CDROM_WMA)&&(cd_subtype != CD_DTS) )
- #endif
- AUDIF_Reset_DSP();//2004AUDDRV DSPReset();
- break;
- #endif //#ifdef AC3_BASS_MANAGEMENT
- case STR_OS_REGION_CODE:
- UserSet.P_RCD = setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL;
- if (UserSet.P_RCD>6) {
- setup_sel[setup_pos[1]][setup_pos[2]] = MIN_ITEM_SEL;
- UserSet.P_RCD = setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL;
- }
- break;
- /*
- case STR_OS_SHARPNESS:
- SetSharpness(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- break;
- */
- case STR_OS_BRIGHTNESS:
- SetBrightness(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- break;
- case STR_OS_CONTRAST:
- SetContrast(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- break;
- case STR_OS_HUE:
- SetHUE(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- break;
- case STR_OS_SATURATION:
- SetSaturation(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- break;
- #ifdef DIP_CFG_ENABLE
- case STR_OS_DEINTLC:
- SetDeInterlace(setup_sel[setup_pos[1]][setup_pos[2]] - MIN_ITEM_SEL);
- break;
- #endif//#ifdef DIP_CFG_ENABLE
- #ifdef SUPPORT_PROLOGIC_II // alan, 2003/7/11 03:14