- /*****************************************************
- Creater: Kenny
- Date : 2001/5/15 02:39PM
- Description: Display menu using
- *****************************************************/
- #include "global.h"
- #include "osd.h"
- #include "func.h"
- #include "cfont.h"
- #include "navdata.h"
- #include "user_if.h"
- #include "osdfont.h"
- #include "auddrv.h" //2004AUDDRV oliver 20041004 for using audio driver purpose
- //#include "audif.h"
- #include "setup.h"
- #include "user_init.h" // alan added : for OSD_FONT_COMPRESS
- #include "stdlib.h"
- #ifdef OSD_BMP
- #include "osd_BmpUI.h"
- #endif
- #ifndef DVDRELEASE
- //#define DISP_DBG 1
- #endif
- #ifndef DISP_DBG
- #undef printf
- #undef print_block
- #define printf(f, a...) do {} while (0)
- #define print_block(x,y) do {} while (0)
- #endif
- #define DISP_SLOW_DOWN 0
- #define DISP_HOLD_COUNT 20
- //OSD disp color definition(the color index are defined in palette_16color_setup[])
- #ifdef GREY_OSD_DISP // ych 2-7-8 17:39
- #define DISP_WHITE 2
- #define DISP_GRAY 3
- #define DISP_GBLUE 4
- #define DISP_GREEN 2//8
- #define DISP_YGREEN 2//9
- #define DISP_ORANGE 2//10 //2-7-6 15:29
- #define DISP_SHADOW 0
- #elif defined(OSD_BMP_DISPLAY)
- #define DISP_SHADOW 7
- #ifdef DISP_REGION_BOTTOM
- #define DISP_SHADOW_CDROM 0
- #endif
- #define DISP_FONT_GRAY 10
- #define DISP_FONT_YELLOW 11
- #define DISP_GBLUE 9
- #define DISP_GREEN 8
- #define DISP_YGREEN 11
- #define DISP_ORANGE 8
- #define DISP_GRAY 10
- #define DISP_WHITE 10
- #define DISP_LITTLE_CHAR_WIDTH 8
- #elif defined(SETUP_COLOR_TYPE2) //zhangyu
- #define DISP_WHITE 2
- #define DISP_GRAY 3
- #define DISP_GBLUE 4
- #define DISP_GREEN 10// 8zhangyu
- #define DISP_YGREEN 1//9
- #define DISP_ORANGE 12//5
- #define DISP_SHADOW 0
- #else
- #define DISP_WHITE 2
- #define DISP_GRAY 3
- #define DISP_GBLUE 4
- #define DISP_GREEN 8
- #define DISP_YGREEN 9
- #ifdef NOSHOW_CDROM_WHEN_DISP
- #define DISP_ORANGE 2
- #else
- #define DISP_ORANGE 5
- #endif
- #define DISP_SHADOW 0
- #endif //GREY_OSD_DISP
- #ifndef OSD_BMP_DISPLAY
- //page 1
- //SVCD,VCD,CDDA
- #define COOK_CD 0
- #if defined(SYBER_DVD)||defined(SHOW_VCD_VER_INFO) //yaowh add 04-12-17//xulf 2003-11-18
- #define COOK_TRK COOK_CD+7 //6
- #elif defined(USE_COOK_TRK_6)//20040210
- #define COOK_TRK COOK_CD+5+1 //5
- #else
- #define COOK_TRK COOK_CD+5 //5
- #endif
- #define COOK_TRK_VAL COOK_TRK+4 //9
- #define COOK_SPK COOK_TRK_VAL+6 //15
- #define COOK_PBC COOK_SPK+3 //18
- #define COOK_REP COOK_PBC+4 //22
- #ifdef FUSS_DVD
- #define COOK_CLOCK COOK_REP+3+1+1 //27//25
- #elif defined(USE_COOK_TRK_6)//20040210
- #define COOK_CLOCK COOK_REP+3-1 //25
- #else
- #define COOK_CLOCK COOK_REP+3 //25
- #endif
- #if defined(USE_COOK_TRK_6) || defined(NINTAUS_DVD)//20040210
- #define COOK_CLOCK_VAL COOK_CLOCK+2+2 //27
- #else//#elif defined(USE_COOK_TRK_6)//20040210
- #define COOK_CLOCK_VAL COOK_CLOCK+2 //27
- #endif//#elif defined(USE_COOK_TRK_6)//20040210
- //DVD
- #ifdef FUSS_DVD
- #define COOK_CHP COOK_TRK_VAL+5+1 //15//14
- #else
- //yw020909 #define COOK_CHP COOK_TRK_VAL+5 //14
- #ifdef NEW_SEARCH_OSD
- // YW ------- osd ---------- [Top]
- // Modify 020725
- #define COOK_CHP COOK_TRK_VAL+6 //14
- // YW ------- osd ---------- [Bottom]
- #else
- #define COOK_CHP COOK_TRK_VAL+5
- #endif
- #endif
- #define COOK_CHP_VAL COOK_CHP+4 //18
- //CDROM(MP3,JPEG)
- //#define COOK_SPK_MP3 COOK_TRK_VAL+8 //17
- #define COOK_SPK_MP3 COOK_TRK_VAL+9 //17 TRK_VAL=xxxx/xxxx Jeff 20020503
- //page 2
- //#define COOK_AUDIO 0
- //#define COOK_AUDIO_VAL COOK_AUDIO+3 //3
- //#define COOK_AUDIO_LANG COOK_AUDIO_VAL+4 //7
- //#define COOK_AUDIO_TYPE COOK_AUDIO_LANG+5 //12
- //#define COOK_SUBTITLE COOK_AUDIO_TYPE+7 //19
- //#define COOK_SUBTITLE_VAL COOK_SUBTITLE+3 //22
- //#define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+5 //26
- //#define COOK_ANGLE COOK_SUBTITLE_LANG+6 //32
- //#define COOK_ANGLE_VAL COOK_ANGLE+3 //35
- #ifdef FUSS_DVD
- #define COOK_AUDIO 0
- #define COOK_AUDIO_VAL COOK_AUDIO+2 //2
- #define COOK_AUDIO_TYPE COOK_AUDIO_VAL+3 //5
- #define COOK_AUDIO_LANG COOK_AUDIO_TYPE+6+3 //14
- #define COOK_SUBTITLE COOK_AUDIO_LANG+9-3 //20
- #define COOK_SUBTITLE_VAL COOK_SUBTITLE+2 //22
- #define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+5 //27
- #define COOK_ANGLE COOK_SUBTITLE_LANG+6 //33
- #define COOK_ANGLE_VAL COOK_ANGLE+2 //35
- #else
- #ifdef NEW_SEARCH_OSD
- #define COOK_ANGLE 14
- #define COOK_ANGLE_VAL 16
- #define COOK_AUDIO 5
- #define COOK_AUDIO_VAL COOK_AUDIO+2
- #define COOK_AUDIO_LANG COOK_AUDIO_VAL+3
- #define COOK_AUDIO_TYPE COOK_AUDIO_LANG+4
- #define COOK_SUBTITLE COOK_AUDIO_TYPE+9
- #define COOK_SUBTITLE_VAL COOK_SUBTITLE+2
- #define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+5
- #else // NEW_SEARCH_OSD
- #define COOK_AUDIO 0
- #define COOK_AUDIO_VAL COOK_AUDIO+2 //2
- #define COOK_AUDIO_LANG COOK_AUDIO_VAL+3 //5
- #define COOK_AUDIO_TYPE COOK_AUDIO_LANG+6 //11
- #define COOK_SUBTITLE COOK_AUDIO_TYPE+9 //20
- #define COOK_SUBTITLE_VAL COOK_SUBTITLE+2 //22
- #define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+5 //27
- #define COOK_ANGLE COOK_SUBTITLE_LANG+6 //33
- #define COOK_ANGLE_VAL COOK_ANGLE+2 //35
- #endif
- #endif
- //special define
- #define COOK_S_TIMER 0x1<<16
- #define COOK_S_LANG 0x1<<17
- #define COOK_S_MODE 0x1<<18
- //Jeff 20020411
- //page 3
- #define COOK_MARK 0
- #define COOK_MARK_VAL COOK_MARK+5 //5
- //#define COOK_MARK_VAL COOK_MARK+4 //4 Jeff 20020621
- #else//OSD_BMP_DISPLAY
- //page 1
- //SVCD,VCD,CDDA
- #define COOK_CD 53
- #define COOK_CDROM 77
- #if defined(SYBER_DVD)
- #define COOK_TRK COOK_CD+68+22
- #define COOK_TRK_CDROM COOK_CDROM+68+22
- #elif defined(USE_COOK_TRK_6)//20040210
- #define COOK_TRK COOK_CD+68+22
- #define COOK_TRK_CDROM COOK_CDROM+68+22
- #else
- #define COOK_TRK COOK_CD+68+22 //COOK_CD+68+22+24-2//libing2004-11-24 12:46
- //zhuyanfeng modified 02/12/2004 14:40 //to avoid the bug "dis"or"hdcd"cover with rep icon.
- #define COOK_TRK_CDROM COOK_CDROM+68+22
- #endif//SYBER_DVD
- #define COOK_TRK_VAL COOK_TRK+2*16+6+26//libing2004-11-24 12:46
- #define COOK_TRK_VAL_CDROM COOK_TRK_CDROM+2*16+6
- #define COOK_SPK 404
- #define COOK_SPK_CDROM 410
- #define COOK_PBC COOK_REP-12-48
- #define COOK_REP 350-22//350 //zhuyanfeng modified 02/12/2004 14:40 //to avoid the bug "dis"or"hdcd"cover with rep icon.
- #define COOK_REP_CDROM 356
- #ifdef FUSS_DVD
- #define COOK_CLOCK 458
- #define COOK_CLOCK_CDROM 464
- #elif defined(USE_COOK_TRK_6)//20040210
- #define COOK_CLOCK 458
- #define COOK_CLOCK_CDROM 464
- #else
- #define COOK_CLOCK 458// 458
- #define COOK_CLOCK_CDROM 464
- #endif//FUSS_DVD
- #if defined(USE_COOK_TRK_6) || defined(NINTAUS_DVD)//20040210
- #define COOK_CLOCK_VAL COOK_CLOCK+16+6
- #define COOK_CLOCK_VAL_CDROM COOK_CLOCK_CDROM+16+6
- #else//#elif defined(USE_COOK_TRK_6)//20040210
- #define COOK_CLOCK_VAL COOK_CLOCK+16+6
- #define COOK_CLOCK_VAL_CDROM COOK_CLOCK_CDROM+16+6
- #endif//#elif defined(USE_COOK_TRK_6)//20040210
- //DVD
- #ifdef FUSS_DVD
- #define COOK_CHP COOK_TRK_VAL+40+26
- #else
- #ifdef NEW_SEARCH_OSD
- // YW ------- osd ---------- [Top]
- // Modify 020725
- #define COOK_CHP COOK_TRK_VAL+40+26
- // YW ------- osd ---------- [Bottom]
- #else
- #define COOK_CHP COOK_TRK_VAL+40+26-2//libing2004-11-24 12:46
- #endif
- #endif
- #define COOK_CHP_VAL COOK_CHP+2*16+6+28//libing2004-11-24 12:46
- #define COOK_SPK_MP3 COOK_TRK_VAL+9*8 //17 TRK_VAL=xxxx/xxxx Jeff 20020503
- //page 2
- #ifdef FUSS_DVD
- #define COOK_AUDIO COOK_CD+68+22
- #define COOK_AUDIO_VAL COOK_AUDIO+30+6
- #define COOK_AUDIO_TYPE 381+38+6
- #define COOK_AUDIO_LANG COOK_AUDIO_VAL+6*8
- #define COOK_SUBTITLE COOK_AUDIO_VAL+4*8+3*8+26
- #define COOK_SUBTITLE_VAL COOK_SUBTITLE+32+6
- #define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+6*8
- #define COOK_ANGLE COOK_AUDIO_TYPE+7*8+26
- #define COOK_ANGLE_VAL COOK_ANGLE+32+6
- #else
- #ifdef NEW_SEARCH_OSD
- #define COOK_ANGLE 507
- #define COOK_ANGLE_VAL COOK_ANGLE+32+6
- #define COOK_AUDIO COOK_CD+68+22
- #define COOK_AUDIO_VAL COOK_AUDIO+30+6
- #define COOK_AUDIO_LANG COOK_AUDIO_VAL+6*8
- #define COOK_AUDIO_TYPE 381+38+6
- #define COOK_SUBTITLE COOK_AUDIO_VAL+4*8+3*8+26
- #define COOK_SUBTITLE_VAL COOK_SUBTITLE+32+6
- #define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+6*8
- #else // NEW_SEARCH_OSD
- #define COOK_AUDIO COOK_CD+68+22
- #define COOK_AUDIO_VAL COOK_AUDIO+30+6
- #define COOK_AUDIO_TYPE 381+38+6
- #define COOK_AUDIO_LANG COOK_AUDIO_VAL+6*8
- #define COOK_SUBTITLE COOK_AUDIO_VAL+4*8+3*8+26
- #define COOK_SUBTITLE_VAL COOK_SUBTITLE+32+6
- #define COOK_SUBTITLE_LANG COOK_SUBTITLE_VAL+6*8
- #define COOK_ANGLE 507
- #define COOK_ANGLE_VAL COOK_ANGLE+32+6
- #endif
- #endif
- //special define
- #define COOK_S_TIMER 0x1<<16
- #define COOK_S_LANG 0x1<<17
- #define COOK_S_MODE 0x1<<18
- //Jeff 20020411
- //page 3
- #define COOK_MARK 0
- #define COOK_MARK_VAL COOK_MARK+5 //5
- //#define COOK_MARK_VAL COOK_MARK+4 //4 Jeff 20020621
- #endif //OSD_BMP_DISPLAY
- extern int getCDDAType();
- extern void mark_UpdateOSD();
- extern UINT8 DVD_check_state(void);
- extern void osd_Move2OSD0(BYTE iLine);
- extern void osd_ClearOSD0(BYTE iSLine, BYTE iELine);
- extern UINT16 mp3_file_count(void);
- extern UINT16 Is_JPEG_STATE(void);
- extern void FSGUI_JpgUpdateOSD(void);
- extern const UINT8 osd_cd_id[];
- #ifdef REMAIN_TIME//nono 2-7-13 11:28 for fuss
- extern BYTE polling_clock;//2-7-13 9:12
- #endif
- extern UINT32 coding_mode_now;
- #ifdef DVD_AUDIO
- extern UINT32 dAMG_LSN; // alan, 2002/11/13 02:12