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

DVD

开发平台:

C/C++

  1. /*****************************************************************************
  2. ** FILE
  3. ** ir_parse.c
  4. **
  5. ** DESCRIPTION
  6. ** process IR keys and send to ir_cmd_xxx for actual process
  7. **
  8. **   creater: Terry
  9. **
  10. **
  11. **
  12. ****************************************************************************/
  13. #include "config.h"
  14. #include "regmap.h"
  15. #include "global.h"
  16. #include "cfont.h"
  17. #include "func.h"
  18. #include "sio.h"
  19. #include "ircmd.h"
  20. #include "ircode.h"
  21. #include "user_init.h"
  22. #include "iop.h"
  23. #include "atapi_if.h"
  24. #include "macro.h"
  25. #include "osd.h"
  26. #include "bitop.h"
  27. #include "timer.h"
  28. #include "kernel.h"
  29. #include "memcfg.h"
  30. #ifdef SUPPORT_MIDI
  31. #include "fsmidi.h"                //ouyang  2004.08.13 take apart the function of "up" key
  32. #ifdef SUPPORT_MIDI_MENU_SEL     xlluo 2004.11.23
  33. #include "fsmidiUI.h"
  34. #endif
  35. #endif
  36. #ifdef AD_TCL//2004-3-22 13:11 lijd
  37. #include "user_if.h"
  38. #endif
  39. #ifdef NEWSTYLE_WINDOW
  40. #include "vpp.h"
  41. #include "osd_arc.h"
  42. #endif
  43. #ifdef EASTWIN
  44. #include "gpio.h"//tulijuan040908
  45. #endif
  46. #ifdef TAS3001_AMP
  47. #include "ti3001.h"
  48. #endif
  49. #ifdef TAS5026_AMP
  50. #include "ti5026.h"
  51. #endif
  52. #ifdef DIVX_DRM
  53. #include "DRM_UI.h"
  54. #endif
  55. //#define ssc_watch_ir_code   1
  56. #ifndef DVDRELEASE
  57. #define IR_DBG  //terry,2004/2/19 05:04PM,pls don't mark it.
  58. #define MONE_DSP24_SHOW_CODEC_NAME_BY_ANGLE_KEY       // 2004/12/21 yltseng
  59. #endif
  60. #ifdef JPG_EFFECT
  61. #include "jpegeffect.h"
  62. #endif
  63. #ifdef SUPPORT_REP_READ
  64. #include "read.h"
  65. #endif
  66. #ifdef SUPPORT_DISPLAY_MENU
  67. #include "setup_def.h"
  68. #endif
  69. #ifdef QSI_SHOW_ERR_RATE
  70. #include "uart.h"
  71. #endif
  72. #ifdef NEW_PARENTAL_GUI//zhaoyanhua add 2004-2-9 13:02
  73. extern BYTE new_parental_gui;
  74. #elif defined(MODIFY_PARENTAL_GUI)
  75. extern BYTE parental_gui_flag;
  76. #endif//NEW_PARENTAL_GUI
  77. #if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI) 
  78. extern void ExitParentalGUI(void);
  79. #endif
  80. #define CLS_ERR_KEY
  81. #ifdef PRE_NEXT_FLAG        
  82. UINT8 PRE_FLAG;
  83. UINT8 NEXT_FLAG;
  84. #endif  //axel, for invalid IRC_NEXT in bad discs 2004/7/12 
  85. //extern void osd_restore();
  86. extern BYTE Is_JPEG_STATE();
  87. extern UINT32 save_srn_start_t;
  88. extern int is_dvd_prohibit_key(void);
  89. extern int is_menu(void); // in cderr.c
  90. extern void init_ir_num(void);
  91. extern void osdshow(UINT8 r,char *buf);
  92. #ifdef TP6317_PANNEL   //yaowh add 04-10-25
  93.    BYTE TP6317_Power = 0 ;
  94. #endif
  95. #ifdef NEW_UART_COMMAND            //lijinhai for fuss new request
  96. extern BYTE nCurrentVolMode;
  97. #endif
  98. #ifdef NEWSTYLE_WINDOW
  99. extern void exit_browse_func(void);
  100. #endif
  101. #ifdef JPG_EFFECT
  102. extern void FSGUI_Menu(void);
  103. #endif
  104. #ifdef SUPPORT_TUNER
  105. extern void tuner_key(BYTE key);
  106. #endif
  107. #ifdef DOUBLE_TITLE //susu add 2003-8-27 13:55
  108. extern void exit_double_title(void);
  109. #endif
  110. #ifdef  ROTARY_VOLUME
  111. extern void RotaryStateChk(void);
  112. #endif
  113. extern BYTE setup_IsSettingPassword(void);
  114. #ifdef HELP_BMP_GUI
  115.     #define HELP_PAGE_COUNT 4
  116. #else
  117.     #define HELP_PAGE_COUNT 3
  118. #endif
  119. void ircmd_null(){}
  120. #ifdef QSI_PLATFORM //qsi: added by johnson 20040812
  121. extern void spi_cmd_switch_media_to_card(void);
  122. extern void spi_cmd_switch_media_to_dvd(void);
  123. void ircmd_card_cd_select(void)
  124. {
  125. #ifdef SUPPORT_CARD_STORAGE
  126.     if( source_type_now == source_disc)
  127.     {
  128.         spi_cmd_switch_media_to_card();
  129.     }
  130.     else
  131.     {
  132.         spi_cmd_switch_media_to_dvd();
  133.     }
  134. #endif
  135. }
  136. #endif
  137. #ifdef PMP_UI//liweihua 2005-1-5
  138. const IRFUNC irc_func_table[IR_CODE_MAX_NUM]=
  139. {
  140. //00-0F
  141. ircmd_null,//ircmd_0,                        //IRC_0,                                        //0x00
  142. ircmd_null,//ircmd_1,                        //IRC_1,                                        //0x01
  143. ircmd_null,//ircmd_2,                        //IRC_2,                                        //0x02
  144. ircmd_null,//ircmd_3,                        //IRC_3,                                        //0x03
  145. ircmd_null,//ircmd_4,                        //IRC_4,                                        //0x04
  146. ircmd_null,//ircmd_5,                        //IRC_5,                                        //0x05
  147. ircmd_null,//ircmd_6,                        //IRC_6,                                        //0x06
  148. ircmd_null,//ircmd_7,                        //IRC_7,                                        //0x07
  149. ircmd_null,//ircmd_8,                        //IRC_8,                                        //0x08
  150. ircmd_null,//ircmd_9,                        //IRC_9,                                        //0x09
  151. ircmd_null,//ircmd_10,                       //IRC_10,                                       //0x0a
  152. ircmd_null,//ircmd_p10,                      //IRC_P10,                                      //0x0b
  153. ircmd_null,//ircmd_eject_toggle,             //IRC_EJECT,                                    //0x0c
  154. ircmd_null,//ircmd_mute,                     //IRC_MUTE,                                     //0x0d
  155. ircmd_null,//ircmd_key_up,                   //IRC_KEY_UP,                                   //0x0e
  156. ircmd_null,//ircmd_key_reset,                //IRC_KEY_RESET,                                //0x0f
  157. //10-1F
  158. ircmd_null,//ircmd_key_down,                 //IRC_KEY_DN,                                   //0x10
  159. ircmd_volume_up,                //IRC_VOLUME_UP,                                //0x11
  160. ircmd_volume_down,              //IRC_VOLUME_DN,                                //0x12
  161. ircmd_slowmotion,               //IRC_SLOW,                                     //0x13
  162. ircmd_null,//ircmd_step,                     //IRC_STEP,                                     //0x14
  163. ircmd_pause,                    //IRC_PAUSE,                                    //0x15
  164. ircmd_play,                     //IRC_PLAY,                                     //0x16
  165. ircmd_play_resume,              //IRC_PLAY_RESUME,                              //0x17
  166. pmpkey_return,                  //IRC_RETURN,                                   //0x18
  167. ircmd_null,//ircmd_stop,                     //IRC_STOP,                                     //0x19
  168. ircmd_null,                     //IRC_LANGUAGE,                                 //0x1a,(not use)
  169. ircmd_backward,                 //IRC_BACKWARD,                                 //0x1b
  170. ircmd_forward,                  //IRC_FORWARD,                                  //0x1c
  171. ircmd_null,//ircmd_prev,                     //IRC_PREV,                                     //0x1d
  172. ircmd_null,//ircmd_next,                     //IRC_NEXT,                                     //0x1e
  173. ircmd_display,                  //IRC_DISPLAY,                                  //0x1f
  174. //20-2F
  175. ircmd_null,//ircmd_repeat_ab,                //IRC_AB,                                       //0x20
  176. ircmd_null,//ircmd_repeat_all,               //IRC_REPEAT,                                   //0x21
  177. ircmd_null,//ircmd_playmode_toggle,          //IRC_PBC,                                      //0x22
  178. ircmd_null,//ircmd_goto,                     //IRC_GOTO,                                     //0x23
  179. ircmd_null,//ircmd_shuffle,                  //IRC_RANDOM,                                   //0x24
  180. ircmd_resume,                   //IRC_RESUME,                                   //0x25
  181. ircmd_null,//ircmd_remaintime,               //IRC_TIME,                                     //0x26
  182. ircmd_power,                    //IRC_POWER,                                    //0x27
  183. ircmd_zoom,                     //IRC_ZOOM,                                     //0x28
  184. pmpkey_up,                       //IRC_UP,                                       //0x29
  185. pmpkey_down,                     //IRC_DOWN,                                     //0x2a
  186. pmpkey_left,                     //IRC_LEFT,                                     //0x2b
  187. pmpkey_right,                    //IRC_RIGHT,                                    //0x2c
  188. ircmd_null,//reset_ir,                       //IRC_PLAY_IS_DEFAULT,                          //0x2d,(not use)
  189. ircmd_null,                    //IRC_FREEZE,                                   //0x2e,no use
  190. ircmd_null,//ircmd_channel,                  //IRC_CHANNEL                                   //0x2f
  191. //30-3F
  192. ircmd_null,//ircmd_channel_dn,               //IRC_CHANNEL_DN,                               //0x30
  193. ircmd_null,                     //IRC_EFFECT,                                   //0x31,(not use) ,terry,2004/2/10 05:00PM
  194. ircmd_null,//ircmd_preview,                  //IRC_PREVIEW,                                  //0x32
  195. ircmd_null,//ircmd_9frames,                  //IRC_9FRAMES,                                  //0x33
  196. ircmd_null,//ircmd_prog,                     //IRC_PROGRAM,                                  //0x34
  197. ircmd_null,//ircmd_display_format_toggle,    //IRC_FORMAT,                                   //0x35
  198. ircmd_null,//ircmd_intro,                    //IRC_INTRO,                                    //0x36
  199. ircmd_null,                     //IRC_GAME_L,                                   //0x37
  200. ircmd_null,                     //IRC_GAME_R,                                   //0x38
  201. ircmd_null,                     //IRC_GAME_UP,                                  //0x39
  202. ircmd_null,                     //IRC_GAME_DN,                                  //0x3a
  203. ircmd_null,                     //IRC_GAME_TN,                                  //0x3b
  204. ircmd_null,                     //IRC_GAME_UL,                                  //0x3c
  205. ircmd_null,                     //IRC_GAME,                                     //0x3d,(not use)
  206. ircmd_null,                     //IRC_FOCUS,                                    //0x3e,(not use)
  207. ircmd_null,                    //IRC_DISK1,                                    //0x3f
  208. //40-4F
  209. ircmd_null,                    //IRC_DISK2,                                    //0x40
  210. ircmd_null,                    //IRC_DISK3,                                    //0x41
  211. ircmd_play_pause,               //IRC_PAUSEPLAY,                                //0x42
  212. ircmd_null,                     //IRC_QUALIFY                                   //0x43,(not use)
  213. ircmd_null,                //IRC_RESET_DSP                                 //0x44
  214. ircmd_null,//ircmd_sub_picture,              //IRC_SUBP                                      //0x45                    
  215. ircmd_null,//ircmd_angle,                    //IRC_ANGLE                                     //0x46
  216. ircmd_null,//ircmd_audio_language,           //IRC_AUD_LANGUAGE                              //0x47
  217. pmpkey_select,                  //IRC_SELECT                                    //0x48
  218. ircmd_null,//ircmd_title_menu,               //IRC_TITLEMENU                                 //0x49
  219. ircmd_null,//ircmd_clear,                    //IRC_CLEAR                                     //0x4a
  220. ircmd_null,//ircmd_setup,                    //IRC_SETUP                                     //0x4b
  221. ircmd_null,//ircmd_karaoke,                  //IRC_KARAOKE                                   //0x4c
  222. ircmd_null,//ircmd_3dsound,                  //IRC_3D                                        //0x4d
  223. ircmd_null,//ircmd_bk_slow,                  //IRC_BK_SLOW                                   //0x4e
  224. ircmd_null,//ircmd_reading,                  //IRC_READING                                   //0x4f
  225. //50-5F
  226. };
  227. #else//#ifdef PMP_UI//liweihua 2005-1-5
  228. const IRFUNC irc_func_table[IR_CODE_MAX_NUM]=
  229. {
  230. //00-0F
  231. ircmd_0,                        //IRC_0,                                        //0x00
  232. ircmd_1,                        //IRC_1,                                        //0x01
  233. ircmd_2,                        //IRC_2,                                        //0x02
  234. ircmd_3,                        //IRC_3,                                        //0x03
  235. ircmd_4,                        //IRC_4,                                        //0x04
  236. ircmd_5,                        //IRC_5,                                        //0x05
  237. ircmd_6,                        //IRC_6,                                        //0x06
  238. ircmd_7,                        //IRC_7,                                        //0x07
  239. ircmd_8,                        //IRC_8,                                        //0x08
  240. ircmd_9,                        //IRC_9,                                        //0x09
  241. ircmd_10,                       //IRC_10,                                       //0x0a
  242. ircmd_p10,                      //IRC_P10,                                      //0x0b
  243. ircmd_eject_toggle,             //IRC_EJECT,                                    //0x0c
  244. ircmd_mute,                     //IRC_MUTE,                                     //0x0d
  245. ircmd_key_up,                   //IRC_KEY_UP,                                   //0x0e
  246. ircmd_key_reset,                //IRC_KEY_RESET,                                //0x0f
  247. //10-1F
  248. ircmd_key_down,                 //IRC_KEY_DN,                                   //0x10
  249. ircmd_volume_up,                //IRC_VOLUME_UP,                                //0x11
  250. ircmd_volume_down,              //IRC_VOLUME_DN,                                //0x12
  251. ircmd_slowmotion,               //IRC_SLOW,                                     //0x13
  252. ircmd_step,                     //IRC_STEP,                                     //0x14
  253. ircmd_pause,                    //IRC_PAUSE,                                    //0x15
  254. ircmd_play,                     //IRC_PLAY,                                     //0x16
  255. ircmd_play_resume,              //IRC_PLAY_RESUME,                              //0x17
  256. ircmd_return,                   //IRC_RETURN,                                   //0x18
  257. ircmd_stop,                     //IRC_STOP,                                     //0x19
  258. ircmd_null,                     //IRC_LANGUAGE,                                 //0x1a,(not use)
  259. ircmd_backward,                 //IRC_BACKWARD,                                 //0x1b
  260. ircmd_forward,                  //IRC_FORWARD,                                  //0x1c
  261. ircmd_prev,                     //IRC_PREV,                                     //0x1d
  262. ircmd_next,                     //IRC_NEXT,                                     //0x1e
  263. ircmd_display,                  //IRC_DISPLAY,                                  //0x1f
  264. //20-2F
  265. ircmd_repeat_ab,                //IRC_AB,                                       //0x20
  266. ircmd_repeat_all,               //IRC_REPEAT,                                   //0x21
  267. ircmd_playmode_toggle,          //IRC_PBC,                                      //0x22
  268. ircmd_goto,                     //IRC_GOTO,                                     //0x23
  269. ircmd_shuffle,                  //IRC_RANDOM,                                   //0x24
  270. ircmd_resume,                   //IRC_RESUME,                                   //0x25
  271. ircmd_remaintime,               //IRC_TIME,                                     //0x26
  272. ircmd_power,                    //IRC_POWER,                                    //0x27
  273. ircmd_zoom,                     //IRC_ZOOM,                                     //0x28
  274. ircmd_up,                       //IRC_UP,                                       //0x29
  275. ircmd_down,                     //IRC_DOWN,                                     //0x2a
  276. ircmd_left,                     //IRC_LEFT,                                     //0x2b
  277. ircmd_right,                    //IRC_RIGHT,                                    //0x2c
  278. #ifdef GBM_IRC_SHIELD_FUNCTION                   //gerry,2004-1-30 19:20
  279. ircmd_shield_func,              //IRC_SHIELD_FUNC       //0x2d
  280. #else
  281. reset_ir,                       //IRC_PLAY_IS_DEFAULT,                          //0x2d,(not use)
  282. #endif
  283. #ifdef USER_MPEG_LOGO
  284. ircmd_mpeg_logo,                //IRC_mpeg_logo,                                //0x2e,no use
  285. #elif defined(ADD_TV_VIDEO_MODE)
  286. ircmd_tv_sys_mode,                      //IRC_TV_MODE,                                      //0X2e
  287. #else
  288. ircmd_null,                     //IRC_FREEZE,                                   //0x2e,no use
  289. #endif 
  290. ircmd_channel,                  //IRC_CHANNEL                                   //0x2f
  291. //30-3F
  292. ircmd_channel_dn,               //IRC_CHANNEL_DN,                               //0x30
  293. #ifdef CNTR_5SPK_VOLUME
  294. ircmd_volume_switch,            //IRC_VOLUME_SWITCH,                            //0x31
  295. #else
  296. ircmd_null,                     //IRC_EFFECT,                                   //0x31,(not use) ,terry,2004/2/10 05:00PM
  297. #endif
  298. ircmd_preview,                  //IRC_PREVIEW,                                  //0x32
  299. ircmd_9frames,                  //IRC_9FRAMES,                                  //0x33
  300. ircmd_prog,                     //IRC_PROGRAM,                                  //0x34
  301. ircmd_display_format_toggle,    //IRC_FORMAT,                                   //0x35
  302. ircmd_intro,                    //IRC_INTRO,                                    //0x36
  303. #ifdef CAR_VCD//kenny 891220 modify
  304. ircmd_next_disk,                                                                //0x37
  305. ircmd_pre_disk,                                                                 //0x38
  306. ircmd_reset_changer,                                                            //0x39
  307. #elif defined(BRIGHTNESS_COLOR_KEY)////////////tw_kevin.lo040901
  308. ircmd_brightness_color, //IRC_BRICOL_ADJUST
  309. ircmd_null,                                                        //0x38
  310. ircmd_null,                      
  311. #else
  312. ircmd_null,                     //IRC_GAME_L,                                   //0x37
  313. ircmd_null,                     //IRC_GAME_R,                                   //0x38
  314. ircmd_null,                     //IRC_GAME_UP,                                  //0x39
  315. #endif
  316. #ifdef TWO_FUN_IN_ONE_VFD_KEY    //dingzhy for GBM
  317. ircmd_vfd_next,                     //IRC_VFD_NEXT,                                  //0x3a
  318. ircmd_vfd_prev,                     //IRC_VFD_PREV,                                  //0x3b
  319. #else
  320. ircmd_null,                     //IRC_GAME_DN,                                  //0x3a
  321. ircmd_null,                     //IRC_GAME_TN,                                  //0x3b
  322. #endif
  323. ircmd_null,                     //IRC_GAME_UL,                                  //0x3c
  324. ircmd_null,                     //IRC_GAME,                                     //0x3d,(not use)
  325. #ifdef VIRTUAL_KEYBOARD // alan, 2003/8/18 01:15PM
  326. ircmd_virtual_keyboard,         //IRC_VIRTUAL_KEYBOARD,                         //0x3e
  327. #else
  328. ircmd_null,                     //IRC_FOCUS,                                    //0x3e,(not use)
  329. #endif
  330. ircmd_null,                    //IRC_DISK1,                                    //0x3f
  331. //40-4F
  332. ircmd_null,                    //IRC_DISK2,                                    //0x40
  333. ircmd_null,                    //IRC_DISK3,                                    //0x41
  334. ircmd_play_pause,               //IRC_PAUSEPLAY,                                //0x42
  335. ircmd_null,                     //IRC_QUALIFY                                   //0x43,(not use)
  336. ircmd_null,                //IRC_RESET_DSP                                 //0x44
  337. #ifdef DOUBLE_TITLE //susu add 2003-8-26 10:30
  338. ircmd_double_picture,
  339. #else
  340. ircmd_sub_picture,              //IRC_SUBP                                      //0x45
  341. #endif                                    
  342. ircmd_angle,                    //IRC_ANGLE                                     //0x46
  343. ircmd_audio_language,           //IRC_AUD_LANGUAGE                              //0x47
  344. ircmd_select,                   //IRC_SELECT                                    //0x48
  345. ircmd_title_menu,               //IRC_TITLEMENU                                 //0x49
  346. ircmd_clear,                    //IRC_CLEAR                                     //0x4a
  347. ircmd_setup,                    //IRC_SETUP                                     //0x4b
  348. ircmd_karaoke,                  //IRC_KARAOKE                                   //0x4c
  349. ircmd_3dsound,                  //IRC_3D                                        //0x4d
  350. ircmd_bk_slow,                  //IRC_BK_SLOW                                   //0x4e
  351. #if defined(Ti3001_OSD_UI_1)||defined(Ti5026_OSD_UI_1)
  352. ircmd_amp_control,      //IRC_AMP_CONTROL
  353. #elif defined(IR_KEY_SET_VIDEO_MODE)
  354. ircmd_set_video_mode,
  355. #else
  356. ircmd_reading,                  //IRC_READING                                   //0x4f
  357. #endif
  358. //50-5F
  359. ircmd_root_menu,                //IRC_ROOT_MENU,                                //0x50
  360. ircmd_play_select,              //IRC_PLAY_SELECT                               //0x51
  361. ircmd_mix_func,                 //IRC_MIX_FUNC                              //0x52
  362. #ifdef SUPPORT_FUNCTION_MENU
  363. ircmd_setup_plus,               //IRC_SETUP_PLUS                            //0x53
  364. #else
  365. ircmd_null,                     //IRC_SLOW_BAK_FORD                             //0x53,(not use)
  366. #endif
  367. #ifdef USE_PROLOGIC_II_KEY//clead 2003-8-7 
  368. ircmd_prologic,                 //IRC_BOOK                                      //0x54
  369. #else
  370. ircmd_book,                     //IRC_BOOK                                      //0x54
  371. #endif 
  372. ircmd_score,                    //IRC_SCORE,                                    //0x55
  373. ircmd_title_return,             //IRC_TITLE_RETURN                              //0x56
  374. ircmd_echo_up,                  //IRC_ECHO_UP                                   //0x57
  375. ircmd_echo_down,                //IRC_ECHO_DOWN                                 //0x58
  376. ircmd_mic_up,                   //IRC_MIC_UP                                    //0x59
  377. #ifdef VIEW_MODE_KEY
  378. ircmd_view_mode,                //IRC_VIEW_MODE                                 //0x5a
  379. #else
  380. ircmd_mic_down,                 //IRC_MIC_DOWN                                  //0x5a
  381. #endif
  382. //reserve ir hard code to new ir cmd
  383. ircmd_p_scan,                   //IRC_VIDEO_OUT,                                //0x5b
  384. #ifdef EMU_MODE
  385. ircmd_chg_dac,                  //IRC_NULL,                                     //0x5c
  386. #else
  387. reset_ir,                       //IRC_NULL,                                     //0x5c
  388. #endif
  389. #ifdef SWITCH_CD_CARD_USB
  390. ircmd_switch_cd_card_usb,       //IRC_SWITCH_GUI                                //0x5d
  391. #else
  392. reset_ir,                       //IRC_NULL,                                     //0x5d
  393. #endif
  394. ircmd_default_setup,            //IRC_NULL,                                     //0x5e
  395. #if defined(FAT_Write_UI) || defined(FILE_MODE_WRITE)   //sunzhh 20041231
  396. ircmd_media_control,            //IRC_MEDIA_CONTROL                                //0x5f
  397. #else
  398. reset_ir,                       //IRC_NULL,                                     //0x5f
  399. #endif
  400. //60-max
  401. #ifdef ONLY_INTERLACE_KEY
  402. ircmd_interlace,               //IRC_INTERLACE                                 //0x60
  403. #endif
  404. #ifdef ONLY_VGA_KEY
  405. ircmd_VGA,                     //IRC_VGA 
  406. #endif                                         
  407. #ifdef ONLY_P_SCAN_KEY
  408. ircmd_only_P_SCAN,              //IRC_ONLY_P_SCAN                               //0x62
  409. #endif
  410. #ifdef ONLY_EQ_KEY
  411. ircmd_EQ,                      //IRC_EQ 
  412. #endif                                      
  413. #ifdef ONLY_SOUND_FIELD_KEY
  414. ircmd_sound_field,                 //IRC_SOUND_FEILD                               //0x64
  415. #endif
  416. #ifdef ONE_KEY_PASS             
  417. ircmd_one_key_pass,            //IRC_ONE_KEY_PASS                              //0x65
  418. #endif //ONE_KEY_PASS
  419. #ifdef AUDIO_2CH_5_1CH
  420. ircmd_2ch_5_1ch,               //IRC_2CH_5_1_CH                                //0x66
  421. #endif
  422. #ifdef RECORD_KEY
  423. ircmd_record,                  //IRC_RECORD
  424. #endif                                
  425. #ifdef DIV_GOTO_DISPLAY
  426. ircmd_search,                  //IRC_SEARCH                                    //0x68
  427. #endif
  428. #ifdef DISC_INFO_KEY
  429. ircmd_disc_info,               //IRC_DISC_INFO                                 //0x69                   
  430. #endif
  431. #ifdef SPECTRUM_KEY   
  432. ircmd_spectrum,               //IRC_SPECTRUM                                   //0x6a 
  433. #endif
  434. #ifdef IR_SWITCH_CARD_CD    //Maoyong,2004.05.13 swith between Card/CD
  435. ircmd_switch_card_cd,
  436. #endif
  437. #ifdef IR_IRCMD_JUMP_30SEC  //wangwei 2004-7-20 22:30
  438. ircmd_jump_30sec,
  439. #endif
  440. #ifdef SANJING_MIDI_DVD    
  441. ircmd_main_melody,     //IRC_MAIN_MELODY
  442. #endif
  443. #ifdef TWO_KEY_SWITCH_TWO_SUBTITLE  //added by wangwei,2004-10-5 14:33
  444. ircmd_switch_2nd_subtitle,
  445. #endif
  446. #ifdef IR_SWITCH_CD_USB_CF_OTHER  //added by dingzhy  4-10-20 13:57
  447. ircmd_switch_cd_usb_cf_other, //IRC_CD_USB_CF_OTHER
  448. #elif defined(FILE_MODE_WRITE)//added by wangwei,2005-1-10 13:07
  449. ircmd_file_mode_write,
  450. #endif
  451. //Note:
  452. //adjustment ir key code to 0x60 
  453. //wanghaoying 2003-10-28 10:46
  454. #if defined(SOUND_NO_KEYPAGE)&&defined(VTREK_DVD)
  455. ircmd_3dsound,                      //IRC_3D2,                                      
  456. #endif
  457. #ifdef ONE_KEY_CONTRL_ECHO
  458. ircmd_echo,                     //IRC_ECHO
  459. #endif
  460. /* wanghaoying marked 2004-7-1 15:41, for not use any more
  461. //freyman mod 2002-9-3 10:35
  462. //#if defined(SUPPORT_AMP) && defined(IR17) // for nextbase remoter
  463. #ifdef IR17 // for nextbase remoter
  464. ircmd_null,                     //IRC_BAND,                 //0x5b
  465. ircmd_center_up,                //IRC_CENTER_UP,            //0x5c
  466. ircmd_center_down,              //IRC_CENTER_DOWN,          //0x5d
  467. ircmd_rear_up,                  //IRC_REAR_UP,              //0x5e 
  468. ircmd_rear_down,                //IRC_REAR_DOWN,            //0x5f 
  469. ircmd_woofer_up,                //IRC_WOOFER_UP,            //0x60
  470. ircmd_woofer_down,              //IRC_WOOFER_DOWN,          //0x61
  471. ircmd_middle_up,                //IRC_MIDDLE_UP,            //0x62
  472. ircmd_middle_down,              //IRC_MIDDLE_DOWN,          //0x63
  473. ircmd_base_up,                  //IRC_BASE_UP,              //0x64
  474. ircmd_base_down,                //IRC_BASE_DOWN,            //0x65
  475. ircmd_treble_up,                //IRC_TREBLE_UP,            //0x66
  476. ircmd_treble_down,              //IRC_TREBLE_DOWN,          //0x67 
  477. ircmd_amp_onoff,                //IRC_AMP_ONOFF,            //0x68
  478. ircmd_front_down,               //IRC_MEMORY_DOWN,          //0x69
  479. ircmd_front_up,                 //IRC_MEMORY_UP,            //0x6a
  480. ircmd_channel_dn,               //IRC_AMP_ON,               //0x6b
  481. //IRC_NUM_ENTER,                //0x6c
  482. #endif
  483. #ifdef SUPPORT_AMP
  484. ircmd_amp_onoff,                //IRC_AMP_ONOFF,            //0x5b
  485. #endif
  486. */
  487. ircmd_only_pause,               //IRC_ONLY_PAUSE ,          //0x5b
  488. ircmd_exit_setup,               //IRC_EXIT_SETUP,           //0x5c
  489. #ifdef NEW_UART_COMMAND      //lijinhai define for fuss new requesst
  490.         ircmd_av1_mode,           //0x5d
  491.         ircmd_av2_mode,           //0x5e
  492.         ircmd_tuner_mode,         //0x5f
  493.         ircmd_dvd_mode,           //0x60
  494.         ircmd_qsound,             //0x61 
  495.         ircmd_vol_default,        //0x62
  496.         ircmd_alarm,              //0x63
  497.         ircmd_front_vol,          //0x64
  498.         ircmd_center_vol,         //0x65
  499.         ircmd_rear_vol,           //0x66
  500.         ircmd_subwoofer_vol,      //0x67
  501.         ircmd_treble_vol,         //0x68
  502.         ircmd_bass_vol,           //0x69
  503.         ircmd_balancefront_vol,   //0x6a
  504.         ircmd_balancerear_vol,    //0x6b
  505. #endif 
  506. reset_ir,                       //IRC_NULL,                                     
  507. #ifdef SUPPORT_RECEIVER  //huziqin 2004-2-26
  508.   ircmd_rcvr_next_mode,     //0x6d
  509.   #ifdef SUPPORT_VIDEO_WITH_SPDIF
  510.     ircmd_rcvr_analog_digital,  //0x6e
  511.   #endif
  512. #endif
  513. #if defined(BASS_ADJUST_KEY)
  514.   ircmd_rcvr_bass,
  515. #endif
  516. #if defined(TREBLE_ADJUST_KEY)
  517.   ircmd_rcvr_treble,
  518. #endif
  519. #if defined(EQ_SWITCH_KEY)
  520.   ircmd_rcvr_EQ,        //xulf 2003-3-25
  521. #endif
  522. #if defined(BAND_SWITCH_KEY)
  523.   ircmd_rcvr_band,
  524. #endif
  525.   
  526.   
  527. #ifdef SUPPORT_POWER_OFF_CLOCK_FUNC  //xyy 2004-10-12
  528.   ircmd_set_clock,
  529. #endif
  530.   
  531. #ifdef TWO_FUNC_LEFT_RIGHT_KEY
  532.   ircmd_vfd_left,
  533.   ircmd_vfd_right,
  534. #endif
  535. #ifdef SUPPORT_RECEIVER  //huziqin 2004-2-26
  536.   ircmd_rcvr_select_mode,
  537. #endif //SUPPORT_RECEIVER
  538. #ifdef DOLBY_AMP_VOLUME_CTRL
  539.     ircmd_set_treble,
  540.     ircmd_set_bass,
  541. #endif
  542. #ifdef QSI_PLATFORM
  543.     ircmd_card_cd_select,
  544. #endif
  545. //IR_CODE_MAX_NUM,  // Just remark the maxium IR COMAMND Numbers. No func mapped to it!!
  546. };
  547. #endif//#ifdef PMP_UI
  548. #ifdef IR_DBG
  549. const UINT8 * const irc_func_str[IR_CODE_MAX_NUM]=
  550. {
  551. //00-0F
  552. "ircmd_0",                              //IRC_0,                //0x00
  553. "ircmd_1",                              //IRC_1,                //0x01
  554. "ircmd_2",                              //IRC_2,                //0x02
  555. "ircmd_3",                              //IRC_3,                //0x03
  556. "ircmd_4",                              //IRC_4,                //0x04
  557. "ircmd_5",                              //IRC_5,                //0x05
  558. "ircmd_6",                              //IRC_6,                //0x06
  559. "ircmd_7",                              //IRC_7,                //0x07
  560. "ircmd_8",                              //IRC_8,                //0x08
  561. "ircmd_9",                              //IRC_9,                //0x09
  562. "ircmd_10",                             //IRC_10,               //0x0a
  563. "ircmd_p10",                            //IRC_P10,              //0x0b
  564. "ircmd_eject_toggle",                   //IRC_EJECT,            //0x0c
  565. "ircmd_mute",                           //IRC_MUTE,             //0x0d
  566. "ircmd_key_up",                         //IRC_KEY_UP,           //0x0e
  567. "ircmd_key_reset",                      //IRC_KEY_RESET,        //0x0f
  568. //10-1F
  569. "ircmd_key_down",                       //IRC_KEY_DN,           //0x10
  570. "ircmd_volume_up",                      //IRC_VOLUME_UP,        //0x11
  571. "ircmd_volume_down",                    //IRC_VOLUME_DN,        //0x12
  572. "ircmd_slowmotion",                     //IRC_SLOW,             //0x13
  573. "ircmd_step",                           //IRC_STEP,             //0x14
  574. "ircmd_pause",                          //IRC_PAUSE,            //0x15
  575. "ircmd_play",                           //IRC_PLAY,             //0x16
  576. "ircmd_play_resume",                    //IRC_PLAY_RESUME       //0x17
  577. "ircmd_return",                         //IRC_RETURN,           //0x18
  578. "ircmd_stop",                           //IRC_STOP,             //0x19
  579. "ircmd_null",                           //IRC_LANGUAGE,         //0x1a,(not use)
  580. "ircmd_backward",                       //IRC_BACKWARD,         //0x1b
  581. "ircmd_forward",                        //IRC_FORWARD,          //0x1c
  582. "ircmd_prev",                           //IRC_PREV,             //0x1d
  583. "ircmd_next",                           //IRC_NEXT,             //0x1e
  584. "ircmd_display",                        //IRC_DISPLAY,          //0x1f
  585. //20-2F
  586. "ircmd_repeat_ab",                      //IRC_AB,               //0x20
  587. "ircmd_repeat_all",                     //IRC_REPEAT,           //0x21
  588. "ircmd_playmode_toggle",                //IRC_PBC,              //0x22
  589. "ircmd_goto",                           //IRC_GOTO,             //0x23
  590. "ircmd_shuffle",                        //IRC_RANDOM,           //0x24
  591. "ircmd_resume",                         //IRC_RESUME,           //0x25
  592. "ircmd_remaintime",                     //IRC_TIME,             //0x26
  593. "ircmd_power",                          //IRC_POWER,            //0x27
  594. "ircmd_zoom",                           //IRC_ZOOM,             //0x28
  595. "ircmd_up",                             //IRC_UP,               //0x29
  596. "ircmd_down",                           //IRC_DOWN,             //0x2a
  597. "ircmd_left",                           //IRC_LEFT,             //0x2b
  598. "ircmd_right",                          //IRC_RIGHT,            //0x2c
  599. #ifdef GBM_IRC_SHIELD_FUNCTION                   //gerry,2004-1-30 19:22
  600. "ircmd_shield_func",                    //IRC_SHIELD_FUNC       //0x2d
  601. #else
  602. "reset_ir",                             //IRC_PLAY_IS_DEFAULT,  //0x2d,(not use)
  603. #endif
  604. #ifdef USER_MPEG_LOGO
  605. "ircmd_mpeg_logo",                        //IRC_FREEZE,                           //0x2e,no use
  606. #elif defined(ADD_TV_VIDEO_MODE)
  607. "ircmd_tv_sys_mode",                      //IRC_TV_MODE,                                      //0X2e
  608. #else
  609. "ircmd_null",                         //IRC_FREEZE,                           //0x2e,no use
  610. #endif 
  611. "ircmd_channel",                        //IRC_CHANNEL,          //0x2f
  612. //30-3F
  613. "ircmd_channel_dn",                     //IRC_CHANNEL_DN        //0x30
  614. "ircmd_null",                           //IRC_EFFECT,           //0x31,(not use)
  615. "ircmd_preview",                        //IRC_PREVIEW,          //0x32
  616. "ircmd_9frames",                        //IRC_9FRAMES,          //0x33
  617. "ircmd_prog",                           //IRC_PROGRAM,          //0x34
  618. "ircmd_display_format_toggle",          //IRC_FORMAT,           //0x35
  619. "ircmd_intro",                          //IRC_INTRO,            //0x36
  620. #ifdef CAR_VCD//kenny 891220 modify
  621. "ircmd_next_disk",                      //IRC_NEXT_DISK         //0x37
  622. "ircmd_pre_disk",                       //IRC_PRE_DISK          //0x38
  623. "ircmd_reset_changer",                  //IRC_RES_CHG           //0x39
  624. #else
  625. "ircmd_null",                           //IRC_GAME_L,           //0x37
  626. "ircmd_null",                           //IRC_GAME_R,           //0x38
  627. "ircmd_null",                           //IRC_GAME_UP,          //0x39
  628. #endif
  629. #ifdef TWO_FUN_IN_ONE_VFD_KEY    //dingzhy for GBM
  630. "ircmd_vfd_next",                           //IRC_VFD_NEXT,          //0x3a
  631. "ircmd_vfd_prev",                           //IRC_VFD_PREV,          //0x3b
  632. #else
  633. "ircmd_null",                           //IRC_GAME_DN,          //0x3a
  634. "ircmd_null",                           //IRC_GAME_TN,          //0x3b
  635. #endif
  636. "ircmd_null",                           //IRC_GAME_UL,          //0x3c
  637. "ircmd_null",                           //IRC_GAME,             //0x3d,(not use)
  638. "ircmd_null",                           //IRC_FOCUS,            //0x3e,(not use)
  639. "ircmd_disk1",                          //IRC_DISK1,            //0x3f
  640. //40-4F
  641. "ircmd_disk2",                          //IRC_DISK2,            //0x40
  642. "ircmd_disk3",                          //IRC_DISK3,            //0x41
  643. "ircmd_play_pause",                     //IRC_PAUSEPLAY,        //0x42
  644. "ircmd_null",                           //IRC_QUALIFY           //0x43,(not use)
  645. "ircmd_null",                      //IRC_RESET_DSP         //0x44
  646. #ifdef DOUBLE_TITLE //susu add 2003-8-26 10:30
  647. "ircmd_double_picture",
  648. #else
  649. "ircmd_sub_picture",                    //IRC_SUBP              //0x45                                     //0x45
  650. #endif
  651. "ircmd_angle",                          //IRC_ANGLE             //0x46
  652. "ircmd_audio_language",                 //IRC_AUD_LANGUAGE      //0x47
  653. "ircmd_select",                         //IRC_SELECT            //0x48
  654. "ircmd_title_menu",                     //IRC_TITLEMENU         //0x49
  655. "ircmd_clear",                          //IRC_CLEAR             //0x4a
  656. "ircmd_setup",                          //IRC_SETUP             //0x4b
  657. "ircmd_karaoke",                        //IRC_KARAOKE           //0x4c
  658. "ircmd_3dsound",                        //IRC_3D                //0x4d
  659. "ircmd_bk_slow",                        //IRC_BK_SLOW           //0x4e
  660. #if defined(Ti3001_OSD_UI_1)||defined(Ti5026_OSD_UI_1)
  661. "ircmd_amp_control",                    //IRC_AMP_CONTROL       //0x4f
  662. #elif defined(IR_KEY_SET_VIDEO_MODE)
  663. "ircmd_set_video_mode",
  664. #else
  665. "ircmd_reading",                        //IRC_READING           //0x4f
  666. #endif
  667. //50-max.
  668. "ircmd_root_menu",                      //IRC_ROOT_MENU         //0x50
  669. "ircmd_play_select",                    //IRC_PLAY_SELECT       //0x51
  670. "ircmd_mix_func",                       //IRC_DISPLAY_TIME      //0x52
  671. "ircmd_null",                           //IRC_SLOW_BAK_FORD     //0x53,(not use)
  672. #ifdef USE_PROLOGIC_II_KEY//clead 2003-8-7 
  673. "ircmd_prologic",                           //IRC_BOOK              //0x54
  674. #else
  675. "ircmd_book",                           //IRC_BOOK              //0x54
  676. #endif
  677. "ircmd_score",                          //IRC_SCORE,            //0x55
  678. "ircmd_title_return",                   //IRC_TITLE_RETURN      //0x56
  679. "ircmd_echo_up",                        //IRC_ECHO_UP           //0x57
  680. "ircmd_echo_down",                      //IRC_ECHO_DOWN         //0x58
  681. "ircmd_mic_up",                         //IRC_MIC_UP            //0x59
  682. "ircmd_mic_down",                       //IRC_MIC_DOWN          //0x5a
  683. //reserve ir hard code to new ir cmd
  684. "ircmd_p_scan",                         //IRC_VIDEO_OUT,        //0x5b
  685. #ifdef EMU_MODE
  686. "ircmd_chg_dac",                        //IRC_NULL,             //0x5c
  687. #else
  688. "reset_ir",                             //IRC_NULL,             //0x5c
  689. #endif
  690. "reset_ir",                             //IRC_NULL,             //0x5d
  691. "ir_default_setup",                     //IRC_NULL,             //0x5e
  692. #if defined(FAT_Write_UI) || defined(FILE_MODE_WRITE)   //sunzhh 20041231
  693. "ircmd_media_control",            //IRC_MEDIA_CONTROL                                //0x5f
  694. #else
  695. "reset_ir",                             //IRC_NULL,             //0x5f
  696. #endif
  697. #ifdef ONLY_INTERLACE_KEY
  698. "ircmd_interlace",                      //IRC_INTERLACE          //0x60
  699. #endif
  700. #ifdef ONLY_VGA_KEY
  701. "ircmd_VGA",                            //IRC_VGA                //0x61
  702. #endif
  703. #ifdef ONLY_P_SCAN_KEY
  704. "ircmd_only_P_SCAN",                     //IRC_ONLY_P_SCAN        //0x62
  705. #endif
  706. #ifdef ONLY_EQ_KEY
  707. "ircmd_EQ",                            //IRC_EQ                 //0x63
  708. #endif
  709. #ifdef ONLY_SOUND_FIELD_KEY
  710. "ircmd_sound_field",                       //IRC_SOUND_FIELD        //0x64
  711. #endif
  712. #ifdef ONE_KEY_PASS             
  713. "ircmd_one_key_pass",                  //IRC_ONE_KEY_PASS       //0x65
  714. #endif //ONE_KEY_PASS
  715. #ifdef AUDIO_2CH_5_1CH
  716. "ircmd_2ch_5_1ch",                     //IRC_2CH_5_1_CH         //0x66
  717. #endif
  718. #ifdef RECORD_KEY
  719. "ircmd_record",                        //IRC_RECORD             //0x67
  720. #endif
  721. #ifdef DIV_GOTO_DISPLAY
  722. "ircmd_search",                        //IRC_SEARCH             //0x68
  723. #endif
  724. #ifdef DISC_INFO_KEY
  725. "ircmd_disc_info",                     //IRC_DISC_INFO          //0x69
  726. #endif
  727. #ifdef SPECTRUM_KEY                    //IRC_SPECTRUM           //0x6a
  728. "ircmd_spectrum",
  729. #endif
  730. #ifdef IR_SWITCH_CARD_CD              //IRC_SWITCH_CARD_CD
  731. "ircmd_switch_card_cd",
  732. #endif
  733. #ifdef IR_IRCMD_JUMP_30SEC  //wangwei 2004-7-20 22:30
  734. "ircmd_jump_30sec",                   //IRC_JUMP_30SEC
  735. #endif
  736. #ifdef SANJING_MIDI_DVD    
  737. "ircmd_main_melody",     //IRC_MAIN_MELODY
  738. #endif
  739. #ifdef TWO_KEY_SWITCH_TWO_SUBTITLE  //added by wangwei,2004-10-5 14:33
  740. "ircmd_switch_2nd_subtitle",
  741. #endif
  742. #ifdef IR_SWITCH_CD_USB_CF_OTHER  //added by dingzhy  4-10-20 13:57
  743. "ircmd_switch_cd_usb_cf_other", //IRC_CD_USB_CF_OTHER
  744. #elif defined(FILE_MODE_WRITE)//added by wangwei,2005-1-10 13:09
  745. "ircmd_file_mode_write",
  746. #endif
  747. //wanghaoying 2003-10-28 10:46
  748. #if defined(SOUND_NO_KEYPAGE)&&defined(VTREK_DVD)
  749. "ircmd_3dsound",                      //IRC_3D2,                                      
  750. #endif
  751. #ifdef ONE_KEY_CONTRL_ECHO
  752. "ircmd_echo",                     //IRC_ECHO
  753. #endif
  754. /* wanghaoying marked 2004-7-1 15:41, for not use any more
  755. //freyman mod 2002-9-3 10:35
  756. //#if defined(SUPPORT_AMP) && defined(IR17) // for nextbase remoter
  757. #ifdef IR17 // for nextbase remoter
  758. //#if defined(SUPPORT_AMP) && defined(IR17) // for nextbase remoter
  759. "ircmd_null",                           //IRC_BAND,             //0x5b
  760. "ircmd_center_up",                      //IRC_CENTER_UP ,       //0x5c
  761. "ircmd_center_down",                    //IRC_CENTER_DOWN,      //0x5d
  762. "ircmd_rear_up",                        //IRC_REAR_UP,          //0x5e 
  763. "ircmd_rear_down",                      //IRC_REAR_DOWN,        //0x5f 
  764. "ircmd_woofer_up",                      //IRC_WOOFER_UP,        //0x60
  765. "ircmd_woofer_down",                    //IRC_WOOFER_DOWN,      //0x61
  766. "ircmd_middle_up",                      //IRC_MIDDLE_UP,        //0x62
  767. "ircmd_middle_down",                    //IRC_MIDDLE_DOWN,      //0x63
  768. "ircmd_base_up",                        //IRC_BASE_UP,          //0x64
  769. "ircmd_base_down",                      //IRC_BASE_DOWN,        //0x65
  770. "ircmd_treble_up",                      //IRC_TREBLE_UP,        //0x66
  771. "ircmd_treble_down",                    //IRC_TREBLE_DOWN,      //0x67 
  772. "ircmd_amp_onoff",                      //IRC_AMP_ONOFF,        //0x68
  773. "ircmd_front_down",                     //IRC_MEMORY_DOWN,      //0x69
  774. "ircmd_front_up",                       //IRC_MEMORY_UP,        //0x6a
  775. "ircmd_channel_dn",                     //IRC_AMP_ON,           //0x6b
  776. #endif
  777. #ifdef SUPPORT_AMP
  778. "ircmd_amp_onoff",                      //IRC_AMP_ONOFF,        //0x5b
  779. #endif
  780. */
  781. "ircmd_only_pause",                     //IRC_ONLY_PAUSE ,      //0x5b
  782. "ircmd_exit_setup",                     //IRC_EXIT_SETUP,       //0x5c
  783. #ifdef NEW_UART_COMMAND      //lijinhai define for fuss new requesst
  784.         "ircmd_av1_mode",           //0x5d
  785.         "ircmd_av2_mode",           //0x5e
  786.         "ircmd_tuner_mode",         //0x5f
  787.         "ircmd_dvd_mode",           //0x60
  788.         "ircmd_qsound",             //0x61 
  789.         "ircmd_vol_default",        //0x62
  790.         "ircmd_alarm",              //0x63
  791.         "ircmd_front_vol",          //0x64
  792.         "ircmd_center_vol",         //0x65
  793.         "ircmd_rear_vol",           //0x66
  794.         "ircmd_subwoofer_vol",      //0x67
  795.         "ircmd_treble_vol",         //0x68
  796.         "ircmd_bass_vol",           //0x69
  797.         "ircmd_balancefront_vol",   //0x6a
  798.         "ircmd_balancerear_vol",    //0x6b
  799. #endif 
  800. "reset_ir",             //IRC_NULL,             //0x5D
  801. #ifdef SUPPORT_RECEIVER  //huziqin 2004-2-26
  802. "ircmd_rcvr_next_mode", //0x6d
  803. #ifdef SUPPORT_VIDEO_WITH_SPDIF
  804. "ircmd_rcvr_analog_digital", //0x6e
  805. #endif
  806. #endif
  807. #if defined(BASS_ADJUST_KEY)
  808.   "ircmd_rcvr_bass",
  809. #endif
  810. #if defined(TREBLE_ADJUST_KEY)
  811.   "ircmd_rcvr_treble",
  812. #endif
  813. #if defined(EQ_SWITCH_KEY)
  814.   "ircmd_rcvr_EQ",        //xulf 2003-3-25
  815. #endif
  816. #if defined(BAND_SWITCH_KEY)
  817.   "ircmd_rcvr_band",
  818. #endif
  819.   
  820.   
  821. #ifdef SUPPORT_POWER_OFF_CLOCK_FUNC  //xyy 2004-10-12
  822.   "ircmd_set_clock",
  823. #endif
  824.   
  825. #ifdef SUPPORT_RECEIVER  //huziqin 2004-2-26
  826. "ircmd_rcvr_select_mode",
  827. #endif //SUPPORT_RECEIVER
  828. #ifdef DOLBY_AMP_VOLUME_CTRL
  829. "ircmd_set_treble",
  830. "ircmd_set_bass",
  831. #endif
  832. #ifdef QSI_PLATFORM
  833.     "ircmd_card_cd_select",
  834. #endif
  835. //IR_CODE_MAX_NUM,  // Just remark the maxium IR 
  836. //IR_CODE_MAX_NUM,  // Just remark the maxium IR COMAMND Numbers. No func mapped to it!!
  837. };
  838. #endif
  839. #ifdef SUPPORT_SPI_QSI
  840. extern UINT8 uSpiRxData;
  841. const SPI_CMD_FUNC spi_cmd_func_table[MAX_SPI_CMD_NUM] =
  842. {
  843.     spi_cmd_wakeup,                     //IRC_NULL,             0x00
  844.     ircmd_power,                        //IRC_POWER,            0x01
  845.     ircmd_eject_toggle,                 //IRC_EJECT,            0x02
  846.     #ifdef SUPPORT_CARD_STORAGE
  847.     #ifndef QSI_PLATFORM //qsi: modify by johnson 20040811
  848.     spi_cmd_switch_2_disc,               //IRC_NULL,             0x03
  849.     spi_cmd_switch_2_card,               //IRC_NULL,             0x04
  850.     #else
  851.     spi_cmd_switch_media_to_dvd,        //IRC_NULL,             0x03
  852.     spi_cmd_switch_media_to_card,       //IRC_NULL,             0x04
  853.     #endif
  854.     #else
  855.     ircmd_null,
  856.     ircmd_null,
  857.     #endif
  858.     spi_cmd_play,                       //IRC_PLAY,             0x05
  859.     spi_cmd_ssaver_on,                  //IRC_NULL,             0x06
  860.     spi_cmd_ssaver_off,                 //IRC_NULL,             0x07
  861.     spi_cmd_stop2eject,                 //IRC_STOP,             0x08
  862.     spi_cmd_play_pause,                 //IRC_PAUSE,            0x09
  863.     spi_cmd_only_pause,                      //IRC_PAUSE,            0x0a
  864.     spi_cmd_pre_stop,                       //IRC_STOP,             0x0b
  865.     ircmd_angle,                        //IRC_ANGLE,            0x0c
  866.     spi_cmd_system,                     //IRC_NULL,             0x0d
  867.     ircmd_return,                       //IRC_RETURN,           0x0e
  868.     ircmd_audio_language,               //IRC_AUD_LANGUAGE,     0x0f
  869.     ircmd_playmode_toggle,              //IRC_PBC,              0x10
  870.     ircmd_zoom,                         //IRC_ZOOM,             0x11
  871.     ircmd_mute,                         //IRC_MUTE,             0x12
  872.     ircmd_sub_picture,                  //IRC_SUBP,             0x13
  873.     ircmd_slowmotion,                   //IRC_SLOW              0x14
  874.     ircmd_step,                         //IRC_STEP              0x15
  875.     ircmd_prog,                         //IRC_PROGRAM,          0x16
  876.     ircmd_shuffle,                      //IRC_RANDOM,           0x17
  877.     ircmd_channel,                      //IRC_CHANNEL,          0x18
  878.     ircmd_goto,                         //IRC_GOTO,             0x19
  879.     ircmd_prev,                         //IRC_PREV,             0x1a
  880.     ircmd_next,                         //IRC_NEXT,             0x1b
  881.     ircmd_forward,                      //IRC_FORWARD,          0x1c
  882.     ircmd_backward,                     //IRC_BACKWARD,         0x1d
  883.     ircmd_setup,                        //IRC_SETUP,            0x1e
  884.     ircmd_volume_up,                    //IRC_VOLUME_UP,        0x1f
  885.     ircmd_volume_down,                  //IRC_VOLUME_DN,        0x20
  886.     ircmd_repeat_all,                   //IRC_REPEAT,           0x21
  887.     ircmd_repeat_ab,                    //IRC_AB,               0x22
  888.     ircmd_clear,                        //IRC_CLEAR,            0x23
  889.     ircmd_title_menu,                   //IRC_TITLEMENU,        0x24
  890.     ircmd_playmode_toggle,              //IRC_PBC,              0x25
  891.     ircmd_echo_up,                      //IRC_ECHO_UP,          0x26
  892.     ircmd_echo_down,                    //IRC_ECHO_DOWN,        0x27
  893.     ircmd_mic_up,                       //IRC_MIC_UP,           0x28
  894.     ircmd_mic_down,                     //IRC_MIC_DOWN,         0x29
  895.     ircmd_resume,                       //IRC_RESUME,           0x2a
  896.     ircmd_display,                      //IRC_DISPLAY,          0x2b
  897.     ircmd_null,                         //IRC_NULL,             0x2c
  898.     ircmd_null,                         //IRC_NULL,             0x2d
  899.     ircmd_null,                         //IRC_NULL,             0x2e
  900.     ircmd_null,                         //IRC_NULL,             0x2f
  901.     ircmd_0,                            //IRC_0,                0x30
  902.     ircmd_1,                            //IRC_1,                0x31
  903.     ircmd_2,                            //IRC_2,                0x32
  904.     ircmd_3,                            //IRC_3,                0x33
  905.     ircmd_4,                            //IRC_4,                0x34
  906.     ircmd_5,                            //IRC_5,                0x35
  907.     ircmd_6,                            //IRC_6,                0x36
  908.     ircmd_7,                            //IRC_7,                0x37
  909.     ircmd_8,                            //IRC_8,                0x38
  910.     ircmd_9,                            //IRC_9,                0x39
  911. #ifdef QSI_PLATFORM
  912.     ircmd_p10,                           //IRC_10,               0x3a
  913. #else    
  914.     ircmd_10,                           //IRC_10,               0x3a
  915. #endif    
  916.     ircmd_up,                           //IRC_UP,               0x3b
  917.     ircmd_down,                         //IRC_DOWN,             0x3c
  918.     ircmd_left,                         //IRC_LEFT,             0x3d
  919.     ircmd_right,                        //IRC_RIGHT,              0x3e
  920.     ircmd_select,                       //IRC_SELECT,           0x3f
  921.     ircmd_null,                         //IRC_NULL,             0x40 Reserved
  922.     spi_cmd_tvout,                      //IRC_NULL,             0x41
  923.     spi_cmd_tvout,                      //IRC_NULL,             0x42
  924.     spi_cmd_tvout,                      //IRC_NULL,             0x43
  925.     spi_cmd_tvout,                      //IRC_NULL,             0x44
  926.     spi_cmd_tvout,                      //IRC_NULL,             0x45
  927.     spi_cmd_tvout,                      //IRC_NULL,             0x46
  928.     spi_cmd_tvout,                      //IRC_NULL,             0x47
  929.     spi_cmd_tvout,                      //IRC_NULL,             0x48
  930.     ircmd_null,                         //IRC_NULL,             0x49 Reserved
  931.     ircmd_null,                         //IRC_NULL,             0x4a Reserved
  932.     ircmd_null,                         //IRC_NULL,             0x4b Reserved
  933.     ircmd_null,                         //IRC_NULL,             0x4c Reserved
  934.     ircmd_null,                         //IRC_NULL,             0x4d Reserved
  935.     ircmd_null,                         //IRC_NULL,             0x4e Reserved
  936.     ircmd_null,                         //IRC_NULL,             0x4f Reserved
  937.     spi_cmd_region,                     //IRC_NULL,             0x50
  938.     spi_cmd_region,                     //IRC_NULL,             0x51
  939.     spi_cmd_region,                     //IRC_NULL,             0x52
  940.     spi_cmd_region,                     //IRC_NULL,             0x53
  941.     spi_cmd_region,                     //IRC_NULL,             0x54
  942.     spi_cmd_region,                     //IRC_NULL,             0x55
  943.     spi_cmd_region,                     //IRC_NULL,             0x56
  944.     spi_cmd_tvsys,                      //IRC_NULL,             0x57
  945.     spi_cmd_tvsys,                      //IRC_NULL,             0x58
  946.     spi_cmd_version_display,            //IRC_NULL,             0x59    
  947. };
  948. const UINT8 SPI_IR_TRANS_TABLE[MAX_SPI_CMD_NUM] =
  949. {
  950.     0x00,                 //0x00
  951.     IRC_POWER,            //0x01
  952.     IRC_EJECT,            //0x02//EJECT
  953.     IRC_NULL,             //0x03//SOURCE TO DISC
  954.     IRC_NULL,             //0x04//SOURCE TO CF
  955.     IRC_PLAY,             //0x05//PLAY
  956.     IRC_NULL,             //0x06
  957.     IRC_NULL,             //0x07
  958.     IRC_EJECT,             //0x08//STOP to EJECT
  959.     IRC_PAUSEPLAY,            //0x09//PLAY/PAUSE
  960.     IRC_PAUSE,            //0x0a//PAUSE
  961.     IRC_STOP,             //0x0b//STOP
  962.     IRC_ANGLE,            //0x0c//ANGLE
  963.     IRC_NULL,             //0x0d
  964.     IRC_RETURN,           //0x0e//RETURN
  965.     IRC_AUD_LANGUAGE,     //0x0f
  966.     IRC_PBC,           //0x10//PBC
  967.     IRC_ZOOM,         //0x11//ZOOM
  968.     IRC_MUTE,             //0x12//MUTE
  969.     IRC_SUBP,             //0x13
  970.     IRC_SLOW,             //0x14//SLOW
  971.     IRC_STEP,             //0x15//STEP
  972.     IRC_PROGRAM,          //0x16//PROGRAM
  973.     IRC_RANDOM,           //0x17//RANDOM
  974.     IRC_CHANNEL,          //0x18//L/R
  975.     IRC_GOTO,             //0x19//GOTO
  976.     IRC_PREV,             //0x1a//PREVIOUS
  977.     IRC_NEXT,             //0x1b//NEXT
  978.     IRC_FORWARD,          //0x1c//FORWARD
  979.     IRC_BACKWARD,         //0x1d//BACKWARD
  980.     IRC_SETUP,            //0x1e//SETUP
  981.     IRC_VOLUME_UP,        //0x1f//VOLUME UP
  982.     IRC_VOLUME_DN,        //0x20//VOLUME DN
  983.     IRC_REPEAT,           //0x21//REPEAT
  984.     IRC_AB,               //0x22//REPEAT A-B
  985.     IRC_CLEAR,            //0x23//CLEAR
  986.     IRC_TITLEMENU,        //0x24//TITLE
  987.     IRC_NULL,           //0x25/MENU
  988.     IRC_ECHO_UP,          //0x26//ECHO UP
  989.     IRC_ECHO_DOWN,        //0x27//ECHO DOWN
  990.     IRC_MIC_UP,           //0x28
  991.     IRC_MIC_DOWN,         //0x29
  992.     IRC_RESUME,           //0x2a//Resume
  993.     IRC_DISPLAY,          //0x2b//Display
  994.     IRC_NULL,             //0x2c//Reserved
  995.     IRC_NULL,             //0x2d//Reserved
  996.     IRC_NULL,             //0x2e//Reserved
  997.     IRC_NULL,             //0x2f//Reserved
  998.     IRC_0,                //0x30//Reserved
  999.     IRC_1,                //0x31//IRC_1
  1000.     IRC_2,                //0x32//IRC_2
  1001.     IRC_3,                //0x33//IRC_3
  1002.     IRC_4,                //0x34//IRC_4
  1003.     IRC_5,                //0x35//IRC_5
  1004.     IRC_6,                //0x36//IRC_6
  1005.     IRC_7,                //0x37//IRC_7
  1006.     IRC_8,                //0x38//IRC_8
  1007.     IRC_9,                //0x39//IRC_9
  1008.     IRC_P10,               //0x3a//IRC_10
  1009.     IRC_UP,               //0x3b//IRC_UP
  1010.     IRC_DOWN,             //0x3c//IRC_DOWN
  1011.     IRC_LEFT,             //0x3d//IRC_LEFT
  1012.     IRC_RIGHT,            //0x3e//IRC_RIGHT
  1013.     IRC_SELECT,           //0x3f//IRC_SELECT
  1014.     IRC_NULL,             //0x40 Reserved
  1015.     IRC_NULL,             //0x41//CVBS ON
  1016.     IRC_NULL,             //0x42
  1017.     IRC_NULL,             //0x43
  1018.     IRC_NULL,             //0x44
  1019.     IRC_NULL,             //0x45
  1020.     IRC_NULL,             //0x46
  1021.     IRC_NULL,             //0x47
  1022.     IRC_NULL,             //0x48
  1023.     IRC_NULL,             //0x49 Reserved
  1024.     IRC_NULL,             //0x4a Reserved
  1025.     IRC_NULL,             //0x4b Reserved
  1026.     IRC_NULL,             //0x4c Reserved
  1027.     IRC_NULL,             //0x4d Reserved
  1028.     IRC_NULL,             //0x4e Reserved
  1029.     IRC_NULL,             //0x4f Reserved
  1030.     IRC_NULL,             //0x50//Region Free
  1031.     IRC_NULL,             //0x51//Region 1
  1032.     IRC_NULL,             //0x52//Region 2
  1033.     IRC_NULL,             //0x53//Region 3
  1034.     IRC_NULL,             //0x54//Region 4
  1035.     IRC_NULL,             //0x55//Region 5
  1036.     IRC_NULL,             //0x56//Region 6
  1037.     IRC_NULL,             //0x57//Output PAL Signal
  1038.     IRC_NULL,             //0x58//Output NTSC Signal
  1039.     IRC_NULL,             //0x59//Version display   
  1040. };
  1041. #endif //#ifdef SUPPORT_SPI_QSI
  1042. //Marked by maoyong 2004-9-24 10:50, now just use a function to set proc func pointer
  1043. #ifdef SUPPORT_NESGAME
  1044. BYTE Game_GetBreakIr(BYTE i)
  1045. {
  1046.     switch(i)
  1047.     {
  1048.         case 0:return IR_EJECT;
  1049.         case 1:return IR_POWER;
  1050.         case 2:return IR_STOP;
  1051.         case 3:return IR_RETURN;
  1052.         case 4:return IR_POWER2; 
  1053.         case 5:return IR_RETURN2;        
  1054.         case 6:return IR_VOLUME_DOWN;
  1055.         case 7:return IR_VOLUME_UP;
  1056.         default: return 0xff;//terry,2004/2/2 04:35PM
  1057.     }
  1058. }
  1059. #ifdef SUPPORT_IR_GAME
  1060. BYTE Game_GetControlIr(BYTE i)
  1061. {
  1062.     switch(i)
  1063.     {
  1064.         case 0:return IR_RIGHT;
  1065.         case 1:return IR_LEFT;
  1066.         case 2:return IR_DOWN;
  1067.         case 3:return IR_UP;
  1068.         case 4:return IR_START; //terry,mark it,2004/2/2 04:35PM
  1069.         case 5:return IR_SELECT;
  1070.         case 6:return IR_A_KEY;
  1071.         case 7:return IR_B_KEY;
  1072.         case 8:return IR_RIGHT_UP;
  1073.         case 9:return IR_LEFT_UP;
  1074.         case 10:return IR_RIGHT_DOWN;
  1075.         case 11:return IR_LEFT_DOWN;        
  1076.         case 12:return IR_RIGHT2;
  1077.         case 13:return IR_LEFT2;
  1078.         case 14:return IR_DOWN2;
  1079.         case 15:return IR_UP2;
  1080.         case 16:return IR_START2; //terry,mark it,2004/2/2 04:35PM
  1081.         case 17:return IR_SELECT2;
  1082.         case 18:return IR_A_KEY2;
  1083.         case 19:return IR_B_KEY2;        
  1084.         default: return 0xff;//terry,2004/2/2 04:35PM
  1085.     }
  1086. }
  1087. #endif
  1088. #endif
  1089. #ifdef YUXING_DVD
  1090.     #ifdef YX828B
  1091.     #include ".\Customers\Yuxing\inv_828b_tbl.h"
  1092.     #elif defined(YX829A)
  1093.     #include ".\Customers\Yuxing\inv_tbl.h"
  1094.     #endif 
  1095. #elif defined(YUXING_MIDI_DVD)                      //add by xlluo 04-6-11 need build ??
  1096.     #include ".\Customers\Yuxing\inv_tbl.h"
  1097. #elif defined(SANJING_MIDI_DVD)                 
  1098.     #include ".\Customers\Sanjing\inv_tbl.h"
  1099. #elif defined(BBK_DVD)
  1100.     #include ".\Customers\Bbk\inv_tbl_bbk.h"
  1101. #elif defined(AKI_DVD)
  1102.     #include ".\Customers\Aki\inv_tbl_aki.h"
  1103. #elif defined(APEX_DVD)
  1104.     #include ".\Customers\Apex\inv_tbl_apex.h"
  1105. #elif defined(ATLAS_DVD)
  1106.     #include ".\Customers\Atlas\inv_tbl_atlas.h"
  1107. #elif defined(SMT_DVD)
  1108.     #include ".\Customers\Smt\inv_tbl_smt.h"
  1109. #elif defined(FUSS_DVD)
  1110.     #include ".\Customers\Fuss\inv_tbl_fuss.h"
  1111. #elif defined(YADAI_DVD)
  1112.      #ifdef SHANGGUANGDIAN_DVD
  1113.      #include ".\Customers\Yadai\inv_tbl_shangguangdian.h"
  1114.      #else
  1115.     #include ".\Customers\Yadai\inv_tbl_yadai.h"
  1116.      #endif
  1117. #elif defined(HUAJIA_DVD)
  1118.     #include ".\Customers\Huajia\inv_tbl_huajia.h"    
  1119. #elif defined(INTECH_DVD)
  1120.     #include ".\Customers\Intech\inv_tbl_intech.h"    
  1121. #elif defined(JCG_DVD)
  1122.     #include ".\Customers\Jcg\inv_tbl_jcg.h"    
  1123. #elif defined(SVA_DVD)
  1124.         #include ".\Customers\Sva\inv_tbl_sva.h"
  1125. #elif defined(KONKA_DVD)
  1126.     #include ".\Customers\Konka\inv_tbl_konka.h"    
  1127. #elif defined(GBM_DVD)
  1128.     #include ".\Customers\Gbm\inv_tbl_gbm.h"    
  1129. #elif defined(GBM_AP_DVD)
  1130.     #include ".\Customers\Gbm_ap\inv_tbl_gbm.h"    
  1131. #elif defined(GBM_PORTABLE_DVD) 
  1132.     #include ".\Customers\Gbm_portable\inv_tbl_gbmportable.h"
  1133. #elif defined(HOBO_DVD)
  1134.     #include ".\Customers\Hobo\inv_tbl_hobo.h"    
  1135. #elif defined(BMT_DVD)
  1136.     #include ".\Customers\bmt\inv_tbl_bmt.h"    
  1137. #elif defined(SUOJIA_DVD)
  1138.     #include ".\Customers\suojia\inv_tbl_suojia.h"    
  1139. #elif defined(OUR_MIND_DVD)
  1140.     #include ".\Customers\ourmind\inv_tbl_ourmind.h"    
  1141. #elif defined(WEIKING_DVD_AMP)
  1142.     #include ".\Customers\weiking\inv_tbl_weiking.h"   
  1143. #elif defined(APOLLO_DVD)
  1144.     #include ".\Customers\apollo\inv_tbl_apollo.h"
  1145. #elif defined(CONSER_DVD)
  1146.     #include ".\Customers\Conser\inv_tbl_conser.h"
  1147. #elif defined(PROVIEW_DVD)
  1148.     #include ".\Customers\Proview\inv_tbl_proview.h"
  1149. #elif defined(CNMOTOR_DVD)
  1150.     #include ".\Customers\Cnmotor\inv_tbl_cnmotor.h"   
  1151. #elif defined(AVIQ_DVD)
  1152.     #include ".\Customers\AViQ\inv_tbl_aviq.h"   
  1153. #elif defined(FUDI_DVD)
  1154.     #include ".\Customers\fudi\inv_tbl_fudi.h"   
  1155. #elif defined(GAODASI_DVD)
  1156.     #include ".\Customers\Gaodasi\inv_tbl_gaodasi.h"    
  1157. #elif defined(QISHENG_DVD)
  1158. //#ifdef NEWSTYLE_WINDOW
  1159.         #include ".\Customers\QiSheng\inv_tbl_qisheng1.h"
  1160. //#else
  1161. //#include ".\Customers\QiSheng\inv_tbl_qisheng.h"
  1162. //#endif
  1163. #elif defined(YAHSIN_DVD)
  1164.     #include ".\Customers\YaHsin\inv_tbl_yahsin.h"
  1165. #elif defined(SKYWORTH_DVD)
  1166.     #include ".\Customers\SkyWorth\inv_tbl_skyworth.h"
  1167. #elif defined(ZIHUAN_DVD)
  1168.     #include ".\Customers\Zihuan\inv_tbl_zihuan.h"
  1169. #elif defined(MICO_DVD)
  1170.     #include ".\Customers\MICO\inv_tbl_mico.h"
  1171. #elif defined(KSD_DVD)
  1172.     #include ".\Customers\trenddigit\inv_tbl_ksd.h"
  1173. #elif defined(DESAY_DVD)
  1174.     #include ".\Customers\Desay\inv_tbl_desay.h"
  1175. #elif defined(MINTON_DVD)
  1176. #ifdef MINTON_YILI_DVD1003_2CH
  1177.     #include ".\Customers\Minton\inv_tbl_minton_dvd1003.h"
  1178. #else
  1179.     #include ".\Customers\Minton\inv_tbl_minton.h"
  1180. #endif
  1181. #elif defined(EASTECH_DVD)    //2004-4-2 1:36  wsf
  1182.     #ifdef EASTECH_DVD_SHARP
  1183.         #include ".\Customers\EASTECH\inv_tbl_eastech_sharp.h" 
  1184.     #else
  1185.         #include ".\Customers\EASTECH\inv_tbl_eastech_top.h" 
  1186.     #endif 
  1187. #elif defined(EVERSTAR_DVD)
  1188.     #include ".\Customers\everstar\inv_tbl_everstar.h"
  1189. #elif defined(IDALL_DVD)
  1190.     #include ".\Customers\Idall\inv_tbl_idall.h"
  1191. #elif defined(VTREK_DVD)
  1192.     #include ".\Customers\Vtrek\inv_tbl.h"
  1193. #elif defined(INTECH_DVD)
  1194.     #include ".\Customers\intech\inv_tbl_intech.h"
  1195. #elif defined(GENTEK_DVD)
  1196.     #include ".\Customers\Gentek\inv_tbl_gentek.h"
  1197. #elif defined(HARMA_DVD)
  1198.     #include ".\Customers\HARMA\inv_tbl.h"
  1199. #elif defined(WYD_DVD)
  1200.     #include ".\Customers\WYD\inv_tbl.h"
  1201. #elif defined(ACTIMA_DVD)   //2004-9-14 09:25?宇M
  1202.     #include ".\Customers\ACTIMA\inv_tbl.h"
  1203. #elif defined(HONGTU_DVD)   //2003-11-25 03:59张宇P
  1204.     #include ".\Customers\HONGTU\inv_tbl.h"
  1205. #elif defined(KENLOON_DVD)   //2004-4-14 11:35张宇M
  1206.     #include ".\Customers\KENLOON\inv_tbl.h"
  1207. #elif defined(SZMALATA_DVD)   //2004-2-3 01:20张宇P
  1208.     #include ".\Customers\SZMALATA\inv_tbl.h"
  1209. #elif defined(TONIC_DVD)   //2004-2-3 01:20张宇P
  1210.     #include ".\Customers\TONIC\inv_tbl.h"
  1211. #elif defined(MALATA_DVD)   //2003-11-25 03:59张宇P
  1212.     #include ".\Customers\MALATA\inv_tbl.h"
  1213. #elif defined(NEWFUSS_DVD)   //2003-11-25 03:59张宇P
  1214.     #include ".\Customers\NEWFUSS\inv_tbl.h"
  1215. #elif defined(TIANKE_DVD)
  1216.     #include ".\Customers\TIANKE\inv_tbl.h"
  1217. #elif defined(WEICHENG_DVD)
  1218.     #include ".\Customers\weicheng\inv_tbl_sunplus.h"
  1219. #elif defined(JIEKE_DVD)
  1220.     #include ".\Customers\jieke\inv_tbl_jieke.h"
  1221. #elif defined(JIEKE_16M_DVD)
  1222.     #include ".\Customers\jieke\inv_tbl_jieke.h"
  1223. #elif defined(XUKE_DVD)
  1224.     #include ".\Customers\xuke\inv_tbl_xuke.h"
  1225. #elif defined(ZhengTai_DVD)
  1226.     #include ".\Customers\ZhengTai\inv_tbl_zhengtai.h"
  1227. #elif defined(SKYTECH_DVD)
  1228.     #include ".\Customers\skytech\inv_tbl_skytech.h"
  1229. #elif defined(XINDE_DVD)
  1230.     #include ".\Customers\xinde\inv_tbl_xinde.h"    
  1231. #elif defined (ORIENTPOWER_DVD)
  1232.     #if  MAX_FULL_PAGE==16
  1233.         #include ".\Customers\Orientpower\inv_tbl_fullosd.h"
  1234.     #else
  1235.         #include ".\Customers\Orientpower\inv_tbl.h"
  1236.     #endif
  1237. #elif defined(ORITRON_DVD)
  1238.     #if defined(ORITRON_DVD4105)
  1239.         #if  MAX_FULL_PAGE==16
  1240.              #include ".\Customers\Oritron\inv_tbl_oritron_4105_fullosd.h"
  1241.         #else   
  1242.              #include ".\Customers\Oritron\inv_tbl_oritron_4105.h"
  1243.         #endif    
  1244.     #else
  1245.     #include ".\Customers\oritron\inv_tbl_oritron.h"
  1246.     #endif
  1247. #elif defined(SYBER_DVD)
  1248.     #include ".\Customers\SYBER\inv_tbl_syber.h"
  1249. #elif defined(XINGQIU_DVD)
  1250.     #include ".\Customers\Xingqiu\inv_tbl_xingqiu.h"
  1251. #elif defined(NINTAUS_DVD)   
  1252.     #include ".\Customers\nintaus\inv_tbl_nintaus.h"
  1253. #elif defined(HANYANG_DVD)   
  1254.     #include ".\Customers\hanyang\inv_tbl_hanyang.h"
  1255. #elif defined(ARGUS_PORTABLE_DVD)
  1256.     #include ".\Customers\argus_portable\inv_tbl_argusportable.h"
  1257. #elif defined(SHIDELI_DVD)   
  1258.     #include ".\Customers\shideli\inv_tbl_shideli.h"     //gerry,2004-4-22 16:09
  1259. #elif defined(THAKRAL_DVD)   
  1260.     #include ".\Customers\thakral\inv_tbl_thakral.h" 
  1261. #elif defined(TEAC_PORTABLE_DVD)//TEAC   
  1262.     #include ".\Customers\teac_portable\inv_tbl_teac.h"  
  1263. #elif defined(EASTWIN_PORTABLE_DVD)
  1264.     #if  MAX_FULL_PAGE==16
  1265.         #include ".\Customers\Eastwin\inv_tbl_eastwin_fullosd.h"
  1266.     #else   
  1267.             #include ".\Customers\Eastwin\inv_tbl_eastwin.h"
  1268.         #endif  
  1269. #else 
  1270. //#ifdef NEWSTYLE_WINDOW//terry,mark it,2003/7/30 04:32PM
  1271. //    #include ".\Customers\Sunplus\inv_tbl_newgoto.h"
  1272. //#else
  1273.     #if  MAX_FULL_PAGE==16
  1274.         #include ".\Customers\Sunplus\inv_tbl_fullosd.h"
  1275.     #else
  1276.         #include ".\Customers\Sunplus\inv_tbl.h"
  1277.     #endif
  1278. #endif
  1279. int user_input_pwd=0;
  1280. void cancel_rep(void)
  1281. {
  1282.      
  1283.      if((rep_mode != REPEAT_IDLE)||(rep_ab_mode != REPEAT_AB_IDLE))
  1284.      {
  1285.         OSD1000ISP_STATUS(OSDISP_REP_IDLE, OSDIR_REPEAT);
  1286.         PrintOsdMsg(STR_OS_REP_CNL,REGION2,1,0);
  1287.         rep_mode    = REPEAT_IDLE;
  1288.         rep_ab_mode= REPEAT_AB_IDLE;
  1289.      }
  1290. }
  1291. #ifdef NEW_STYLE_SETUP
  1292. extern UINT8 logo_type;//NEW STYLE SETUP FOR GBM 
  1293. #endif//NEW_STYLE_SETUP
  1294. #ifdef MONE_DSP24_SHOW_CODEC_NAME_BY_ANGLE_KEY  // 2004/12/21 yltseng
  1295. #define ShowDSPCodecNameByAngleKey()                                
  1296. {                                                                   
  1297.     if( rx == IRC_ANGLE )                                           
  1298.     {                                                               
  1299.         const BYTE* pName = AUDKRNL_Get_Current_DSP3Codec_Name();   
  1300.         strcpy( RegionValStr[ REGION1 ], &pName[12] );              
  1301.         ConvertLowerCaseToUpperCase( RegionValStr[ REGION1 ] );     
  1302.         PrintOsdMsg( STR_OS_SPACE, REGION1, 1, 1 );                 
  1303.     }                                                               
  1304. }
  1305. #else
  1306. #define ShowDSPCodecNameByAngleKey()
  1307. #endif
  1308. static inline UINT32 RejectBySWD( BYTE rx )
  1309. {
  1310.     BYTE res;
  1311.     res = FALSE;
  1312.     #ifdef SUPPORT_PLAY_SWD
  1313.     extern BYTE SWD_CheckIrcmd(BYTE rx);
  1314.     if( START_POLLING_SWD )
  1315.     {
  1316.         res = SWD_CheckIrcmd(rx);
  1317.     }
  1318.     #endif
  1319.     return res;
  1320. }
  1321. void ircmd_pre_paser(BYTE rx)
  1322. {
  1323.     UINT8 need_run_cmd=1,display_again=0;//terry,0513 
  1324.     UINT32 invalid=ir_invalid_state[rx];
  1325.     #ifdef IR_DBG
  1326.     printf("ir pre-parser inn");    
  1327.     #endif
  1328.    
  1329.    #ifdef FILE_MODE_WRITE//added by wangwei,2005-1-25 16:21
  1330.    if(rx == IRC_FM_WRITE)
  1331.         play_state = VCD_STATE_NORMAL;
  1332.    #endif
  1333. #ifdef SUPPORT_MIDI_MENU_SEL
  1334.    printf("polling_rotary bHoldInput %dn",bHoldInput);
  1335.         //may be I should set a critical section      
  1336.     if (gIsMidiSelMenu&&bHoldInput )                                      //xlluo 04-11-26
  1337.           return;                                                          //xlluo for irdebug 04-11-23
  1338. #endif   
  1339. #ifdef QSI_SHOW_ERR_RATE
  1340. if(QSI_PIPO_TEST==0x1)
  1341.     irc_func_table[rx]();   
  1342. #endif
  1343.     
  1344.     if(show_logo)
  1345.     {
  1346.         return;
  1347.     }
  1348.         
  1349. #ifdef MIDI_EJECT_PASSWORD    //ouyang add for eject password 2004-11-20 15:10
  1350. extern UINT8 midi_open_pwd_start;    
  1351. extern UINT8 midi_open_pwd_finished; 
  1352. #endif        
  1353. #ifdef MIDI_EJECT_PASSWORD   //xlluo 04-12-06
  1354.     if (midi_open_pwd_start&&(!midi_open_pwd_finished)) 
  1355.     {
  1356.        switch(rx)
  1357.        {
  1358.             case IRC_0:     
  1359.             case IRC_1:
  1360.             case IRC_2:
  1361.             case IRC_3:
  1362.             case IRC_4:
  1363.             case IRC_5:
  1364.             case IRC_6:
  1365.             case IRC_7:
  1366.             case IRC_8:
  1367.             case IRC_9:
  1368.             case IRC_SELECT:
  1369.             case IRC_POWER:
  1370.                 printf("hahan");
  1371.                 break;
  1372.             default:
  1373.                 printf("forbiddenn");
  1374.                 return;
  1375.        }
  1376.     }
  1377. #endif//#ifdef MIDI_EJECT_PASSWORD    //ouyang add for eject password 2004-11-20 15:10
  1378.        
  1379.     #ifdef RECORD_KEY//zhaoyanhua add  2003-11-19 16:37      
  1380.     //NOTE:
  1381.     // if you want change the RECORD_OSD_SHOW_TIME value, 
  1382.     // must change it in file sysmain2.c at the same time.
  1383.     //zhaoyanhua  2003-12-12 15:18  
  1384.     #define RECORD_OSD_SHOW_TIME  14   
  1385.     
  1386.     //when show RECORD OSD message, other keys except IR_RECORD will
  1387.     // break out the OSD message and excute its function.
  1388.     if(same_disc_flag!= 0)
  1389.     {
  1390.         if(rx != IRC_RECORD)
  1391.         {
  1392.             same_disc_flag = RECORD_OSD_SHOW_TIME;
  1393.             //to keep this IR code.
  1394.             //excute IR function after exit RECORD OSD message.
  1395. #ifdef MODIFY_RECORD_KEY//2004-3-30 19:16
  1396.             if(rx == IRC_EJECT||rx == IRC_POWER)//2004-3-30 19:14
  1397. #endif         
  1398.             keep_cmd_code = rx;
  1399.             //regs0->iop_data[IR_PORT]|=IR_RDY;
  1400.             return;
  1401.     }
  1402.     }
  1403.     #endif
  1404.         
  1405. #ifdef MIC_FUNCTION_KEY
  1406.     #ifdef BBK_DVD//zhaoyanhua add 2003-11-30 12:29
  1407.     extern BYTE bFuncStep;
  1408.     //if user enter other keys except IRC_MIX__FUNCTION/UP/DOWN,
  1409.     // it will excute its corresponding function.
  1410.     if((rx !=IRC_MIX_FUNC ) && (rx != IRC_UP) && (rx != IRC_DOWN)&&(bFuncStep))
  1411.     {
  1412.         osd_tog_region(REGION1, OSD_OFF);
  1413.         bFuncStep = 0;    
  1414.     }     
  1415.     #endif
  1416.         
  1417. #endif //MIC_FUNCTION_KEY   
  1418.         
  1419.     if(user_input_pwd==1)//nono 20020604
  1420.     {
  1421.         if( (rx<=IRC_10)||(rx==IRC_SELECT)||
  1422.             (rx==IRC_CLEAR)||(rx==IRC_PLAY_RESUME)||
  1423.             (rx==IRC_POWER)||(rx==IRC_EJECT)||
  1424.             (rx==IRC_PLAY_SELECT)||(rx==IRC_PAUSEPLAY) )
  1425.         {
  1426.             if((rx==IRC_EJECT)||(rx==IRC_POWER))
  1427.             {
  1428.                 user_input_pwd=2;
  1429. #ifdef DVD_AUDIO//2004-3-5 17:48
  1430.                 if(pDSV->hid_gp_chk_pwd==2)
  1431.                 {
  1432.                     regs0->iop_data[IR_PORT]|=IR_RDY;
  1433.                     //full_scrn=0; //t_disp=disp_mode;
  1434.                     osd_init();
  1435.                     return;
  1436.                 }
  1437. #endif//DVD_AUDIO
  1438.             }    
  1439.                         
  1440.             //Maoyong 2004.03.06 , Record disc check Level SYSTEM_SETUP_BROWSER, 
  1441.             //Avoid 2 times "ircmd_eject_toggle" and then can't do right TRAY OUT           
  1442.             #ifdef  CHECK_RECORD_DISK_PARENT_LVL
  1443.             if( !((system_state == SYSTEM_SETUP_BROWSER) && (rx== IRC_EJECT)) )
  1444.             #endif          
  1445.             #ifdef SUPPORT_SPI_QSI
  1446.             if( /*(rx == IRC_STOP) || */(rx == IRC_PLAY) /*|| (rx == IRC_PAUSE)*/ )
  1447.                 spi_cmd_func_table[uSpiRxData]();
  1448.             else
  1449.             #endif
  1450.             irc_func_table[rx]();
  1451.             
  1452.             if( (rx==IRC_SELECT)||(rx==IRC_PLAY_RESUME)||
  1453.                 (rx==IRC_PLAY_SELECT)||(rx==IRC_PAUSEPLAY))
  1454.                 user_input_pwd=0;
  1455.             
  1456.               
  1457.         }
  1458.         if((rx!=IRC_EJECT)&&(rx!=IRC_POWER))
  1459.             return;
  1460.     }
  1461.     
  1462.     if( RejectBySWD( rx ) )
  1463.         return;
  1464.         
  1465. extern UINT8 gIsMidiSelMenu; //mimitsai add 2004-12-03 17:13
  1466.     
  1467. #ifdef DIVX_DRM
  1468.     if( ( invalid & DRM_MENU ) && ( full_scrn & DIVX_DRM_MENU ) )
  1469.     {
  1470.     #ifdef IR_DBG
  1471.         printf( "Disable key in DRM_MENUn" );
  1472.     #endif
  1473.         return;
  1474.     }
  1475.     else
  1476. #endif
  1477. #ifdef SUPPORT_MIDI         //axel add for "FF"、“pause”etc.are invalid when press "PREVIEW"2004.09.21
  1478.     if ((gIsMidiSelMenu)&&(rx==IRC_PREVIEW))
  1479.     {
  1480.         need_run_cmd=0;
  1481.         #ifdef IR_DBG            
  1482.           printf("<ir_invalid 15>n");
  1483.         #endif
  1484.     }
  1485.     else
  1486. #endif
  1487. #if defined(SUPPORT_MIDI)&&defined(NEW_SEARCH_OSD)   //axelchen add for "display"
  1488.         extern UINT8 gIsMidiSelMenu;
  1489.         if (gIsMidiSelMenu)
  1490.            {
  1491.             if((rx==IRC_GOTO)||(rx==IRC_DISPLAY))
  1492.             need_run_cmd=0;
  1493.             }
  1494.         else 
  1495. #endif// defined(SUPPORT_MIDI)&&defined(NEW_SEARCH_OSD)
  1496.     if(rx==IRC_RANDOM)
  1497.     {
  1498.         if(action_click)
  1499.         {
  1500.             if(invalid&(0x01<<play_state))
  1501.             {
  1502.                 #ifdef IR_DBG            
  1503.                 printf("<ir_invalid 13>n");
  1504.                 #endif
  1505.                 need_run_cmd=0;
  1506.             }
  1507.         }
  1508.     }else if(invalid&(0x01<<play_state))
  1509.     {
  1510.         need_run_cmd=0;
  1511.         #ifdef IR_DBG            
  1512.         printf("<ir_invalid 12>n");
  1513.         #endif                    
  1514.         /* alan added 02-05-13 for FUSS : return to main setup menu when press IRC_RETURN */        
  1515.         //terry,0516, 
  1516.         //setup ->3d
  1517.         #ifdef  FUSS_DVD                        
  1518.         if( (full_scrn&SETUP)&&(rx==IRC_RETURN) ) need_run_cmd=1;
  1519.         #endif          
  1520.     }
  1521.     else if( (invalid&HL)&&HL_exist)
  1522.     {
  1523.         #ifdef IR_DBG            
  1524.         printf("<ir_invalid 11>n");
  1525.         #endif            
  1526.         need_run_cmd=0;
  1527.     }else if((invalid&STILL)&&still_timer)
  1528.     {
  1529.         #ifdef IR_DBG            
  1530.         printf("<ir_invalid 10>n");
  1531.         #endif                  
  1532.         need_run_cmd=0;
  1533.     }
  1534.     #if defined(NINTAUS_DVD)
  1535.     else if( (invalid&MENU)&&(is_menu()))//( psd_state==(PSD_SEL_LIST|PSD_PLAY_SEG)) )
  1536.     #else
  1537.     else if( (invalid&MENU)&&( psd_state==(PSD_SEL_LIST|PSD_PLAY_SEG)) )
  1538.     #endif 
  1539.     {//terry,2002/9/11 04:08PM
  1540.      //I'm not sure whether has bug.But I'm sure DVD non-hl menu may be pause/ff/bw/...
  1541.         #ifdef IR_DBG            
  1542.         printf("<ir_invalid 9>n");
  1543.         #endif                  
  1544.         need_run_cmd=0;
  1545.     }else if((invalid&(0x01<<(VCD_STATE_MAX-1+cd_type_loaded)))&&(GetCurrentFileType()!=CDROM_MP4)) //Jeff 20010928 (-1)
  1546.     {
  1547.         #ifdef IR_DBG            
  1548.         printf("<ir_invalid 8>n");
  1549.         #endif                  
  1550.         need_run_cmd=0;
  1551.         #ifdef SUPPORT_HDD_ACCESS
  1552.         if(rx==IRC_SUBP || IRC_TITLEMENU) {
  1553.             extern int do_copy_file();
  1554.             printf("<SUB-TITLE>n");
  1555.             do_copy_file();
  1556.             return;
  1557.         }
  1558.         #endif //SUPPORT_HDD_ACCESS
  1559.     }else if( (invalid&PROG_PLAY)&&prog_cnt && (!setup_IsSettingPassword()) )
  1560.     {        
  1561.         #ifdef IR_DBG            
  1562.         printf("<ir_invalid 7>n");
  1563.         #endif                  
  1564.         need_run_cmd=0;
  1565.     }
  1566. #ifndef SUPPORT_GOTO_IN_JPEG_STATE//suqiaoli add 2003-11-20
  1567.     else if( (invalid&JPEG)&&(Is_JPEG_STATE()) )
  1568.     {
  1569.         #ifdef IR_DBG            
  1570.         printf("<ir_invalid 4>n");
  1571.         #endif                  
  1572.         need_run_cmd=0;
  1573.     }
  1574. #endif
  1575.     else if(keep_cmd_code != IR_CODE_MAX_NUM)//2004-3-30 19:19
  1576.     {
  1577.         #ifdef IR_DBG            
  1578.         printf("<ir_invalid 3>n");
  1579.         #endif                  
  1580.         need_run_cmd=0;
  1581.     }else if(dev_status_flag&DEV_DETECT_CSS)
  1582.     {
  1583.         #ifdef IR_DBG            
  1584.         printf("<ir_invalid 2>n");
  1585.         #endif                  
  1586. #ifdef PRE_NEXT_FLAG  //axel, for invalid IRC_NEXT in bad discs 2004/7/12      
  1587.         if(rx==IRC_PREV) 
  1588.         {
  1589.           PRE_FLAG=1;
  1590.         #ifdef IR_DBG            
  1591.         printf("<PRE_FLAG>n");
  1592.         #endif                  
  1593.         }
  1594.         else if(rx==IRC_NEXT) 
  1595.         {
  1596.           NEXT_FLAG=1;
  1597.         #ifdef IR_DBG            
  1598.         printf("<NEXT_FLAG>n");
  1599.         #endif                  
  1600.         }
  1601. #endif //#ifdef PRE_NEXT_FLAG    
  1602.         need_run_cmd=0;
  1603.     }else if((invalid&DVD_PROHIBIT)&&(is_dvd_prohibit_key()||(goto_active==1)) )
  1604.     {
  1605.         #ifdef IR_DBG            
  1606.         printf("<ir_invalid 1>n");
  1607.         #endif  
  1608. #ifdef PRE_NEXT_FLAG     //axel, for invalid IRC_NEXT in bad discs 2004/7/12   
  1609.         if(rx==IRC_PREV) 
  1610.         {
  1611.           PRE_FLAG=1;
  1612.         #ifdef IR_DBG            
  1613.         printf("<PRE_FLAG>n");
  1614.         #endif                  
  1615.         }
  1616.         else if(rx==IRC_NEXT) 
  1617.         {
  1618.           NEXT_FLAG=1;
  1619.         #ifdef IR_DBG            
  1620.         printf("<NEXT_FLAG>n");
  1621.         #endif                  
  1622.         }
  1623. #endif //PRE_NEXT_FLAG
  1624.         if(rep_ab_mode!=REPEAT_FIND_B)
  1625.             need_run_cmd=0;
  1626.     }
  1627.     //else if((invalid&BOOKMARK)&&(t_disp==3))//NONO 2-4-29 18:41
  1628.      //need_run_cmd=0;
  1629.     //else if( (invalid&GAME)&&(Is_GAME_STATE()) )//NONO 2-4-29 18:41
  1630.     //need_run_cmd=0;
  1631.     
  1632.     if(need_run_cmd!=2) {                   //terry,2002/5/16 10:37PM,
  1633. #ifdef SETUP_PROGRAM_IN_PLACE_UNDER_16M     // 2004/01/14 yltseng
  1634.         extern UINT8   g_uiOSDStatus;
  1635.         if( g_uiOSDStatus & OSD_FULL_SCREEN_STATUS_WAIT_ATAPI_CMD_FINISH || 
  1636.             g_uiOSDStatus & OSD_FULL_SCREEN_STATUS_WAIT_KERNEL_DECODE_FINISH )
  1637.             return;
  1638. #endif
  1639.             
  1640.         if(full_scrn)
  1641.         {
  1642.             if(StateChkKey[rx] & full_scrn)
  1643.             {                               
  1644.                 //printf("State:%x rx:%d full_scrn:%xn",StateChkKey[rx],rx,full_scrn);
  1645.                 #ifdef NEWSTYLE_WINDOW
  1646.                 if(full_scrn==MESSAGE)
  1647.                 {
  1648.                     //printf("StateChkKey[%d]: %d   full_scrn=:%dn",rx,StateChkKey[rx],full_scrn);
  1649.                     //if(rx == IRC_ZOOM)
  1650.                     //{
  1651.                     //    invalid_key();
  1652.                     //    return;
  1653.                     //}
  1654.                     exit_browse_func();
  1655.                 }
  1656.                 #endif
  1657.                 #ifdef DOUBLE_TITLE //susu add 2003-8-27 13:55
  1658.                 if (full_scrn & DOUBLETITLE)
  1659.                 {   
  1660.                     exit_double_title();
  1661.                 }
  1662.                 #endif
  1663.                 if (full_scrn & SOUND)
  1664.                 {
  1665.                     #ifdef RETAIN_3D_IN_PREV_NEXT
  1666.                     if(!(rx==IRC_PREV || rx==IRC_NEXT)) //wuxiaofeng 2004-5-24                    
  1667.                     #endif
  1668.                     cancel_sound();//liweihua 2004-1-13 10:04
  1669.                 }
  1670.                 else if (full_scrn & PROGRAM)  //add by shawn 20020218
  1671.                 {                        
  1672.                     #ifdef SDRAM_16Mb_Mode                  
  1673.                         #ifdef SDRAM_16MB_IRCMD_RETURN_WHEN_PROGRAM    //linrc 2004-6-10 11:19
  1674.                             if((rx==IRC_ANGLE)||(rx==IRC_SUBP)||(rx==IRC_CHANNEL)||
  1675.                                 (rx==IRC_PREV)||(rx==IRC_NEXT)||(rx==IRC_BACKWARD)||
  1676.                                 (rx==IRC_FORWARD)||(rx==IRC_RETURN)||(rx==IRC_ZOOM) || 
  1677.                                 (rx==IRC_SLOW)||(rx==IRC_REPEAT)||(rx==IRC_AB)||(rx==IRC_PAUSE)) return;
  1678.                         #endif                 
  1679.                         #ifdef NEW_STYLE_SETUP
  1680.                         
  1681.                         if (rx ==IRC_SETUP)//zhaoyanhua add 2003-8-8 13:42
  1682.                             prog_state = 6;
  1683.                         #else
  1684.                     prog_state=3;   // 3 means that ircmd_stop pressed when full_scrn==PROGRAM
  1685.                     prog_cnt = 0; //dingzhy add for 1x16 
  1686.                     prog_func_clear(); //dingzhy add for 1x16
  1687.                         #endif//NEW_STYLE_SETUP                  
  1688.                     #endif//SDRAM_16Mb_Mode 
  1689.                     //#ifdef JIEKE_DVD
  1690.                     //return;
  1691.                     //#else
  1692.                     #ifdef JIEKE_DVD
  1693.                     prog_cnt = 0;
  1694.                     #endif
  1695.                     prog_func_off();
  1696. #ifdef SDRAM_16Mb_Mode                    
  1697.                     resumeMSF=0;//nono 4-1-16 15:27
  1698. #endif//SDRAM_16Mb_Mode                    
  1699.             //#endif    
  1700.                     // re-load setup module
  1701.                     //LoadModual(MODUAL_AP2);
  1702.                 }
  1703.                 else if ((full_scrn & SETUP) || (full_scrn & CUSTM))
  1704.                 {
  1705.                     #ifdef NEW_STYLE_SETUP//2003-8-13 18:16
  1706.                     if(rx == IRC_TITLEMENU) return;
  1707.                     #endif//NEW_STYLE_SETUP
  1708.                     
  1709.                     #ifdef SDRAM_16Mb_Mode                  
  1710.                         #ifdef NEW_STYLE_SETUP//zhaoyanhua add 2003-8-8 10:07
  1711.                         //In SETUP, enter PROGRAM
  1712.                         if (rx == IRC_PROGRAM)
  1713.                             prog_state =6;
  1714.                         
  1715.                         #else
  1716.                     prog_state=3;   // 3 means that ircmd_stop pressed when full_scrn==SETUP
  1717.                         #endif// NEW_STYLE_SETUP                     
  1718.                     #endif //SDRAM_16Mb_Mode 
  1719.                     //#ifdef JIEKE_DVD
  1720.                     //return;
  1721.                     //#else
  1722.                     #ifdef KARAOKE_MENU
  1723.                     if(rx!=IRC_KARAOKE)
  1724.                     KARAOKE_MENU_FLAG=0;
  1725.                     #endif
  1726.                     
  1727. #if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)
  1728.                     //avoid the error:when TRAY OUT enter SETUP ,show error infomation. 
  1729.                     //zhaoyanhua add 2004-2-9 11:24
  1730. #if defined(NEW_PARENTAL_GUI)
  1731.                     if(new_parental_gui)
  1732. #elif defined(MODIFY_PARENTAL_GUI)
  1733.                     if(parental_gui_flag)
  1734. #endif//defined(MODIFY_PARENTAL_GUI)
  1735.                     {
  1736. #if defined(DVD_AUDIO)//&&defined(NEW_PARENTAL_GUI)//20040302
  1737.                          if(pDSV->hid_gp_chk_pwd==2)
  1738.                                ExitDVDAudioGUI();
  1739.                          else
  1740. #endif
  1741.                        ExitParentalGUI(); 
  1742.                     }else 
  1743.                     #endif//NEW_PARENTAL_GUI
  1744. #ifdef SETUP_SOME_KEY_NO_RESPONSE//eastech2030
  1745.                      //printf("pre test6n");
  1746.                 if(rx==IRC_SETUP||rx==IRC_POWER||rx==IRC_EJECT)   //add by TOM
  1747.                         ExitSetupPage(1);
  1748.                 else
  1749.                 {
  1750.                     if(rx!=IRC_STOP)
  1751.                     {
  1752.                         rx=IRC_NULL;
  1753.                         return;
  1754.                     }
  1755.                     else
  1756.                     {
  1757.                         if(full_scrn & CUSTM)
  1758.                     ExitSetupPage(1);
  1759.                         if(full_scrn & SETUP)
  1760.                         {
  1761.                             rx=IRC_NULL;
  1762.                             return;
  1763.                         }
  1764.                     }
  1765.                 }
  1766. #else
  1767.                     ExitSetupPage(1);
  1768. #endif//SETUP_SOME_KEY_NO_RESPONSE
  1769.                     
  1770.                     #ifdef SDRAM_16Mb_Mode
  1771.                     //avoid the bug when otherIR key (except SETUP),
  1772.                     //"DISPLAY" cause error.
  1773.                     //zhaoyanhua add 2003-11-13 11:36
  1774.                     if (0)//old_t_disp)
  1775.                     {
  1776.                         t_disp=old_t_disp;
  1777.                         DispPolling(3);
  1778.                     }
  1779.                     
  1780.                     resumeMSF=0;//nono 4-1-16 15:28
  1781.                     #endif
  1782.                     //#endif
  1783.                 }
  1784.                 #ifdef SUPPORT_FUNCTION_MENU
  1785.                 else if(full_scrn & SETUP_PLUS)
  1786.                 {
  1787.                     ExitSetupPage(0);
  1788.                 }
  1789.                 #endif
  1790.                 else if(full_scrn & GOTO)
  1791.                 #ifdef DIV_GOTO_DISPLAY//zhaoyanhua add 03-11-5 22:39
  1792.                     ExitGOTOPage(); 
  1793.                 #else
  1794.                     ircmd_goto();
  1795.                 #endif
  1796.                 #ifdef SUPPORT_REP_READ
  1797.                 else if(full_scrn & READ)
  1798.                 {           
  1799.                     CancelRead();      
  1800.                 }
  1801.                 #endif
  1802.                 
  1803.                 else if(full_scrn & MARK)     //Jeff 20020416
  1804.                 {
  1805.                     // alan 0429 solve goto fade out and fade in again  when full_scrn in mark mode
  1806.                     if (rx != IRC_GOTO)
  1807.                         ircmd_book();
  1808.                 }
  1809. #if (defined VIRTUAL_KEYBOARD) && (defined DIV_GOTO_DISPLAY) //zhaoyanhua add 2004-2-16 16:58
  1810.                 else if (full_scrn & KEYBOARD)
  1811.                 {
  1812.                     ircmd_virtual_keyboard();
  1813.                 }
  1814. #endif
  1815. #ifdef SWITCH_CD_CARD_USB//liweihua 2004-6-13 14:51
  1816.                 else if(full_scrn & SWITCH_GUI)
  1817.                 {
  1818.                     ircmd_switch_cd_card_usb();   
  1819.                 }
  1820. #endif
  1821.                 else
  1822.                     ClearOsdMsg(1);
  1823. #ifdef RETAIN_3D_IN_PREV_NEXT
  1824.          if((full_scrn&SOUND) && !((rx==IRC_PREV || rx==IRC_NEXT))    //wuxiaofeng 2004-5-24
  1825.     #ifdef  CF_CARD_WRITE
  1826.                 || (!(full_scrn & PERIPHERAL))      //wuxiaofeng if define card, use preview for IR input
  1827.     #endif
  1828.                 )
  1829. #else 
  1830.     #ifdef  CF_CARD_WRITE
  1831.         if(!(full_scrn & PERIPHERAL))       //wuxiaofeng if define card, use preview for IR input
  1832.     #endif
  1833. #endif
  1834.                 //wanghaoying changed 2003-12-9 14:21
  1835.                 full_scrn = 0;            
  1836.                 #ifdef SOUND_NO_KEYPAGE                
  1837.                 bEqDisplay = 0;  
  1838.                 #endif
  1839.                 //terry,0513,yuxing , 
  1840.                 //bug1: cdda , display->goto->step or slow            
  1841.                 //bug2: cdda , goto->step , goto highlight isn't cleared.
  1842.                 display_again=1;
  1843.             } //if(StateChkKey[rx] & full_scrn)
  1844.         } //if(full_scrn)
  1845.     } //if(need_run_cmd!=2)
  1846. #ifndef IR_TOOL
  1847.     #ifdef IR_DBG
  1848.     printf("invalid:%x need_run_cmd:%x play_state:%xn",invalid,need_run_cmd,play_state);
  1849.     #endif
  1850. #endif
  1851.     if((rx > IRC_P10) && (rx != IRC_SELECT)) {
  1852.         #ifdef SUPPORT_DISPLAY_MENU
  1853.         if(!In_Goto_Menu())
  1854.         #endif//end #ifdef SUPPORT_DISPLAY_MENU
  1855.         init_ir_num();
  1856.     }
  1857.     if(need_run_cmd==1)
  1858.     {
  1859.         //nono 2-6-2 15:09
  1860.         //#ifndef FUSS_DVD
  1861.         if(invalid&CN_REP)
  1862.             cancel_rep();
  1863.         //#endif
  1864.         if( (invalid&CN_INTRO)&&bIntro )
  1865.         {
  1866.             bIntro=0;
  1867.         }
  1868.         if( (rx==IRC_EJECT)&&(dev_status_flag&ATAPI_WAIT_TIME_OUT))
  1869.         {
  1870.             keep_cmd_code=rx;
  1871.             if(!is_user_opened()) {
  1872.                 OSD1000ISP_STATUS(OSDISP_OC_OPEN, OSDIR_OPEN);
  1873.                 PrintOsdMsg(STR_OS_OPEN,REGION1,0,0);
  1874.             }
  1875.         } else
  1876.         {
  1877.             //terry,0512 , avoid show error osd msg
  1878.             ir_osd_post_show=1;
  1879.             #ifdef SUPPORT_SPI_QSI
  1880.             if( /*(rx == IRC_STOP) || */(rx == IRC_PLAY) /*|| (rx == IRC_PAUSE)*/ )
  1881.                 spi_cmd_func_table[uSpiRxData]();
  1882.             else
  1883.             #endif
  1884.             irc_func_table[rx]();
  1885.             if(ir_osd_post_show>1) {
  1886.                 //#ifdef DVDRELEASE//2-7-29 16:00
  1887.                 osdshow(1,osd_buf);//2-8-1 20:15
  1888.                 //#else
  1889.                 //osd_tog_region(1,OSD_ON); 
  1890.                 //#endif 
  1891.             }
  1892.             ir_osd_post_show=0;  
  1893.         }
  1894.         //terry,0513,reduce code
  1895.         display_again=1;            
  1896.     } else if(need_run_cmd!=2)
  1897.     {
  1898.         invalid_key();
  1899.     }
  1900.     ShowDSPCodecNameByAngleKey();       // 2004/12/21 yltseng
  1901.     if( (display_again)&&(t_disp) )
  1902.     {//terry,0513 ,reduce code
  1903.         t_disp=t_disp%10;
  1904.         t_disp+=10;     
  1905.     }
  1906.     #ifdef NEW_STYLE_SETUP    
  1907.     printf("===>logo_type:%x sys_cmd:%x setup_state:%x full_scrn:%xn",logo_type,sys_cmd,setup_state,full_scrn & SETUP);
  1908.     //if (full_scrn & SETUP)//terry,2003/9/13 01:04AM
  1909.     {
  1910.         #ifdef SDRAM_16Mb_Mode
  1911.         if( (logo_type == 1)&&(play_state!=VCD_STATE_NORMAL)&&(prog_state==0)&&((cd_type_loaded!=CDROM)||(Is_MP3_STATE()==1)) )
  1912.         #else
  1913.     if( (logo_type == 1)&&(play_state!=VCD_STATE_NORMAL)&&(setup_state==0)&&((cd_type_loaded!=CDROM)||(Is_MP3_STATE()==1)) )
  1914.         #endif //SDRAM_16Mb_Mode  
  1915.         ShowTitle();
  1916.     }
  1917.     #endif// NEW_STYLE_SETUP    
  1918. }
  1919. /* wanghaoying marked 2004-7-1 16:51, for not use any more
  1920. #if defined(SUPPORT_TUNER)  //freyman add 2002-8-28 21:40
  1921. void ircmd_power_volume(BYTE rx)
  1922. {   
  1923.     extern void set_volume(BYTE x);
  1924.     if(rx==IRC_VOLUME_UP)
  1925.         if(audio_volume<15)
  1926.             audio_volume++;
  1927.     if(rx==IRC_VOLUME_DN)
  1928.         if(audio_volume>0)
  1929.             audio_volume--;
  1930.     set_volume(2*audio_volume+50);
  1931.     #ifdef VFD_VOLUME_DISPLAY
  1932.     timeout_vfd = 2*VFD_TIMEOUT;
  1933.     vfd_set_volume(0);
  1934.     #endif
  1935. }
  1936. #endif
  1937. */
  1938. #include "password.c"
  1939. #ifdef SUPPORT_APOGEE_AMP  //huziqin
  1940. extern BYTE amp_enter_flag;
  1941. #endif
  1942. #ifdef SUPPORT_RECEIVER //huziqin 2004-2-26
  1943. /*
  1944. BYTE call_ir_func_receiver_hook(BYTE rx)
  1945.   I seperate this function from call_ir_func(),to make code
  1946.   easy to read.
  1947.   return 0-->don't return
  1948.   return 1-->return
  1949. */
  1950. #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS)
  1951. extern void tuner_key();
  1952. #endif
  1953. #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS)
  1954. void call_ir_func_tuner(BYTE rx)
  1955. {
  1956.         if((system_state== SYSTEM_DOING_TUNER)&&(!(full_scrn & SOUND))) 
  1957.         {
  1958. #if defined(XINGQIU_DVD_RECEIVER)//xyy 2004-8-5
  1959.             if(rx==IRC_PREV||rx==IRC_NEXT||rx==IRC_BACKWARD||rx==IRC_FORWARD||rx==IRC_LEFT||rx==IRC_RIGHT||rx==IRC_SELECT|| 
  1960.                     rx==IRC_MUTE||rx==IRC_RCVR_BAND||rx==IRC_GOTO||rx==IRC_SETUP||rx==IRC_AUD_LANGUAGE||rx==IRC_CLEAR||rx==IRC_TITLEMENU)//xyy 2004-5-24 9:38
  1961. #elif defined(ORITRON_DVD_RECEIVER)//xyy 2004-8-14
  1962.             if(rx==IRC_PREV||rx==IRC_NEXT||rx==IRC_BACKWARD||rx==IRC_FORWARD||rx==IRC_LEFT||rx==IRC_RIGHT|| 
  1963.                     rx==IRC_MUTE||rx==IRC_RCVR_BAND||rx==IRC_PLAY_SELECT||rx==IRC_RCVR_EQ||rx==IRC_P_SCAN 
  1964.                     || rx==IRC_VFD_LEFT || rx==IRC_VFD_RIGHT)//xyy 2004-5-24 9:38
  1965. #else
  1966.      #ifndef SUPPORT_Radio_NEW_UI  //wuzhj  2004/12/10      
  1967.       if(rx==IRC_UP||rx==IRC_DOWN||rx==IRC_LEFT||rx==IRC_RIGHT
  1968.             ||rx == IRC_ZOOM||rx == IRC_SELECT||rx == IRC_MUTE||IRC_PROGRAM == rx
  1969.             ||IRC_FORMAT == rx )
  1970.      #else
  1971.          //printf("-=----------------------------------n");
  1972.         //printf("%x %xn",IRC_VOLUME_DN,rx);
  1973.         if(rx==IRC_UP||rx==IRC_DOWN||rx==IRC_LEFT||rx==IRC_RIGHT
  1974.             ||rx == IRC_ZOOM||rx == IRC_SELECT||rx == IRC_MUTE||IRC_PROGRAM == rx
  1975.             ||IRC_FORMAT == rx||IRC_PREV== rx||IRC_NEXT== rx||IRC_PAUSE== rx
  1976.             ||IRC_PROLOGIC== rx ||IRC_VOLUME_DN== rx||IRC_VOLUME_UP== rx)
  1977.     #endif
  1978. #endif
  1979.             {
  1980.                 //printf("-=----------------------------------n");
  1981.                 //printf("%x %xn",IRC_STEP,rx);
  1982.                 //if(amp_enter_flag == 0)      
  1983.                 tuner_key(rx);
  1984.                 printf("  invalid key ?n");
  1985.                 return;
  1986.             }       
  1987. #if defined(SUPPORT_STATION_INPUT)//xyy 2004-8-5
  1988.             else if(rx<=IRC_10)
  1989.                 irc_func_table[(BYTE)rx]();
  1990. #endif      
  1991.     }
  1992. }
  1993. #endif
  1994. #ifdef AVOID_READDISC_WHEN_STARTUP  //xyy add for Oritron
  1995. extern UINT16 uStartCounter;
  1996. extern UINT16 uCounterFlag;
  1997. #endif
  1998. BYTE call_ir_func_receiver_hook(BYTE rx)
  1999. {
  2000. if((system_state == SYSTEM_DOING_AV1)||(system_state == SYSTEM_DOING_AV2)
  2001.    ||(system_state == SYSTEM_DOING_SPDIF) 
  2002.    || (system_state == SYSTEM_DOING_TUNER))//xyy add for Oritron 2004-11-8 15:14
  2003. {   
  2004. if(rx == IRC_EJECT)
  2005. {
  2006. return;
  2007. }
  2008. }
  2009.  #ifdef RECEIVER_USE_PSCAN_BUTTON
  2010.     if (rx == IRC_P_SCAN)
  2011.     {
  2012.         rx = IRC_RCVR_NEXT_MODE;
  2013.     }
  2014.  #endif
  2015. #if  1 //TAS_5026_PWM//wuzhj 2004/10/09
  2016.   
  2017.   #ifndef SUPPORT_Radio_NEW_UI  //wuzhj  2004/12/10   
  2018.   if(IRC_ANGLE==rx)
  2019.     {
  2020.         subvol_next_channel();
  2021.         return 1;
  2022.     }  
  2023.   #else
  2024.    if(IRC_ANGLE==rx)
  2025.     {
  2026.       if(system_state == SYSTEM_DOING_TUNER)
  2027.         {
  2028.             return 1;
  2029.         }
  2030.         else
  2031.         {
  2032.             subvol_next_channel();
  2033.             return 1;
  2034.          }
  2035.        
  2036.       }  
  2037.    #endif
  2038. #endif  
  2039.  
  2040.  #ifdef RECEIVER_USE_DISPLAY_BUTTON
  2041.     if (rx == IRC_DISPLAY)
  2042.     {
  2043.         rx = IRC_RCVR_ANALOG_DIGITAL;
  2044.     }
  2045.  #endif
  2046. #ifdef DOLBY_AMP_VOLUME_CTRL
  2047. //wuzhj 2004/12/1
  2048. #ifndef SUPPORT_Radio_NEW_UI  //wuzhj  2004/12/10
  2049.     if((rx == IRC_VOLUME_DN)||(rx == IRC_VOLUME_UP))
  2050.         {
  2051.         //ircmd_prologic();
  2052.         return 0;
  2053.     }
  2054. #endif
  2055. #ifdef SUPPORT_BASS_TREBLE
  2056.     if(rx == IRC_SET_BASS)
  2057.     {
  2058.         ircmd_set_bass();
  2059.         return 1;
  2060.     }
  2061.     if(rx == IRC_SET_TRE)
  2062.     {
  2063.         ircmd_set_treble();
  2064.         return 1;
  2065.     }
  2066.     
  2067. #endif
  2068. #endif
  2069. #ifdef USE_PROLOGIC_II_KEY
  2070. //wuzhj 2004/12/1
  2071. #ifndef SUPPORT_Radio_NEW_UI  //wuzhj  2004/12/10
  2072.     if(rx == IRC_PROLOGIC)
  2073.         {
  2074.         //ircmd_prologic();
  2075.         return 0;
  2076.     }
  2077. #endif
  2078. #endif
  2079.  
  2080.   // Simon:  1/7/2004
  2081.  // If we eject, switch automatically back to DVD mode
  2082.   if ((rx == IRC_EJECT) && (current_rcvr_mode != RECEIVER_MODE_DVD))
  2083.  {
  2084.     system_state = SYSTEM_EJECT_CHANGE;
  2085.     return 1;
  2086.  }
  2087. //xyy delete 2004-8-17 
  2088. /*
  2089. #if defined(BAND_SWITCH_KEY)
  2090.     if((system_state!= SYSTEM_DOING_TUNER)&&(rx==IRC_RCVR_BAND))
  2091.     {
  2092.         invalid_key();
  2093.         return 1;   
  2094.     }
  2095. #endif
  2096. */
  2097.     if ((rx == IRC_RCVR_NEXT_MODE)
  2098.      #ifdef SUPPORT_VIDEO_WITH_SPDIF  //xyy 2004-8-11
  2099.      || (rx == IRC_RCVR_ANALOG_DIGITAL)
  2100.      #endif
  2101.     #if defined(EQ_SWITCH_KEY)
  2102. ||((rx == IRC_RCVR_EQ)&&(current_rcvr_mode == RECEIVER_MODE_DVD))
  2103.     #endif
  2104.     #if defined(BASS_SWITCH_KEY)
  2105.         ||(rx == IRC_RCVR_LEVEL)
  2106.     #endif
  2107.     #if defined(TREBLE_SWITCH_KEY)
  2108.     ||(rx == IRC_RCVR_TONE)
  2109. #endif
  2110.         ) //end if condition sentence
  2111.  {
  2112. #ifdef AVOID_READDISC_WHEN_STARTUP  //xyy add for Oritron
  2113.   if((rx==IRC_RCVR_NEXT_MODE && uCounterFlag==0)/*||(system_state==SYSTEM_OPEN)*/)
  2114.   {
  2115.   return 1;
  2116.   }
  2117. #endif
  2118.     irc_func_table[(BYTE)rx]();
  2119.     return 1;
  2120.  }
  2121.  // If one of the specific mode buttons is pressed, call ircmd_rcvr_select_mode
  2122.     //xulf  modified 2004-3-7
  2123.     else if ((rx >= IRC_RCVR_SELECT_DVD) && (rx <= IRC_RCVR_SELECT_DUMMY))  // mode buttons
  2124.     {
  2125.         rx = rx - IRC_RCVR_SELECT_DVD;      // mode button values start at 0x6f
  2126.         if (rcvr_support_bits & (1 << rx))  // check to see if mode is enabled
  2127.             ircmd_rcvr_select_mode(rx);
  2128.         else
  2129.         {
  2130.             invalid_key();          // unsupported mode
  2131.         }
  2132.         return 1;
  2133.     }
  2134.  
  2135.  // Don't let user press any other button other than power if we aren't in DVD mode
  2136.     else if ((current_rcvr_mode != RECEIVER_MODE_DVD) && (rx != IRC_POWER))
  2137.     {
  2138.     
  2139. #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS)
  2140.         //Move to call_ir_func_tuner()
  2141.         call_ir_func_tuner(rx);   //xyy 2004-8-14
  2142.                 return 1;
  2143. #endif //SUPPORT_TUNER_MV114    
  2144.     
  2145.         invalid_key();
  2146. return 1;
  2147. }
  2148. return 0;
  2149. }
  2150. #endif//SUPPORT_RECEIVER
  2151. void call_ir_func(BYTE rx)
  2152. {   
  2153. //gerry,to avoid gpio key bugs,2004-6-3 9:36
  2154.     extern UINT32 save_srn_start_t;
  2155.     save_srn_start_t = get_rtc_val();
  2156.     #ifdef AD_TCL//2004-3-22 13:12 lijd
  2157.     jpg_ps=1;
  2158.     menu_id=0;
  2159.     #endif 
  2160. #ifdef TP6317_PANNEL   //yaowh add 04-10-25
  2161.    if(TP6317_Power == 2)
  2162.    {
  2163.       return ;
  2164.    }
  2165. #endif
  2166.     //printf("call ir inn");    
  2167.     if(rx<IR_CODE_MAX_NUM)
  2168.     {
  2169. #ifdef AUDIO_SHOW_SAVER
  2170.         ir_cmd_temp = rx;   //yw 020904
  2171. #endif
  2172. /*
  2173. temporary used for oritron receiver
  2174. */
  2175. #ifdef SUPPORT_POWER_OFF_CLOCK_FUNC  //xyy 2004-10-12
  2176. if(rx==IRC_SET_CLOCK)
  2177. {
  2178. if(system_state==SYSTEM_DOING_CLOCK_FUNC)
  2179. ircmd_set_clock();
  2180. else
  2181. invalid_key();
  2182. return;
  2183. }
  2184. #endif
  2185. #ifdef AD_TCL//2004-3-22 13:12 lijd     
  2186.    if((rx==IRC_CHANNEL||rx==IRC_EFFECT||rx==IRC_3D)&&(Is_JPEG_STATE()))
  2187.        rx=IRC_NULL;
  2188.    if((play_state==VCD_STATE_OPEN)&&(rx==IRC_CHANNEL))
  2189.        rx=IRC_P_SCAN;    
  2190.    else if((Is_JPEG_SlideMode())&&(rx==IRC_ROOT_MENU))
  2191.    {
  2192.         menu_id=1;
  2193.         rx==IRC_STOP;   
  2194.    }    
  2195. #endif
  2196. #ifdef SUPPORT_RECEIVER  //huziqn 2004-2-26
  2197.     if(call_ir_func_receiver_hook(rx))
  2198.         return;
  2199. #endif  // End:  #ifdef SUPPORT_RECEIVER
  2200. #ifdef AD_TCL
  2201.     if((cd_type_loaded==CDDVD)&&(get_tt_info(DISP_TT)==0)&&(rx==IRC_NEXT||rx==IRC_PREV))
  2202.         rx=IRC_NULL;
  2203. #endif  
  2204. #if defined(JPG_EFFECT)
  2205.         if( (rx == IRC_PAUSE)||(rx == IRC_ONLY_PAUSE) )
  2206.         {
  2207.             //printf("Now pause");
  2208.             pause_flag=1;
  2209.         }
  2210. #endif
  2211. #if defined(JPG_EFFECT)&&defined(CALL_JPGEFFECT_HELP)
  2212. //      jpeg_call_help();
  2213.         if(Jpg_Show_Usage_Flag)
  2214.         {
  2215.         #ifdef HELP_BMP_GUI
  2216.             if((rx!=IRC_POWER)&&(rx!=IRC_EJECT)&&(rx!=IRC_STOP)&&(rx!=IRC_SELECT)&&(rx != IRC_PLAY_SELECT)&&(rx!=IRC_NEXT)&&(rx != IRC_PREV)&&(rx !=IRC_PREVIEW))
  2217.         #else
  2218.             if((rx!=IRC_POWER)&&(rx!=IRC_EJECT)&&(rx!=IRC_STOP)&&(rx!=IRC_SELECT)&&(rx != IRC_PLAY_SELECT))
  2219.         #endif
  2220.                 return;
  2221. #ifdef HELP_BMP_GUI
  2222.             if (rx == IRC_NEXT)
  2223.             {
  2224.                 if (Jpg_Show_Usage_Page < 4)
  2225.                 {    
  2226.                     Jpg_Show_Usage_Page ++;
  2227.                     Jpg_Show_Usage();
  2228.                     return;
  2229.                 }
  2230.                 else
  2231.                 {
  2232.                     help_stop_flag = 1;
  2233.                     rx = IRC_STOP;
  2234.                 }                
  2235.             }
  2236.             
  2237.             if (rx == IRC_PREV)
  2238.             {
  2239.                 if (Jpg_Show_Usage_Page > 0)
  2240.                 {    
  2241.                     Jpg_Show_Usage_Page --;
  2242.                     Jpg_Show_Usage();
  2243.                 return;
  2244.                 }
  2245.                 else
  2246.                 {
  2247.                     help_stop_flag = 1;
  2248.                     rx = IRC_STOP;
  2249.                 }                
  2250.             }
  2251.             if (rx == IRC_PREVIEW)//when select "preview" button continully,show Mp3 Gui
  2252.             {
  2253.                     help_stop_flag = 1;
  2254.                     rx = IRC_STOP;                
  2255.             }               
  2256. #endif      
  2257.         
  2258.             if( (rx == IRC_SELECT)||(rx == IRC_PLAY_SELECT) )
  2259.             {
  2260.                 if(Jpg_Show_Usage_Page < HELP_PAGE_COUNT)
  2261.                 {
  2262.                     Jpg_Show_Usage_Page++;
  2263.                     Jpg_Show_Usage();
  2264.                     return;
  2265.                 }
  2266.                 else if(Jpg_Show_Usage_Page == HELP_PAGE_COUNT)
  2267.                 {
  2268. //wanghaoying marked below 2004-7-1 14:01, for it is repetitive
  2269. //              #if !defined(MP3_JPEG_COWORK)//2004-05-18 Clear the flag in fs_nav_jpg.c
  2270.               Jpg_Show_Usage_Flag=0;//nono open it.4-7-26 15:41
  2271. //              #endif  
  2272.                     Jpg_Show_Usage_Page=0;
  2273.                     
  2274.                     #ifdef FS_BMP_GUI
  2275.                     help_stop_flag = 1;
  2276.                     #endif
  2277.                     rx = IRC_STOP;
  2278.                 }
  2279.             }
  2280.             if(rx == IRC_STOP)
  2281.             {
  2282. //wanghaoying marked below 2004-7-1 14:01, for it is repetitive
  2283. //          #ifndef  MP3_JPEG_COWORK//2004-05-18 Clear the flag in fs_nav_jpg.c
  2284.               Jpg_Show_Usage_Flag=0;//nono open it.4-7-26 15:41
  2285. //          #endif  
  2286.                     Jpg_Show_Usage_Page=0;
  2287. #ifdef  SDRAM_16Mb_Mode                 
  2288.                  ircmd_stop();
  2289. #else// SDRAM_16Mb_Mode
  2290.                             if(pFsJpeg->gifsState!=3)   //2003/10/27 axelchen for HELP screen flickering
  2291.                             {
  2292.                     delay_srv_10ms(2);
  2293.                     #if defined (MP3_LARGE_GUI) || defined (FS_BMP_GUI)//Maoyong 2003.12.29 for Large GUI  retrun from Jpeg Help page
  2294.                     config_memory(MEMORY_GRAPH_NTSC);    //Large , not SMALL, but NTSC 
  2295.                     #else
  2296.                     config_memory(MEMORY_GRAPH_SMALL);
  2297.                     #endif
  2298.                     setup_tv_format(tv_format);
  2299.                     play_state = VCD_STATE_MP3_FILELIST;
  2300.                     FSGUI_Menu();
  2301.                     delay_srv_10ms(2);
  2302.             }
  2303. #endif//SDRAM_16Mb_Mode
  2304.                          }
  2305.         }
  2306.     #endif //#ifdef JPG_EFFECT
  2307.         if(play_state==VCD_STATE_POWER)
  2308.         {   
  2309.  
  2310. #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS)
  2311.             if( (rx==IRC_POWER)||(rx<=IRC_P10) )
  2312.             {
  2313.                 irc_func_table[(BYTE)rx]();
  2314.                 return;
  2315.             }
  2316.             else if(rx==IRC_3D||rx==IRC_SETUP||rx==IRC_FORMAT||rx==IRC_P_SCAN)
  2317.             {
  2318.                 action_click=1;
  2319.                 irc_func_table[(BYTE)rx]();
  2320.                 return;
  2321.             }
  2322.             else if(rx==IRC_VOLUME_UP||rx==IRC_VOLUME_DN)
  2323.             {
  2324.                 chk_password(rx);
  2325.                 return;
  2326.             }
  2327. #ifdef XINGQIU_DVD_RECEIVER
  2328.             else if(rx==IRC_PREV||rx==IRC_NEXT||rx==IRC_BACKWARD||rx==IRC_FORWARD||rx==IRC_LEFT||rx==IRC_RIGHT||rx==IRC_SELECT||
  2329.                     rx==IRC_MUTE||rx==IRC_RCVR_BAND||rx==IRC_AUD_LANGUAGE||IRC_ANGLE)
  2330. #else
  2331.             else if(rx==IRC_UP||rx==IRC_DOWN||rx==IRC_LEFT||rx==IRC_RIGHT||rx==IRC_SELECT||
  2332.                     rx==IRC_MUTE||rx==IRC_ZOOM||rx==IRC_AUD_LANGUAGE||IRC_ANGLE)
  2333. #endif
  2334.             {
  2335.                 #ifdef SUPPORT_APOGEE_AMP
  2336.                 if((!((full_scrn & APOGEEAMPVOL)||(full_scrn & SOUND)||(full_scrn & SETUP))))
  2337.                 #endif
  2338.                 {
  2339.                         tuner_key(rx);
  2340.                         return;
  2341.                 }
  2342.                     }
  2343.                     else
  2344.                     {
  2345.                         return;
  2346.                     }
  2347. #else 
  2348.             if(rx==IRC_POWER)
  2349.                 irc_func_table[(BYTE)rx]();
  2350. #endif
  2351. //wanghaoying marked below 2004-7-1 14:00, for not use any more
  2352.             //freyman add 2002-8-27 11:24
  2353.             //in tuner or aninput mode switch amp on off
  2354. //    #ifdef IR17
  2355. //        if((rx>=IRC_CENTER_UP)||(rx<=IRC_MEMORY_UP))
  2356. //    #else
  2357. //        #ifdef SUPPORT_AMP
  2358. //        if(rx==IRC_AMP_ONOFF)
  2359. //        #endif
  2360. //    #endif
  2361.             irc_func_table[(BYTE)rx]();
  2362. //  wanghaoying marked 2004-7-1 13:59, for not use any more
  2363. //        #if defined(SUPPORT_TUNER)
  2364. //        if((rx==IRC_VOLUME_DN)||(rx==IRC_VOLUME_UP))
  2365. //            ircmd_power_volume(rx);
  2366. //        #endif
  2367.         }    
  2368.         else
  2369.         {//move to password.c,terry,2003/8/20 06:47PM
  2370.             chk_password(rx);
  2371.         }
  2372.     }
  2373. }
  2374. extern const BYTE ir_mapcode[256];
  2375. BYTE GetReverse(BYTE bIRCode)
  2376. {
  2377.     BYTE i;
  2378.     for (i = 0; i < 256; i++)
  2379.     {
  2380.         if (ir_mapcode[i] == bIRCode)
  2381.             break;
  2382.     }
  2383.     if (bIRCode == 255)
  2384.         return 0xff;
  2385.     return revn(i, 8);
  2386. }
  2387. /*
  2388. **  freyman 2002-7-30 13:24
  2389. **  Des: Rotary encoder utility.
  2390. **  
  2391. */
  2392. #ifdef ROTARY_VOLUME
  2393. #define RV_IDLE         1
  2394. #define RV_CWBEGIN      2
  2395. #define RV_CWEND        3
  2396. #define RV_CCWBEGIN     4
  2397. #define RV_CCWEND       5
  2398. #define RV_HIGH         1
  2399. #define RV_LOW          0
  2400. #if 0//def  ROTARY_VOL_HUAJIA600    //wangfeng 2003-09-22 20:31
  2401. #define RV_WAIT_HIGH    0
  2402. #define RV_WAIT_LOW 6
  2403. void polling_rotary(void)
  2404. {
  2405.     BYTE pin_a=RV_LOW, pin_b=RV_LOW;
  2406.     static BYTE rotary_state = RV_WAIT_HIGH;
  2407.     static BYTE old_pin_a=RV_LOW,old_pin_b=RV_LOW;
  2408.     static BYTE _j;
  2409.     extern void set_volume(BYTE);
  2410.     extern void ampvol_rotary(BYTE direction);
  2411.     regs0->sft_cfg6 &= ~(0x1 << 6);
  2412.     regs0->sft_cfg6 &= ~(0x1 << 4);
  2413.     regs0->gpio_master[14/16] |= (0x3 << (14%16));
  2414.     regs0->gpio_oe[14/16] &= (~0x3 << (14%16) );
  2415.     pin_a = ((regs0->gpio_in[14/16] >> (14%16)) & 0x01);
  2416.     pin_b = ((regs0->gpio_in[15/16] >> (15%16)) & 0x01);
  2417.     if((old_pin_a!=pin_a)||(old_pin_b!=pin_b))
  2418.     {
  2419.         old_pin_a=pin_a;
  2420.         old_pin_b=pin_b;
  2421.         _j=0;
  2422.         return;
  2423.     }
  2424.     
  2425.     //if(_j++<1)    return;
  2426.     if( (pin_a==RV_HIGH)&&(pin_b==RV_HIGH) )        
  2427.     {
  2428.         rotary_state = RV_WAIT_HIGH;
  2429.         return;
  2430.         
  2431.     }
  2432.     else if( (pin_a==RV_LOW)&&(pin_b==RV_LOW) )
  2433.     {
  2434.         rotary_state = RV_WAIT_LOW;
  2435.         return;
  2436.         
  2437.     }
  2438.     else if((pin_a==RV_HIGH)&&(pin_b==RV_LOW))  
  2439.     {
  2440.         if(rotary_state==RV_WAIT_HIGH)
  2441.         {
  2442.             rotary_state = RV_CCWBEGIN;//RV_CCWEND;  
  2443.         }
  2444.         else if(rotary_state==RV_WAIT_LOW)
  2445.         {
  2446.             rotary_state = RV_CWBEGIN;//RV_CWEND;
  2447.         }
  2448.         
  2449.         else if(rotary_state==RV_CCWBEGIN)
  2450.         {
  2451.             rotary_state = RV_CCWEND;
  2452.         }
  2453.         else if(rotary_state==RV_CWBEGIN)
  2454.         {
  2455.             rotary_state = RV_CWEND;
  2456.         }
  2457.     }
  2458.     if(rotary_state==RV_CWEND)
  2459.     {
  2460.         ircmd_volume_up();
  2461.         //rotary_state==RV_WAIT_HIGH;
  2462.         
  2463.     }
  2464.     else if(rotary_state==RV_CCWEND)
  2465.     {
  2466.         ircmd_volume_down();
  2467.         //rotary_state==RV_WAIT_HIGH;
  2468.         
  2469.     }
  2470. }               
  2471. #elif 1//0//for hj-1250/hj-1251 rotary volume
  2472. #define RV_WAIT         0
  2473. void polling_rotary(void)
  2474. {
  2475.     BYTE pin_a=RV_LOW, pin_b=RV_LOW;
  2476.     static BYTE rotary_state = RV_WAIT;
  2477.     static BYTE old_pin_a=RV_LOW,old_pin_b=RV_LOW;
  2478.     static BYTE _j;
  2479.     extern void set_volume(BYTE);
  2480.     extern void ampvol_rotary(BYTE direction);
  2481. /*
  2482.     regs0->sft_cfg6 &= ~(0x1 << 6);
  2483.     regs0->sft_cfg6 &= ~(0x1 << 4);
  2484.     regs0->gpio_master[14/16] |= (0x3 << (14%16));
  2485.     regs0->gpio_oe[14/16] &= (~0x3 << (14%16) );
  2486. */ 
  2487. #ifdef HJ_8202_8408
  2488.     pin_a = ((17/16] >> (17%16)) & 0x01);
  2489.     pin_b = ((regs0->gpio_in[16/16] >> (16%16)) & 0x01);
  2490. #else
  2491.     pin_a = ((regs0->gpio_in[15/16] >> (15%16)) & 0x01);
  2492.     pin_b = ((regs0->gpio_in[16/16] >> (16%16)) & 0x01);
  2493. #endif
  2494.     if((old_pin_a!=pin_a)||(old_pin_b!=pin_b))
  2495.     {
  2496.         old_pin_a=pin_a;
  2497.         old_pin_b=pin_b;
  2498.         _j=0;
  2499.         return;
  2500.     }
  2501.     if(_j++<6)  return;
  2502.     if( (pin_a==RV_HIGH)&&(pin_b==RV_HIGH) )        
  2503.     {
  2504.         rotary_state = RV_WAIT;
  2505.         return;
  2506.         
  2507.     }
  2508.     else if( (pin_a==RV_LOW)&&(pin_b==RV_LOW) )
  2509.     {
  2510.         if(rotary_state==RV_CWBEGIN)
  2511.         {
  2512.             rotary_state = RV_CWEND;
  2513.         }
  2514.         else if(rotary_state==RV_CCWBEGIN)
  2515.         {
  2516.             rotary_state = RV_CCWEND;
  2517.         }
  2518.         
  2519.     }
  2520.     else if((pin_a==RV_HIGH)&&(pin_b==RV_LOW))  
  2521.     {
  2522.         if(rotary_state==RV_WAIT)
  2523.         {
  2524.             rotary_state = RV_CCWBEGIN;//RV_CCWEND;  
  2525.         }
  2526.     }
  2527.     else if((pin_a==RV_LOW)&&(pin_b==RV_HIGH))  
  2528.     {
  2529.         if(rotary_state==RV_WAIT)
  2530.         {
  2531.             rotary_state = RV_CWBEGIN;//RV_CWEND;
  2532.         }
  2533.                 
  2534.     }
  2535.     if(rotary_state==RV_CWEND)
  2536.     {
  2537.         RotaryStateChk();
  2538.         #ifdef ROTARY_SWITCH_1251
  2539.         //ircmd_volume_down();//1251    //fengjl mark it  2004-03-03 16:21 to cancel screen saver by rotate volume
  2540.         call_ir_func(IRC_VOLUME_DN);  
  2541.         #else
  2542.         //ircmd_volume_up();
  2543.         call_ir_func(IRC_VOLUME_UP);
  2544.         #endif
  2545.         rotary_state = RV_WAIT;
  2546.         
  2547.     }
  2548.     else if(rotary_state==RV_CCWEND)
  2549.     {
  2550.         RotaryStateChk();
  2551.         #ifdef ROTARY_SWITCH_1251
  2552.         //ircmd_volume_up();
  2553.         call_ir_func(IRC_VOLUME_UP);        
  2554.         #else
  2555.         //ircmd_volume_down();
  2556.         call_ir_func(IRC_VOLUME_DN);        
  2557.         #endif
  2558.         rotary_state = RV_WAIT;
  2559.     }
  2560. //wangfeng add 2003-12-29
  2561. #elif 0//for hj-3000 rotary volume
  2562. #define RV_WAIT         0
  2563. #define R_WAIT          6
  2564. #define L_WAIT          7
  2565. #define RV_R            8
  2566. #define RV_L            9
  2567. void polling_rotary(void)
  2568. {
  2569.     BYTE pin_a=RV_LOW, pin_b=RV_LOW;
  2570.     static BYTE rotary_state = RV_WAIT;
  2571.     static BYTE old_pin_a=RV_LOW,old_pin_b=RV_LOW;
  2572.     //static BYTE old_pin_a=RV_HIGH,old_pin_b=RV_HIGH;
  2573.     static BYTE _j;
  2574.     extern void set_volume(BYTE);
  2575.     extern void ampvol_rotary(BYTE direction);
  2576.  
  2577.     pin_a = ((regs0->gpio_in[14/16] >> (14%16)) & 0x01);
  2578.     pin_b = ((regs0->gpio_in[15/16] >> (15%16)) & 0x01);
  2579.     if((old_pin_a!=pin_a)||(old_pin_b!=pin_b))
  2580.     {
  2581.         old_pin_a=pin_a;
  2582.         old_pin_b=pin_b;
  2583.         _j=0;
  2584.         return;
  2585.     }
  2586.     if(_j++<8)  return;
  2587.     if( (pin_a==RV_HIGH)&&(pin_b==RV_HIGH) )        
  2588.     {
  2589.         if(rotary_state==RV_CWEND)
  2590.             rotary_state=RV_R;
  2591.         else
  2592.                 rotary_state = R_WAIT;
  2593.         //return;
  2594.         
  2595.     }
  2596.     else if((pin_a==RV_HIGH)&&(pin_b==RV_LOW))
  2597.     {
  2598.         if(rotary_state==RV_CCWEND)
  2599.             rotary_state=RV_L;
  2600.         else if(rotary_state==RV_CWEND)
  2601.             rotary_state=RV_R;
  2602.         else
  2603.                 rotary_state = L_WAIT;
  2604.         //return;
  2605.         
  2606.     }
  2607.     else if( (pin_a==RV_LOW)&&(pin_b==RV_LOW) )
  2608.     {
  2609.         if(rotary_state==L_WAIT)
  2610.         {
  2611.             rotary_state = RV_CCWEND;
  2612.         }
  2613.         else if(rotary_state==RV_CWBEGIN)
  2614.         {
  2615.             rotary_state = RV_CWEND;
  2616.         }
  2617.         
  2618.     }
  2619.     else if((pin_a==RV_LOW)&&(pin_b==RV_HIGH))  
  2620.     {
  2621.         if(rotary_state==R_WAIT)
  2622.         {
  2623.             rotary_state = RV_CWBEGIN;//RV_CCWEND;  
  2624.         }
  2625.         else if(rotary_state==RV_CCWBEGIN)
  2626.         {
  2627.             rotary_state = RV_CCWEND;
  2628.         }
  2629.     }
  2630.     
  2631.     if(rotary_state==RV_R)
  2632.     {
  2633.         RotaryStateChk();
  2634.         #ifdef ROTARY_SWITCH_1251
  2635.         ircmd_volume_down();//1251
  2636.         #else
  2637.         ircmd_volume_up();
  2638.         #endif
  2639.         rotary_state = RV_WAIT;
  2640.         
  2641.     }
  2642.     else if(rotary_state==RV_L)
  2643.     {
  2644.         RotaryStateChk();
  2645.         #ifdef ROTARY_SWITCH_1251
  2646.         ircmd_volume_up();
  2647.         #else
  2648.         ircmd_volume_down();
  2649.         #endif
  2650.         rotary_state = RV_WAIT;
  2651.     }
  2652. #else//ROTARY_VOL_HUAJIA600
  2653. #define RV_WAIT         0
  2654. void polling_rotary(void)
  2655. {
  2656.     BYTE pin_a=RV_LOW, pin_b=RV_LOW;
  2657.     static BYTE rotary_state = RV_WAIT;
  2658.     extern void set_volume(BYTE);
  2659.     extern void ampvol_rotary(BYTE direction);
  2660.     pin_a = ((regs0->gpio_in[4/16] >> (4%16)) & 0x01);
  2661.     pin_b = ((regs0->gpio_in[5/16] >> (5%16)) & 0x01);
  2662.     if( (pin_a==RV_HIGH)&&(pin_b==RV_HIGH) )        
  2663.     {
  2664.         rotary_state = RV_WAIT;
  2665.         return;
  2666.     }
  2667.     else if( (pin_a==RV_LOW)&&(pin_b==RV_LOW) )
  2668.     {
  2669.         rotary_state = RV_IDLE;
  2670.         return;
  2671.     }
  2672.     else if( (pin_a==RV_LOW)&&(pin_b==RV_HIGH) )
  2673.     {
  2674.         if(rotary_state==RV_WAIT)
  2675.         {
  2676.             rotary_state = RV_CWBEGIN;  
  2677.         }
  2678.         else if( (rotary_state==RV_IDLE)||(rotary_state==RV_CCWBEGIN) )
  2679.         {
  2680.             rotary_state = RV_CCWEND;
  2681.         }
  2682.         else
  2683.         {
  2684.             rotary_state = RV_WAIT;
  2685.         }
  2686.     }
  2687.     else if( (pin_a==RV_HIGH)&&(pin_b==RV_LOW) )
  2688.     {
  2689.         if(rotary_state==RV_WAIT)
  2690.         {
  2691.             rotary_state = RV_CCWBEGIN;
  2692.         }
  2693.         else if( (rotary_state==RV_IDLE)||(rotary_state==RV_CWBEGIN) )
  2694.         {
  2695.             rotary_state = RV_CWEND;
  2696.         }
  2697.         else
  2698.         {
  2699.             rotary_state = RV_WAIT;
  2700.         }
  2701.     }
  2702.     
  2703.     if(rotary_state==RV_CWEND)
  2704.     {
  2705. /* freyman marked 2004-3-23 15:39 for no use any more
  2706.         #ifdef SVA_SAMPLE
  2707.         if(full_scrn==AMPVOL)
  2708.             ampvol_func_right();
  2709.         else
  2710.         set_volume(1);
  2711.         #else
  2712. */
  2713.         #if defined(SUPPORT_TUNER)
  2714.         ircmd_power_volume(IRC_VOLUME_UP);
  2715.         #else
  2716.         ircmd_volume_up();
  2717.         #endif//SUPPORT_TUNER AV_INPUT
  2718. //        #endif
  2719.     }
  2720.     else if(rotary_state==RV_CCWEND)
  2721.     {
  2722. /* freyman marked 2004-3-23 15:37 for no use any more
  2723.         #ifdef SVA_SAMPLE
  2724.         if(full_scrn==AMPVOL)
  2725.             ampvol_func_left();
  2726.         else
  2727.         set_volume(0);
  2728.         #else
  2729. */
  2730.         #if defined(SUPPORT_TUNER)
  2731.         ircmd_power_volume(IRC_VOLUME_DN);
  2732.         #else
  2733.         ircmd_volume_down();
  2734.         #endif
  2735. //        #endif
  2736.     }
  2737. }                   
  2738. #endif//ROTARY_VOL_HUAJIA600
  2739. //shut off certain full_scrn when rotary vol is on, wangfeng 2004-2-4 17:02
  2740. void RotaryStateChk(void)
  2741. {
  2742.         if(full_scrn)
  2743.             {
  2744.                 if (full_scrn & PROGRAM)  //add by shawn 20020218
  2745.                 {
  2746.                     #ifdef SDRAM_16Mb_Mode                  
  2747.                         prog_state=3;   // 3 means that ircmd_stop pressed when full_scrn==PROGRAM
  2748.  
  2749.                     #endif//SDRAM_16Mb_Mode 
  2750.                     #ifdef JIEKE_DVD
  2751.                     prog_cnt = 0;
  2752.                     #endif
  2753.                     prog_func_off();
  2754.                 }
  2755.                 else if (full_scrn & SOUND)  //add by wangfeng 2004-2-4 17:00
  2756.                 {
  2757.                     cancel_sound();
  2758.                 }
  2759.                 else if (full_scrn & SETUP)  //add by wangfeng 2004-2-5 14:41
  2760.                 {
  2761.                     ExitSetupPage(1);
  2762.                 }
  2763. #ifdef  CF_CARD_WRITE
  2764.         if(!(full_scrn & PERIPHERAL))       //wuxiaofeng if define card, use preview for IR input
  2765. #endif
  2766.                 //wanghaoying changed 2003-12-9 14:21
  2767.                 full_scrn = 0;            
  2768.                 #ifdef SOUND_NO_KEYPAGE                
  2769.                 bEqDisplay = 0;  
  2770.                 #endif
  2771.                 //display_again=1;
  2772.             } //if(full_scrn)
  2773. }
  2774. #endif//ROTARY_VOLUME
  2775. extern UINT16 GetIRCode()
  2776. {
  2777.     // 2004/09/23 yltseng
  2778.     extern const BYTE ir_mapcode[256];
  2779.     UINT16 rx = regs0->iop_data[IR_PORT];
  2780.     
  2781.     #ifndef SUPPORT_SPI
  2782.     if( rx & IR_RDY )
  2783.     #endif
  2784.     {
  2785.         #ifdef IR_NEC
  2786.         rx = reverse_fun(rx);
  2787.         #else
  2788.         rx = rx&0x003f;
  2789.         #endif
  2790.         #if defined(IR30)
  2791.         if(regs0->iop_data[6] == IR_ADDR_PATT)
  2792.         {
  2793.             switch(rx)
  2794.             {
  2795.             case 0x30:
  2796.             case 0x32:
  2797.             case 0x33:
  2798.             case 0x34:
  2799.                 rx+=0x10;
  2800.                 break;
  2801.             default:
  2802.                 break;
  2803.             }
  2804.         }
  2805.         if(regs0->iop_data[6] == IR_ADDR_PATT2)
  2806.         {
  2807.             switch(rx)
  2808.             {
  2809.             case 0x30:
  2810.             case 0x32:
  2811.             case 0x33:
  2812.             case 0x34:
  2813.                 rx+=0x15;
  2814.                 break;
  2815.             default:
  2816.                 break;
  2817.             }
  2818.         }
  2819.         #endif //#if defined(IR30)
  2820.         #ifdef SUPPORT_SPI
  2821.         rx = ir_mapcode[(BYTE)spi_mem[5]];
  2822.         #else
  2823.         rx = ir_mapcode[(BYTE) rx];
  2824.         #endif
  2825.         regs0->iop_data[IR_PORT] &= (~IR_RDY);
  2826.                 
  2827.         return rx;
  2828.     }
  2829.     
  2830.     return IR_CODE_MAX_NUM;
  2831. }
  2832. void PollingSpecifiedKeys( UINT16* pKeyArray, UINT32 uiArraySize )  // 2004/10/14 yltseng
  2833. {
  2834.     UINT16 rx = GetIRCode();
  2835.     if( rx == IR_CODE_MAX_NUM )
  2836.     {
  2837. #ifdef SUPPORT_VFD
  2838.         extern UINT32 CheckVFDkey();
  2839.         rx = CheckVFDkey();
  2840. #endif
  2841.         if( rx == IR_CODE_MAX_NUM )
  2842.             return;
  2843.     }
  2844.     
  2845.     UINT32 i = 0;
  2846.     for( i = 0; i < uiArraySize; i++ )
  2847.     {
  2848.         if( rx == pKeyArray[i] )
  2849.         {
  2850.             irc_func_table[rx]();
  2851.             break;
  2852.         }
  2853.     }
  2854. }
  2855. #ifdef SUPPORT_SPI_QSI
  2856. extern void spi_cmd_production_reset(void);
  2857. extern void spi_cmd_run_in(void);
  2858. extern void spi_cmd_run_in_final(void);
  2859. extern void spi_cmd_mecha_test(void);
  2860. extern void spi_cmd_slot_test(void);
  2861. extern void spi_cmd_invalid_key(void);
  2862. void spicmd_pre_parse(BYTE spi_cmd)
  2863. {
  2864.     UINT8 uRx;
  2865.     uSpiRxData=spi_cmd;//tmp usage
  2866.     
  2867.     switch(uSpiRxData)//special cmd
  2868.     {
  2869.         case 0x00:
  2870.             spi_cmd_wakeup(); return;
  2871.         case 0x80:
  2872.             spi_cmd_production_reset(); return;
  2873.         case 0x81:
  2874.             spi_cmd_run_in(); return;
  2875.         case 0x82:
  2876.             spi_cmd_run_in_final(); return;
  2877.         case 0x83: //qsi: added by johnson 20040715
  2878.             spi_cmd_mecha_test(); return;
  2879.         case 0x84: //qsi: added by johnson 20040715
  2880.             spi_cmd_slot_test(); return;
  2881.             
  2882.         case 0xF0:
  2883.             spi_cmd_invalid_key(); return;
  2884.     }
  2885.     
  2886.     if(uSpiRxData < MAX_SPI_CMD_NUM)//boundry control
  2887.         uRx = SPI_IR_TRANS_TABLE[uSpiRxData];
  2888.     else
  2889.         return;
  2890.     //if( uRx == IRC_NULL)
  2891.        //spi_cmd_func_table[spi_cmd]();
  2892.     //else
  2893.     call_ir_func(uRx);
  2894.         //ircmd_pre_paser(uRx);
  2895. }
  2896. #endif //#ifdef SUPPORT_SPI_QSI
  2897. //Maoyong 2004-9-24 8:59 call after full scrn menu initialization 
  2898. void SetFullscrnCmdFuncPtr( void (*up), void (*down), void (*left), void (*right),void (*sel))
  2899. {
  2900.     ircmd_full_scrn_up = up;
  2901.     ircmd_full_scrn_down = down;
  2902.     ircmd_full_scrn_left = left;
  2903.     ircmd_full_scrn_right = right;
  2904.     ircmd_full_scrn_select = sel;
  2905. }