setup_tab.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:181k
- //
- // FILE
- // setup_tab.c
- //
- //--------------------------------------
- //Modefied by wangfeng, 2003-08-29 15:18
- //For new setup menu
- //--------------------------------------
- #include "user_init.h"
- extern int user_input_pwd;
- #ifdef NEW_SETUP_OSD // majinping 2002-05-02 for new setup menu
- #error
- #include "setup_new.c"
- #elif defined(KONKA_DVD) // 2-7-16 14:44 for new setup menu
- #include "setup_konka.c"
- #else
- /*****************************************************
- Creater: Terry
- Date : 2001/5/11 12:49PM
- Description: Setup menu using
- *****************************************************/
- //#define USE_MIC_ECHO_PARAM
- #include "global.h"
- #include "osd.h"
- #include "func.h"
- #include "navdata.h"
- #include "kernel.h"
- #include "vpp.h"
- #include "user_if.h"
- #include "dsp3_if.h"
- #include "cchar.h"
- #include "ircmd.h"
- #include "auddrv.h" //2004AUDDRV oliver 20041004 for using audio driver purpose
- //#include "audif.h"
- #include "tvif.h"
- #include "memmap.h"
- #include "stdlib.h"
- #include "kinf.h"
- #include "gpio.h"//nono 2004-4-26 20:57
- #ifdef SUPPORT_MIDI //ouyang 2004-10-18 22:44
- #include "fsmidi.h"
- #endif
- #ifdef SUPPORT_DISPLAY_MENU
- #include "ircode.h"
- #include "irconfig.h"
- #endif//end #ifdef DISPLAY_MENUs
- #ifdef TAS3001_AMP //Ti3001_OSD_UI_2 // TAS3001_AMP use setup menu control /jsaon 2-8-30 21:30
- #include "ti3001.h"
- #endif
- #ifdef SUPPORT_APOGEE_AMP//xyy 2004-1-12 17:40
- #include "ddx8000.h"
- #endif
- #ifdef SUPPORT_SPI
- #include "spi.h"
- #endif
- #ifdef DVB_MENU_SETUP_STYLE
- #include "dvbmenu.h"
- #endif
- #ifndef DVDRELEASE
- #define SETUP_DBG 1
- //#define MONE_SETUP
- #endif
- #ifndef SETUP_DBG
- #undef printf
- #undef print_block
- #define printf(f, a...) do {} while (0)
- #define print_block(x,y) do {} while (0)
- #endif
- #if defined (YI_XIAN_TONG)||defined (TONIC_DVD)//zhaoyanhua add 03-11-3 22:20
- #include "gpio.h"
- #endif
- extern UINT16 echo_para_tbl[9][2];//echo_para[9][2]; for using audio driver purpose
- #ifdef VGA_CTRL_FORMAT//wangfeng 2003-12-18 16:12
- BYTE temp_format=0;
- #endif
- #ifdef MIC_FUNCTION_KEY
- extern BYTE bFuncStep;//nono 20040107
- #endif//MIC_FUNCTION_KEY
- //wangap add for downmix off volume
- #ifndef AC3_BASS_MANAGEMENT
- BYTE cspk_volume;
- BYTE fspk_volume;
- BYTE sspk_volume;
- #endif
- #ifdef USE_PROLOGIC_II_KEY
- BYTE prologic_val;//clead 2003-8-7
- #endif
- #if defined(GBM_DVD)&&!defined(GBM_FULL_FUNCTION)&&!defined(USER_MPEG_LOGO)
- #undef SAME_DISC_RESUME
- BYTE same_disc_onoff = 1;
- #endif
- #ifdef DYNAMIC_SPECTRUM //fengjl 3-10-21 20:38
- #undef SAME_DISC_RESUME
- BYTE band_onoff = 0;//inital value must be 0.zhaoyanhua modify 2004-1-12 15:01
- #endif
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //fengjl add for bbk's new setup 3-11-12 16:17
- extern void osd_init_bbk_setup(void);
- BYTE one_key_pass_flag = 0;
- BYTE main_setup = 0;
- #elif defined(BBK_DSS_555_DVD)||defined(BBK_DV911S)
- BYTE main_setup = 0;
- #endif
- #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-7 17:18
- extern int GetVideoSetValue(int id);
- #endif//end VIDEO_SETUP_NEW_GUI
- #ifdef AUDIO_2CH_5_1CH//zhaoyanhua add 03-11-1 17:33
- extern BYTE ChannelFlag;
- #endif
- #ifdef KARAOKE_MENU//wangfeng
- BYTE KARAOKE_MENU_FLAG=0;
- #endif
- //#define MONE_SETUP
- //=======================
- #ifdef NEW_STYLE_SETUP
- #define BUTTON_COLOR 7
- //zhaoyanhua add 3-7-14 17:49
- //a flag decide to operate setupmenu or not.
- //if 0,only show setup menu, now at level 0, can not operate.
- //if 1,now at level 1, can operate setup menu with UP/DOWN/LEFT/RIGHT/SELECT key.
- int GBM_run_setupmenu_flag = 0;
- #endif
- //define setup pages(including MAX_SETUP_PAGE+MAX_CUSTM_SETUP_PAGE)
- #include "setup_def.h"
- const BYTE OSD_LANG_MAP[8] = OSD_LANG_SETUP_MAP; //Jeff 20030217
- const BYTE upgrade_file_name[] = UPGRADE_FILE_NAME;//nono 3-6-17 14:03
- extern void RsmInfo2Flash(int);
- extern void audif_set_SPDIF_BITSTREAM();
- //extern void ircmd_stop(void);
- #ifdef SAME_DISC_RESUME
- BYTE same_disc_onoff;
- #endif
- extern UINT8 ap_tv_out_id;//nono 2003-8-1 18:08
- #ifdef USER_MPEG_LOGO
- BYTE mpeg_logo_onoff=0;
- BYTE need_show_logo=0;
- extern void Change_User_Logo();
- #endif
- #ifdef DVB_MENU_SETUP_STYLE
- extern const char * osd_str_dvb_submenu[N_OSD_LANGS][5];
- #endif
- #if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)//zhaoyanhua add 2003-11-28 10:46
- #if defined(NEW_PARENTAL_GUI)
- extern void osd_init_parental_gui(void);
- BYTE new_parental_gui = 0;
- #endif
- #if defined(MODIFY_PARENTAL_GUI)
- BYTE parental_gui_flag = 0;
- #endif//#if defined(MODIFY_PARENTAL_GUI)
- void check_parent_password(void);
- void ExitParentalGUI(void);
- #endif
- //osd related function
- extern void osd_init_setup(void);
- extern void osd_disable(void);
- extern void osd_DrawLine(UINT32 xStart, UINT32 yStart, UINT32 xEnd, UINT32 yEnd, BYTE color, BYTE lineWidth);
- extern void osd_draw_rect(UINT32 xStart, UINT32 yStart, UINT32 xLen, UINT32 yLen, BYTE bkColor);
- extern void osd_draw_setup_button(BYTE xStart, BYTE yStart, BYTE xLen, BYTE color, BYTE bDown);
- extern void setVPP_OffsetX(int X);
- extern void setVPP_OffsetY(int Y);
- //3D sound(EQ, Surround) related setting
- extern BYTE soundGetSurroundType();
- //misc functions
- extern void set_aud_buf_size(void);
- void setup_DrawItem(BYTE level, BYTE yStart, BYTE updowngray);
- const char * setup_SetItemString(void);
- void run_save_tv_cmd(UINT8 item,UINT8 sel);
- UINT16 run_save_unChk_cmd(UINT8 save);
- void set_video_aspect(void);
- int is_aspect_menu(void);
- void run_save_sel_cmd(BYTE page,BYTE index);
- void run_save_total_sel(void);
- void rep_run_the_menu(void);
- void show_lock(int s,int mode);
- void setup_ShowAC3Config();
- void setup_CookScaleItem(UINT8 id, UINT8 dir);
- void setup_PrepareScaleItem(BYTE id, BYTE up1down);
- void setup_ShowVolCtrlConfig();
- void ShowPasswordGUI();
- void setup_ShowAC3DynamicRange(void);
- void set_AC3DynamicRange(void);
- void reset_passwd_cnt(void);
- void setup_func_return_main(void);
- int IsOSDChinese();
- //void SetSharpness(BYTE nVal);
- void SetBrightness(BYTE nVal);
- void SetContrast(BYTE nVal);
- void setup_save_exit(void);
- #ifdef IR_KEY_SET_VIDEO_MODE
- void SetBrightnessAdjust(BYTE nVal, BYTE nVal2);
- void SetContrastAdjust(BYTE nVal, BYTE nVal2);
- #endif//IR_KEY_SET_VIDEO_MODE
- void SetHUE(BYTE nVal);
- void SetSaturation(BYTE nVal);
- #ifdef DIP_CFG_ENABLE
- void SetDeInterlace(BYTE nVal);
- #endif
- #ifdef BBK_DVD//zhaoyanhua add 03-10-19 10:43
- void AudioSet2chOutput(void);
- void AudioSet5_1chOutput(void);
- void AudioSetPrologic_IIOutput(void);
- #endif//end BBK_DVD
- #ifdef SHOW_STANDBY_TIMER //suqiaoli add 2003-8-2
- #define STANDBY_TIMER_ITEM 3
- void polling_setup_standby_timer(void);
- #endif
- extern void search_ap_tv_out_id(void);
- extern void update_tv_format_sel(void);
- /*********** Item description **********************
- BYTE function
- 0 mode(MSB 4bits) ==>show direction picture
- 0x0:no effect
- 0x1:basic select function
- 0x2:can enter number
- 0x3:need run function by osd id
- 0x4:left/right shift only
- 0x5:only show text,can't move to this area
- 1 title ---sw region 1
- 2~6 select item ---sw region 2
- ******************************************************/
- enum
- {
- SET_NE=0,
- SET_BS=0x1,
- SET_NM=0x2,
- SET_FUNC=0x3,
- SET_SH=0x4,
- SET_SHOW=0x5,
- SET_SCALE=0x6,
- SET_SPACE=0x7,
- };
- UINT8 setup_page,setup_id,setup_sel_item;
- #define page setup_page
- #define id setup_id
- #define sel setup_sel_item
- UINT8 id,sel,page;
- #ifdef SETUP_6_DIGIT_PASSWORD//zhaoyanhua add 03-10-14 14:22
- UINT32 tmp_passwd;
- #else
- UINT16 tmp_passwd;
- #endif
- UINT32 romCheckSum;
- #ifdef Ti3001_OSD_UI_2
- INT8 amp_volume_level;
- INT8 amp_fspk_level;
- INT8 amp_fspk_balance_level;
- INT8 amp_sspk_level;
- INT8 amp_sspk_balance_level;
- INT8 amp_cspk_level;
- INT8 amp_subwoofer_level;
- INT8 amp_bass_level;
- INT8 amp_tremble_level;
- INT8 amp_dynamic_level;
- #endif
- BYTE index_y=0; //item index for 1st-level page, 2nd-level page
- BYTE index_y2=0; //item index for 3rd-level page
- BYTE index_y_start=0;
- BYTE index_y2_start=0;
- #ifdef EASTECH_SETUPMENU
- BYTE index_pscan_ok=0;
- #endif
- BYTE submenuStart=SETUP_MENU_YSTART;
- BYTE setupLevel=0; //0:main menu, 1:sub-menu, 2:selection-menu(menu of sub-menu)
- BYTE setupItemNum[3] = { //max item num in every sub-menu
- MAX_PAGE_ITEM, //main menu items count
- MAX_PAGE_ITEM, //second-level menu items count
- MAX_PAGE_ITEM //third-level menu
- };
- //define setup page
- #include "setup_page.h"
- //PS:this command line doesn't be used in macro define
- //run_save_sel_cmd(0, 5);
- #ifdef Ti3001_OSD_UI_2
- const UINT8 setup_MainP[][2] =
- {
- {STR_OS_SYS_SETUP, 0},
- {STR_OS_LANG_SETUP, 1},
- {STR_OS_AUD_SETUP, 2},
- //{STR_OS_SPK_SETUP, 3},
- {STR_OS_SPK_SETUP, 3},
- {STR_OS_DIGTAL_SETUP, 4},
- {STR_OS_AMP_SETUP1,5}, //S:"功放设定1"
- {STR_OS_AMP_SETUP2,6}, //S:"功放设定2"
- {STR_OS_EXIT_MENU, 7},
- };
- #elif defined(DVB_MENU_SETUP_STYLE)
- const UINT8 setup_MainP[][2] =
- {
- {STR_OS_INSTALL_SETUP, 0},
- {STR_OS_CHANNEL_SETUP, 1},
- {STR_OS_SYS_SETUP, 2},
- {STR_OS_LANG_SETUP, 3},
- {STR_OS_AUD_SETUP, 4},
- {STR_OS_VIDEO_SETUP, 5},
- {STR_OS_SPK_SETUP, 6},
- {STR_OS_DIGTAL_SETUP, 7},
- {STR_OS_SPACE, 0},
- {STR_OS_EXIT_MENU, 8},
- {STR_OS_NO, 0},
- };
- #else//take off SOFT_MENU special setup_MainP,share with old setup_MainP.chenzhao on 2004-11-15 11:3
- const UINT8 setup_MainP[][2] =
- {
- {STR_OS_SYS_SETUP, 0},
- {STR_OS_LANG_SETUP, 1},
- {STR_OS_AUD_SETUP, 2},
- #ifdef QSI_SETUP_MENU//liweihua 2004-6-15
- {STR_OS_KARAOKE_SETUP,3},
- #else
- #ifndef BBK_SIMPLE_SETUP
- #ifndef SETUP_DONGLI459//20040206
- {STR_OS_VIDEO_SETUP, 3},
- {STR_OS_SPK_SETUP, 4},
- {STR_OS_DIGTAL_SETUP, 5},
- #else
- {STR_OS_SPK_SETUP, 3},
- {STR_OS_DIGTAL_SETUP, 4},
- #endif
- {STR_OS_SPACE, 0},
- #else//#ifndef BBK_SIMPLE_SETUP
- {STR_OS_VIDEO, 0},
- #endif//#ifndef BBK_SIMPLE_SETUP
- #endif//#ifdef QSI_SETUP_MENU
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE
- {STR_OS_ONEKEY_SETUP, 7},
- {STR_OS_EXIT_MENU,8},
- #else
- {STR_OS_EXIT_MENU, 7},
- #endif
- {STR_OS_NO, 0},
- };
- #endif
- //
- // If you change the sequence of the menu items, please check up the following definition
- // and
- // set_default_value()
- // run_set_variable()
- // setup_func_down()
- // setup_SetAC3Config()
- //
- UINT8 setup_sel[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM];//Item number
- #ifdef SUPPORT_FUNCTION_MENU
- UINT8 setup_sel_plus[MAX_SETUP_PAGE_PLUS][MAX_PAGE_ITEM_PLUS];
- #endif
- //const UINT8 setup_item[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM][MAX_ITEM_SEL]
- //exe_setup_function,terry,2004/2/10 03:36PM
- //take off SOFT_MENU special setup_item,share with old setup_item.chenzhao on 2004-11-15 11:3
- #include "setup_item.c"
- #include "setup_exe.c"
- #include "setup_if.c"
- #ifdef SUPPORT_FUNCTION_MENU
- #include "setup_plus.c"
- #endif
- int setup_IsSpkSubwooferOn(void)
- {
- int res;
- if(SETUP_SPK_SUBWOOFER==3)
- res=1;
- else
- res=0;
- return res;
- }
- int WillKeyShiftNotDo(void)//nono 2-5-12 20:54
- {
- int res=0;
- #ifndef SETUP_ALL_VALID//nono 2003-9-25 16:54
- if( ((SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF)||(coding_mode_now==AUDIF_CODING_MODE_LPCM) )&&(cd_type_loaded==CDDVD) )
- res=1;
- else if( (SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF)&&(coding_mode_now==AUDIF_CODING_MODE_DTSCD) )
- res=1;
- #endif
- return res;
- }
- #ifdef USER_MPEG_LOGO
- UINT8 setup_GetMPEGLogoItem(void)
- {
- return (SETUP_MPEG_LOGO);
- }
- void setup_SetMPEGLogo(void)//nono 2-5-16 18:05
- {
- //setup_sel[SysNextPage][MPEG_LOGO_ITEM]=3;
- SETUP_MPEG_LOGO = MPEG_LOGO_ON;//3
- //exe_setup_function(STR_OS_SELECT_LOGO,STR_OS_DEFAULT_SETUP,0); // alan, 2003/9/16 05:03PM
- exe_setup_function(STR_OS_SELECT_LOGO,STR_OS_MPEG_LOGO,0); //NONO 2004-2-17 17:02
- //setup_sel[7][2]=3;
- run_save_sel_cmd(SysNextPage, MPEG_LOGO_ITEM);//nono 2004-2-17 17:02
-
- }
- #ifdef YUXING_MIDI_DVD //nono 2004-10-28 14:34
- void setup_SetDefaultLogo(void)//nono 2-5-16 18:05
- {
- SETUP_MPEG_LOGO = 2;//3
- exe_setup_function(STR_OS_SELECT_LOGO,STR_OS_DEFAULT_SETUP,0); // alan, 2003/9/16 05:03PM
- run_save_sel_cmd(SysNextPage, MPEG_LOGO_ITEM);//nono 2004-2-17 17:02
- }
- #endif
- #endif//USER_MPEG_LOGO
- int setup_IsSpkDownmixOff(void)//nono 2-5-16 18:05
- {
- if(SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF)
- return 1;
- else
- return 0;
- }
- void setup_Showredframe(UINT8 page_val)
- {
- #ifndef SETUPMENU_16Mb_NO_ICON
- UINT16 line=SETUP_MAX_WIDTH*16-20;
- if(page_val==7) page_val=0;
- osd_DrawLine(line*page_val/6+30,14,line*page_val/6+80,14,SANTIBGCOLOR,1);
- osd_DrawLine(line*page_val/6+30,50,line*page_val/6+80,50,SANTIBGCOLOR,1);
- osd_DrawLine(line*page_val/6+30,14,line*page_val/6+30,50,SANTIBGCOLOR,1);
- osd_DrawLine(line*page_val/6+80,14,line*page_val/6+80,50,SANTIBGCOLOR,1);
- #endif
- }
- void setup_ShowAC3DynamicRange(void)
- {
- BYTE buf[40];
- BYTE fontColor;
- if ( (page!=AC3DIGITALPAGE) ||
- (setupLevel!=2) ||
- (index_y!=AC3OUTMODEITEM)
- )
- {
- return;
- }
- if ( (SETUP_AC3DIGITAL_OUTMODE==AC3DYNAMICITEM2) && 1
- // (SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF)
- )
- {
- fontColor = SFONTCOLOR;
- } else {
- fontColor = SGRAYCOLOR;
- }
- id = setup_item[page][AC3DYNAMICITEM1][1];
- psprintf(buf, "%s", _OsdMessegeFont1[osd_font_mode][id]);
- osd_DrawString(SETUP_MENU_XSTART+1, AC3DYNAMICITEM1+SETUP_MENU_YSTART, buf, fontColor, SBGCOLOR);
- }
- void set_AC3DynamicRange(void)
- {
- if (ac3_dynarange) {
- AUDIF_Set_OutputMode(OUT_CustomModeB_DigitalDialnormK1, ac3_dynarange * 0x2020 - 0x0101);//2004AUDDRV AudioSetOutputMode(0x80, ac3_dynarange * 0x2020 - 0x0101);
- } else {
- AUDIF_Set_OutputMode(OUT_CustomModeB_DigitalDialnormK1, 0);//2004AUDDRV AudioSetOutputMode(0x80, 0);
- }
- }
- #ifdef AUDIO_2CH_5_1CH
- int setup_IsSpkStereo(void)
- {
- if(SETUP_SPK_DOWNMIX == DOWNMIXSTEREO)
- return 1;
- else
- return 0;
- }
- /*
- * to set 5.1 channel output mode
- *
- */
- void AudioSet5_1chOutput(void)
- {
- exe_setup_function(STR_OS_DOWNMIX_SETUP,STR_OS_OFF,0);//turn off mix off
- SETUP_SPK_DOWNMIX = AC3DOWNMIXOFF;
-
- #ifdef YI_XIAN_TONG//zhaoyanhua add 2003-12-17 9:51
- Gpio5ChOutput();
- #endif
- }
- /*
- * to set PROLOGIC_II channel output mode
- *
- */
- #ifdef SUPPORT_PROLOGIC_II //axel 2004/1/28 10:30
- void AudioSetPrologic_IIOutput(void)
- {
- //abstract from setup_tab_ui.c
- //NOTE:
- // can not change the order.
- //zhaoyanhua note 03-11-1 18:58
- exe_setup_function(STR_OS_PROLOGIC,STR_OS_PL_MUSIC,0);
- SETUP_PROLOGIC_II= 3;//STR_OS_PL_MUSIC to update SETUP in time.
- //set AUDIO output SIMULATE
- //because BBK need SIMULATE and DIGITAL ouput at the same time
- //so we must mask the following sentences.
- //zhaoyanhua mask 2003-11-29 20:29
- #if 0
- SETUP_SPDIF=2;
- exe_setup_function(STR_OS_AUD_OUT,STR_OS_SIMULATE,0);
- #endif
- //set DOWNMIX OFF
- SETUP_SPK_DOWNMIX = AC3DOWNMIXOFF;
- exe_setup_function(STR_OS_DOWNMIX_SETUP,STR_OS_OFF,0);
-
- }
- #endif //SUPPORT_PROLOGIC_II //axel 2004/1/28 10:30
- #endif// AUDIO_2CH_5_1CH
- //terry,2004/2/5 12:08PM
- void setup_SetTV_format(UINT8 id)
- {//terry,2004/2/5 12:02PM
- #ifndef NO_TV_FORMAT
- #ifndef FUSS_TV_DVD//nono 2-8-20 12:55
- int i;
-
- for(i=2;i<MAX_ITEM_SEL;i++)
- {
- if(setup_item[SYSPAGE][TV_FORMAT][i]==id)
- {
- SETUP_TV_FORMAT=i;
- run_save_sel_cmd(SYSPAGE,TV_FORMAT);//terry,2004/2/3 03:35PM
- break;
- }
- }
- #endif
- #endif
- }
- #ifdef FORCE_RETURN_TO_DEFAULT_TV_FORMAT//nono 20030913
- void setup_SetTV_default_format(void)
- {
- SETUP_TV_FORMAT = MIN_ITEM_SEL+DEFAULT_TV_SYS;
- //setup_tv_format(DEFAULT_TV_SYS); // Robert 020919
- //exe_setup_function(STR_OS_TV_SYS,STR_OS_NTSC,0);
- //modefied by wangfeng,2004-2-9 17:39
- #if defined(TV_FORMAT)&& !defined(FORCE_RETURN_TO_DEFAULT_TV_FORMAT)//terry,2004/2/3 01:34PM
-
- exe_setup_function(STR_OS_TV_SYS,setup_item[SYSPAGE][TV_FORMAT][SETUP_TV_FORMAT],1);
- #else
- //exe_setup_function(STR_OS_TV_SYS,STR_OS_NTSC,1);
- #ifdef FORCE_RETURN_TO_FORMAT_PAL
- tv_format=MODE_PAL;//MODE_NTSC;
- #elif defined(FORCE_RETURN_TO_FORMAT_AUTO) //fengjl add 2004-03-09 15:47
- tv_format=MODE_AUTO;
- #else
- tv_format=MODE_NTSC;
- #endif
- update_tv_format_sel();
- setup_tv_format(tv_format);
- #ifdef FORCE_RETURN_TO_FORMAT_PAL
- setup_SetTV_format(STR_OS_PAL);
- #elif defined(FORCE_RETURN_TO_FORMAT_AUTO)
- setup_SetTV_format(STR_OS_AUTO);
- #else
- setup_SetTV_format(STR_OS_NTSC);
- #endif
- //exe_setup_function(STR_OS_TV_SYS,STR_OS_PAL,1);
- #endif
- }
- #endif//FORCE_RETURN_TO_DEFAULT_TV_FORMAT
- #ifdef USE_PROLOGIC_II_KEY//clead 2003-8-7
- void set_prologic_val(BYTE prologic_mode)
- {
- BYTE type=0x23;
- switch (prologic_mode)
- {
- case 0:
- pl2_init_val|=(1<<20); // set prologic-II enable
- pl2_init_val|=(1<<16); // set init-val to movie mode
- //DSP set prologic-II enable
- AUDIF_Set_ProLogicII(0x11);//2004AUDDRV AudioIOControl(PROLOGIC,0x11,0);
- type=0x23; //Oliver : prologic-II Decoder Mode - Movie/Standard Mode
- printf("<MOVIE>, pl2_init_val=0x%06xn",pl2_init_val);
- break;
- case 1:
- pl2_init_val|=(1<<20); // set prologic-II enable
- pl2_init_val&=(~(1<<16)); // set init-val to music mode
- //DSP set prologic-II enable
- AUDIF_Set_ProLogicII(0x11);//2004AUDDRV AudioIOControl(PROLOGIC,0x11,0);
- type=0x22; //Oliver : prologic-II Decoder Mode - Music Mode
- printf("<MUSIC>, pl2_init_val=0x%06xn",pl2_init_val);
- break;
- case 2:
- //pl2_init_val&=(~(1<<20)); // set prologic-II disable
- pl2_init_val=0x037300;
- //DSP set prologic-II disable
- AUDIF_Set_ProLogicII(0x10);//2004AUDDRV AudioIOControl(PROLOGIC,0x10,0);
- printf("<OFF>, pl2_init_val=0x%06xn",pl2_init_val);
- break;
- }
- //DSP set prologic-II Decoder Mode Select
- AUDIF_Set_ProLogicII(type);//2004AUDDRV AudioIOControl(PROLOGIC,type,0);
- SETUP_PROLOGIC_II=prologic_mode+2;
- exe_setup_function(STR_OS_PROLOGIC, setup_item[AUDPAGE][PROLOGIC_II][SETUP_PROLOGIC_II], 1);
- //clead 2003-10-21
- run_save_sel_cmd(AUDPAGE,PROLOGIC_II);//clead 2003-10-21
- }
- #endif //clead_prologic
- void setup_SetPScan(void)
- {
- #ifndef FUSS_TV_DVD//nono 2-8-20 12:55
- SETUP_VIDEO_FORMAT = ap_tv_out_id+2;
- #if defined(SCART_TV)||defined(KSD_SCART_TV)||defined(SCART_TV_2)||defined(SCART_TV_4)||defined(SCART_TV_5)//wangfeng 2003-12-2 23:03
- //if(tv_out_id==PC_VGA||tv_out_id==TV_RGB)
- if(tv_out_id==TV_RGB)//nono 2003-8-24 21:08
- SET_SCART_RGB(1);
- else
- SET_SCART_RGB(0);
- #elif defined(SCART_TV_3)
- if(tv_out_id==TV_RGB)
- SET_SCART_RGB(0);
- else
- SET_SCART_RGB(1);
- #endif
-
- #ifdef SUPPORT_SCART_TV//SPHE8202//nono 4-3-27 21:35
- if(tv_out_id==TV_RGB)
- {
- SET_SCART_GPIO_SFT_CFG_CTRL();
- SET_SCART_TO_RGB();
- }
- else
- {
- SET_SCART_GPIO_SFT_CFG_CTRL();
- SET_SCART_TO_CVBS();
- }
- #endif//SPHE8202
-
- //run_save_cmd();
- run_save_sel_cmd(SYSPAGE,2);
- #endif
- }
- //////////////////////////////////
- #if 0//def IR_KEY_SET_VIDEO_MODE
- void set_video_val(BYTE video_mode)
- {
- int i=0;
- UINT8 parm[6][3] = { {8,8,8},//0
- {7,9,6},//1
- {9,8,10},//2
- {8,9,9},//3
- {11,10,9},//4
- {7,5,7},//5
- };
- if(video_mode<6)
- {
- SETUP_BRIGHTNESS=parm[video_mode][0];
- SETUP_CONTRAST=parm[video_mode][1];
- SETUP_HUE=parm[video_mode][2];
- }else
- {
- ReadFromI2c(0xa0, 240,(BYTE *)&SETUP_BRIGHTNESS,1);
- ReadFromI2c(0xa0, 241,(BYTE *)&SETUP_CONTRAST,1);
- ReadFromI2c(0xa0, 242,(BYTE *)&SETUP_HUE,1);
- }
- SetBrightness(SETUP_BRIGHTNESS - 2);
- SetContrast(SETUP_CONTRAST - 2);
- SetHUE(SETUP_HUE - 2);
- //SetSaturation(SETUP_SATURATION - 2);
- do{
- run_save_sel_cmd(VIDEOPAGE,i);
- i++;
- }while(i<4);
- }
- #endif
- //
- //
- #ifdef IR_KEY_SET_VIDEO_MODE
- void set_video_val(BYTE video_mode)
- {
- UINT8 b,c,h,s;
- //b:SETUP_BRIGHTNESS
- //c:SETUP_CONTRAST
- //h:SETUP_HUE
- UINT8 parm[6][3] = { {8,8,8},//0
- {7,9,6},//1
- {9,8,10},//2
- #ifndef SET_4_VIDEO_MODE
- {8,9,9},//3
- {11,10,9},//4
- {7,5,7},//5
- #endif//SET_4_VIDEO_MODE
- };
- #ifdef SET_4_VIDEO_MODE
- if(video_mode<3)
- #else//SET_4_VIDEO_MODE
- if(video_mode<6)
- #endif//SET_4_VIDEO_MODE
- {
- b=parm[video_mode][0];
- c=parm[video_mode][1];
- h=parm[video_mode][2];
- s=2;
- SetBrightnessAdjust(b - 2,c);
- SetContrastAdjust(c - 2,b);
- }else
- {
- b=SETUP_BRIGHTNESS;
- c=SETUP_CONTRAST;
- h=SETUP_HUE;
- s=SETUP_SATURATION;
- SetBrightness(b - 2);
- SetContrast(c - 2);
- }
-
- //SetBrightness(SETUP_BRIGHTNESS - 2);
- //SetContrast(SETUP_CONTRAST - 2);
- //SetSaturation(SETUP_SATURATION - 2);
- //SetHUE(SETUP_HUE - 2);
- //SetSaturation(SETUP_SATURATION - 2);
- SetHUE(h - 2);
- SetSaturation(s - 2);
- //if(video_mode_val==6)
- }
- #endif
- //
- #ifdef AUTO_ADJUST_TV_TYPE //lijd 2004-9-15 13:33
- void auto_adjust_tv_type(void)
- {
- int mode;
- mode=(pDSV->dV_ATR>>8)&0x0f;
- switch(mode)
- {
- case 0x0e: //16:9
- SETUP_TV_TYPE=4;
- exe_setup_function(STR_OS_TV_RATIO,STR_OS_16_9,1);
- run_save_sel_cmd(0,3);
- ExitSetupPage(1);
- break;
- case 0x0d: //4:3LB
- SETUP_TV_TYPE=3;
- exe_setup_function(STR_OS_TV_RATIO,STR_OS_4_3LB,1);
- run_save_sel_cmd(0,3);
- ExitSetupPage(1);
- break;
- case 0x03: //4:3PS
- SETUP_TV_TYPE=2;
- exe_setup_function(STR_OS_TV_RATIO,STR_OS_4_3PS,1);
- run_save_sel_cmd(0,3);
- ExitSetupPage(1);
- break;
- default:
-
- break;
-
- }
-
- }
- #endif
- //
- //
- #ifdef ADD_DVI311_SETUP
- #include "spv301.h"
- extern void scaler_main(void);
- void set_default_value_dvi(void)
- {
- if(getVPP_TVsystem())
- dvi311_tv_mode = 0x84; //0x85:NTSC, 0x86:PAL60, 0x84:PAL, 0x7a:AUTO
- else
- dvi311_tv_mode = 0x85; //0x85:NTSC, 0x86:PAL60, 0x84:PAL, 0x7a:AUTO
- dvi311_format = STR_OS_DIGIT_OUTPUT; //output format:0xb7:模拟输出, 0xb8:数字输出 //for default digital output.Modifed by ChenZhao on 2004-10-19 11:15
- #ifdef DVI311_NO_PC_MODE
- dvi311_mode = Mode_480P;
- #else
- dvi311_mode =Mode_XGA;// 3; //output mode:0:720P, 1:576P, 2:480P, 3:SXGA, 4:XGA, 5:SVGA, 6:VGA
- #endif
- SETUP_DVI_MODE=dvi311_mode+2;
- Power_off_311=1; //kevin0710
- }
- #endif
- void set_default_value(void)
- {
- int i,j;
- #ifdef SUPPORT_FUNCTION_MENU
- {
- for(i=0;i<MAX_PAGE_ITEM_PLUS;i++)
- {
-
- if(setup_item_plus[0][i][1] == STR_OS_BRIGHTNESS)
- {
- setup_sel_plus[0][i] = DEFAULT_BRIGHTNESS;
- }
- else if(setup_item_plus[0][i][1] == STR_OS_TV_RATIO)
- {
- setup_sel_plus[0][i] = MIN_ITEM_SEL_PLUS;
- }
- else
- {
- setup_sel_plus[0][i] = MIN_ITEM_SEL_PLUS;
- }
- }
- }
- #endif //end #ifdef SUPPORT_FUNCTION_MENU
-
- for(i=0;i<(MAX_SETUP_PAGE+MAX_CUSTM_SETUP_PAGE);i++) {
- for(j=0;j<MAX_PAGE_ITEM;j++) {
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)//zhaoyanhua add 2003-11-29 20:52
- if(i == ONEKEYPASSPAGE)
- continue;
- #endif
-
- //rating and password
- if((setup_item[i][j][1]==STR_OS_RATING)||(setup_item[i][j][1]==STR_OS_PASSWORD)||(setup_item[i][j][1]==STR_OS_REGION_CODE))//nono 20031122
- continue; //grade item need not load default value
- #ifdef SUPER_DEFAULT_OSD_LANG
- if(i==CUSTMPAGEINDEX)
- {
- if(setup_item[i][j][1]==STR_OS_OSD)
- continue;
- }
- #endif
- #ifndef ARGUS_PORTABLE_DVD
- if(setup_item[i][j][1]==STR_OS_TV_SYS)
- {
- setup_sel[i][j]=MIN_ITEM_SEL+DEFAULT_TV_SYS;
- //setup_tv_format(DEFAULT_TV_SYS); // Robert 020919
- exe_setup_function(STR_OS_TV_SYS,setup_item[SYSPAGE][TV_FORMAT][setup_sel[i][j]],1);//terry.2004/2/3 01:41PM
- }
- else
- #endif
- if(setup_item[i][j][1] == STR_OS_SUBTITLE_LANG_SETUP) { //Jeff 20021007
- setup_sel[i][j] = DEFAULT_SUBT_LANG;
- }
- #ifdef SETUP_MENU_TWO_BUTTON_SELECT_TWO_SUBTITLE //added by wangwei,2004-10-25 0:13
- else if(setup_item[i][j][1] == STR_OS_SUBTITLE_LANG_2ND_SETUP) {
- setup_sel[i][j] = DEFAULT_SUBT_LANG_2ND;
- }
- #endif
- else if(setup_item[i][j][1] == STR_OS_AUDIO_LANG_SETUP) { //Jeff 20021007
- setup_sel[i][j] = DEFAULT_AUDIO_LANG;
- }
- else if(setup_item[i][j][1] == STR_OS_MENU_LANG_SETUP) { //Jeff 20021007
- setup_sel[i][j] = DEFAULT_MENU_LANG;
- }
-
- //gerry mark it,2003-12-23 15:59
- /*
- #ifdef DEFAULT_S_VIDEO_OUTOUT //gerry for panda dvd,3-8-23 18:30
- else if(setup_item[i][j][1] == STR_OS_VIDEO) {
- setup_sel[i][j] = MIN_ITEM_SEL+4;
- }
- #endif
- */
- #ifdef EASTECH_DEFAULT_S_VIDEO_OUTOUT
- else if(setup_item[i][j][1] == STR_OS_VIDEO) {
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #ifdef SETUP_ITEM_NO_DOWNSAMPLE_AND_DEFAULT_96K
- else if(setup_item[i][j][1] == STR_OS_FREQ_MASK) {
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #ifdef SETUP_ITEM_NO_DOWNMIX_AND_DEFAULT_STEREO
- else if(setup_item[i][j][1] == STR_OS_DOWNMIX_SETUP) {
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #ifdef GBM_PORTABLE_DVD
- #ifdef USE_RGB_TFT
- else if(setup_item[i][j][1] == STR_OS_VIDEO) {
- setup_sel[i][j] = MIN_ITEM_SEL+3;
- }
- #endif
- #endif
- #if defined(DEFAULT_MIC_OFF) //gerry for panda dvd,3-9-2 18:06
- else if(setup_item[i][j][1] == STR_OS_MIC_ONOFF) {
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #ifdef SOUND_EFFECT_MENU //sunzhh add 2004-4-28 13:56
- else if(setup_item[i][j][1] == STR_OS_EQ){
- setup_sel[i][j] = MIN_ITEM_SEL+0;
- }
- else if(setup_item[i][j][1] == STR_OS_SURR){
- setup_sel[i][j] = MIN_ITEM_SEL+5;
- }
- #endif //#ifdef SOUND_EFFECT_MENU
- #ifdef JIEKE_DVD
- else if(setup_item[i][j][1] == STR_OS_SSAVER_SETUP){
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- else if(setup_item[i][j][1] ==STR_OS_AUD_OUT){
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #if defined(BBK_NEW_SETUP)||defined(BBK_SIMPLE_SETUP) //fengjl add 3-11-28 23:08
- else if(setup_item[i][j][1] == STR_OS_TV_RATIO){
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #if defined(SSAVER_DEFAULT_OFF)
- else if(setup_item[i][j][1] == STR_OS_SSAVER_SETUP){
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #if defined(SLEEP_DEFAULT_OFF)
- else if(setup_item[i][j][1] == STR_OS_SLEEP_SETUP){
- setup_sel[i][j] = MIN_ITEM_SEL+6;
- }
- #endif
- #ifdef GBM_SAME_DISC_RESUME_DEFAULT_ON //gerry,2004-1-30 20:45
- else if(setup_item[i][j][1] == STR_OS_RESUME){
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #if defined(ADD_P_SCAN_ONOFF)
- else if(setup_item[i][j][1] == STR_OS_P_SCAN_YUV){
- setup_sel[i][j] = MIN_ITEM_SEL+1;
- }
- #endif
- #if defined(ADD_DVI311_SETUP)//for default digital output.Added by ChenZhao on 2004-10-19 11:18
- else if(setup_item[i][j][1] == STR_OS_DVI311_FORMAT){
- setup_sel[i][j] = MIN_ITEM_SEL+1;//+0 analog/+1 digital
- }
- #endif
- #ifdef HDMI
- else if(setup_item[i][j][1] ==STR_OS_AUD_OUT){
- setup_sel[i][j] = MIN_ITEM_SEL+2;//for default spdif PCM output for HDMI output.Modifed by ChenZhao on 2004-10-21 10:51
- }
- #endif
- else if(setup_item[i][j][1] ==STR_OS_AUD_OUT){
- setup_sel[i][j] = MIN_ITEM_SEL+1;//for default spdif RAW output
- }
- else {
- setup_sel[i][j]=MIN_ITEM_SEL;
- }
- } //for(j=0;j<MAX_PAGE_ITEM;j++) {
- } //for(i=0;i<(MAX_SETUP_PAGE+MAX_CUSTM_SETUP_PAGE);i++) {
- #ifdef TONIC_DVD
- SETUP_BASS_MODE = 2; //dingzhy for tonic 2004-2-11 13:24
- #endif
- #if 0//def BASS_MODE_ONOFF //yaowh add 2005-4-5 10:34
- SETUP_BASS_MODE = 3;
- #endif
- #ifdef SUPER_DEFAULT_OSD_LANG
- SETUP_OSD_LANG = UserSet.setup_default_osd_lang + 2;
- #else
- SETUP_OSD_LANG = DEFAULT_OSD_LANG+2;
- #endif
-
- #ifdef SUPPORT_PROLOGIC_II //axel 2004/1/26 11:43
- #ifdef DEFAULT_PROLOGIC_MUSIC //HIMAGE1251 //fengjl add 2004-02-25 09:39
- SETUP_PROLOGIC_II=3;//4; // alan, 3-8-8 18:30
- #else
- SETUP_PROLOGIC_II=4;//4; // alan, 3-8-8 18:30
- #endif
- //assign default value for special items(such as scaleable items, echo, key...)
- #endif
- #ifdef NOT_SHOW_MIC_SETUP_DAFAULT_AUTO
- AUDIF_Set_MICStatus(STATUS_AUTO, 0);//2004AUDDRV AudioSetMIC(2, 0); //Set MIC auto detect(the second parameter:unsed now)
- #endif//NOT_SHOW_MIC_SETUP_DAFAULT_AUTO
- #ifdef DIG_AND_AUD//2004-7-2 1:57
- AUDIF_Set_OutputMode(OUT_51DownmixLtRt, 0);//2004AUDDRV AudioSetOutputMode(0x08, 0); //Set Output mode(8:AC3 downmix Lt/Rt)
- if (full_scrn & SETUP)
- setup_ShowAC3Config();
- AUDIF_Set_FSPKGain(8);//2004AUDDRV AudioSetFSPKGain(8);
- #endif
- //echo
- #ifdef KSD_DVD //wangap 03/08/13
- #ifdef NO_MIC // liweihua add 03-8-8 21:09
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 8;
- #endif
- echo_level = 6;
- #elif defined(VTREK_DVD)
- #ifdef NO_MIC
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 6;
- #endif
- echo_level = 0;
- #elif defined(HUAJIA_DVD)
- #ifdef NO_MIC
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 9;
- #endif
- echo_level = 7;
- #elif defined(NINTAUS_DVD)
- #ifdef NO_MIC
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 9;
- #endif
- echo_level = 7;
- #elif defined(INIT_MAX_ECHO)//axel 2004/2/6 10:04PM
- #ifdef NO_MIC
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 10;
- #endif
- echo_level = 8;
- #elif defined(SUPPORT_EXT_AD_SHOW_MIC_AUTO_SING) //ouyang add for extern AD achieve AUTO sing 2004-12-10 19:15
- #ifdef NO_MIC
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 2;
- #endif
- echo_level = 0;
- #else
- #ifdef NO_MIC
- SETUP_ECHO = 2;
- #else
- SETUP_ECHO = 8;
- #endif
- echo_level = 6;
- SETUP_MIC_ONF = 3; //chen edit 0430
- #endif
- #ifndef BBK_DVD //fengjl add 3-12-3 21:10
- #ifdef DELETE_VIDEO_ITEM
- setup_tv_out(TV_SVIDEO);
- //ap_tv_out_id=TV_SVIDEO;//nono 2003-8-1 18:05
- search_ap_tv_out_id();//terry,2003/8/19 03:21PM
- #endif//DELETE_VIDEO_ITEM
- #endif
- #ifdef SET_RETURN_TO_DEFAULT_TV_FORMAT_PAL
- setup_tv_format(MODE_PAL);
- #endif//SET_RETURN_TO_DEFAULT_TV_FORMAT_PAL
- #ifdef Ti3001_OSD_UI_2
- SETUP_AMP_VOLUME = 8;
- amp_volume_level = 6;
- SETUP_AMP_FSPK = 8;
- amp_fspk_level = 6;
- SETUP_AMP_FSPK_BALANCE = 8;
- amp_fspk_balance_level = 6;
- SETUP_AMP_SSPK = 8;
- amp_sspk_level = 6;
- SETUP_AMP_SSPK_BALANCE = 8;
- amp_sspk_balance_level = 6;
- SETUP_AMP_CSPK = 8;
- amp_cspk_level = 6;
- SETUP_AMP_SUBWOOFER = 8;
- amp_subwoofer_level = 6;
- SETUP_AMP_BASS = 8;
- amp_bass_level = 6;
- SETUP_AMP_TREMBLE = 8;
- amp_tremble_level = 6;
- SETUP_AMP_DYNAMIC= 8;
- amp_dynamic_level = 12;//6
- #endif //#ifdef Ti3001_OSD_UI_2
- // Video related
- //SETUP_SHARPNESS = 1 + 2;
- #if 1//!defined(IR_KEY_SET_VIDEO_MODE)
- SETUP_BRIGHTNESS = 6 + 2;
- SETUP_CONTRAST = 6 + 2;
- SETUP_HUE = 6 + 2;
- SETUP_SATURATION = 0 + 2;
-
- #endif
- #ifdef IR_KEY_SET_VIDEO_MODE
- //video_mode_val=ReadFromI2c(0xa0, 220,(BYTE *)&video_mode_val,1);
- video_mode_val=0;
- set_video_val(video_mode_val);
- #endif
- #ifdef CNTR_5SPK_VOLUME
- {
- int volume;
- int i,read_volume;
- for (i=0; i<7; i++){
- read_volume=ReadFromI2c(0xa0,ADDR_I2C_VOLUME+i,(BYTE *)&audio_volume,sizeof(audio_volume));
- volume_5SPK[i] = audio_volume;//VOL_VALUE; //set to maximum volume
- if(i==0)
- idVolume_5SPK[i] = Volume_Font_ID;
- else
- idVolume_5SPK[i] = VOL_FL_ID+i-1;
- //DSPReset();
- }
- }
- #endif//#ifdef CNTR_5SPK_VOLUME
- #ifdef DIP_CFG_ENABLE
- SETUP_DE_INTERLACE = 3 + 2;//2 + 2;//0 + 2;
- #endif//#ifdef DIP_CFG_ENABLE
- //key
- SETUP_KEY = 8;
- audio_key = 0;
- SETUP_DOWN_SAMPLE = 2;
- //mic-volume
- #ifdef NO_MIC_VOL //gerry for EXT MIC default volume is max,3-10-6 9:31
- SETUP_MIC_VOL = 10;
- mic_volume = 8;
- #else
- #ifdef HUAJIA_DVD //HIMAGE1251//wangfeng 2004-2-11 21:49 //fengjl edit 2004-02-25 10:42
- SETUP_MIC_VOL = 9;
- #else
- SETUP_MIC_VOL = 10;
- #endif
- #ifdef MIC_2CHANNEL //wangfeng 2003-09-12 22:20
- SETUP_MIC_VOL_2 = 10;
- #endif
- #if defined( HUAJIA_DVD ) //HIMAGE1251//wangfeng 2004-2-11 21:49 //fengjl edit 2004-02-25 10:42
- mic_volume = 7;
- #elif defined( SUPPORT_EXT_AD_SHOW_MIC_AUTO_SING ) //ouyang add for extern AD achieve AUTO sing 2004-12-10 19:15
- mic_volume = 0;
- #else
- mic_volume = 8;
- #endif
- #endif
- //AC3 setting
- #if defined(FUSS_TCHINESE_CUSTOMER_DEF_STEREO)||defined(DOWNMIX_DEFAULT_STEREO)
- //SETUP_SPK_DOWNMIX = 3; //hq marked, 2004-3-21 15:21
- SETUP_SPK_DOWNMIX = DOWNMIXSTEREO;
- #elif defined(DOWNMIX_DEFAULT_LR) //hq, 2004-3-10 16:16
- SETUP_SPK_DOWNMIX = DOWNMIXLTRT; //2004-3-21 15:34
- #elif defined(DOWNMIX_DEFAULT_OFF)
- //SETUP_SPK_DOWNMIX = 5; //hq marked, 2004-3-21 15:21
- SETUP_SPK_DOWNMIX = AC3DOWNMIXOFF; //had better use macro-define. hq, 2004-3-21 15:23
- #elif defined(JIEKE_DVD)
- SETUP_SPK_DOWNMIX = 3;
- #elif defined(DOWNMIX_DEFAULT_DOWNMIXVSRND)
- //SETUP_SPK_DOWNMIX = 4;//axel 2004/1/19 05:14 4--->DOWNMIXVSRND
- SETUP_SPK_DOWNMIX = DOWNMIXVSRND; //hq, 2004-3-21 15:37
- #elif defined(TONIC_DVD) //oujx
- SETUP_SPK_DOWNMIX = 2;
- #else
- SETUP_SPK_DOWNMIX = 4;
- #endif
- #ifdef DEFAULT_SPDIF_RAW
- #if defined(BBK_NEW_SETUP)||defined(EASTECH_NEW_SETUP_MENU)||defined(EASTECH_DP3240_SETUP_MENU)
- SETUP_SPDIF = 2;
- #else//BBK_NEW_SETUP
- SETUP_SPDIF = 3;
- #endif//BBK_NEW_SETUP
- #if defined(DIVIDE_AC3_DTS_SPDIF_OUTPUTS)&&defined(DEFAULT_SPDIF_PCM_ON)
- SETUP_SPDIF_PCM=3;
- #endif
- #elif defined(DEFAULT_SPDIF_PCM)
- SETUP_SPDIF = 4;
- #endif
- #ifndef AC3_BASS_MANAGEMENT
- SETUP_SPK_FRONT = 10; //0 ~ 8
- SETUP_SPK_CENTER = 10; //0 ~ 8
- SETUP_SPK_SURROUND = 10; //0 ~ 8
- cspk_volume=SETUP_SPK_CENTER-4;
- sspk_volume=SETUP_SPK_SURROUND-4;
- fspk_volume=SETUP_SPK_FRONT-4;
- #elif defined(BASS_MODE_DEFAULT_SM_SPK) //fengjl add 2004-03-30 21:54
- SETUP_BASS_MODE=3;
- #endif
- SETUP_SPK_SUBWOOFER = 3; //0:off, 1:on
- SETUP_SPK_CENTER_DELAY = 2; //0 ~ 5, 2:0 ms
- SETUP_SPK_SURROUND_DELAY = 4; //0 ~ 5, 4:6 ms
- //Dolby Digital Setup
- #if defined(DUAL_MONO_DEFAULT_STEREO)//fengjl add 2004-03-12 19:21
- SETUP_AC3DIGITAL_LnR = 5-3; //stero, nono 2-8-26 21:06
- #else
- SETUP_AC3DIGITAL_LnR = 5; //Mixed channel, Jeff 20020513
- #endif
- #ifdef DVB_MENU_SETUP_STYLE //Maoyong 2004-12-23 11:41
- SETUP_DVB_LANG = DEFAULT_OSD_LANG + 2;
- SETUP_DVB_TIME_ZONE = DEFAULT_TIME_ZONE + 2;
- #endif
- //gerry move it,2004-2-6 13:47
- /*
- #if 1//defined(VTREK_DVD)||defined(MINTON_DVD)//nono 20031117
- SETUP_AC3DIGITAL_DYNA = 2; //Jeff 20020604
- #else
- SETUP_AC3DIGITAL_DYNA = 10; //Jeff 20020604
- #endif
- */
- #ifdef FUSS_TV_DVD//nono 2-8-20 12:55
- UserSet.P_V_CFG = 0x0d00;
- #endif
- //SETUP_CUSTM_REGION = REGION_NUM+2; //Jeff 20021012//nono marked 2003-11-21 10:46
- /*
- #if 1//def MINTON_DVD//nono 20031117
- ac3_dynarange = 0; //hq,3-11-10 20:11
- SETUP_AC3DIGITAL_DYNA = 2;
- #else
- ac3_dynarange = 8;
- SETUP_AC3DIGITAL_DYNA = 10;
- #endif
- */
- #ifdef HUAJIA_DVD //wangfeng 2004-2-18 14:34
- ac3_dynarange = 8;
- SETUP_AC3DIGITAL_DYNA = 10;
- #elif defined(SETUP_DONGLI459)//||defined(EASTECH_NEW_SETUP_MENU)
- ac3_dynarange = 8;
- SETUP_AC3DIGITAL_DYNA = 10;
- #else
- ac3_dynarange = 0;
- SETUP_AC3DIGITAL_DYNA = 2;
- #endif
- #ifdef ADD_DVI311_SETUP
- set_default_value_dvi();
- #endif
- if (audio_channel!=0) { //Jeff 20030919
- AUDIF_Set_OutputMode(0+1, 0);//2004AUDDRV AudioSetOutputMode(0+1, 0); //set to audio_channel default
- }
- audio_channel = 0; // Robert 021008
- //#if (defined(SAME_DISC_RESUME)&&!defined(GBM_FULL_FUNCTION))||defined(SHOW_STANDBY_TIMER)
- #if defined(NEXTPAGE_SYS) //freyman 2004-3-25 23:59
- page = SysNextPage;
- #ifdef SAME_DISC_RESUME
- same_disc_onoff = 0;
- #endif
- #else
- page = 0;
- #endif
- #ifdef USE_FREQ_MASK //default output 48K fengjl add 3-12-1 22:38
- SETUP_FREQ_MASK = 2;
- #endif
- #ifdef TUNR_OFF_PARENTAL_LVL
- bTurnOffParentalLVL=0;//zhaoyanhua 2003-12-1 20:10
- #endif
-
- #if defined(ONLY_DOWNMIX)
- #ifdef USE_4334_OR_4344_DAC //caoh 2005-1-5 13:12
- AUDIF_Reset_DSP();
- #endif
- exe_setup_function(STR_OS_BASS_MANAGEMENT,STR_OS_BASS_MODE_1,0);//nono 4-3-11 18:34
- #endif
-
- #ifdef DYNAMIC_SPECTRUM //fengjl 3-10-27 21:08
- SETUP_BAND=3;
- bEqDisplay = 0;
- #endif
- #ifdef SETUP_DONGLI459
- if(GPIO_I_GET(36)==0)
- setup_tv_out(P_SCAN);
- else
- setup_tv_out(INTERLACE);
- search_ap_tv_out_id();
- #endif //#ifdef SETUP_DONGLI459
- //xyy deleted 2004-3-8
- //the amp default status setting is moved to amp_gui.c
- #ifdef SUPPORT_DEFAULT_CHANGE_REGION
- SETUP_CUSTM_REGION=REGION_NUM+2;
- UserSet.P_RCD = REGION_NUM;
- #endif
-
- //#ifdef MINTON_YILI_LCD1003_6CH //hq,2004-4-22 17:35
- #if defined(MINTON_YILI_LCD1003_6CH)||defined(QSI_SETUP_MENU)//liweihua mod for QSI 2004-6-17
- SetBrightness(SETUP_BRIGHTNESS - 2);
- SetContrast(SETUP_CONTRAST - 2);
- SetHUE(SETUP_HUE - 2);
- SetSaturation(SETUP_SATURATION - 2);
- #endif//DELETE_VIDEO_ITEM
- //added by wangwei,2004-9-17 16:05
- //(when press "DEFAULT" button in SETUP MENU,3D sound will be restored.)
- #ifdef SETUP_RESTORE_ALSO_RESTORE_3D
- restore_3Dsound();
- #endif
-
- #ifdef SET_AMP_VOL_DEFAULT //xyy add for Oritron 2004-11-11
- extern void set_amp_default_vol(void);
- set_amp_default_vol();
- #endif
- #ifdef DEFAULT_VIDEO_SVIDEO // chen edit 0428
- setup_sel[0][2]=2+2;
- #endif
- #ifdef NO_USE_PASSWORD_RATING
- SETUP_GRADE=RATE_DEFAULT;
- SETUP_GRADE = SETUP_CUSTM_GRADE;
- run_save_sel_cmd(SYSPAGE, GRADEITEM);
- UserSet.ParentalLvl=8;//adult level
- #endif
-
- }
- // xyy deleted 2004-3-8
- //the amp default status settint is moved to amp_gui.c
- //void set_ampsetup_default(void)
- void run_set_variable(void)
- {
- int i,j;
- //freyman 2004-3-26 0:00, for when next page used MAX_SETUP_PAGE is defined 7 in setup_def.h
- //#if (defined(SAME_DISC_RESUME)&&!defined(GBM_FULL_FUNCTION))||defined(SHOW_STANDBY_TIMER)//for the next sys-page is P.7,wangfeng 2003-12-1 17:49
- // for(i=0;i<MAX_SETUP_PAGE+1;i++)
- //#else
- for(i=0;i<MAX_SETUP_PAGE;i++)
- //#endif
- for(j=0;j<MAX_PAGE_ITEM;j++)
- {
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)
- if(i == ONEKEYPASSPAGE)
- {
- SETUP_SPK_DOWNMIX = DOWNMIXSTEREO;
- //TV format
- SETUP_TV_FORMAT = 2;//NTSC;
- exe_setup_function(setup_item[i][0][1],setup_item[i][0][DOWNMIXSTEREO],1);
- exe_setup_function(setup_item[i][1][1],setup_item[i][1][2],1);
- continue;
- }
- #endif
-
- sel=setup_sel[i][j];
- if (setup_item[i][j][1]!=STR_OS_SSAVER_SETUP)
- {
- #ifdef SELECT_MEDIA_IN_SETUPMENU //Maoyong 2004/8/11 run default setting should ignore media selection item
- if(setup_item[i][j][1] ==STR_OS_MEDIA_TYPE)
- continue;
- #endif
-
- //only setting variable ,not run function...
- //printf("i:%d j:%d sel:%d",i,j,sel);
-
- if(setup_item[i][j][1]==STR_OS_RATING)
- {
- if( (sel<RATE_LOW)||(sel>RATE_HIGH) )
- {
- sel = RATE_DEFAULT;
- setup_sel[i][j]=sel;
- }
- }
- #ifdef GBM_DVD
- if (setup_item[i][j][1]==STR_OS_TV_SYS)
- {
- exe_setup_function(setup_item[i][j][1],setup_item[i][j][sel],1);
- }
- else
- #endif
- exe_setup_function(setup_item[i][j][1],setup_item[i][j][sel],0);
- }
- }
-
- //added by wangwei,2004-9-17 16:05
- //(when press "DEFAULT" button in SETUP MENU,3D default set will be saved and loaded.)
- #ifdef REMB_3DSOUND
- run_sound_save(sound_sel);
- load_3Dsound(sound_sel,user_osd_set);
- sound_set_EQ_again(); //(after restore SETUP MENU,when comeback to play and don't show 3D menu,there will be no sound effect,so add it here.)
- #endif
-
-
- }
- #ifdef SUPPORT_PASSWD3
- extern UINT8 setup_audio_mode;
- void chg_audio_default_mode(void)
- {
- WriteToI2c(0xa0, 0,(BYTE *)&setup_audio_mode,1);//audio mode
- }
- #endif
- void init_mode_val(void)
- {
- #ifdef VOLUME_RECODE
- {
- int r;
- int i;
-
- #ifdef CNTR_5SPK_VOLUME//wangfeng 2003-11-11 21:27
- for (i=0; i<7; i++)
- {
- #ifdef SW_VOL_63
- if(i==6) audio_volume = SUB_DEFAULT;
- else audio_volume = DEFAULT_VOL;
- #else
- audio_volume = DEFAULT_VOL;
- #endif
-
- //audio_volume = VOL_VALUE; //set to max volume at the first time gerry 2-11-6 9:24
- r=WriteToI2c(0xa0, ADDR_I2C_VOLUME+i, (BYTE *)&audio_volume,sizeof(audio_volume));
- }//for
-
- audio_volume=DEFAULT_VOL;
- volume_Switch=0;
-
- #else//CNTR_5SPK_VOLUME//wangfeng 2003-11-11 21:27
- audio_volume = DEFAULT_VOL; //set to max volume when we default gerry 2-11-6 9:26;
- r=WriteToI2c(0xa0, ADDR_I2C_VOLUME+i, (BYTE *)&audio_volume,sizeof(audio_volume));
- #endif
- }
- #endif//#ifdef VOLUME_RECODE
-
- #ifdef IR_KEY_SET_VIDEO_MODE
- video_mode_val=0;
- WriteToI2c(0xa0, VIDEO_MODE_I2C_ADDRESS,(BYTE *)&video_mode_val,1);
- #endif
- #ifdef SUPPORT_PASSWD3
- setup_audio_mode=0;
- chg_audio_default_mode();
- #endif
-
- }
- void read_record_val(void)
- {
- #ifdef VOLUME_RECODE //read volume from I2C gerry 2-11-5 16:47
- int i,r;
- #ifdef CNTR_5SPK_VOLUME
- for (i=0; i<7; i++)
- {
- r=ReadFromI2c(0xa0,ADDR_I2C_VOLUME+i,(BYTE *)&audio_volume,sizeof(audio_volume));
- //printf("%%%%%%^^^^^^r==<%d>:audio_volume=====>%dn",r,audio_volume);
-
- if(r<=0) audio_volume = DEFAULT_VOL; //set to max volume when we default gerry 2-11-6 9:26;
- volume_5SPK[i] = audio_volume;//VOL_VALUE; //set to maximum volume
- if(i==0) idVolume_5SPK[i] = Volume_Font_ID;
- else idVolume_5SPK[i] = VOL_FL_ID+i-1;
- } //for
-
- audio_volume = volume_5SPK[0] ;
- volume_Switch = 0; //set to main volume
- #else
- r=ReadFromI2c(0xa0,ADDR_I2C_VOLUME+i,(BYTE *)&audio_volume,sizeof(audio_volume));
- audio_volume = (audio_volume <= DEFAULT_VOL)?audio_volume:DEFAULT_VOL;
- //printf("%%%%%%^^^^^^r==<%d>:audio_volume=====>%dn",r,audio_volume);
- #endif
- #endif //VOLUME_RECODE
- #ifdef IR_KEY_SET_VIDEO_MODE
- int r;
- r=ReadFromI2c(0xa0, VIDEO_MODE_I2C_ADDRESS,(BYTE *)&video_mode_val,1);
- //printf("%%%%%%^^^^^^r==<%d>:video_mode_val=====>%dn",r,video_mode_val);
- if(r<=0) video_mode_val=0;
- set_video_val(video_mode_val);
- #endif
- #ifdef SUPPORT_PASSWD3
- ReadFromI2c(0xa0,0,(BYTE *)&setup_audio_mode,1);
- #endif
-
- }
- void init_val_by_record(void)
- {
- //echo: shift to 0 ~ 8
- #ifdef NOT_REWRITE_MIC_VALUE //axel 2004/2/8 10:05PM
- echo_level = 8;
- #else
- echo_level = SETUP_ECHO - 2;
- #endif //NOT_REWRITE_MIC_VALUE
- //key: shift to -6 ~ 6
- #ifdef NOT_REWRITE_MIC_VALUE //axel 2004/2/8 10:05PM
- audio_key = 0;
- #else
- audio_key = SETUP_KEY - 2 - 6;
- #endif //NOT_REWRITE_MIC_VALUE
- //mic-volume: shift to 0 ~
- #ifdef MIC_2CHANNEL //wangfeng 2003-09-12 22:20
- if(id==STR_OS_MIC_VOL_1)
- #endif
- #ifdef NOT_REWRITE_MIC_VALUE //axel 2004/2/8 10:05PM
- mic_volume = 6;
- #else
- mic_volume = SETUP_MIC_VOL - 2;
- #endif //NOT_REWRITE_MIC_VALUE
- #ifdef MIC_2CHANNEL
- else if(id==STR_OS_MIC_VOL_2)
- mic_volume = SETUP_MIC_VOL_2 - 2;
- #endif
- ac3_dynarange = SETUP_AC3DIGITAL_DYNA - 2;
- #ifdef DYNAMIC_SPECTRUM //zhaoyanhua add 2003-12-3 11:42
- if(SETUP_BAND == 2)
- {
- band_onoff = 1;
- bEqDisplay = 1;
- }
- #endif
- }
- #ifdef MONE_SETUP
- void dump_setup_val(void)
- {
- int i, j;
- printf("read eeprom setup menu,ok!!n");
- for (i=0; i<MAX_SETUP_PAGE+MAX_CUSTM_SETUP_PAGE; i++) {
- for (j=0; j<7; j++) {
- printf("setup_sel[%d][%d]=%dn", i, j, setup_sel[i][j]);
- }
- }
- }
- #else
- #define dump_setup_val();
- #endif
- #ifdef FORCE_REWRITE_WHEN_UPGRADE//terry,2004/1/8 05:28PM
- void load_user_setup(UINT8 force_update)
- #else
- void load_user_setup(void)
- #endif
- {
- // int i,j;
- int iRts;
- UINT16 unChksum,unTmp;
- BYTE *p;
- UINT32 romSum=0;
- #ifdef MONE_SETUP
- printf("load setup menu,inn");
- #endif
- //get ROM-code-checksum from ROM(20th ~ 23th Byte)
- {
- UINT32 *pSum;
- pSum = (UINT32 *)(ROM_BASE_UNCACHED+0x40);
- romCheckSum = *pSum &0xffffff;
- }
- //read ROM-code-checksum from setup EEPROM(flash)(0-th Byte)
- p = (BYTE *)(&romSum);
- iRts = ReadFromI2c(0xa0, 1, p, 3);
- WriteToI2c(0xa0, 1, (BYTE *)&romCheckSum,3);//save rom check sum
- printf("romCheckSum:%x %xn",romCheckSum,romSum);
- #ifdef FORCE_REWRITE_WHEN_UPGRADE//terry,2004/1/8 05:28PM
- if(force_update==1)
- {
- romSum = 0;
- setup_sel[SYSPAGE][GRADEITEM]=RATE_DEFAULT;
- NP_PTL_LVL = 8;//zhaoyanhua 2004-3-9 11:32 after UPGRADE, must set parent level is 8.
- }
- #endif
- #ifdef SELECT_MEDIA_IN_SETUPMENU //Maoyong always default as Disc 2004-8-9 15:33
- SETUP_MEDIA_TYPE = DISC_ITEM + 2;
- #endif
- if (iRts > 0)
- {//read ok
- if (romSum==romCheckSum)
- {//read setup setting from setup EEPROM(2-th Byte)
- #ifdef Ti3001_OSD_UI_1
- load_amplifier_setup(); // jason add 2-10-5 15:59
- #endif
- p=(BYTE *)setup_sel;
- iRts=ReadFromI2c(0xa0, sizeof(UINT32), p, sizeof(setup_sel));
- //yanlb added 2004/07/07
- #ifdef REMB_3DSOUND
- load_3Dsound(sound_sel,user_osd_set);
- #endif
- } else
- {//flash upgrade
- iRts = -1;
- //if rom0-check-sum is not equal, set to default password, Jeff 20020703
- #ifdef SUPER_DEFAULT_OSD_LANG
- UserSet.setup_default_osd_lang = DEFAULT_OSD_LANG;
- #endif
- UserSet.parent_passwd = DEFAULT_PASSWORD;
- WriteToI2c(0xa0, sizeof(UINT32)+sizeof(setup_sel)+2, (BYTE *)&UserSet, sizeof(t_USER_SET));
- /*
- Here not used deleted by xyy 2004-8-5
- */
- #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS)//xyy 2004-5-26
- init_tuner_var();
- #endif
- //init mode
- init_mode_val();
- } //if (romSum==romCheckSum) {
- } //if (iRts > 0) {
- //read audio/video mode
- read_record_val();
-
- if(iRts>0)
- {
- init_val_by_record();
- dump_setup_val();
- //read setup checksum from setup EEPROM
- iRts=ReadFromI2c(0xa0, sizeof(UINT32)+sizeof(setup_sel), (BYTE *)&unChksum, 2);
- if (iRts>0)
- {
- printf("read eeprom setup check successn");
- //count setup checksum
- unTmp = run_save_unChk_cmd(0);
- //check setup checksum and counted checksum
- if (unTmp!=unChksum)
- {
- printf("check sum error, uTmp=%d unCkhsum=%dn",unTmp,unChksum);
- iRts=-2;
- }
- else
- {
- printf("check sum successn");
- #ifdef EASTWIN
- if(SETUP_VIDEO_FORMAT==5)//jhuang eastwin 2004/8/16
- {
- SETUP_VIDEO_FORMAT = MIN_ITEM_SEL;
- run_save_sel_cmd(SYSPAGE,2);
- setup_tv_out(INTERLACE);
-
- }
- #endif
- }
-
- }
- else
- {
- printf("read eeprom setup check errorn");
- }
-
- #ifdef MONE_SETUP
- printf("chksum=%02xn",unChksum);
- #endif
- }
- if (iRts < 0)
- {
- //set to default, when
- // //1. different ROM-code-checksum(setup-EEPROM vs. ROM)
- ////2. counted setup-checksum != stored in setup EEPROM
- #ifdef MONE_SETUP
- printf("read eeprom setup menu,fail!!n");
- #endif
- SETUP_CUSTM_REGION = REGION_NUM+2; //nono 20031121
- UserSet.P_RCD = REGION_NUM;
- set_default_value();
- run_save_total_sel();
- safe_srn_forceOFF();
-
- #ifdef Ti3001_OSD_UI_1 // jason 2-10-5 15:30
- reset_amplifier_default_setup();
- #endif
- #ifdef POWER_RESUME
- RsmInfo2Flash(1); //clear resume flash memory, Jeff 20020928
- #endif
- }
- //read UserSet for DVD-related
- //if (iRts>0)
- iRts=ReadFromI2c(0xa0, sizeof(UINT32)+sizeof(setup_sel)+2, (BYTE *)&UserSet, sizeof(t_USER_SET));
- if(iRts>0)
- {
- printf("read eeprom system menu,ok!!n");
- UserSet.P_RCD = SETUP_CUSTM_REGION - 2;
- } else
- {
- printf("read eeprom system menu,fail!!n");
-
- SETUP_CUSTM_REGION = REGION_NUM+2; //Jeff 20021012
- UserSet.P_RCD = REGION_NUM;
- }
- SETUP_CUSTM_REGION = UserSet.P_RCD+2;
- #ifdef SUPER_DEFAULT_OSD_LANG
- SETUP_CUSTM_OSDLANG = UserSet.setup_default_osd_lang + 2;
- #endif
- run_set_variable();
- //David added 2003-12-17 23:01 temp
- //Syber required: No need switch video output, only YUV default
- #if defined(YUV_DEFAULT_OUTPUT) && defined(DELETE_VIDEO_ITEM)
- #ifdef S_VIDEO_OUT
- regs0->emu_cfg[1]|=0x100;
- #endif //#ifdef S_VIDEO_OUT
- setup_tv_out(INTERLACE);//set S-video output(composited+component)(0x00:D0-D1-D2-D3=CVBS-V-Y-U)
- search_ap_tv_out_id();//terry,2003/8/19 03:21PM
- #endif
- //UserSet.M_LCD = 'z' * 256 + 'h';
- //china zh ,taiwan tw
- //china
- UserSet.CTY_CD=('C'<<8)|('N');
- UserSet.P_A_CFG=0xffff;// should be config//uinted states:US ,china:CN , taiwan:TW
- if (SETUP_PASSWORD == (MIN_ITEM_SEL+1) ) {
- UserSet.parental_ststus=C_UNLOCK;
- } else {
- UserSet.parental_ststus=C_LOCK;
- //#ifndef NO_USE_PASSWORD_RATING //chen edit 905
- SETUP_PASSWORD = MIN_ITEM_SEL;
- //#endif
- }
- #ifdef MONE_SETUP
- printf("load setup menu,outn");
- #endif
- //check password and grade
- #ifdef RATING_8
- if ( (SETUP_GRADE<2) || (SETUP_GRADE>9) ) {
-
- SETUP_GRADE = 9;
-
- // UserSet.parent_passwd = 0;//NONO mark it.3-11-23 22:17
- // UserSet.parental_ststus = C_UNLOCK;//NONO mark it.3-11-23 22:17
- UserSet.parent_passwd = DEFAULT_PASSWORD; //Jeff 20020703
- }
-
- #else
- if ( (SETUP_GRADE<2) || (SETUP_GRADE>4) ) {
- SETUP_GRADE = 4;
- UserSet.parent_passwd = 0;
- UserSet.parental_ststus = C_UNLOCK;
- UserSet.parent_passwd = DEFAULT_PASSWORD; //Jeff 20020703
- }
- #endif
- #ifdef SETUP_6_DIGIT_PASSWORD//zhaoyanhua add 03-10-14 14:10
- if (UserSet.parent_passwd > 999999)
- #else //4 digit
- if (UserSet.parent_passwd > 9999)
- #endif //end SETUP_6_DIGIT_PASSWORD
- {
- UserSet.parent_passwd = 0;
- UserSet.parental_ststus = C_UNLOCK;
- }
- setupLevel = 0;
-
- #if defined(SAME_DISC_RESUME)&&defined(NEXTPAGE_SYS)//freyman 2004-3-26 0:01 alan, 3-9-30 18:59
- if(setup_sel[SysNextPage][SAME_DISC_RESUME_ITEM]==3)
- same_disc_onoff=1;
- else
- same_disc_onoff=0;//CLEAD 2003-9-29
- printf("nn====same_disc_onoff:%d====n",same_disc_onoff);
- #endif
-
- #ifdef BBK_DVD //fengjl add 3-11-25 22:09 for YUV output when next power on
- #define VIDEO_OUTPUT_OFFSET 240
- int res = ReadFromI2c(0xa0, VIDEO_OUTPUT_OFFSET,(BYTE *)&tv_out_id,sizeof(tv_out_id));
- if(res < 0) tv_out_id = INTERLACE;
- setup_tv_out(tv_out_id);
- //audio key set default value.zhaoyanhua add 2003-12-4 11:44
- audio_key = 0;
- #endif
-
- #ifdef VGA_CTRL_FORMAT//wangfeng 2003-12-18 18:55
- int res = ReadFromI2c(0xa0, ADDR_I2C_VGA,(BYTE *)&temp_format,sizeof(temp_format));
- if(res)
- if(temp_format)
- {
- exe_setup_function(STR_OS_TV_SYS,temp_format,1);//terry,2004/2/3 01:34PM
- }
- #endif
- }
- void show_main_title(int id)
- {
- #ifndef SPE_SETUP //2004-4-22 06:51张宇P
- const char *str;
- int start,len;
- #ifdef DVB_MENU_SETUP_STYLE
- extern const char *osd_str_dvb_mainmenu[N_OSD_LANGS][2];
- if(system_state == SYSTEM_TS)
- {
- if((page == INSTALLPAGE))
- {
- osd_DrawString(2, 2, osd_str_dvb_mainmenu[osd_font_mode][0], 7,SBLACKCOLOR/*SWHITECOLOR, SBLACKCOLOR*/);
- return;
- }
- else if((page == CHANNELPAGE))
- {
- osd_DrawString(2, 2, osd_str_dvb_mainmenu[osd_font_mode][1], 7,SBLACKCOLOR/*SWHITECOLOR, SBLACKCOLOR*/);
- return;
- }
- }
-
- #endif
- //count main menu title string length
- str = _OsdMessegeFont1[osd_font_mode][id];
- len = strlen(str);
- if ( IsOSDChinese() ) {
- len = len*2;
- }
- start = SETUP_MAX_WIDTH/2-len+2;
- #ifdef SETUP_COLOR_TYPE1 //wangfeng 2003-08-29 17:16
- osd_DrawString(3, 2, (char *)str, 7,SBLACKCOLOR/*SWHITECOLOR, SBLACKCOLOR*/);
- #elif defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-2 18:02
- if(id == STR_OS_SYS_SETUP)
- osd_DrawRegionString(2, 13, (char *)str, 12,SBLACKCOLOR,0);
- else if(id == STR_OS_LANG_SETUP)
- osd_DrawRegionString(8, 13, (char *)str, 12,SBLACKCOLOR,0);
- else if(id == STR_OS_AUD_SETUP)
- osd_DrawRegionString(16, 13, (char *)str, 12,SBLACKCOLOR,0);
- else if(id == STR_OS_KARAOKE_SETUP)
- osd_DrawRegionString(22, 13, (char *)str, 12,SBLACKCOLOR,0);
- #else
- osd_DrawString(2, 2, (char *)str, 7,SBLACKCOLOR/*SWHITECOLOR, SBLACKCOLOR*/);
- #endif
- #endif
- }
- void draw_3rd_menu()
- {
- int i;
- BYTE fontColor, bgColor;
- BYTE upDown;
- const char *str;
- //draw ">" between sub-mean and it's corresponding selection area
- #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 17:12
- osd_DrawString(SETUP_SUB_XSTART-1, index_y+SETUP_MENU_YSTART+1, Ch_arrorR, SANTIFONTCOLOR, SBGCOLOR);
- #else
- osd_DrawString(SETUP_SUB_XSTART-1, index_y+SETUP_MENU_YSTART+1, Ch_arrorR, SFONTCOLOR, SBGCOLOR);
- #endif// QSI_SETUP_MENU_DESIGN
-
- #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-7 17:15
- if(page == VIDEOPAGE)
- {
- for(i = 0; i < (setupItemNum[1]); i++ )
- {
-
- if(setup_item[page][i][0] == SET_SCALE)//"EXIT" item, return
- {
- if(index_y == i)
- fontColor = 4;
- else
- fontColor = SFONTCOLOR;
-
- setup_VideoItemValue(i, fontColor,SBGCOLOR);
- }
- }
- return;
- }
- #endif
- //show first selection menu of third-level menu
- for (i=2; i<MAX_ITEM_SEL; i++)
- {
- //get select item
- #ifdef BBK_NEW_SETUP//zhaoyanhua add 2003-11-18 17:15
- #if !defined(BBK_DSS_555_DVD)&&!defined(BBK_DV911S) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE
- if(one_key_pass_flag)//OENKEYPASSPAGE
- {
- sel = GetOneKeyPageSel(index_y);
- }
- else
- #endif
- sel=setup_sel[page][index_y];
- #else
- sel = setup_sel[page][index_y+index_y_start];
- #endif
- id = setup_item[page][index_y+index_y_start][i];
- if (id==0)
- {
- if (setup_item[page][index_y+index_y_start][0]==SET_SCALE)
- setup_PrepareScaleItem(setup_item[page][index_y+index_y_start][1], 0);
- break;
- }
- str = setup_SetItemString();
-
- #ifdef SETUP_COLOR_TYPE1 //wangfeng 2003-08-29 17:16
- if (sel == i)
- {
- fontColor = SDEFAULTCOLOR;//4; //SFONTCOLOR;
- bgColor = SBGCOLOR; // SANTIBGCOLOR;
- upDown = 1;
- } else {
- fontColor = 2;//SFONTCOLOR;
- bgColor = SBGCOLOR;
- upDown = 0;
- }
- #elif defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-4 16:52
- if (sel == i)
- {
- fontColor = SDEFAULTCOLOR;//4; //SFONTCOLOR;
- bgColor = SBGCOLOR; // SANTIBGCOLOR;
- upDown = 1;
- }
- else {
- fontColor = SFONTCOLOR;
- bgColor = SBGCOLOR;
- upDown = 0;
- }
- #else
- if (sel == i)
- {
- fontColor = 4; //SFONTCOLOR;
- bgColor = SBGCOLOR; // SANTIBGCOLOR;
- upDown = 1;
- } else {
- #ifdef SELECT_MEDIA_IN_SETUPMENU
- if( IsSetupMediaItemDisable(i) )
- fontColor = SGRAYCOLOR;
- else
- #endif
- fontColor = SFONTCOLOR;
- bgColor = SBGCOLOR;
- upDown = 0;
- }
- #endif
- //special item(PASSWORD), page-0, item-4
- if (setup_item[page][index_y+index_y_start][0]==SET_NM)
- {
- submenuStart = index_y+SETUP_MENU_YSTART;//zhaoyanhua add 2004-1-16 11:03
-
- if (UserSet.parental_ststus==C_LOCK)
- {
- setup_sel[page][index_y+index_y_start] = MIN_ITEM_SEL;
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
- } else {
- setup_sel[page][index_y+index_y_start] = MIN_ITEM_SEL + 1;
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_UNLOCK];
- }
- #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 16:41
- osd_draw_setup_button(SETUP_SUB_XSTART, (submenuStart)+1, SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, SANTIBGCOLOR, 1);
- #endif
- osd_DrawString(SETUP_SUB_XSTART+1, (submenuStart)+1, str, SANTIFONTCOLOR, SANTIBGCOLOR);
- }
- else
- {
- #ifdef RATING_8
- //when I draw PASSWORD GUI, return main seutp with"ShowSetupPage()",
- //rating8 show uncorrectly. so I add the following codes
- //zhaoyanhua 2004-1-16 10:44
- if ( (page==SYSPAGE) && (index_y == GRADEITEM) )
- {
- submenuStart = SETUP_MENU_YSTART;
- }
- else
- #endif
- #ifdef SUPER_DEFAULT_OSD_LANG
- if(index_y==CUSTMOSDITEM)
- {
- if((8-N_OSD_LANGS)>=4)
- submenuStart = index_y + SETUP_MENU_YSTART;
- else
- submenuStart = SETUP_MENU_YSTART + (8-N_OSD_LANGS) + 1;
- }else
- #endif
- submenuStart = index_y+SETUP_MENU_YSTART;
- #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 16:41
- osd_draw_setup_button(SETUP_SUB_XSTART, (i-2)+submenuStart+1, SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, bgColor, upDown);
- #endif
- //printf("#### in draw3rdmenu --- draw string ---n");
- osd_DrawString(SETUP_SUB_XSTART+1, (i-2)+submenuStart+1, str, fontColor, bgColor);
- }
- }
- setupItemNum[2] = i-2;
- }
- void setup_func_return_main(void)
- {
- setupLevel=0;
- index_y = 0;
- index_y_start=0;
- ShowSetupPage(1);
- }
- void ShowSel(BYTE xStart, BYTE yStart,BYTE xLen,BYTE down)
- {
- BYTE fnColor,bgColor;
- const char *str;
- str = setup_SetItemString();
- //#ifdef SETUP_COLOR_TYPE1 //wangfeng 2003-08-29 17:16
- #if defined(SETUP_COLOR_TYPE1) || defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-4 16:46
- if (down)
- fnColor=SDEFAULTCOLOR;//4;
- else
- fnColor=SFONTCOLOR;
- bgColor = SBGCOLOR;
- #else
- if (down)
- fnColor=4;
- else
- fnColor=SFONTCOLOR;
- bgColor = SBGCOLOR;
- #endif
- #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 16:41
- osd_draw_setup_button(xStart,yStart,xLen, bgColor, down);
- #endif
- osd_DrawString(xStart+1, yStart, str, fnColor, bgColor);
- }
- //NOTE: the following .h files only include UI function,such as
- // LEFT,RIGHT, UP, DOWN, SELECT, ShowSetupPage.
- #ifdef NEW_STYLE_SETUP//zhaoyanhua add 3-7-25 17:29
- #include "setup_newstyle_ui.c"
- #elif defined(SOFT_MENU)//Modifed by ChenZhao on 2004-9-8 17:39 WP
- #include "setup_tab_ui_SFM.c"
- #else
- #include "setup_tab_ui.c"
- #endif //NEW_STYLE_SETUP
- #ifdef NEW_STYLE_SETUP //zhaoyanhua add 3-7-25 19:18
- void init_setup(void)
- {
- page = 0;
- index_y=0;
- index_y_start=0;
- setupLevel=0;
- GBM_run_setupmenu_flag = 0;
- //setup_tv_format(MODE_NTSC);//force to NTSC zhaoyanhua note 2003-07-19 21:39
- full_scrn=SETUP; //setup menu
- //read_setup_select(); // read data from EEPROM or Flush
-
- //printf("IN Init_SETUP NEW STYLEn");
-
- //osd_init_setup();//zhaoyanhuamask
- //ShowSetupPage(2);//zhaoyanhua amsk
- //zhaoyanhua add the following page.
- //printf("getVPP_TVsystem():%xn",getVPP_TVsystem());
- if(getVPP_TVsystem() == 1)//terry,0813
- {
-
- osd_init_hand_ICON_for_PAL();
- setupLevel=1;
- ShowSetupPage(0);//must showsetuppage,because it will clear the rect.
- setupLevel=0;
- ShowCurrentPage_for_PAL(page);
-
- }else
-
- //if (tv_format == MODE_NTSC)
- {
- osd_init_hand_ICON_for_NTSC();
- setupLevel=1;
- ShowSetupPage(0);//must showsetuppage,because it will clear the rect.
- setupLevel=0;
- ShowCurrentPage_for_NTSC(page);
-
- }
-
- }
- #elif defined(SOFT_MENU)//Modifed by ChenZhao on 2004-9-2 14:46 WP
- void init_setup(void)
- {
- page = 0;
- index_y=0;
- index_y_start=0;
- setupLevel=0; // alan, 2003/9/5 02:31