disp.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:35k
源码类别:

DVD

开发平台:

C/C++

  1. /*****************************************************
  2. Creater: Kenny
  3. Date   : 2001/5/15 02:39PM
  4. Description: Display menu using
  5. *****************************************************/
  6. #include "global.h"
  7. #include "osd.h"
  8. #include "func.h"
  9. #include "cfont.h"
  10. #include "navdata.h"
  11. #include "user_if.h"
  12. #include "osdfont.h"
  13. #include "auddrv.h" //2004AUDDRV oliver 20041004 for using audio driver purpose
  14. //#include "audif.h"
  15. #include "setup.h"
  16. #include "user_init.h"   // alan added : for OSD_FONT_COMPRESS
  17. #include "stdlib.h"
  18. #ifdef OSD_BMP
  19. #include "osd_BmpUI.h"
  20. #endif
  21. #ifndef DVDRELEASE
  22. //#define DISP_DBG    1
  23. #endif
  24. #ifndef DISP_DBG
  25. #undef printf
  26. #undef print_block
  27. #define printf(f, a...) do {} while (0)
  28. #define print_block(x,y) do {} while (0)
  29. #endif
  30. #define     DISP_SLOW_DOWN      0
  31. #define     DISP_HOLD_COUNT     20
  32. //OSD disp color definition(the color index are defined in palette_16color_setup[])
  33. #ifdef GREY_OSD_DISP               // ych 2-7-8 17:39
  34.     #define DISP_WHITE      2
  35.     #define DISP_GRAY       3
  36.     #define DISP_GBLUE      4
  37.     #define DISP_GREEN      2//8
  38.     #define DISP_YGREEN     2//9
  39.     #define DISP_ORANGE     2//10   //2-7-6 15:29
  40.     #define DISP_SHADOW     0
  41. #elif defined(OSD_BMP_DISPLAY)
  42.     #define DISP_SHADOW 7
  43.     #ifdef DISP_REGION_BOTTOM
  44.         #define DISP_SHADOW_CDROM 0
  45.     #endif
  46.     #define DISP_FONT_GRAY 10
  47.     #define DISP_FONT_YELLOW 11
  48.     #define DISP_GBLUE      9
  49.     #define DISP_GREEN     8 
  50.     #define DISP_YGREEN     11
  51. #define DISP_ORANGE     8
  52.     #define DISP_GRAY       10
  53.     #define DISP_WHITE 10
  54.     #define DISP_LITTLE_CHAR_WIDTH 8
  55. #elif defined(SETUP_COLOR_TYPE2)     //zhangyu 
  56.     #define DISP_WHITE      2
  57.     #define DISP_GRAY       3
  58.     #define DISP_GBLUE      4
  59.     #define DISP_GREEN     10// 8zhangyu
  60.     #define DISP_YGREEN     1//9
  61.     #define DISP_ORANGE     12//5
  62.     #define DISP_SHADOW     0
  63. #else
  64.     #define DISP_WHITE      2
  65.     #define DISP_GRAY       3
  66.     #define DISP_GBLUE      4
  67.     #define DISP_GREEN      8
  68.     #define DISP_YGREEN     9
  69.     #ifdef  NOSHOW_CDROM_WHEN_DISP
  70.     #define DISP_ORANGE     2
  71.     #else
  72.     #define DISP_ORANGE     5
  73.     #endif
  74.     #define DISP_SHADOW     0
  75. #endif //GREY_OSD_DISP
  76. #ifndef OSD_BMP_DISPLAY
  77. //page 1
  78. //SVCD,VCD,CDDA
  79.     #define COOK_CD                 0
  80.     #if defined(SYBER_DVD)||defined(SHOW_VCD_VER_INFO)   //yaowh add 04-12-17//xulf 2003-11-18
  81.     #define COOK_TRK                COOK_CD+7               //6
  82.     #elif defined(USE_COOK_TRK_6)//20040210
  83.     #define COOK_TRK                COOK_CD+5+1               //5
  84.     #else
  85.     #define COOK_TRK                COOK_CD+5               //5
  86.     #endif
  87.     #define COOK_TRK_VAL            COOK_TRK+4              //9
  88.     #define COOK_SPK                COOK_TRK_VAL+6          //15
  89.     #define COOK_PBC                COOK_SPK+3              //18
  90.     #define COOK_REP                COOK_PBC+4              //22
  91.     #ifdef FUSS_DVD
  92.     #define COOK_CLOCK              COOK_REP+3+1+1              //27//25
  93.     #elif defined(USE_COOK_TRK_6)//20040210
  94.     #define COOK_CLOCK              COOK_REP+3-1              //25
  95.     #else
  96.     #define COOK_CLOCK              COOK_REP+3              //25
  97.     #endif
  98.     #if defined(USE_COOK_TRK_6) || defined(NINTAUS_DVD)//20040210
  99.     #define COOK_CLOCK_VAL          COOK_CLOCK+2+2            //27
  100.     #else//#elif defined(USE_COOK_TRK_6)//20040210
  101.     #define COOK_CLOCK_VAL          COOK_CLOCK+2            //27
  102.     #endif//#elif defined(USE_COOK_TRK_6)//20040210
  103. //DVD
  104.     #ifdef FUSS_DVD
  105.     #define COOK_CHP                COOK_TRK_VAL+5+1          //15//14
  106.     #else
  107.         //yw020909 #define COOK_CHP                COOK_TRK_VAL+5          //14
  108.         #ifdef NEW_SEARCH_OSD
  109.         // YW ------- osd ---------- [Top]
  110.         // Modify 020725
  111.         #define COOK_CHP                COOK_TRK_VAL+6          //14
  112.         // YW ------- osd ---------- [Bottom]
  113.         #else
  114.         #define COOK_CHP COOK_TRK_VAL+5
  115.         #endif
  116.     #endif
  117.     #define COOK_CHP_VAL            COOK_CHP+4              //18
  118.     //CDROM(MP3,JPEG)
  119.     //#define COOK_SPK_MP3            COOK_TRK_VAL+8          //17
  120.     #define COOK_SPK_MP3            COOK_TRK_VAL+9          //17   TRK_VAL=xxxx/xxxx Jeff 20020503
  121. //page 2
  122.     //#define COOK_AUDIO              0
  123.     //#define COOK_AUDIO_VAL          COOK_AUDIO+3            //3
  124.     //#define COOK_AUDIO_LANG         COOK_AUDIO_VAL+4        //7
  125.     //#define COOK_AUDIO_TYPE         COOK_AUDIO_LANG+5       //12
  126.     //#define COOK_SUBTITLE           COOK_AUDIO_TYPE+7       //19
  127.     //#define COOK_SUBTITLE_VAL       COOK_SUBTITLE+3         //22
  128.     //#define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+5     //26
  129.     //#define COOK_ANGLE              COOK_SUBTITLE_LANG+6    //32
  130.     //#define COOK_ANGLE_VAL          COOK_ANGLE+3            //35
  131.     #ifdef FUSS_DVD
  132.     #define COOK_AUDIO              0
  133.     #define COOK_AUDIO_VAL          COOK_AUDIO+2            //2
  134.     #define COOK_AUDIO_TYPE         COOK_AUDIO_VAL+3       //5
  135.     #define COOK_AUDIO_LANG         COOK_AUDIO_TYPE+6+3        //14
  136.     #define COOK_SUBTITLE           COOK_AUDIO_LANG+9-3        //20
  137.     #define COOK_SUBTITLE_VAL       COOK_SUBTITLE+2         //22
  138.     #define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+5     //27
  139.     #define COOK_ANGLE              COOK_SUBTITLE_LANG+6    //33
  140.     #define COOK_ANGLE_VAL          COOK_ANGLE+2            //35
  141.     #else
  142.     #ifdef NEW_SEARCH_OSD
  143.     #define COOK_ANGLE              14
  144.     #define COOK_ANGLE_VAL          16
  145.     #define COOK_AUDIO              5
  146.     #define COOK_AUDIO_VAL          COOK_AUDIO+2
  147.     #define COOK_AUDIO_LANG         COOK_AUDIO_VAL+3
  148.     #define COOK_AUDIO_TYPE         COOK_AUDIO_LANG+4
  149.     #define COOK_SUBTITLE           COOK_AUDIO_TYPE+9
  150.     #define COOK_SUBTITLE_VAL       COOK_SUBTITLE+2
  151.     #define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+5
  152.     #else // NEW_SEARCH_OSD
  153.     #define COOK_AUDIO              0
  154.     #define COOK_AUDIO_VAL          COOK_AUDIO+2            //2
  155.     #define COOK_AUDIO_LANG         COOK_AUDIO_VAL+3        //5
  156.     #define COOK_AUDIO_TYPE         COOK_AUDIO_LANG+6       //11
  157.     #define COOK_SUBTITLE           COOK_AUDIO_TYPE+9       //20
  158.     #define COOK_SUBTITLE_VAL       COOK_SUBTITLE+2         //22
  159.     #define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+5     //27
  160.     #define COOK_ANGLE              COOK_SUBTITLE_LANG+6    //33
  161.     #define COOK_ANGLE_VAL          COOK_ANGLE+2            //35
  162.     #endif
  163.     #endif
  164.     //special define
  165.     #define COOK_S_TIMER            0x1<<16
  166.     #define COOK_S_LANG             0x1<<17
  167.     #define COOK_S_MODE             0x1<<18
  168. //Jeff 20020411
  169. //page 3
  170.     #define COOK_MARK               0
  171.     #define COOK_MARK_VAL           COOK_MARK+5             //5
  172.     //#define COOK_MARK_VAL           COOK_MARK+4             //4 Jeff 20020621
  173. #else//OSD_BMP_DISPLAY
  174. //page 1
  175. //SVCD,VCD,CDDA
  176.     #define COOK_CD                 53
  177.     #define COOK_CDROM 77
  178. #if defined(SYBER_DVD)
  179.     #define COOK_TRK                COOK_CD+68+22
  180.     #define COOK_TRK_CDROM COOK_CDROM+68+22
  181.     #elif defined(USE_COOK_TRK_6)//20040210
  182.     #define COOK_TRK                COOK_CD+68+22
  183.     #define COOK_TRK_CDROM COOK_CDROM+68+22
  184.     #else
  185.     #define COOK_TRK            COOK_CD+68+22 //COOK_CD+68+22+24-2//libing2004-11-24 12:46
  186.                                               //zhuyanfeng modified 02/12/2004 14:40  //to avoid the bug "dis"or"hdcd"cover with rep icon.
  187.     #define COOK_TRK_CDROM COOK_CDROM+68+22
  188.     #endif//SYBER_DVD
  189. #define COOK_TRK_VAL            COOK_TRK+2*16+6+26//libing2004-11-24 12:46
  190.     #define COOK_TRK_VAL_CDROM COOK_TRK_CDROM+2*16+6
  191.     #define COOK_SPK                404
  192.     #define COOK_SPK_CDROM 410
  193.     #define COOK_PBC                COOK_REP-12-48
  194.     #define COOK_REP               350-22//350 //zhuyanfeng modified 02/12/2004 14:40  //to avoid the bug "dis"or"hdcd"cover with rep icon.
  195.     #define COOK_REP_CDROM   356
  196. #ifdef FUSS_DVD
  197.     #define COOK_CLOCK              458
  198.     #define COOK_CLOCK_CDROM 464
  199.     #elif defined(USE_COOK_TRK_6)//20040210
  200.     #define COOK_CLOCK              458
  201.     #define COOK_CLOCK_CDROM 464
  202.     #else
  203.     #define COOK_CLOCK            458//  458
  204.     #define COOK_CLOCK_CDROM 464
  205.     #endif//FUSS_DVD
  206.     #if defined(USE_COOK_TRK_6) || defined(NINTAUS_DVD)//20040210
  207.     #define COOK_CLOCK_VAL          COOK_CLOCK+16+6
  208.     #define COOK_CLOCK_VAL_CDROM COOK_CLOCK_CDROM+16+6
  209.     #else//#elif defined(USE_COOK_TRK_6)//20040210
  210.     #define COOK_CLOCK_VAL          COOK_CLOCK+16+6
  211.     #define COOK_CLOCK_VAL_CDROM COOK_CLOCK_CDROM+16+6
  212.     #endif//#elif defined(USE_COOK_TRK_6)//20040210
  213.     //DVD
  214.     #ifdef FUSS_DVD
  215.     #define COOK_CHP                COOK_TRK_VAL+40+26
  216.     #else
  217.     #ifdef NEW_SEARCH_OSD
  218.     // YW ------- osd ---------- [Top]
  219.     // Modify 020725
  220.     #define COOK_CHP                COOK_TRK_VAL+40+26
  221.     // YW ------- osd ---------- [Bottom]
  222.     #else
  223.     #define COOK_CHP COOK_TRK_VAL+40+26-2//libing2004-11-24 12:46
  224.     #endif
  225.     #endif
  226.     #define COOK_CHP_VAL            COOK_CHP+2*16+6+28//libing2004-11-24 12:46
  227.     #define COOK_SPK_MP3            COOK_TRK_VAL+9*8          //17   TRK_VAL=xxxx/xxxx Jeff 20020503
  228. //page 2
  229.     #ifdef FUSS_DVD
  230.     #define COOK_AUDIO              COOK_CD+68+22
  231.     #define COOK_AUDIO_VAL          COOK_AUDIO+30+6
  232.     #define COOK_AUDIO_TYPE         381+38+6
  233.     #define COOK_AUDIO_LANG         COOK_AUDIO_VAL+6*8
  234.     #define COOK_SUBTITLE           COOK_AUDIO_VAL+4*8+3*8+26
  235.     #define COOK_SUBTITLE_VAL     COOK_SUBTITLE+32+6
  236.     #define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+6*8
  237.     #define COOK_ANGLE              COOK_AUDIO_TYPE+7*8+26
  238.     #define COOK_ANGLE_VAL          COOK_ANGLE+32+6
  239.     #else
  240.         #ifdef NEW_SEARCH_OSD
  241.         #define COOK_ANGLE              507
  242.         #define COOK_ANGLE_VAL          COOK_ANGLE+32+6
  243.         #define COOK_AUDIO              COOK_CD+68+22
  244.         #define COOK_AUDIO_VAL          COOK_AUDIO+30+6
  245.         #define COOK_AUDIO_LANG         COOK_AUDIO_VAL+6*8
  246.         #define COOK_AUDIO_TYPE         381+38+6
  247.         #define COOK_SUBTITLE           COOK_AUDIO_VAL+4*8+3*8+26
  248.         #define COOK_SUBTITLE_VAL     COOK_SUBTITLE+32+6
  249.         #define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+6*8
  250.         #else // NEW_SEARCH_OSD
  251.         #define COOK_AUDIO              COOK_CD+68+22
  252.         #define COOK_AUDIO_VAL          COOK_AUDIO+30+6
  253.         #define COOK_AUDIO_TYPE         381+38+6
  254.         #define COOK_AUDIO_LANG         COOK_AUDIO_VAL+6*8
  255.         #define COOK_SUBTITLE           COOK_AUDIO_VAL+4*8+3*8+26
  256.         #define COOK_SUBTITLE_VAL       COOK_SUBTITLE+32+6
  257.         #define COOK_SUBTITLE_LANG      COOK_SUBTITLE_VAL+6*8
  258.         #define COOK_ANGLE              507
  259.         #define COOK_ANGLE_VAL          COOK_ANGLE+32+6
  260.         #endif
  261.     #endif
  262. //special define
  263. #define COOK_S_TIMER            0x1<<16
  264. #define COOK_S_LANG             0x1<<17
  265. #define COOK_S_MODE             0x1<<18
  266. //Jeff 20020411
  267. //page 3
  268. #define COOK_MARK               0
  269. #define COOK_MARK_VAL           COOK_MARK+5             //5
  270. //#define COOK_MARK_VAL           COOK_MARK+4             //4 Jeff 20020621
  271. #endif //OSD_BMP_DISPLAY
  272. extern int getCDDAType();
  273. extern void mark_UpdateOSD();
  274. extern UINT8 DVD_check_state(void);
  275. extern void osd_Move2OSD0(BYTE iLine);
  276. extern void osd_ClearOSD0(BYTE iSLine, BYTE iELine);
  277. extern UINT16 mp3_file_count(void);
  278. extern UINT16 Is_JPEG_STATE(void);
  279. extern void FSGUI_JpgUpdateOSD(void);
  280. extern const UINT8 osd_cd_id[];
  281. #ifdef REMAIN_TIME//nono 2-7-13 11:28 for fuss
  282. extern BYTE polling_clock;//2-7-13 9:12
  283. #endif
  284. extern UINT32 coding_mode_now;
  285. #ifdef DVD_AUDIO
  286. extern UINT32 dAMG_LSN; // alan, 2002/11/13 02:12