- //
- // FILE
- // setup_tab_reeng.c
- //
- //--------------------------------------
- //Modefied by JSLin, 20040817
- //For setup menu reengineering
- //--------------------------------------
- #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
- #include "setup.h"
- #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
- #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];//2004AUDDRV 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 0//def ADD_DVI311_SETUP//Modifed by chenzhao on 2004-12-2 11:55
- #include "spv301.h"
- extern void scaler_main(void);
- void set_default_value_dvi(void)
- {
- dvi311_tv_mode = 0x84; //0x85:NTSC, 0x86:PAL60, 0x84:PAL, 0x7a:AUTO
- dvi311_format = 0xb7; //output format:0xb7:模拟输出, 0xb8:数字输出
- dvi311_mode =5;// 3; //output mode:0:720P, 1:576P, 2:480P, 3:SXGA, 4:XGA, 5:SVGA, 6:VGA
- Power_off_311=0; //kevin0710
- }
- #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 int check_chipinfo(int);
- //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
- #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//#if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)
- //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 run_save_total_userSet(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,
- SET_LINK=0x8, //jump to another page
- };
- 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;
- 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"
- // for DVD_SETUP_REENG, no more setup_page.h
- #include "setup_VA.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},
- };
- #else
- 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+1];//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
- #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;
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_SUBWOOFER);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_SUBWOOFER]]==STR_OS_ON)
- res=1;
- else
- res=0;
- return res;
- }
- int WillKeyShiftNotDo(void)//nono 2-5-12 20:54
- {
- int res=0;
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- #ifndef SETUP_ALL_VALID//nono 2003-9-25 16:54
- if( ((setup_item[P][I][setup_VA[SETUP_VA_DOWNMIX]]==STR_OS_OFF)
- ||(coding_mode_now==AUDIF_CODING_MODE_LPCM) )&&(cd_type_loaded==CDDVD) )
- res=1;
- else if( (setup_item[P][I][setup_VA[SETUP_VA_DOWNMIX]]==STR_OS_OFF)
- &&(coding_mode_now==AUDIF_CODING_MODE_DTSCD) )
- res=1;
- #endif
- return res;
- }
- #ifdef USER_MPEG_LOGO
- UINT8 setup_GetMPEGLogoItem(void)
- {
- //return (SETUP_MPEG_LOGO);
- return (setup_VA[SETUP_VA_SELECT_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
- //JS //20040818
- setup_VA[SETUP_VA_SELECT_LOGO] = MPEG_LOGO_ON;
- exe_setup_function(STR_OS_SELECT_LOGO, STR_OS_MPEG_LOGO, 0);
- run_save_sel_cmd(setup_VA[SETUP_VA_SELECT_LOGO], SETUP_VA_SELECT_LOGO);
- }
- #endif//USER_MPEG_LOGO
- int setup_IsSpkDownmixOff(void)//nono 2-5-16 18:05
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_DOWNMIX]]==STR_OS_OFF)
- return 1;
- else
- return 0;
- }
- #if 0//no used in DVD_SETUP_REENG
- 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
- }
- #endif
- void setup_ShowAC3DynamicRange(void)
- {
- return;
- #if 0
- 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);
- #endif
- }
- 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)
- {
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- if(setup_item[P][I][setup_VA[SETUP_VA_DOWNMIX]] == STR_OS_STEREO)
- 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;
- UINT16 P, I, S;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- for(S=MIN_ITEM_SEL; S<MAX_ITEM_SEL; S++) {
- if(setup_item[P][I][S]==STR_OS_OFF)
- {break;}
- }
- setup_VA[SETUP_VA_DOWNMIX]=S;
- setup_sel[P][I]=S;
- //run_save_sel_cmd(setup_VA[SETUP_VA_DOWNMIX], SETUP_VA_DOWNMIX);
- #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.
- UINT16 P,I,S;
- P=setup_getItemPos(STR_OS_PROLOGIC);
- I=P&0xff;
- P=P>>8;
- for(S=MIN_ITEM_SEL; S<MAX_ITEM_SEL; S++) {
- if(setup_item[P][I][S]==STR_OS_PL_MUSIC)
- {break;}
- }
- setup_VA[SETUP_VA_PROLOGIC]=S;
- setup_sel[P][I]=S;
- //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);
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- for(S=MIN_ITEM_SEL; S<MAX_ITEM_SEL; S++) {
- if(setup_item[P][I][S]==STR_OS_OFF)
- {break;}
- }
- setup_VA[SETUP_VA_DOWNMIX]=S;
- setup_sel[P][I]=S;
- }
- #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
- UINT32 P, I, S;
- P = setup_getSelPos(id);
- I = (P>>8)&0xff;
- S = P&0xff;
- P = P>>16;
- setup_VA[SETUP_VA_TV_SYS] = S;
- run_save_sel_cmd(setup_VA[SETUP_VA_TV_SYS], SETUP_VA_TV_SYS);
- #endif
- #endif
- }
- #ifdef FORCE_RETURN_TO_DEFAULT_TV_FORMAT//nono 20030913
- void setup_SetTV_default_format(void)
- {
- setup_VA[SETUP_VA_TV_SYS] = MIN_ITEM_SEL+DEFAULT_TV_SYS;
- //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
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_TV_SYS);
- I=P&0xff;
- P=P>>8;
- exe_setup_function(STR_OS_TV_SYS,setup_item[P][I][setup_VA[SETUP_VA_TV_SYS]],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;
- 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;
- 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
- //added by JS //for setup reengineering //20040818
- UINT32 P, I;
- P = setup_getItemPos(STR_OS_PROLOGIC);
- I = P&0xff;
- P = P>>8;
- setup_VA[SETUP_VA_PROLOGIC] = prologic_mode+2;
- exe_setup_function(STR_OS_PROLOGIC, setup_item[P][I][setup_VA[SETUP_VA_PROLOGIC]], 1);
- run_save_sel_cmd(setup_VA[SETUP_VA_PROLOGIC], SETUP_VA_PROLOGIC);
- }
- #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;
- setup_VA[SETUP_VA_VIDEO] = ap_tv_out_id + MIN_ITEM_SEL;
- #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);
- run_save_sel_cmd(setup_VA[SETUP_VA_VIDEO], SETUP_VA_VIDEO);
- #endif
- }
- //this function was modified by JS //for setup reengineering //20040819
- //but, we should not hard code parameters in function
- #if 0 //def IR_KEY_SET_VIDEO_MODE
- void set_video_val(BYTE video_mode)
- {
- 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_VA[SETUP_VA_BRIGHTNESS]=parm[video_mode][0];
- setup_VA[SETUP_VA_CONTRAST]=parm[video_mode][1];
- setup_VA[SETUP_VA_HUE]=parm[video_mode][0];
- }else
- {
- ReadFromI2c(0xa0, 240,(BYTE *)&setup_VA[SETUP_VA_BRIGHTNESS],1);
- ReadFromI2c(0xa0, 241,(BYTE *)&setup_VA[SETUP_VA_CONTRAST],1);
- ReadFromI2c(0xa0, 242,(BYTE *)&setup_VA[SETUP_VA_HUE],1);
- }
- SetBrightness(setup_VA[SETUP_VA_BRIGHTNESS] - 2);
- SetContrast(setup_VA[SETUP_VA_CONTRAST] - 2);
- SetHUE(setup_VA[SETUP_VA_HUE] - 2);
- //SetSaturation(SETUP_SATURATION - 2);
- run_save_sel_cmd(setup_VA[SETUP_VA_BRIGHTNESS],SETUP_VA_BRIGHTNESS);
- run_save_sel_cmd(setup_VA[SETUP_VA_CONTRAST],SETUP_VA_CONTRAST);
- run_save_sel_cmd(setup_VA[SETUP_VA_HUE],SETUP_VA_HUE);
- }
- #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_VA[SETUP_VA_BRIGHTNESS];//SETUP_BRIGHTNESS;
- c=setup_VA[SETUP_VA_CONTRAST];//SETUP_CONTRAST;
- h=setup_VA[SETUP_VA_HUE];//SETUP_HUE;
- s=setup_VA[SETUP_VA_SATURATION];//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
- //for setup reengineering //added by JS //20040816
- void set_default_value(void)
- {
- int i,j, VA;
- #ifdef MONE_SETUP
- printf("nn=============> set_default_value() INn");
- #endif
- #ifdef ADD_DVI311_SETUP//Modifed by chenzhao on 2004-11-30 19:55
- Power_off_311=1;
- #endif
- for(i=0;i<(MAX_SETUP_PAGE+MAX_CUSTM_SETUP_PAGE);i++){
- for(j=1;j<=MAX_PAGE_ITEM;j++){
- VA=setup_item[i][j][MAX_ITEM_SEL+1];
- if(VA<MAX_SETUP_VA){
- 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))
- {/*do nothing here*/}
- #ifdef ADD_DVI311_SETUP//Modifed by chenzhao on 2004-11-30 19:55
- else if((setup_item[i][j][1]==STR_OS_HDCP))
- {
- if(setup_VA[VA]<MIN_ITEM_SEL)
- setup_VA[VA]=MIN_ITEM_SEL;
- }
- #endif
- else
- {
- setup_VA[VA] = setup_item[i][j][MAX_ITEM_SEL+2]+MIN_ITEM_SEL;
- if(setup_item[i][j][1]==STR_OS_TV_SYS)
- exe_setup_function(setup_item[i][j][1], setup_item[i][j][setup_VA[VA]], 1);
- }
- }
- }
- }
- setup_VA2sel();
- init_val_by_record();
- #ifdef MONE_SETUP
- dump_setup_val();
- printf("nn=============> set_default_value() OUTn");
- #endif
- }
- // xyy deleted 2004-3-8
- //the amp default status settint is moved to amp_gui.c
- //void set_ampsetup_default(void)
- //added by JS //for setup reengineering //20040811
- void run_set_variable(void)
- {
- int i,j;
- int P0, P1, P2, P3;
- P0 = setup_pos[0];
- P1 = setup_pos[1];
- P2 = setup_pos[2];
- P3 = setup_pos[3];
- #ifdef MONE_SETUP
- printf("nn >>>>>run_set_variable INn");
- #endif
- //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=1;j<=MAX_PAGE_ITEM;j++)
- {
- setup_pos[1] = i;
- setup_pos[2] = j;
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)
- if(i == ONEKEYPASSPAGE)
- {
- /* //marked by JS //for setup reengineering //20040819
- 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;
- */
- //added by JS //for setup reengineering //20040819
- if(setup_item[i][j][1]==STR_OS_DOWNMIX_SETUP){
- setup_VA[SETUP_VA_DOWNMIX] = DOWNMIXSTEREO;
- exe_setup_function(STR_OS_DOWNMIX_SETUP,setup_item[i][j][DOWNMIXSTEREO],1);
- }
- else if(setup_item[i][j][1]== STR_OS_TV_SYS){
- setup_VA[SETUP_VA_TV_SYS] = 2; //set to NTSC //??????? is this always correct?
- exe_setup_function(STR_OS_TV_SYS, setup_item[i][j][2], 1);
- }
- }
- #endif
- sel=setup_sel[i][j];
- setup_pos[3]=sel;
- 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;
- setup_pos[3] = 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);
- }
- }
- safe_srn_forceOFF();
- #ifdef HDCP_CUSTOM
- UINT16 pi;
- pi=setup_getItemPos(STR_OS_HDCP);
- if(pi!=0xffff)
- exe_setup_function(setup_item[pi>>8][pi & 0xff][1],setup_item[pi>>8][pi & 0xff][setup_sel[pi>>8][pi & 0xff]],0);
- #endif
- setup_pos[0] = P0;
- setup_pos[1] = P1;
- setup_pos[2] = P2;
- setup_pos[3] = P3;
- #ifdef MONE_SETUP
- printf("nn >>>>>run_set_variable OUTn");
- #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));
- //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)
- {
- //printf("nn [init_val_by_record]n");
- //echo: shift to 0 ~ 8
- echo_level = setup_VA[SETUP_VA_ECHO] -2;
- //key: shift to -6 ~ 6
- audio_key = setup_VA[SETUP_VA_KEY] -2 -6;
- //ac3_dynarange 0 ~ 8
- ac3_dynarange = setup_VA[SETUP_VA_DYNAMCRANGE] -2;
- //mic-volume: shift to 0 ~ 8
- #ifdef MIC_2CHANNEL // fake code here
- mic_volume = setup_VA[SETUP_VA_MIC_VOL_2] - 2;
- mic_volume = setup_VA[SETUP_VA_MIC_VOL_1] - 2;
- #else
- mic_volume = setup_VA[SETUP_VA_MIC_VOL] - 2;
- #endif
- #ifdef DYNAMIC_SPECTRUM //zhaoyanhua add 2003-12-3 11:42
- if(setup_VA[SETUP_VA_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,VA;
- int iRts;
- UINT16 unChksum,unTmp;
- BYTE *p;
- UINT32 romSum=0;
- #ifdef MONE_SETUP
- printf("n <load_user_setup> INnn");
- #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_VA[SETUP_VA_RATING]= RATE_DEFAULT;
- NP_PTL_LVL = 8;//zhaoyanhua 2004-3-9 11:32 after UPGRADE, must set parent level is 8.
- }
- #endif
- if (iRts > 0)//read ROM-code-checksum from setup EEPROM(flash)(0-th Byte) ok
- {
- if (romSum==romCheckSum)
- {
- #ifdef Ti3001_OSD_UI_1
- load_amplifier_setup(); // jason add 2-10-5 15:59
- #endif
- /* xyy marked 2004-3-8 11:28
- #if defined(SUPPORT_APOGEE_AMP)&&defined(XINGQIU_DVD_RECEIVER)
- //xyy 2004-1-13 10:04
- load_amp_setup();
- #endif
- */
- //read setup setting from setup EEPROM(4-th Byte)
- p=(BYTE *)setup_VA;
- iRts=ReadFromI2c(0xa0, sizeof(UINT32), p, sizeof(setup_VA));
- /*
- printf("===================================================================n");
- for(i=0; i<64; i++)
- {
- printf("setup_VA[%d] = %xn", i, setup_VA[i]);
- }
- printf("===================================================================n");
- */
- setup_VA2sel();
- //yanlb added 2004/07/07
- #ifdef REMB_3DSOUND
- load_3Dsound(sound_sel,user_osd_set);
- #endif
- }
- else //flash upgrade (romSum!=romCheckSum)
- {
- 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_VA)+2, (BYTE *)&UserSet, sizeof(t_USER_SET));
- #if defined(SUPPORT_DDX8000)//xyy 2004-5-26
- //init_ddx_amp_st();
- //save_amplifier_status_to_e2prom();
- #endif
- #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) // read setup setting from setup EEPROM(4-th Byte) ok
- {
- init_val_by_record();
- dump_setup_val();
- //read setup checksum from setup EEPROM
- iRts=ReadFromI2c(0xa0, sizeof(UINT32)+sizeof(setup_VA), (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");
- }
- }
- else
- {
- printf("read eeprom setup check errorn");
- }
- #ifdef MONE_SETUP
- printf("chksum=%02xn",unChksum);
- #endif
- }
- //set to default, when
- // 1. different ROM-code-checksum(setup-EEPROM vs. ROM)
- // 2.counted setup-checksum != stored in setup EEPROM
- if (iRts < 0)
- {
- #ifdef MONE_SETUP
- printf("nn read eeprom setup menu,fail!! set to default now!!n");
- #endif
- setup_VA[SETUP_VA_REGION_CODE] = REGION_NUM+2; //nono 20031121
- UserSet.P_RCD = REGION_NUM;
- set_default_value();
- run_save_total_sel();
- #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_VA)+2, (BYTE *)&UserSet, sizeof(t_USER_SET));
- if(iRts>0)
- {
- printf("read eeprom system menu,ok!!n");
- printf("nnpassword>>> %dn", UserSet.parent_passwd);
- UserSet.P_RCD = setup_VA[SETUP_VA_REGION_CODE] - 2;
- } else
- {
- printf("read eeprom system menu,fail!!n");
- setup_VA[SETUP_VA_REGION_CODE] = REGION_NUM+2; //Jeff 20021012
- UserSet.P_RCD = REGION_NUM;
- }
- setup_VA[SETUP_VA_REGION_CODE] = UserSet.P_RCD+2;
- /* //marked by JS //20040817
- #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_VA[SETUP_VA_PASSWORD] == (MIN_ITEM_SEL+1) ) {
- UserSet.parental_ststus=C_UNLOCK;
- } else {
- UserSet.parental_ststus=C_LOCK;
- setup_VA[SETUP_VA_PASSWORD] = MIN_ITEM_SEL;
- }
- #ifdef MONE_SETUP
- //printf(">>>>>>load setup menu,outn");
- #endif
- //check password and grade
- #ifdef RATING_8
- if ( (setup_VA[SETUP_VA_RATING]<2) || (setup_VA[SETUP_VA_RATING]>9) ) {
- setup_VA[SETUP_VA_RATING] = 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_VA[SETUP_VA_RATING]<2) || (setup_VA[SETUP_VA_RATING]>4) ) {
- setup_VA[SETUP_VA_RATING] = 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
- setup_VA2sel();
- run_save_total_sel();
- run_save_total_userSet();
- //=================================================================
- #ifdef MONE_SETUP
- //dump_setup_val();
- printf("n <load_user_setup> OUTnn");
- #endif
- }
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- #if 0//ndef DVD_SETUP_REENG
- void show_main_title(int id)
- {
- #ifndef SPE_SETUP //2004-4-22 06:51张宇P
- const char *str;
- int start,len;
- //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
- }
- #endif //end of DVD_SETUP_REENG
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- #if 0//ndef DVD_SETUP_REENG
- 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 {
- 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;
- }
- #endif //end of DVD_SETUP_RENEG
- void setup_func_return_main(void)
- {
- setupLevel=0;
- index_y = 0;
- index_y_start=0;
- ShowSetupPage(1);
- }
- #if 0//ndef DVD_SETUP_REENG
- 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);
- }
- #endif
- //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"
- #else
- #include "setup_tab_ui.c"
- #endif //NEW_STYLE_SETUP
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- void init_setup(void)
- {
- //printf(">>>>> setup_tab.c init_setupn");
- full_scrn=SETUP; //setup menu
- ShowSetupPage(0);
- }
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- #if 0 //ndef DVD_SETUP_REENG
- void setup_DrawItem(BYTE level, BYTE yStart, BYTE updowngray)
- {
- const char *str;
- BYTE xStart, xWidth;
- BYTE xOffset;
- BYTE cFont, cBackground;
- BYTE idString;
- #ifdef SUPPORT_FUNCTION_MENU
- if(full_scrn&SETUP_PLUS)
- {
- if (level==1)
- {
- xStart = SETUP_MENU_XSTART_PLUS;
- #ifdef SUPPORT_DISPLAY_MENU
- if(In_Display_Menu())
- xWidth = DISPLAY_MENU_LENGTH;
- else
- #endif
- xWidth = SETUP_SUB_XSTART_PLUS-SETUP_MENU_XSTART_PLUS-1;
- xOffset = 1;
- idString = id;
- }
- }
- else
- {
- #endif //end #ifdef SUPPORT_FUNCTION_MENU
- if (level==0) {
- xStart = SETUP_MENU_XSTART;
- xWidth = SETUP_MAX_WIDTH-2*SETUP_MENU_XSTART;
- xOffset = 8;
- idString = setup_MainP[page][0];
- } else if (level==1)
- {
- xStart = SETUP_MENU_XSTART;
- xWidth = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- xOffset = 1;
- idString = id;
- } else {
- xStart = SETUP_SUB_XSTART;
- xWidth = SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2;
- xOffset = 1;
- idString = id;
- }
- #ifdef SUPPORT_FUNCTION_MENU
- }
- #endif //end #ifdef SUPPORT_FUNCTION_MENU
- #ifdef SUPPORT_DISPLAY_MENU
- if((In_Display_Menu()) && (index_y == TITLE_TRACK_ITEM)
- && (cd_type_loaded != CDDVD))
- idString = id = setup_item_plus[page][index_y][1] = STR_OS_TRACK;
- else if((In_Display_Menu()) && (index_y == PBC_MENU_ITEM)
- && (cd_type_loaded == CDDVD))
- idString = id = setup_item_plus[page][index_y][1] = STR_OS_MENU;
- #endif
- if (updowngray==0) { //up
- cFont = SFONTCOLOR;
- cBackground = SBGCOLOR;
- } else if (updowngray==1) { //down
- cFont = SANTIFONTCOLOR;
- cBackground = SANTIBGCOLOR;
- } else
- //if (updowngray==2)
- { //gray
- cFont = SGRAYCOLOR;
- cBackground = SBGCOLOR;
- updowngray = 0;
- }
- #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 16:41
- osd_draw_setup_button(xStart, yStart, xWidth, cBackground, updowngray);
- #endif
- /*
- #ifndef BBK_NEW_SETUP//zhaoyanhua add for BBK_DVD
- if (idString==STR_OS_RETURN_MAIN_SETUP) // no main page, so this item changes to exit_setup_menu
- idString=STR_OS_EXIT_MENU;
- #endif
- */
- #ifdef BBK_NEW_SETUP //fengjl edit 4-1-28 14:23
- #if defined(BBK_DSS_555_DVD)||defined(BBK_DV911S)
- if (idString==STR_OS_RETURN_MAIN_SETUP)
- idString=STR_OS_EXIT_MENU;
- #endif
- #else
- if (idString==STR_OS_RETURN_MAIN_SETUP) // no main page, so this item changes to exit_setup_menu
- idString=STR_OS_EXIT_MENU;
- #endif
- #ifdef SUPER_DEFAULT_OSD_LANG
- if((page==CUSTMPAGEINDEX)&&(index_y==CUSTMOSDITEM)&&(setupLevel!=1))
- {
- str = lang_names[osd_font_mode][id];
- }
- else
- #endif
- str = _OsdMessegeFont1[osd_font_mode][idString];
- #ifdef SUPPORT_DISPLAY_MENU
- if((In_Display_Menu()) && (index_y == PBC_MENU_ITEM)
- && (cd_type_loaded == CDDVD))
- {
- BYTE buf[7];
- osd_DrawString(SETUP_MENU_XSTART_PLUS+6, index_y+SETUP_MENU_YSTART_PLUS, str, cFont, cBackground);
- psprintf(buf,"GOTO");
- osd_DrawString(SETUP_MENU_XSTART_PLUS+1, index_y+SETUP_MENU_YSTART_PLUS, buf, cFont, cBackground);
- }
- else
- if(index_y != BATTERY_ITEM)
- #endif//end #ifdef SUPPORT_DISPLAY_MENU
- osd_DrawString(xStart+xOffset, yStart, (char *)str, cFont, cBackground);
- #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-7 18:36
- if(page == VIDEOPAGE)
- {
- if(setup_item[page][index_y][0] == SET_SCALE)
- {
- if(updowngray)
- cFont = 4;//HLCOLOR
- else
- cFont = SFONTCOLOR;
- setup_VideoItemValue(index_y, cFont,SBGCOLOR);//show value with HL color.
- } //draw_3rd_menu();
- }
- #endif //VIDEO_SETUP_NEW_GUI
- #ifdef SUPPORT_DISPLAY_MENU
- if(In_Display_Menu())
- {
- Set_Update_Item_Flag();
- if(updowngray == 1)
- show_display_item_content(index_y,SANTIFONTCOLOR,SANTIBGCOLOR);
- else
- show_display_item_content(index_y,SFONTCOLOR,SBGCOLOR);
- }
- #endif
- }
- #endif // end of DVD_SETUP_REENG
- UINT16 run_save_unChk_cmd(UINT8 save)
- {
- int test,i,j;
- UINT16 unChksum;
- unChksum=0;
- setup_VA2sel();
- for(i=0;i<(MAX_SETUP_PAGE+MAX_CUSTM_SETUP_PAGE);i++) {
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)
- if(i == ONEKEYPASSPAGE)
- continue;
- //not calculate the last item :RETURN_TO_MAIN_PAGE
- for(j=1;j<=(MAX_PAGE_ITEM-1);j++)
- #else
- for(j=1;j<=MAX_PAGE_ITEM;j++)
- #endif
- {
- #ifdef SELECT_MEDIA_IN_SETUPMENU //Maoyong 2004-8-10 17:28 check sum not consider media switch
- if( setup_item[i][j][1]==STR_OS_MEDIA_TYPE )
- 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))
- 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
- unChksum+=(UINT16)(setup_sel[i][j]);
- }
- }
- if(save==1)
- {
- test=WriteToI2c(0xa0, sizeof(UINT32)+sizeof(setup_VA), (BYTE *)&unChksum, 2);
- #ifdef MONE_SETUP
- if(test==1)
- printf("SAVE unChksum=%d,sizeof(setup_VA)=%d OKn",unChksum,sizeof(setup_VA));
- else
- printf("SAVE unChksum=%d,sizeof(setup_VA)=%d ERRORn",unChksum,sizeof(setup_VA));
- #endif
- }
- return unChksum;
- }
- //modified by JS //for setup reengineering //20040810
- //void run_save_sel_cmd(BYTE page,BYTE index)
- void run_save_sel_cmd(BYTE value, BYTE index)
- {
- BYTE *p;
- #ifdef MONE_SETUP
- printf("n SSSSSSSSSSSSS run_save_sel_cmd value:%d index:%dn", value, index);
- #endif
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)
- if(page == ONEKEYPASSPAGE)
- return;
- #endif
- if(index>=MAX_SETUP_VA)
- return;
- //run_save_romChk_cmd();//terry,2003/12/15 05:11PM
- p=(BYTE *)&setup_VA[index];
- WriteToI2c(0xa0, sizeof(UINT32)+index, p, 1);
- run_save_unChk_cmd(1);
- }
- void run_save_total_sel(void)
- {
- BYTE *p;
- //UINT8 setup_VA[64] = {};
- int test;
- #ifdef MONE_SETUP
- printf(">>>>> RUN TOTAL SEL CMDn");
- #endif
- setup_sel2VA();
- /*
- int i;
- for(i=0; i<MAX_SETUP_VA; i++)
- {
- printf("run_save_total_sel>>> setup_VA[%d] = %xn", i, setup_VA[i]);
- }
- */
- //run_save_romChk_cmd();
- p=(BYTE *)setup_VA;
- test=WriteToI2c(0xa0, sizeof(UINT32), p, sizeof(setup_VA));
- run_save_unChk_cmd(1);
- }
- //added by JS //for setup reengineering //20040810
- void run_save_userSet_cmd(UINT8 *update)
- {
- int test;
- #ifdef MONE_SETUP
- printf("!!!run_save_userSet_cmdn");
- #endif
- test=WriteToI2c(0xa0, sizeof(UINT32)+sizeof(setup_VA)+2, update, sizeof(update));
- }
- #ifdef SETUP_DONT_PAUSE//terry,2004/2/23 03:58PM
- UINT8 user_set_write_cnt=sizeof(t_USER_SET);
- void polling_10ms_save(void)
- {
- int test;
- if(user_set_write_cnt<sizeof(t_USER_SET))
- {
- test=WriteToI2c(0xa0, sizeof(UINT32)+sizeof(setup_VA)+2+user_set_write_cnt, (BYTE *)&UserSet+user_set_write_cnt,1);
- user_set_write_cnt++;
- //printf("-%d",user_set_write_cnt);
- }
- }
- #endif
- void run_save_total_userSet(void)
- {
- int test;
- #ifdef NEW_SEARCH_OSD
- // YW:020725
- //sound_type = SETUP_SPK_DOWNMIX;
- //sound_type = ITEM_SPK_DOWNMIX[sound_type];
- //JS 20040820 //for setup reengineering
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_DOWNMIX_SETUP);
- I=P&0xff;
- P=P>>8;
- sound_type=setup_item[P][I][setup_VA[SETUP_VA_DOWNMIX]];
- #endif
- #ifdef MONE_SETUP
- printf("!!!run_save_total_userSetn");
- #endif
- #ifdef SETUP_DONT_PAUSE//4-2-14 13:45
- user_set_write_cnt=0;
- printf("sizeof(t_USER_SET):%dn",sizeof(t_USER_SET));
- //polling_10ms_save();
- #else
- test=WriteToI2c(0xa0, sizeof(UINT32)+sizeof(setup_VA)+2, (BYTE *)&UserSet, sizeof(t_USER_SET));
- #endif
- #ifdef MONE_SETUP
- /*
- {
- int i, j;
- for (i=0; i<4; i++) {
- for (j=0; j<7; j++) {
- printf("setup_sel[%d][%d]=%dn", i, j, setup_sel[i][j]);
- }
- }
- }
- */
- #endif
- }
- void setup_save_exit(void)
- {
- if (cd_type_loaded==CDDVD)
- nav_param_by_user();
- /* //marked by JS 20040820
- if (full_scrn&CUSTM) {
- SETUP_GRADE = SETUP_CUSTM_GRADE;
- }
- */
- run_save_total_userSet();
- }
- int setup_IsLock()//nono 20020707
- {
- if ( UserSet.parental_ststus==C_LOCK)
- return 1;
- else
- return 0;
- }
- #if 0//ndef DVD_SETUP_REENG
- void show_lock(int s,int mode)
- {
- //s : 0:lock 1:unlock
- //mode : 0:normal 1:ANTI
- int font,bg;
- const char *str;
- UserSet.parental_ststus=s;
- setup_sel[page][index_y] = (MIN_ITEM_SEL+s);
- if(mode)
- {
- font=SANTIFONTCOLOR;
- bg=SANTIBGCOLOR;
- }
- else
- {
- #ifdef JIEKE_DVD
- font = SBLACKCOLOR;
- #else
- font = SFONTCOLOR;
- #endif
- bg = SBGCOLOR;
- }
- str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK+s];
- #ifdef TONIC_DVD
- if(ShowPasswordErr==0)
- osd_DrawString(SETUP_SUB_XSTART+1, submenuStart+1, (char *)str , font, bg);
- else
- osd_DrawString(SETUP_SUB_XSTART+1, submenuStart+1, "ERROR" , font, bg);
- #else//#ifdef TONIC_DVD
- osd_DrawString(SETUP_SUB_XSTART+1, submenuStart+1, (char *)str , font, bg);
- #endif//#ifdef TONIC_DVD
- }
- #endif
- #if 0//ndef SETUP_DVD_REENG
- const char * setup_SetItemString()
- {
- const char *str;
- if(page==LANGPAGE)
- {
- if (id==STR_OS_OFF)
- str = _OsdMessegeFont1[osd_font_mode][id];
- else
- str = lang_names[osd_font_mode][id];
- }
- #ifdef SUPER_DEFAULT_OSD_LANG
- else if((page==CUSTMPAGEINDEX)&&(index_y==CUSTMOSDITEM))
- str = lang_names[osd_font_mode][id];
- #endif
- else
- str = _OsdMessegeFont1[osd_font_mode][id];
- return str;
- }
- #endif
- void setup_password(void)
- {
- setup_setPasswd();
- }
- void show_password(BYTE num)
- {
- setup_showPasswd(num);
- }
- void reset_passwd_cnt(void) /*jhuang 2001/5/17 05:13PM*/
- {
- tmp_passwd = 0;
- digit_cnt = 0;
- }
- void read_custm_setup_select(void)
- {
- reset_passwd_cnt(); /*jhuang pending 2001/5/15 08:16PM*/
- UserSet.parental_ststus=C_UNLOCK;
- /* //marked by JS 20040820
- SETUP_CUSTM_GRADE=SETUP_GRADE;
- page=CUSTMPAGEINDEX;
- */
- }
- #ifdef RCD_GPIO_CONTROL
- #define RCD_GPIO (1<<GPIO_N)
- #define is_gpio_high (regs0->gpio_in[GPIO_N/16]&RCD_GPIO)
- void set_region(void)
- {
- regs0->gpio_master[GPIO_N/16] |= RCD_GPIO;
- regs0->gpio_oe[GPIO_N/16] &= ~RCD_GPIO;
- if (is_gpio_high)
- NP_P_RCD=0;
- else
- NP_P_RCD=0x01<<(CUS_RCD-1);
- }
- #else
- void set_region(void)
- {
- UINT8 i,region;
- if(UserSet.P_RCD)
- {
- NP_P_RCD= 0x01 << (UserSet.P_RCD-1);
- }else
- {
- #ifdef NAV_DBG
- printf("Region code:%xn",pDSV->VMG_CAT_RM);
- #endif
- NP_P_RCD=0; //terry,2002/5/29 06:58PM
- for(i=0,region=1;i<8;i++)
- {
- if( !(pDSV->VMG_CAT_RM&(region<<i)) )
- {
- NP_P_RCD=0x01 << i;
- #ifdef NAV_DBG
- printf("Region code:%xn",i);
- #endif
- break;
- }
- }
- #ifdef BBK_DVD//terry,2003/11/18 04:48PM
- if(pDSV->VMG_CAT_RM==0) NP_P_RCD=0x4;//terry,2003/11/18 04:44PM,for CONAIR,BBK
- #endif
- }
- }
- #endif
- void setup_ShowVolCtrlConfig()
- {
- return;
- #if 0
- const char *str;
- BYTE fontColor;
- BYTE i;
- if ( (page!=AUDPAGE) ||
- (index_y!=DIGIOUTITEM)
- )
- {
- return;
- }
- if (SETUP_SPDIF!=SPDIFBITSTREAM) {
- fontColor = SFONTCOLOR;
- } else {
- if ( (coding_mode_now&(AUDIF_CODING_MODE_DTS|
- AUDIF_CODING_MODE_DTSCD|
- //AUDIF_CODING_MODE_PCM| //DTSCD-BITSTREAM MODE, Jeff 20020719
- AUDIF_CODING_MODE_AC3)
- )||(cd_subtype==CD_DTS) )//nono 2-7-25 17:29
- {
- fontColor = SFONTCOLOR;
- //fontColor = SGRAYCOLOR;
- } else {
- fontColor = SFONTCOLOR;
- }
- }
- for (i=VOLCTRLSTART; i<=VOLCTRLEND; i++) {
- if (coding_mode_now==AUDIF_CODING_MODE_LPCM) { //Jeff 20020703
- if (i==KEYITEM) {
- fontColor = SFONTCOLOR;
- //fontColor = SGRAYCOLOR;
- } else {
- fontColor = SFONTCOLOR;
- }
- } else
- if ( (SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF) &&
- (i==KEYITEM)
- )
- {
- if( ( coding_mode_now&(AUDIF_CODING_MODE_DTS| AUDIF_CODING_MODE_DTSCD|AUDIF_CODING_MODE_AC3|AUDIF_CODING_MODE_LPCM) )||(cd_subtype==CD_DTS) )//nono 2-8-5 15:05
- {
- fontColor = SFONTCOLOR;
- //fontColor = SGRAYCOLOR;
- } else {
- fontColor = SFONTCOLOR;
- }
- }
- #ifdef KARAOKE_MENU //wangfeng 2003-10-30 10:19
- if((page==AUDPAGE)&&(KARAOKE_MENU_FLAG)&&((i<2)||(i>5)))
- {
- fontColor = SBGCOLOR;
- }
- //wangfeng 2003-11-11 14:06
- else if((page==AUDPAGE)&&(KARAOKE_MENU_FLAG==0)&&((i>=2)&&(i<=5)))
- {
- fontColor = SBGCOLOR;
- }
- #ifdef PROLOGIC_ON_51CH//wangfeng 2003-12-22 16:40
- else if ((page==AUDPAGE)&&(KARAOKE_MENU_FLAG==0)
- && !setup_IsSpkDownmixOff()&&(i==1))
- {
- fontColor = SGRAYCOLOR;
- }
- #endif
- else
- #endif
- id = setup_item[page][i][1];
- #ifdef TONIC_DVD
- if(id==STR_OS_RETURN_MAIN_SETUP)
- id=STR_OS_EXIT_MENU;
- #endif//#ifdef TONIC_DVD
- str = _OsdMessegeFont1[osd_font_mode][id];
- osd_DrawString(SETUP_MENU_XSTART+1, i+SETUP_MENU_YSTART+1, str, fontColor, SBGCOLOR);
- }
- #endif
- }
- //To do speaker(AC3) config
- void setup_ShowAC3Config()
- {
- return;
- #if 0
- BYTE buf[40];
- BYTE fontColor;
- BYTE i;
- if ( (page!=MULTISPKPAGE) ||
- (setupLevel!=2) ||
- (index_y!=AC3DOWNMIXITEM)
- )
- {
- return;
- }
- #if defined(ONLY_DOWNMIXOFF_CAN_SET_CE_RE)//2003-8-13 23:32
- if (SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF) { //set to 5.1 channel
- fontColor = SFONTCOLOR;
- } else
- {
- fontColor = SGRAYCOLOR;
- }
- #elif !defined(SETUP_ALL_VALID)
- if ( (SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF) && (SETUP_SPDIF==SPDIFSIMULATE) ) { //set to 5.1 channel
- fontColor = SFONTCOLOR;
- } else
- {
- fontColor = SGRAYCOLOR;
- }
- #elif defined(SET_FCR_SPEAKER)//XYY 2004-10-23 10:47
- if (SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF) { //xulf 2004-01-06
- fontColor = SFONTCOLOR;
- } else
- {
- fontColor = SGRAYCOLOR;
- }
- #else
- fontColor = SFONTCOLOR;
- #endif
- for (i=SPKSTART; i<=SPKEND; i++) {
- id = setup_item[page][i][1];
- psprintf(buf, "%s", _OsdMessegeFont1[osd_font_mode][id]);
- osd_DrawString(SETUP_MENU_XSTART+1, i+SETUP_MENU_YSTART+1, buf, fontColor, SBGCOLOR);
- }
- #endif
- }
- int setup_IsSet2SPDIF_PCM()
- {
- UINT16 P,I;
- #ifdef DIVIDE_AC3_DTS_SPDIF_OUTPUTS
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- if (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_STEREO_PCM)
- #else
- P=setup_getItemPos(STR_OS_AUD_OUT);
- I=P&0xff;
- P=P>>8;
- if (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_STEREO_PCM)
- #endif
- return 1;
- return 0;
- }
- void setup_SetAC3PCMConfig()//nono 2004-8-3 22:41
- {
- #if !defined(SPHE8202)
- if( (cd_type_loaded==CDDVD)&&(coding_mode_now == AUDIF_CODING_MODE_AC3)&&(setup_IsSet2SPDIF_PCM()==1) )//nono 4-5-26 21:49
- {
- AUDIF_Set_OutputMode(OUT_51DownmixLtRt, 0);//2004AUDDRV AudioSetOutputMode(8, 0); //Set Output mode(7:2 channel)
- }
- #endif
- }
- void setup_SetAC3Config()
- {
- //BYTE newid, newsel;
- //set speaker setting
- /*newsel = SETUP_SPK_DOWNMIX;
- newid = ITEM_SPK_DOWNMIX[newsel];
- #ifdef NEW_SEARCH_OSD
- // YW:020725
- sound_type = newid;
- #endif
- //to run speaker setup downmix mode
- // run twice to prevent from losing the very 1st cmd, we have to check risc-dsp to see
- // why the 1st cmd lost by curr handshake, status report okay, ??????, 2003-05-13
- exe_setup_function( ITEM_SPK_DOWNMIX[1], newid, 0);
- exe_setup_function( ITEM_SPK_DOWNMIX[1], newid, 0);*/
- printf("ac3 setup function ..STR_OS_DOLBY_OP_SETUP:%x STR_OS_DUAL_MONO_SETUP:%xn",STR_OS_DOLBY_OP_SETUP,STR_OS_DUAL_MONO_SETUP);
- //set AC3 digital setting
- //newsel = SETUP_AC3DIGITAL_OUTMODE;
- //newid = ITEM_AC3DIGITAL_OUTMODE[newsel];
- UINT16 P, I;
- P=setup_getItemPos(STR_OS_DOLBY_OP_SETUP);
- I=P&0xff;
- P=P>>8;
- //printf("ITEM_AC3DIGITAL_OUTMODE[1]:%x out: newsel:%x newid:%xn",ITEM_AC3DIGITAL_OUTMODE[1],newsel,newid);
- //exe_setup_function( ITEM_AC3DIGITAL_OUTMODE[1], newid, 0);
- //exe_setup_function( STR_OS_DOLBY_OP_SETUP, newid, 0);
- exe_setup_function( STR_OS_DOLBY_OP_SETUP, setup_item[P][I][setup_VA[SETUP_VA_DOLBY_OP]], 0);
- if (setup_VA[SETUP_VA_DOLBY_OP] == MIN_ITEM_SEL) {
- set_AC3DynamicRange();
- }
- //newsel = SETUP_AC3DIGITAL_LnR;
- //newid = ITEM_AC3DIGITAL_LnR[newsel];
- //printf("ITEM_AC3DIGITAL_OUTMODE[1]:%x out: newsel:%x newid:%xn",ITEM_AC3DIGITAL_LnR[1],newsel,newid);
- //exe_setup_function( ITEM_AC3DIGITAL_OUTMODE[1], newid, 0);
- P=setup_getItemPos(STR_OS_DUAL_MONO_SETUP);
- I=P&0xff;
- P=P>>8;
- exe_setup_function( STR_OS_DUAL_MONO_SETUP, setup_item[P][I][setup_VA[SETUP_VA_DUAL_MONO]], 0); //axelchen 20040105 Panasonic 瑈ē
- //terry,2004/6/30 04:57PM
- //set center speaker delay, 1:center speaker
- AUDIF_Set_SpkDelay(1, setup_VA[SETUP_VA_CSPK_DELAY]-2);//2004AUDDRV AudioSetSpkDelay(1, setup_VA[SETUP_VA_CSPK_DELAY]-2);
- //set surround speaker delay, 2:surround speaker
- AUDIF_Set_SpkDelay(2, (setup_VA[SETUP_VA_SSPK_DELAY]-2)*3);//2004AUDDRV AudioSetSpkDelay(2, (setup_VA[SETUP_VA_SSPK_DELAY]-2)*3);
- }
- #ifdef QSI_SETUP_MENU//liweihua add 2004-6-15
- UINT16 safe_wait_time = 1* 60 * 100;
- BYTE select_save_time(BYTE res)
- {
- BYTE i;
- UINT16 save_time[]={1* 60 * 100, 5* 60 * 100, 10* 60 * 100, 30* 60 * 100};
- if(res <= 5)
- {
- safe_wait_time = save_time[res-2];
- res = 1;
- }
- else
- res=0;
- return res;
- }
- #endif
- BYTE setup_GetSSaveType()
- {
- // In stup menu, we use screen saver item as the auto play item
- // when AUTO_PLAY, always return 1 ==> screen saver always turn on
- #ifdef AUTO_PLAY
- #ifdef JIEKE_DVD//no saver, wangfeng 2003-10-28 11:19
- return 0;
- #else
- return 1;
- #endif
- #else
- BYTE res;
- res = setup_VA[SETUP_VA_SSAVER];//SETUP_SSAVER;
- if (res < 2) res=2;
- #ifdef QSI_SETUP_MENU//liweihua add for SQI 2004-6-15
- res = select_save_time(res);
- #else
- if (res==2) {
- res = 1;
- } else {
- res = 0;
- }
- #endif
- return res;
- #endif
- }
- //=============================================
- //for DVD_SETUP_REENG //added by JS //20040728
- #if 0//ndef DVD_SETUP_REENG
- //up1down : 0 -> up, 1-> down
- #define X_60 SETUP_SUB_XSTART*16+60
- #define X_76 SETUP_SUB_XSTART*16+76
- #define X_94 SETUP_SUB_XSTART*16+94
- #define X_96 SETUP_SUB_XSTART*16+96
- #define Y_0 SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT
- #define Y_8 SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+8
- void setup_DrawScaleItem(BYTE id, BYTE up1down, int val)
- {
- BYTE uColor, dColor;
- BYTE fontColor, bgColor;
- BYTE clrCursorColor;// to clear cursor. zhaoyanhua add 2003-12-16 10:56
- UINT32 yStart=0, yDelta=0;
- UINT32 yNew, yNew_8;
- if (up1down) {
- uColor = SBLACKCOLOR;
- dColor = SWHITECOLOR;
- #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 17:45
- fontColor = SFONTCOLOR;
- bgColor = SANTIFONTCOLOR;
- #else
- fontColor = SANTIFONTCOLOR;
- bgColor = SANTIBGCOLOR;
- #endif
- #ifdef HL_CURSOR_ONLY//zhaoyanhua add 2003-12-16 10:58
- clrCursorColor = SBGCOLOR;
- #else
- clrCursorColor = SANTIBGCOLOR;
- #endif
- } else {
- uColor = SWHITECOLOR;
- dColor = SBLACKCOLOR;
- fontColor = SFONTCOLOR;
- #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 17:45
- bgColor = SDEFAULTCOLOR;
- #else
- bgColor = SBGCOLOR;
- #endif
- clrCursorColor = SBGCOLOR;
- }
- if (id==STR_OS_ECHO) {//echo_level(0 ~ 8)
- //yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+26;
- //yDelta = 5 * SETUP_BUTTON_HEIGHT-30;
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 5 * SETUP_BUTTON_HEIGHT-16;
- } else
- #ifdef Ti3001_OSD_UI_2
- if ((id==STR_OS_AMP_MAINVOLUME)||(id==STR_OS_AMP_FSPK)||(id==STR_OS_AMP_FSPK_BALANCE)||
- (id==STR_OS_AMP_SSPK)||(id==STR_OS_AMP_SSPK_BALANCE)||(id==STR_OS_AMP_CSPK)||(id==STR_OS_AMP_SUBWOOFER))
- {//level(1 ~ 15)
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 8 * SETUP_BUTTON_HEIGHT-16; //中间刻度线的长度。2-8-27 9:59 gerry
- } else
- if ((id==STR_OS_AMP_BASS)||(id==STR_OS_AMP_TREMBLE))
- {//level(1 ~ 15)
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 7 * SETUP_BUTTON_HEIGHT-16;
- } else
- if (id==STR_OS_AMP_DYNAMICRANGE)
- {//level(1 ~ 15)
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 7 * SETUP_BUTTON_HEIGHT-16;
- } else
- #endif
- if (id==STR_OS_KEY) {//audio_key(-6 ~ 6)
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 7 * SETUP_BUTTON_HEIGHT-16;
- val+=6;
- } else
- if (id==STR_OS_MIC_VOL||id==STR_OS_MIC_VOL_1||id==STR_OS_MIC_VOL_2) {//mic_volume(0 ~ 8)
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;//wangfeng 2003-09-12 20:30
- yDelta = 5 * SETUP_BUTTON_HEIGHT-16;
- } else
- if ( (id==STR_OS_FSPK) || (id==STR_OS_CSPK) || (id==STR_OS_SSPK) ) { //0 ~ 8
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 5 * SETUP_BUTTON_HEIGHT-16;
- //val=0;
- } else
- if ( (id==STR_OS_CSPK_DELAY) || (id==STR_OS_SSPK_DELAY) ) { //0 ~ 5
- #ifdef NO_SHOW_ADD_ICON//zhaoyanhua add 2003-12-9 17:18
- yStart = (SETUP_MENU_YSTART+2)*SETUP_BUTTON_HEIGHT+18;
- yDelta = 4 * SETUP_BUTTON_HEIGHT-30-2;
- #else
- yStart = (SETUP_MENU_YSTART+2)*SETUP_BUTTON_HEIGHT+24;
- yDelta = 4 * SETUP_BUTTON_HEIGHT-30;
- #endif
- //val=0;
- } else
- if (id==STR_OS_DYNAMICRANGE) {
- yStart = SETUP_MENU_YSTART*SETUP_BUTTON_HEIGHT+12;
- yDelta = 5 * SETUP_BUTTON_HEIGHT-16;
- }
- else if (id == STR_OS_BRIGHTNESS ||
- id == STR_OS_CONTRAST ||
- id == STR_OS_HUE ||
- #ifdef ADD_DVI311_SETUP
- id == STR_OS_DVI311_MODE ||
- #endif
- id == STR_OS_SATURATION)
- {
- yStart = SETUP_MENU_YSTART * SETUP_BUTTON_HEIGHT + 12;
- yDelta = 7 * SETUP_BUTTON_HEIGHT - 16;
- }
- #ifdef DIP_CFG_ENABLE
- else if (id == STR_OS_DEINTLC)
- {
- yStart = (SETUP_MENU_YSTART+1) * SETUP_BUTTON_HEIGHT + 12;
- yDelta = 4 * SETUP_BUTTON_HEIGHT - 16;
- }
- #endif//#ifdef DIP_CFG_ENABLE
- //osd_draw_rect(X_60, yStart+32, 36, yDelta, bgColor); // alan, 2003/08/06
- //osd_DrawLine(X_76, yStart+28, X_76, yStart+yDelta+32, fontColor, 3); // alan, 2003/08/06
- #ifdef ADD_DVI311_SETUP
- if(id==STR_OS_DVI311_MODE)
- yNew = yStart+yDelta-16 - (val*SETUP_BUTTON_HEIGHT);
- else
- #endif
- yNew = yStart+yDelta-16 - (val*SETUP_BUTTON_HEIGHT/2);
- #ifdef NO_SHOW_ADD_ICON//zhaoyanhua add 2003-12-9 17:41
- if ( (id==STR_OS_CSPK_DELAY) || (id==STR_OS_SSPK_DELAY) )
- yNew+=32+8;
- else
- #endif
- yNew+=32;
- yNew_8=yNew+8;
- // alan,3-8-6 14:34
- {
- UINT32 yyStart,yyLen;
- if ( (yNew-20)<(yStart+32) )
- yyStart=yStart+32;
- else
- yyStart=yNew-20;
- if ( (yNew-20+8+40)>(yStart+32+yDelta) )
- {
- UINT32 diff=(yNew-20+8+40)-(yStart+32+yDelta);
- yyLen=8+40-diff;
- } else
- yyLen=8+40;
- //osd_draw_rect(X_60-4, yNew-20, 32+8, 8+40, bgColor);
- //osd_draw_rect(X_60-4, yyStart, 32+8, yyLen, bgColor);
- #ifdef NO_SHOW_ADD_ICON//zhaoyanhua add 2003-12-9 17:41
- if ( (id==STR_OS_CSPK_DELAY) || (id==STR_OS_SSPK_DELAY) )
- osd_draw_rect(X_60-4, yyStart-2-8, 32+8, yyLen+10+4,clrCursorColor);
- else
- #endif
- #ifdef ADD_DVI311_SETUP
- if(id == STR_OS_DVI311_MODE) //clear Cursor Color
- {
- osd_draw_rect(X_60+30-4, 108-2, 32+8, 48, clrCursorColor);
- osd_draw_rect(X_60+30-4, 120-2, 32+8, 48, clrCursorColor);
- osd_draw_rect(X_60+30-4, 152-2, 32+8, 48, clrCursorColor);
- osd_draw_rect(X_60+30-4, 184-2, 32+8, 48, clrCursorColor);
- osd_draw_rect(X_60+30-4, 216-2, 32+8, 48, clrCursorColor);
- osd_draw_rect(X_60+30-4, 248-2, 32+8, 48, clrCursorColor);
- osd_draw_rect(X_60+30-4, 280-2, 32+8, 36, clrCursorColor);
- }
- else
- #endif