setup_newstyle_ui.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:70k
- /*************************************************
- * setup_newstyle_ui.c
- *
- * include when NEW_STYLE_SETUP for GBM
- *
- * UI function:
- * LEFT,RIGHT, UP, DOWN, SELECT, ShowSetupPage.
- *
- * Creator: zhaoyanhua
- * Date: 3-7-25 17:12
- **************************************************/
- #ifdef SDRAM_16Mb_Mode//zhaoyanhua add 2003-11-10 16:33
- #include "memmap.h"
- #include "memmap0.h"
- #endif
- void ShowCUSTMMsg(void);
- void ShowCurrentPage_for_NTSC(int page);
- void ShowCurrentPage_for_PAL(int page);
- void draw_setup_Btn_HL(UINT8 r, int xStart, int yStart, int xLen, int yLen );
- #ifdef IR_KEY_SET_VIDEO_MODE
- #ifdef SET_4_VIDEO_MODE
- #define VIDEO_MODE_VAL_DEFAULT 3
- #else//#ifdef SET_4_VIDEO_MODE
- #define VIDEO_MODE_VAL_DEFAULT 0
- #endif//#ifdef SET_4_VIDEO_MODE
- #endif//#ifdef IR_KEY_SET_VIDEO_MODE
- #if defined(GBM_DVD)&&!defined(GBM_FULL_FUNCTION)&&!defined(USER_MPEG_LOGO)
- #undef SAME_DISC_RESUME
- #endif
- #define NTSC_AUDIO_YSTART 2
- #define NTSC_LAN_YSTART 163
- #define NTSC_VIDEO_YSTART 4
- #define NTSC_SYSTEM_YSTART 235
- #define NTSC_EXIT_YSTART 221
- #define PAL_AUDIO_YSTART 0
- #define PAL_LAN_YSTART 185-HL_OFFSET+5+3
- #define PAL_VIDEO_YSTART 5-3
- #define PAL_SYSTEM_YSTART 265-HL_OFFSET+5+3
- #define PAL_EXIT_YSTART 251-HL_OFFSET+15
- #define HL_XSTART_OFFSET 3
- #define HL_OFFSET 20
- /*
- ** FUNC: Show the Highlight (hand icon)
- ** and setup menu in current page.
- **
- ** zhaoyanhua
- ** date: 3-7-14 10:44
- */
- void ShowCurrentPage_for_NTSC(int page)
- {
- #ifdef MONE_SETUP
- printf("&&&&-------SHOW CURRENt page ! page = %dn",page);
- #endif
- if (page ==3)
- {
- osd_tog_region(0,OSD_ON);
- //osd_tog_region(2,OSD_OFF);
- }
- else if ((page == 0) || (page == 7))
- {
- osd_tog_region(0,OSD_OFF);
- //osd_tog_region(2,OSD_ON);
- }
- else
- {
- osd_tog_region(0,OSD_OFF);
- //osd_tog_region(2,OSD_OFF);
- }
-
- /*
- char *str1 = "PRESS";
- memset(linebuf,0,100);
- osd_DrawString(0, 0, str1, 11, 0);
- */
- switch (page)
- {
- case SYSPAGE:
-
- draw_setup_Btn_HL(1, 227+HL_OFFSET-HL_XSTART_OFFSET,NTSC_SYSTEM_YSTART , 140-HL_OFFSET, 67);
-
- break;
- case LANGPAGE:
-
- draw_setup_Btn_HL(1, 8+HL_OFFSET-HL_XSTART_OFFSET , NTSC_LAN_YSTART, 140-HL_OFFSET, 67);
-
- break;
- case AUDPAGE:
-
- draw_setup_Btn_HL(1, 8+HL_OFFSET-HL_XSTART_OFFSET, NTSC_AUDIO_YSTART , 140-HL_OFFSET,67);
-
- break;
- case MULTISPKPAGE:
-
- draw_setup_Btn_HL(1, 450+HL_OFFSET-HL_XSTART_OFFSET , NTSC_AUDIO_YSTART, 140-HL_OFFSET, 67);
-
- break;
- case AC3DIGITALPAGE:
- draw_setup_Btn_HL(1, 450+HL_OFFSET-HL_XSTART_OFFSET, NTSC_LAN_YSTART , 140-HL_OFFSET, 67);
-
- break;
- case VIDEOPAGE:
-
- draw_setup_Btn_HL(0, 18+HL_OFFSET-HL_XSTART_OFFSET, NTSC_VIDEO_YSTART , 140-HL_OFFSET, 67);
-
- break;
- case EXITPAGE :
- {
- osd_draw_rect(0, 0, 38*16, 9*SETUP_BUTTON_HEIGHT+24, 0);
- osd_DrawIcon(445, NTSC_EXIT_YSTART , 0,page);
-
- break;
- }
- default: break;
- }
- #ifdef ROLL_SHOW_SETUP
- if(page != EXITPAGE)//nono 20030919
- //show osd msg from BUTTON start to BUTTON end.
- MoveBuf2OSD(SETUP_MENU_XSTART+10, (SETUP_MENU_XSTART+10)+(SETUP_SUB_XSTART-SETUP_MENU_XSTART-1));
- #endif
- }
- void ShowCurrentPage_for_PAL(int page)
- {
- #ifdef MONE_SETUP
- printf("&&&&-------SHOW CURRENt page ! page = %dn",page);
- #endif
- if (page ==3)
- {
- osd_tog_region(0,OSD_ON);
- //osd_tog_region(2,OSD_OFF);
- }
- else if ((page == 0) || (page == 7))
- {
- osd_tog_region(0,OSD_OFF);
- //osd_tog_region(2,OSD_ON);
- }
- else
- {
- osd_tog_region(0,OSD_OFF);
- //osd_tog_region(2,OSD_OFF);
- }
- /*
- char *str1 = "PRESS";
- memset(linebuf,0,100);
- osd_DrawString(0, 0, str1, 11, 0);
- */
- switch (page)
- {
- case SYSPAGE:
-
- draw_setup_Btn_HL(1, 227+HL_OFFSET-HL_XSTART_OFFSET, PAL_SYSTEM_YSTART, 140-HL_OFFSET, 70);
-
- break;
- case LANGPAGE:
-
- draw_setup_Btn_HL(1, 8+HL_OFFSET-HL_XSTART_OFFSET, PAL_LAN_YSTART, 140-HL_OFFSET, 70);
-
- break;
- case AUDPAGE:
-
- draw_setup_Btn_HL(1, 8+HL_OFFSET-HL_XSTART_OFFSET, PAL_AUDIO_YSTART, 140-HL_OFFSET,70);
-
- break;
- case MULTISPKPAGE:
-
- draw_setup_Btn_HL(1, 450+HL_OFFSET, PAL_AUDIO_YSTART, 140-HL_OFFSET, 70);
-
- break;
- case AC3DIGITALPAGE:
-
- draw_setup_Btn_HL(1, 450+HL_OFFSET, PAL_LAN_YSTART, 140-HL_OFFSET, 70);
-
- break;
- case VIDEOPAGE:
-
- draw_setup_Btn_HL(0, 18+HL_OFFSET-HL_XSTART_OFFSET, PAL_VIDEO_YSTART, 140-HL_OFFSET, 70);
-
- break;
- case EXITPAGE :
- {
- osd_draw_rect(0, 0, 38*16, 13*SETUP_BUTTON_HEIGHT+10, 0);
- osd_DrawIcon(445, PAL_EXIT_YSTART, 0,page);
-
- break;
- }
- default: break;
- }
- #ifdef ROLL_SHOW_SETUP
- if(page != EXITPAGE)//nono 20030919
- MoveBuf2OSD(SETUP_MENU_XSTART+10, (SETUP_MENU_XSTART+10)+(SETUP_SUB_XSTART-SETUP_MENU_XSTART-1));
- #endif
- }
- /*
- ** FUNC: to rewrite the infomation in CUSM when Rating_8.
- **
- ** zhaoyanhua
- ** Date: 3-7-25 17:55
- */
- void ShowCUSTMMsg(void)
- {
- BYTE buf[40];
- BYTE *pVersion;
- extern const UINT8 ServoVersion[];
- int i=0;
- pVersion = (BYTE *)(ROM_BASE_UNCACHED);
- //show ROM code checksum
- buf[0]= '[';
- for (i=0x40; i<0x44; i++)
- {
- BYTE ch[3];
- psprintf(ch,"%02x",*(pVersion+i));
- buf[2*i-126]=ch[1];
- buf[2*i-127]=ch[0];
- }
- buf[9]= ']';
- buf[10]= 0;
- osd_DrawString(SETUP_SUB_XSTART+6, SETUP_MENU_YSTART+2, buf, SFONTCOLOR, SBGCOLOR);
- //ServoVersion[16]=0; can't write to const data
- osd_DrawString(SETUP_SUB_XSTART, SETUP_MENU_YSTART, ServoVersion, SFONTCOLOR, SBGCOLOR);
- //show some "codes" strings
- for (i=0x50; i<0x58; i++) { //Extend version string length to 8 Bytes, Jeff 20020715
- buf[i-0x50] = *(pVersion+i);
- }
- buf[8]= 0; //Extend version string length to 8 Bytes, Jeff 20020715
- osd_DrawString(SETUP_SUB_XSTART, SETUP_MENU_YSTART+1, buf, SFONTCOLOR, SBGCOLOR);
- //add build version, Jeff 20021008
- psprintf(buf, "%s", VERSION_STRING);
- osd_DrawString(SETUP_SUB_XSTART+8, SETUP_MENU_YSTART+1, buf, SFONTCOLOR, SBGCOLOR);
- //psprintf(buf, "%c SUM:", regs0->stamp+'A');
- //psprintf(buf, "%c SUM:", (regs0->stamp&0x7f)+'A');//4-8-26 16:06
- psprintf(buf, "%02x%03x", (regs0->stamp & 0xff),get_iop_b_status()); //2004/11/30 ycwen
- osd_DrawString(SETUP_SUB_XSTART, SETUP_MENU_YSTART+2, buf, SFONTCOLOR, SBGCOLOR);
-
- }
- /*
- **FUNC : draw a rect border to show which button is select.
- **
- ** zhaoyanhua
- ** Date: 2003-07-22 15:49
- */
- void draw_setup_Btn_HL(UINT8 r, int xStart, int yStart, int xLen, int yLen )
- {
- osd_draw_region_rect(xStart, yStart, xLen, yLen, BUTTON_COLOR, r);
- osd_draw_region_rect(xStart+4, yStart+4, xLen-8, yLen-8, 0, r );
- }
- void setup_func_down(void)
- {
- const char *str;
- int i;
-
- reset_passwd_cnt();
- SetOsdCol(0,0,SANTIBGCOLOR,0xa346ffc0);
- if (setupLevel==0) { //main menu page
-
- /*
- if ( (page==AC3DIGITALPAGE) && ( (SETUP_SPDIF==SPDIFBITSTREAM) || (coding_mode_now!=AUDIF_CODING_MODE_AC3) ) )
- {
- page--;
- }
- if ( (page==MULTISPKPAGE) && (cd_type_loaded!=CDDVD) && ( coding_mode_now&(~(AUDIF_CODING_MODE_AC3|AUDIF_CODING_MODE_DTS|AUDIF_CODING_MODE_DTSCD)) ) )
- {
- page--;
- } else if ( (page==MULTISPKPAGE) && (SETUP_SPDIF!=SPDIFSIMULATE) )
- {
- page--;
- }
- #ifdef TWO_CHANNEL_ONLY
- if (page==MULTISPKPAGE) page--;
- #endif//SetMovePointer(38, 15);//system Button
-
- */
- return;
- } else
- if (setupLevel==1) {
- //second level menu page
- if ( (index_y+index_y_start) < (setupItemNum[1]-1)) {
- if (full_scrn&CUSTM) {
- //CUSTM menu page
- //clear third-level menu
- #ifdef RATING_8
- if (index_y == 3)
- {
- osd_draw_rect((SETUP_SUB_XSTART-1)*16,
- SETUP_MENU_YSTART,
- (SETUP_MAX_WIDTH-SETUP_SUB_XSTART-1)*16,
- 8*SETUP_BUTTON_HEIGHT,//(SETUP_MAX_LINE-SETUP_MENU_YSTART-2)*SETUP_BUTTON_HEIGHT,
- SBGCOLOR);
- ShowCUSTMMsg();
-
- }
- else
- #endif//end RAGING_8
- {
- osd_draw_rect((SETUP_SUB_XSTART-1)*16,
- (SETUP_MENU_YSTART+3)*SETUP_BUTTON_HEIGHT,
- (SETUP_MAX_WIDTH-SETUP_SUB_XSTART-1)*16,
- 7*SETUP_BUTTON_HEIGHT,//(SETUP_MAX_LINE-SETUP_MENU_YSTART-2)*SETUP_BUTTON_HEIGHT,
- SBGCOLOR);
- }
-
- id = setup_item[page][index_y][1];
- setup_DrawItem(1, index_y+SETUP_MENU_YSTART+1, 0);
- index_y++;
- id = setup_item[page][index_y][1];
- setup_DrawItem(1, index_y+SETUP_MENU_YSTART+1, 1);
- //the last active item in sub-menu is "EXIT", so we skip it's drawing selection area
- #ifdef RCD_GPIO_CONTROL // alan 2002/7/26 02:08