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

📄 setup_tab_reeng.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 5 页
字号:
    } 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,out\n");
    #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("\n\n====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>  OUT\n\n");
    #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_setup\n");

    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

⌨️ 快捷键说明

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