ircmd_video.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:20k
源码类别:

DVD

开发平台:

C/C++

  1. /*
  2. *  Terry,2003/8/20 08:21PM
  3. *  
  4. */
  5. //#define P_SCAN_ONLY_CHG_INT_MODE]
  6. #ifdef ADD_DVI311_SETUP
  7. #include "spv301.h"
  8. #endif
  9. #ifdef DVD_SETUP_REENG
  10. #include "setup_VA.h"
  11. #include "setup_def.h"
  12. #endif
  13. #ifdef QSI_PLATFORM //qsi: merge by johnson 20040712
  14. void ircmd_tvout(void);
  15. //qsi: add by sharon
  16. #endif
  17. const UINT8 tv_out_map[MODE_MAX_PSCAN] = {VIDEO_SET_MODE};//{INTERLACE,TV_SVIDEO,TV_RGB,P_SCAN,PC_VGA};
  18. const UINT8 video_setup_id[] = {VIDEO_SETUP_STRING};//nono 2003-7-14 10:12
  19. #define MODE_MAX_FORMAT TV_FORMAT_MAX
  20. UINT8 ap_tv_out_id = 0;
  21. //UINT8 is_ap_svideo;
  22. #ifdef  DYNAMIC_SPECTRUM  //fengjl  3-10-30 15:04
  23. void Show3dspectrum(void);
  24. #endif    
  25. #ifdef BBK_DVD//zhaoyanhua add 3-11-26 16:41
  26. #define VIDEO_OUTPUT_ADDR   240
  27. #define VIDEO_VFD_DELAY_TIME  100
  28. int  tv_output_vfd_time = 0;
  29. #endif
  30. #ifdef SUPPORT_OSDID3//suqiaoli add 2004-3-26 
  31. extern void osd_init_OSDID3(void);
  32. extern void show_id3(void);
  33. #endif
  34. #ifdef SUPPORT_CD_TEXT//lizhx add 2004/08/24
  35. #include"CDTextUtil.h"
  36. #endif
  37. #ifdef SUPPORT_MP4_SUBTITLE  // David 2004-5-12
  38. extern void osd_init_OSDSRT(void);
  39. #endif
  40. //========================== Decleration the Functions ========================
  41. static inline void    ircmd_TV_format_toggle(void);
  42. // ============================================================================
  43. // Video  Video  Video  Video  Video
  44. // ============================================================================
  45. void setup_tv_out(UINT8 id)
  46. {
  47.     int old_mode=p_scan;
  48.     extern UINT8 srv_on;
  49.     
  50. #ifdef TVOUT6_4DAC_ON   //terry,2003-8-19 17:44
  51.     if(id==TV_SVIDEO)
  52.     #ifdef SPHE1000 //MIKEY 2004.07.06
  53.         tv_dacoff( (0x01<<4)|(0x01<<5) );  // dac off        //SPHE1000 use DAC C as C signal in S-Video 
  54.     #else 
  55.         #ifdef MP_BOARD_216_PIN_NON_SHARE   // ronnie 2004/09/09
  56.          tv_dacoff( (0x01<<1)|(0x01<<2) );
  57.         #else
  58.          tv_dacoff( (0x01<<3)|(0x01<<4)|(0x01<<5) );  // dac off
  59.         #endif
  60.     #endif 
  61. #ifdef P_SCAN_TURNOFF_CVBS_SVIDEO
  62.     else if( (id==P_SCAN)||(id==PC_VGA)||(id==INTERLACE)||(id==TV_RGB) )//nono 20030920
  63.         tv_dacoff( (0x01<<1)|(0x01<<2) );  // dac off
  64. #endif
  65. #ifdef S_VIDEO_RGB_OUT_IN_THE_SAME_TIME//4-1-15 16:05
  66.     else if(id==TV_RGB)
  67.         tv_dacoff( (0x00<<1)|(0x00<<2)|(0x00<<3)|(0x00<<4)|(0x00<<5) );  // dac off
  68. #endif//S_VIDEO_RGB_OUT_IN_THE_SAME_TIME
  69.     else
  70.     #ifdef SPHE1000 //wrwu, 2004/11/03, fix a bug of the SPHE100X changing video output
  71.      tv_dacoff(0);  
  72.     #else
  73.         tv_dacoff( (0x01<<1)|(0x01<<2) );  // dac off
  74. #endif
  75.     
  76. #endif//#ifdef TVOUT6_4DAC_ON   //terry,2003-8-19 17:44 
  77. //wanghaoying 2003-11-6 22:54
  78. #ifdef TV_USE_4_DAC
  79. #ifdef SETUP_CVBS_OUTPUT        
  80.     if (id == CVBS )
  81.     {//terry,2003/12/25 09:19PM
  82.         tv_dacoff( (0x01<<1)|(0x01<<2)|(0x01<<3)|(0x01<<4)|(0x01<<5) );
  83.     }
  84. #endif
  85. #endif
  86.     
  87. //gerry add for gbm,when we set to S-VIDEO,tv dac3 will be off,2004-5-13 15:44
  88. //#define S_VIDEO_SET_TV_DAC3_OFF
  89. #if defined(TV_USE_4_DAC)&&defined(S_VIDEO_SET_TV_DAC3_OFF)
  90.     if(id==TV_SVIDEO)
  91.         tv_dacoff( (0x01<<3) );  // dac off
  92.     else
  93.         tv_dacoff( (0x00<<3) );  // dac on    
  94. #endif//#if defined(TV_USE_4_DAC)&&defined(S_VIDEO_SET_TV_DAC3_OFF)
  95.     
  96.     
  97.     if( (id==INTERLACE)||(id==TV_RGB)||(id==TV_SVIDEO) )//terry,2003/8/3 05:30PM
  98.     {
  99.         tv_setup_int();             
  100.         p_scan=0;
  101.     }
  102. #ifdef SETUP_CVBS_OUTPUT        //wanghaoying 2003-11-6 22:55
  103.     else if( id==CVBS )//terry,2003/8/3 05:30PM
  104.     {
  105.         tv_setup_int();             
  106.         p_scan=0;
  107.     }
  108.     #endif
  109.     else
  110.     {
  111. #ifdef ADD_DVI311_SETUP
  112.         if(id==P_SCAN)
  113.         {
  114.             #ifdef For_TsingHua//Modifed by chenzhao on 2004-12-14 15:34  
  115.             if(dvi311_tv_mode>0x84)
  116.                 dvi311_mode=Mode_480P;           //576P   @kevin 2k40708
  117.             else if(dvi311_tv_mode==0x84)
  118.                 dvi311_mode=Mode_576P;           //480P @kevin 2k406708
  119.             #ifdef DVD_SETUP_REENG//Modifed by chenzhao on 2004-11-24 21:8   
  120.                 setup_VA[SETUP_VA_SPV311MODE]=dvi311_mode+MIN_ITEM_SEL;
  121.             #endif
  122.             #endif
  123.             #ifdef For_TsingHua
  124.             tv_setup_nint();                
  125.             p_scan=1;
  126.             #endif
  127.         }    
  128.         if(id==PC_VGA)
  129.         {
  130.             //dvi311_mode=5;           //SVGA @kevin 2k406708
  131.             if(Power_off_311==1)   //setoutput   @kevin0710
  132.             {
  133.                 close_pll(0xff);
  134.             
  135.             }//reset 311  kevin0710
  136.             #ifdef For_TsingHua
  137.             setup_tv_out(1);
  138.             #endif
  139.         }    
  140.         scaler_main();
  141. #else
  142.         tv_setup_nint();                
  143.         p_scan=1; //kevin forbid it for HDDVD @2k40706
  144.  #endif
  145.     }  
  146. #ifdef ADD_DVI311_SETUP
  147.     HD_display(id);
  148. #endif
  149.     
  150.     if(p_scan!=old_mode)
  151.     {
  152.         if (full_scrn & SETUP)
  153.         {
  154.             //printf("show setup pagen");
  155.             osd_init_setup();
  156. #ifdef SETUP_TAB
  157.             ShowSetupPage(2);
  158. #else
  159.             ShowSetupPage();
  160. #endif
  161.         }else if(srv_on)
  162.         {
  163.             osd_init();
  164.             //printf("setup tv out,osd enablen");
  165.         }
  166.     }
  167.     tv_setup_output(id);
  168.     tv_out_id=id;
  169. #ifdef  DYNAMIC_SPECTRUM        
  170.     if(bEqDisplay)
  171.         Show3dspectrum();           
  172. #endif
  173. #ifdef SUPPORT_OSDID3//liweihua add 2004-1-9 10:21
  174.    if(Is_MP3_STATE())
  175.    {
  176.     osd_init_OSDID3();
  177.     show_id3();
  178.     }
  179. #endif 
  180. #ifdef SUPPORT_CD_TEXT//lizhx add 2004/08/24
  181.     if( cd_type_loaded == CDDA )
  182.     {
  183.         osd_init_CDText();
  184.         show_CDText( v11_trk_now );
  185.     }
  186. #endif  
  187. #ifdef SUPPORT_MP4_SUBTITLE  // David 2004-5-12
  188.     if (GetCurrentFileType() ==  CDROM_MP4)
  189.     {
  190.         osd_init_OSDSRT();
  191.     }
  192. #endif
  193.     
  194. #ifdef GBM_USE_VFD_CONTROL_P_SCAN_LED       //gerry,2004-2-20 14:23
  195.     if(full_scrn==SETUP)
  196.     {
  197.     if(p_scan==0)
  198.     write_vfd_led(0xf);     //3 led are all off,2004-2-19 21:03
  199.     else//GBM_USE_VFD_CONTROL_P_SCAN_LED
  200.     write_vfd_led(0xe);     //only p-san led on,2004-2-19 21:03
  201.     }
  202. #endif//GBM_USE_VFD_CONTROL_P_SCAN_LED    
  203. }
  204. void search_ap_tv_out_id(void)
  205. {
  206.     UINT8 i;
  207.     
  208.     for(i=0;i<=MODE_MAX_PSCAN;i++)    
  209.     {
  210.       if(tv_out_id == tv_out_map[i])
  211.       {
  212.         ap_tv_out_id = i;
  213.         return;
  214.       }      
  215.     }
  216.     ap_tv_out_id = 0;
  217. }
  218. //terry,2004/2/4 06:05PM
  219. #ifndef MINTON_DVD                            //hq, let "AUTO" between "NTSC" and "PAL" for ngailik,4-2-17 1:00
  220. const UINT8  TV_format_table[] = {
  221. #ifdef  SUPPORT_NTSC
  222.     MODE_NTSC,
  223. #endif
  224. #ifdef  SUPPORT_NTSCJ
  225.     MODE_NTSCJ,
  226. #endif
  227. #ifdef  SUPPORT_PAL
  228.     MODE_PAL,
  229. #endif
  230. #ifdef  SUPPORT_PAL60
  231.     MODE_PAL60,
  232. #endif
  233. #ifdef  SUPPORT_PALM
  234.     MODE_PALM,
  235. #endif
  236. #ifdef  SUPPORT_PALN
  237.     MODE_PALN,
  238. #endif
  239. #ifdef  SUPPORT_PALNc
  240.     MODE_PALNC,
  241. #endif
  242.     MODE_AUTO
  243. };
  244. #else
  245. const UINT8  TV_format_table[] = 
  246. {
  247.     MODE_NTSC,
  248.     MODE_AUTO,
  249.     MODE_PAL
  250. };
  251. #endif                   //end ifndef MINTON_DVD, hq,4-2-17 1:03 
  252. //terry,2004/2/5 12:11PM
  253. UINT8 tv_format_sel=0;
  254. void update_tv_format_sel(void)
  255. {
  256.    //int i;
  257.    UINT8 i;//nono 2004-2-20 0:38 cancel warning...
  258.    
  259.    for(i=0;i<sizeof(TV_format_table)/sizeof(TV_format_table[0]);i++)
  260.    {
  261.     if(TV_format_table[i]==tv_format)
  262.     {
  263.        tv_format_sel=i;
  264.        break;
  265.     }
  266.    }
  267. }
  268. static inline void    ircmd_TV_format_toggle(void)
  269. {
  270.     UINT8 id=STR_OS_PAL;
  271. #ifdef NEWSTYLE_WINDOW  // alan, 2003/8/27 10:06AM
  272.     if (full_scrn&MESSAGE)
  273.     {
  274.         invalid_key();
  275.         return;
  276.     }
  277. #endif  
  278.     
  279. #ifndef ADJUSTING_ACTION_VALID_RIGHT_NOW
  280.     if(action_click)
  281. #endif
  282.     {
  283.         tv_format_sel++;
  284.         if (tv_format_sel>=sizeof(TV_format_table)/sizeof(TV_format_table[0])) {
  285.            tv_format_sel=0;
  286.         }
  287.         tv_format = TV_format_table[tv_format_sel];
  288.         
  289.         setup_tv_format(tv_format);
  290.      
  291. #ifdef ADD_DVI311_SETUP
  292.         if(tv_format==MODE_NTSC)
  293.             dvi311_tv_mode=0x85;    //NTSC
  294.         else if(tv_format==MODE_PAL)
  295.             dvi311_tv_mode=0x84;
  296.         else if(tv_format==MODE_PAL60)
  297.             dvi311_tv_mode=0x86;
  298.         if(tv_out_id!=P_SCAN)                                   //not HD output  kevin@2k0708
  299.         {
  300.             if((dvi311_tv_mode>0x84&&dvi311_mode==Mode_576P)//576P   @kevin 2k40525
  301.             ||(dvi311_tv_mode==0x84&&dvi311_mode==Mode_480P))//480P @kevin 2k40525 change for display correct !
  302.             {
  303.                 #ifdef DVI311_NO_PC_MODE
  304.                     if(dvi311_tv_mode>0x84)
  305.                         dvi311_mode=Mode_480P;
  306.                     else if(dvi311_tv_mode==0x84)
  307.                         dvi311_mode=Mode_576P;                        
  308.                 #else
  309.             dvi311_mode=Mode_VGA;//SVGA
  310.                 #endif
  311.             }
  312.         }
  313.         else if(tv_out_id==P_SCAN)                                   //not HD output  kevin@2k0708
  314.         {
  315.             if(dvi311_tv_mode>0x84&&dvi311_mode==Mode_576P)// NTSC and 480P   @kevin 2k40708
  316.                 dvi311_mode=Mode_480P;
  317.             if(dvi311_tv_mode==0x84&&dvi311_mode==Mode_480P)// PAL and 576P   @kevin 2k40708
  318.         dvi311_mode=Mode_576P;
  319.         }
  320.         
  321.         scaler_main();
  322. #endif
  323.     }
  324. #ifdef SUPPORT_SCANMODE_SWITCH
  325.     SwitchRegionTVformat();
  326. #endif               //ouyang2004.07.23
  327.     switch(tv_format)
  328.     {
  329.     case MODE_NTSC:     id=STR_OS_NTSC;break;
  330.     case MODE_PAL:      id=STR_OS_PAL; break;
  331.     case MODE_AUTO:     id=STR_OS_AUTO; break;
  332. #ifdef SUPPORT_PAL60
  333.     case MODE_PAL60:    id=STR_OS_PAL60; break;
  334. #endif
  335. #ifdef SUPPORT_PALM     //gerry,2004-1-8 13:48
  336.     case MODE_PALM:     id=STR_OS_PALM; break;
  337. #endif//SUPPORT_PALM
  338. #ifdef SUPPORT_PALN
  339.     case MODE_PALN:     id=STR_OS_PALN; break;
  340. #endif
  341. #ifdef SUPPORT_PALNc
  342.     case MODE_PALNC:    id=STR_OS_PALNc; break;
  343. #endif
  344.     }
  345. //terry,2004/2/5 12:04PM move
  346. #ifndef FORMAT_KEY_NOT_CHANGE_SETUP//BBK_DVD  // fengjl add for bbk   4-1-12 10:54
  347.     setup_SetTV_format(id); //update setup menu item
  348. #endif
  349.     OSD1000ISP_STATUS(tv_format, OSDIR_PAL_NTSC);
  350.     PrintOsdMsg(STR_OS_TV_SYS|(id<<OSDSTR_ID_TOTL_BIT),REGION1,1,4);
  351. #ifdef NEWSTYLE_WINDOW
  352.     if(full_scrn==MESSAGE)
  353.     {
  354.         full_scrn = 0;
  355.     #if defined(BBK_DVD)&&defined(DISC_INFO_KEY)  //fengjl edit 2004-04-28 11:10
  356.         ircmd_disc_info();
  357.     #else
  358.         ircmd_goto();
  359.     #endif
  360.     }
  361. #endif
  362. }
  363. #if defined(TV_FORMAT_CHG2_VIDEO_MODE)||defined(ADD_TV_VIDEO_MODE)
  364. void ircmd_tv_sys_mode(void)
  365. {   
  366. #ifdef INVALID_TV_MODE_KEY_IN_SETUP           //hq, 2004-3-13 15:24
  367.     if(full_scrn&SETUP)
  368.     {       
  369.         return;
  370.     }
  371. #endif  
  372.     
  373. #ifndef ADJUSTING_ACTION_VALID_RIGHT_NOW    
  374.     if(action_click)
  375. #endif//ADJUSTING_ACTION_VALID_RIGHT_NOW
  376.     {
  377. //        printf("in, tv_out_id:%x ap_tv_out_id:%xn",tv_out_id,ap_tv_out_id);
  378.         if(tv_out_id==TV_SVIDEO)
  379.         {
  380.           //if(p_scan)
  381.           //   tv_out_id=P_SCAN;
  382.           //else
  383. #ifdef MIN_SCART_TV_2
  384.              tv_out_id=TV_RGB;          
  385. #else//MIN_SCART_TV_2
  386.              tv_out_id=INTERLACE;          
  387. #endif//MIN_SCART_TV_2
  388.         }else
  389.         #ifdef EASTWIN_PORTABLE_DVD
  390.         if(tv_out_id==INTERLACE)//tulijuan040805
  391.         {
  392.              tv_out_id=P_SCAN;          
  393.         }else/*
  394.         if(tv_out_id==P_SCAN )//tulijuan040908
  395.         {
  396.           tv_out_id=OFF;          
  397.         }else*/
  398.         #endif
  399.           tv_out_id=TV_SVIDEO;
  400.         
  401.         setup_tv_out(tv_out_id);
  402.         search_ap_tv_out_id();
  403.         setup_SetPScan();
  404. //        printf("out, tv_out_id:%x ap_tv_out_id:%xn",tv_out_id,ap_tv_out_id);
  405.     }
  406.     #ifdef EASTWIN_PORTABLE_DVD
  407.     run_save_total_userSet();//tulijuan040825 save tv_mode
  408.     #endif
  409.     OSD1000ISP_STATUS(tv_out_id, OSDIR_SCAN_VGA);
  410.     PrintOsdMsg(video_setup_id[ap_tv_out_id],REGION1,1,0);
  411. }
  412. #endif//#if defined(TV_FORMAT_CHG2_VIDEO_MODE)||defined(ADD_TV_VIDEO_MODE)
  413. #if defined(TV_FORMAT_CHG2_VIDEO_MODE)||defined(ADD_TV_VIDEO_MODE)||defined(SUPPORT_IR_I2P_KEY)
  414. static inline void ircmd_p_scan_mode(void)
  415. {   
  416. #ifdef MIN_SCART_TV_2
  417. if( (tv_out_id!=TV_RGB)&&(tv_out_id!=P_SCAN) )
  418. #else//#ifdef MIN_SCART_TV_2
  419. if( (tv_out_id!=INTERLACE)&&(tv_out_id!=P_SCAN) )
  420. #endif//#ifdef MIN_SCART_TV_2
  421. {
  422.     invalid_key();
  423.     return; 
  424. }
  425. #ifndef ADJUSTING_ACTION_VALID_RIGHT_NOW    
  426.     if(1)//action_click)
  427. #endif//ADJUSTING_ACTION_VALID_RIGHT_NOW
  428.     {
  429.         //printf("in, tv_out_id:%x ap_tv_out_id:%x p_scan:%x id:%xn",tv_out_id,ap_tv_out_id,p_scan,video_setup_id[ap_tv_out_id]);
  430.         if(p_scan)
  431.         {
  432. //            if(is_ap_svideo)
  433. //              tv_out_id=TV_SVIDEO;
  434. //            else
  435. #ifdef MIN_SCART_TV_2
  436.              tv_out_id=TV_RGB;          
  437. #else//MIN_SCART_TV_2
  438.               tv_out_id=INTERLACE;             
  439. #endif//MIN_SCART_TV_2      
  440.         setup_tv_out(tv_out_id);
  441. #ifdef MIN_SCART_TV_2
  442.         PrintOsdMsg(STR_OS_TV_RGB,REGION1,1,0);   
  443. #elif defined(SUPPORT_IR_I2P_KEY)
  444.         PrintOsdMsg(STR_OS_INTERLACE,REGION1,1,0);   
  445. #else//#ifdef MIN_SCART_TV_2
  446.         PrintOsdMsg(STR_OS_YCbCr,REGION1,1,0);   
  447. #endif//#ifdef MIN_SCART_TV_2
  448.         }else
  449.         {
  450.              tv_out_id=P_SCAN;             
  451.              setup_tv_out(P_SCAN);       
  452. #if defined(SUPPORT_IR_I2P_KEY)
  453.         PrintOsdMsg(STR_OS_PROGRESSIVE,REGION1,1,0);   
  454. #else //#if defined(SUPPORT_IR_I2P_KEY)
  455.              PrintOsdMsg(STR_OS_P_SCAN_YUV,REGION1,1,0);      
  456. #endif//#if defined(SUPPORT_IR_I2P_KEY)
  457.         }
  458. #if defined(SUPPORT_IR_I2P_KEY)        
  459.         search_ap_tv_out_id();
  460.         setup_SetPScan();
  461. #endif        
  462.        
  463. //        printf("out, tv_out_id:%x ap_tv_out_id:%x p_scan:%x id:%xn",tv_out_id,ap_tv_out_id,p_scan,video_setup_id[ap_tv_out_id]);
  464.     }
  465. //    PrintOsdMsg(video_setup_id[ap_tv_out_id],REGION1,1,0);
  466. }
  467. #endif//#if defined(TV_FORMAT_CHG2_VIDEO_MODE)||defined(ADD_TV_VIDEO_MODE)
  468. static inline void ircmd_p_scan_all_mode(void)
  469. {   
  470. #ifndef ADJUSTING_ACTION_VALID_RIGHT_NOW    
  471.     if(action_click)
  472. #endif//ADJUSTING_ACTION_VALID_RIGHT_NOW
  473.     {
  474.         ap_tv_out_id++;
  475.         if (ap_tv_out_id>=MODE_MAX_PSCAN) ap_tv_out_id=0;
  476.         tv_out_id=tv_out_map[ap_tv_out_id];
  477.         setup_tv_out(tv_out_id);
  478.         setup_SetPScan();
  479.         
  480.     }
  481.     OSD1000ISP_STATUS(ap_tv_out_id, OSDIR_SCAN_VGA);
  482.     PrintOsdMsg(video_setup_id[ap_tv_out_id],REGION1,1,0);
  483. }
  484. #ifdef QSI_PLATFORM //qsi: merge by johnson 20040712
  485. //qsi: add by sharon
  486. extern void spi_cmd_tvout(void);
  487. extern UINT8 uSpiRxData;
  488. #define MAX_TVOUT_MODE  8
  489. #define IR_TO_SPI_ADJ  0x40
  490. void ircmd_tvout(void)
  491. {
  492.     ap_tv_out_id++;
  493.        
  494.     uSpiRxData = ap_tv_out_id + IR_TO_SPI_ADJ;
  495.     spi_cmd_tvout();              
  496.     if( ap_tv_out_id >= MAX_TVOUT_MODE )
  497.     {
  498.         ap_tv_out_id = 0;   
  499.     }
  500.     return;
  501. }
  502. #endif
  503. #ifdef SUPPORT_VFD_SHOW_P_SCAN
  504. void ircmd_p_scan_only(void)
  505. {
  506.       if(ap_tv_out_id==2)
  507.       return;
  508.       ap_tv_out_id=2;
  509.       tv_out_id=tv_out_map[ap_tv_out_id];
  510.         setup_tv_out(tv_out_id);
  511.         //setup_SetPScan();
  512.        OsdShowPscan(1);
  513. }
  514. void ircmd_yuv_only(void)
  515. {
  516.       if(ap_tv_out_id==0)
  517.       return;
  518.       ap_tv_out_id=0;
  519.       tv_out_id=tv_out_map[ap_tv_out_id];
  520.         setup_tv_out(tv_out_id);
  521.         //setup_SetPScan();
  522.        OsdShowPscan(0);
  523. }
  524. #endif
  525. void ircmd_p_scan(void)
  526. {
  527.   #ifdef SUPPORT_MIDI
  528.     #if !defined(IR44)
  529.      if(midiState == MIDI_STATE_PAYLOAD) return;//axel2004.08.09
  530.      
  531.     #else//!defined(IR44)
  532.         //if (bMidiPlayerBoolean) { //Jeff 20031029
  533.         if(midiState == MIDI_STATE_PAYLOAD){ // dtb 20040109
  534.             ircmd_key_down();
  535.             return;
  536.         }
  537.         #ifdef SUPPORT_MIDI_MENU_SEL
  538.         if (gIsMidiSelMenu)  return;
  539.         #endif
  540.     #endif//!defined(IR44)axel2004.08.09
  541.    #endif//SUPPORT_MIDI
  542. #if defined(MINTON_DVD)
  543.     if (full_scrn&SETUP)
  544.     {
  545.         return;
  546.     }   
  547. #endif
  548. #if defined(P_SCAN_ONLY_CHG_INT_MODE)||defined(SUPPORT_IR_I2P_KEY)
  549.     ircmd_p_scan_mode();
  550. #elif defined(QSI_PLATFORM) //qsi: merge by johnson 20040712
  551.     ircmd_tvout();
  552. //qsi: add by sharon    
  553. #else 
  554.     ircmd_p_scan_all_mode();
  555. #endif
  556. #ifdef CD_PLAYER        //liweihua 2003-9-3
  557.     if((cd_type_loaded==CDDA)&&(play_state!=VCD_STATE_STOP))
  558.     {
  559.         show_cdplayer();
  560.     }
  561. #endif
  562. #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS)  //xyy 2003-10-13 9:42
  563.         if(play_state == VCD_STATE_POWER)
  564.             disfreq();
  565. #endif
  566. }
  567. #ifdef ONLY_INTERLACE_KEY
  568. /*
  569.  *video output mode :
  570.  *      INTERLACE
  571.  */        
  572. void ircmd_interlace(void)
  573. {
  574.     tv_out_id = INTERLACE;
  575.     setup_tv_out(tv_out_id);
  576. //    setup_SetPScan();  //fengjl marked it  3-11-25 22:19
  577.     
  578.     //PrintOsdMsg(STR_OS_YCbCr, REGION1, 1, 0);
  579.     PrintOsdMsg(STR_OS_YCbCr, REGION1, 3, 0);    
  580.     WriteToI2c(0xa0, VIDEO_OUTPUT_ADDR, (BYTE *)&tv_out_id,sizeof(tv_out_id));
  581.     //refresh VFD pannel
  582.     tv_output_vfd_time = VIDEO_VFD_DELAY_TIME;
  583.         
  584. }
  585. #endif
  586. #ifdef ONLY_VGA_KEY
  587. /*
  588.  *video output mode :
  589.  *      VGA
  590.  */        
  591. void ircmd_VGA(void)
  592. {
  593.     printf("---VGA---n");
  594.     
  595.         tv_out_id = PC_VGA;
  596.         setup_tv_out(tv_out_id);
  597. //      setup_SetPScan();   //fengjl marked it  3-11-25 22:19
  598.     
  599.         //PrintOsdMsg(STR_OS_PC_VGA, REGION1, 1, 0);
  600.         PrintOsdMsg(STR_OS_PC_VGA, REGION1, 3, 0);      
  601.         
  602.     
  603.         //save tv_out_id_value
  604.     WriteToI2c(0xa0, VIDEO_OUTPUT_ADDR, (BYTE *)&tv_out_id,sizeof(tv_out_id));
  605.     //refresh VFD pannel
  606.     tv_output_vfd_time = VIDEO_VFD_DELAY_TIME;
  607. }
  608. #endif//ONLY_VGA_KEY
  609. #ifdef ONLY_P_SCAN_KEY
  610. /*
  611.  *video output mode :
  612.  *      P_SCAN
  613.  */        
  614. #ifdef GBM_DVD
  615. void ircmd_only_P_SCAN(void)
  616. {
  617.     printf("-----------P_SCAN---n");
  618.         tv_out_id = P_SCAN;
  619.         setup_tv_out(tv_out_id);
  620.         setup_SetPScan(); 
  621.     PrintOsdMsg(STR_OS_P_SCAN_YUV, REGION1, 1, 0);     
  622.     
  623. }
  624. #else//GBM_DVD
  625. void ircmd_only_P_SCAN(void)
  626. {
  627.     printf("-----------P_SCAN---n");
  628.         tv_out_id = P_SCAN;
  629.         setup_tv_out(tv_out_id);
  630. //          setup_SetPScan();   //fengjl marked it  3-11-25 22:19
  631.     
  632.         //PrintOsdMsg(STR_OS_P_SCAN_YUV, REGION1, 1, 0);
  633.     PrintOsdMsg(STR_OS_P_SCAN_YUV, REGION1, 3, 0);     
  634.     WriteToI2c(0xa0, VIDEO_OUTPUT_ADDR, (BYTE *)&tv_out_id,sizeof(tv_out_id));
  635.     //refresh VFD pannel
  636.     tv_output_vfd_time = VIDEO_VFD_DELAY_TIME;
  637.     
  638. }
  639. #endif//GBM_DVD
  640. #endif//ONLY_P_SCAN_KEY
  641. /*
  642. #ifdef BBK_DVD    //fengjl marked it  3-11-25 22:19
  643. /
  644.  *  default TV output is "INTERLACE"
  645.  * 
  646.  * to avoid the bug when POWER ON, S video can not output normally.
  647.  * zhaoyanhua add 2003-11-24 14:13
  648.  /
  649. void tv_init_output(void)
  650. {
  651.     tv_out_id = INTERLACE;
  652.     setup_tv_out(tv_out_id);
  653. //    setup_SetPScan();
  654.     
  655. }
  656. #endif
  657. */
  658. void ircmd_chg_dac(void)
  659. {
  660. #if 0    
  661.     regs0->emu_cfg[1] = regs0->emu_cfg[1]^0x100;
  662. #endif    
  663. }
  664. /*
  665. ** display format
  666. */
  667. void    ircmd_display_format_toggle(void)
  668. {
  669. #ifdef INVALID_TV_FORMAT_KEY_IN_SETUP        //hq, 2004-3-13 15:24
  670.     if(full_scrn&SETUP)
  671.     {       
  672.         return;
  673.     }
  674. #endif  
  675. #ifdef TVFORMAT_USE_IR_CRT
  676. #if defined(MINTON_DVD) 
  677.     if (full_scrn&SETUP)
  678.     {
  679.         return;
  680.     }   
  681. #endif
  682. #if defined(SDRAM_16Mb_Mode)    
  683.     if( (full_scrn&SETUP)||(full_scrn&PROGRAM) )
  684.     {
  685.         return;
  686.     }   
  687. #endif
  688. #if defined(TV_FORMAT_CHG2_VIDEO_MODE)&&!defined(ADD_TV_VIDEO_MODE) 
  689.     ircmd_tv_sys_mode();
  690. #else   
  691.     ircmd_TV_format_toggle();
  692. #endif
  693. #endif//TVFORMAT_USE_IR_CRT
  694. }