Lcd_osd.lst
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:725k
开发平台:

C/C++

  1. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 40  
  2. 2383   5      
  3. 2384   5                                                      // Leave current mode and search mode again
  4. 2385   5                                                      ucMode_Curr = MODE_OSDFORCE;
  5. 2386   5                                              }
  6. 2387   4      
  7. 2388   4                                              OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
  8. 2389   4                                              ucOSD_Item_Index1   = 0;    // Leave the item
  9. 2390   4                                      }
  10. 2391   3                                      else
  11. 2392   3                                      {
  12. 2393   4                                              ucOSD_Item_Index1   = 2;    // Enter the item, Default NO
  13. 2394   4                                              OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  14. 2395   4                                      }
  15. 2396   3                                      break;
  16. 2397   3                                      
  17. 2398   3                              case PAGE5_ITEM_VOLUME :
  18. 2399   3                                      if (ucOSD_Item_Index1)
  19. 2400   3                                      {
  20. 2401   4                                              ucOSD_Item_Index1   = 0;    // Leave the item
  21. 2402   4                                              OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 4, 14);
  22. 2403   4                                      }
  23. 2404   3                                      else
  24. 2405   3                                      {
  25. 2406   4                                              ucOSD_Item_Index1   = 1;    // Enter the item, show slider
  26. 2407   4      
  27. 2408   4                                              stGUD3.VOLUME   &= 0x1f;
  28. 2409   4                                              OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 2, 14);
  29. 2410   4                                      }
  30. 2411   3                                      break;
  31. 2412   3                                      
  32. 2413   3                              case PAGE5_ITEM_EXIT :
  33. 2414   3                                      // Disable highlight window
  34. 2415   3                                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  35. 2416   3                                              , 0, 0, 14, 251, 0, 1, 0);
  36. 2417   3                                      // De-select the page item and disable the hightlight window
  37. 2418   3                                      ucOSD_Item_Index0   = 0;
  38. 2419   3                                      ucOSD_Item_Index1   = 0;
  39. 2420   3      
  40. 2421   3                                      break;
  41. 2422   3                                      
  42. 2423   3                      }
  43. 2424   2              }
  44. 2425   1      }
  45. 2426          
  46. 2427          void Page5_Left_Right_Key(unsigned char Key)
  47. 2428          {
  48. 2429   1              if (ucOSD_Item_Index1)
  49. 2430   1              {
  50. 2431   2                      switch (ucOSD_Item_Index0)
  51. 2432   2                      {
  52. 2433   3                              case PAGE5_ITEM_OPTION :
  53. 2434   3                                      ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 2 : 1;      // 1-720, 2-640
  54. 2435   3                                      OSD_Line( 7, 36 , 16, 0x40, 2);
  55. 2436   3                                      OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(7+1), 7, 0x20, 2);
  56. 2437   3                                      //RTDOSDW((1 == ucOSD_Item_Index1) ? OSD_MODE_V720 : OSD_MODE_V640);
  57. 2438   3                                      break;
  58. 2439   3                                      
  59. 2440   3                              case PAGE5_ITEM_RECALL :
  60. 2441   3      //                              ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 1 : 2;
  61. 2442   3                                      ucOSD_Item_Index1   = (NOTIFY_RIGHT_KEY == Key) ? 1 : 2;
  62. 2443   3                                      OSD_Line( 9, 36 , 14, 0x40, 2);
  63. 2444   3                                      OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  64. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 41  
  65. 2445   3                                      //RTDOSDW(OSD_YESNO_TABLE[ucOSD_Item_Index1 - 1][stGUD1.FUNCTION & 0x07]);
  66. 2446   3                                      break;
  67. 2447   3                                      
  68. 2448   3                              case PAGE5_ITEM_VOLUME :
  69. 2449   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  70. 2450   3                                      if (NOTIFY_LEFT_KEY == Key)
  71. 2451   3                                      {
  72. 2452   4                                              if (0x00 == stGUD3.VOLUME)
  73. 2453   4                                                      break;
  74. 2454   4      
  75. 2455   4                                              stGUD3.VOLUME   = stGUD3.VOLUME - 1;
  76. 2456   4                                      }
  77. 2457   3                                      else
  78. 2458   3                                      {
  79. 2459   4                                              if (0x1f <= stGUD3.VOLUME)
  80. 2460   4                                                      break;
  81. 2461   4      
  82. 2462   4                                              stGUD3.VOLUME   = stGUD3.VOLUME + 1;
  83. 2463   4                                      }
  84. 2464   3      
  85. 2465   3                                      OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 2, 14);
  86. 2466   3                                      SetVolume();
  87. 2467   3                                      Save_GUD3();
  88. 2468   3                                      break;
  89. 2469   3                                      
  90. 2470   3                              default :
  91. 2471   3                                      break;
  92. 2472   3                                      
  93. 2473   3                      }
  94. 2474   2              }
  95. 2475   1              else
  96. 2476   1              {
  97. 2477   2                      Osd_Change_Item(Key,PAGE5_ITEM_NUM);
  98. 2478   2              }
  99. 2479   1      }
  100. 2480          
  101. 2481          void Page5_Show(void)
  102. 2482          {
  103. 2483   1              Show_Osd_Page(3,Page5_Atb,4);
  104. 2484   1      
  105. 2485   1              //Set Window 5 to select "Misc."
  106. 2486   1      //      OSD_Window( 5, 10, 136, 186, 216, 1, 1, 14, 251, 0, 1, 25);
  107. 2487   1              OSD_Window( 5, 10, 136, 153, 183, 1, 1, 14, 251, 0, 1, 25);
  108. 2488   1      
  109. 2489   1      #if (AUDIO_TYPE != AUDIO_NONE)
  110. 2490   1      
  111. 2491   1              OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 4, 14);
  112. 2492   1      
  113. 2493   1      #endif
  114. 2494   1              if (0 == ucOSD_Item_Index1)
  115. 2495   1              {
  116. 2496   2                      if( ucOSD_Item_Index0 == PAGE5_ITEM_SOURCE)
  117. 2497   2                              OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  118. 2498   2              }
  119. 2499   1              else
  120. 2500   1              {
  121. 2501   2                      switch (ucOSD_Item_Index0)
  122. 2502   2                      {
  123. 2503   3                              case PAGE5_ITEM_OPTION :
  124. 2504   3                                      //OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
  125. 2505   3                                      //RTDOSDW((1 == ucOSD_Item_Index1) ? OSD_MODE_V720 : OSD_MODE_V640);
  126. 2506   3                                      break;
  127. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 42  
  128. 2507   3                                      
  129. 2508   3                              case PAGE5_ITEM_RECALL :
  130. 2509   3                                      //OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
  131. 2510   3                                      //RTDOSDW(OSD_YESNO_TABLE[ucOSD_Item_Index1 - 1][stGUD1.FUNCTION & 0x07]);
  132. 2511   3                                      break;
  133. 2512   3                                      
  134. 2513   3                              case PAGE5_ITEM_VOLUME :
  135. 2514   3                                      //stGUD3.VOLUME   &= 0x1f;
  136. 2515   3                                      //OSD_Slider(11, 2, 20, 0x1f - stGUD3.VOLUME, 0x1f, 0x61);
  137. 2516   3                                      break;
  138. 2517   3                                      
  139. 2518   3                              default :
  140. 2519   3                                      break;
  141. 2520   3                                      
  142. 2521   3                      }
  143. 2522   2              }
  144. 2523   1      }
  145. 2524          
  146. 2525          void Page5B_Enter_Key()
  147. 2526          {
  148. 2527   1              Data[0] = (PAGE5B_ITEM_DVI == ucOSD_Item_Index1) ?  SOURCE_DVI 
  149. 2528   1                      : (PAGE5B_ITEM_CVBS == ucOSD_Item_Index1) ? SOURCE_AV
  150. 2529   1                      : (PAGE5B_ITEM_SV == ucOSD_Item_Index1) ?   SOURCE_SV 
  151. 2530   1                      : (PAGE5B_ITEM_YUV == ucOSD_Item_Index1) ?  SOURCE_YUV 
  152. 2531   1                      : (PAGE5B_ITEM_TV == ucOSD_Item_Index1) ?   SOURCE_TV : SOURCE_VGA;
  153. 2532   1      
  154. 2533   1              if(Data[0] != ucInputSrc)
  155. 2534   1              {
  156. 2535   2                      Change_Source(Data[0]);
  157. 2536   2                      ucOSD_Page_Index = 0;
  158. 2537   2              }
  159. 2538   1              else
  160. 2539   1              {
  161. 2540   2                      ucOSD_Item_Index1 = 0;            // Quit Sub-Page
  162. 2541   2              }
  163. 2542   1      
  164. 2543   1      }
  165. 2544          
  166. 2545          void Page5B_Left_Right_Key(unsigned char Key)
  167. 2546          {
  168. 2547   1              // Select and highlight the next/previous item
  169. 2548   1              OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
  170. 2549   1                      54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 0, 0, 14, 251, 0, 1, 0);
  171. 2550   1              if (NOTIFY_RIGHT_KEY == Key)
  172. 2551   1                      ucOSD_Item_Index1   = (PAGE5B_ITEM_NUM == ucOSD_Item_Index1) ? 1 : (ucOSD_Item_Index1 + 1);
  173. 2552   1              else
  174. 2553   1                      ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? PAGE5B_ITEM_NUM : (ucOSD_Item_Index1 - 1);
  175. 2554   1      
  176. 2555   1              OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
  177. 2556   1                      54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
  178. 2557   1      }
  179. 2558          
  180. 2559          void Page5B_Show()
  181. 2560          {
  182. 2561   1              Show_Osd_Page(4,Page9_Atb,8);
  183. 2562   1              RTDOSDW(Page9_Content);
  184. 2563   1      
  185. 2564   1              OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
  186. 2565   1                      54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
  187. 2566   1              // Highlight the select item
  188. 2567   1              // Set Window 6
  189. 2568   1              //OSD_Window( 6, 152, 282, 56, 86, 2, 2, 14, 251, 0, 1, 25);
  190. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 43  
  191. 2569   1      
  192. 2570   1      
  193. 2571   1      }
  194. 2572          
  195. 2573          void Page6_Left_Right_Key(unsigned char Key)
  196. 2574          {
  197. 2575   1              if(Key == NOTIFY_RIGHT_KEY)
  198. 2576   1                      ucOSD_Page_Index    = GetNextPageIdx(ucOSD_Page_Index);
  199. 2577   1              else
  200. 2578   1                      ucOSD_Page_Index    = GetPrevPageIdx(ucOSD_Page_Index);
  201. 2579   1      }
  202. 2580          
  203. 2581          void Page6_Show(void)
  204. 2582          {
  205. 2583   1              //Init_Page(5);
  206. 2584   1              //RTDOSDW(OSD_PAGE_TABLE[5][stGUD1.FUNCTION & 0x07]);
  207. 2585   1      
  208. 2586   1              Show_Osd_Page(4,Page6_Atb,5);
  209. 2587   1      
  210. 2588   1              //Set Window 5 to select "Exit"
  211. 2589   1      //      OSD_Window( 5, 10, 136, 219, 249, 1, 1, 14, 251, 0, 1, 25);
  212. 2590   1              OSD_Window( 5, 10, 136, 186, 216, 1, 1, 14, 251, 0, 1, 25);
  213. 2591   1      }
  214. 2592          
  215. 2593          //////////////////////////////////////////////////////////////////////////////////
  216. 2594          //anson
  217. 2595          //////////////////////////////////////////////////////////////////////////////////
  218. 2596          void PageFactory_Show(void)
  219. 2597          {
  220. 2598   1              OSD_Fact_Clear( 0,20, 0,30);
  221. 2599   1              OSD_Position(OSD_ENABLE);
  222. 2600   1              OSD_Position(OSD_ENABLE);
  223. 2601   1      
  224. 2602   1              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  225. 2603   1              RTDOSDW(OSD_Reset);
  226. 2604   1              RTDOSDW(OSD_Clean_All);
  227. 2605   1              RTDOSDW(FactoryPageAtbFont);
  228. 2606   1              OSD_Fact_Line( 3, 0, 15, 0x20, 2);
  229. 2607   1              RTDOSDW(Version_Panel);
  230. 2608   1              ShowValue( 5,12, stGUD0.CONTRAST, 0x13 );               //Contrast
  231. 2609   1              ShowValue( 6,12, stGUD0.BRIGHT, 0x13 );         //Brightness
  232. 2610   1              ShowValue( 7,12, stGUD3.SPREAD, 0x13 );         //Spread
  233. 2611   1              ShowValue( 8,  9, stGUD4.C2_R, 0x13 );                  //R-6500K
  234. 2612   1              ShowValue( 8,15, stGUD4.C2_G, 0x13 );                   //G-6500K
  235. 2613   1              ShowValue( 8,21, stGUD4.C2_B, 0x13 );                   //B-6500K
  236. 2614   1      }
  237. 2615          
  238. 2616          void PageFactory_Enter_Key(void)
  239. 2617          {
  240. 2618   1              if (ucOSD_Item_Index1)
  241. 2619   1              {
  242. 2620   2                      if (ucOSD_Item_Index2)
  243. 2621   2                      {
  244. 2622   3                              switch(ucOSD_Item_Index1)
  245. 2623   3                              {
  246. 2624   4                                      case 1:
  247. 2625   4                                              OSD_Fact_Line( 8,  9, 3, 0x13, 2);
  248. 2626   4                                              ucOSD_Item_Index2   = 0;
  249. 2627   4                                              break;
  250. 2628   4                                      case 2:
  251. 2629   4                                              OSD_Fact_Line( 8,15, 3, 0x13, 2);
  252. 2630   4                                              ucOSD_Item_Index2   = 0;
  253. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 44  
  254. 2631   4                                              break;
  255. 2632   4                                      case 3:
  256. 2633   4                                              OSD_Fact_Line( 8,21, 3, 0x13, 2);
  257. 2634   4                                              ucOSD_Item_Index2   = 0;
  258. 2635   4                                              break;
  259. 2636   4                              }
  260. 2637   3                      }
  261. 2638   2                      else            //ucOSD_Item_Index2 = 0 
  262. 2639   2                      {
  263. 2640   3                              switch (ucOSD_Item_Index0)
  264. 2641   3                              {
  265. 2642   4                                      case PAGEFact_ITEM_Contrast:
  266. 2643   4                                              ShowValue(5,12, stGUD0.CONTRAST, 0x13 );
  267. 2644   4                                              ucOSD_Item_Index1   = 0;
  268. 2645   4                                              break;
  269. 2646   4      
  270. 2647   4                                      case PAGEFact_ITEM_Brightness:
  271. 2648   4                                              ShowValue(6,12, stGUD0.BRIGHT, 0x13 );
  272. 2649   4                                              ucOSD_Item_Index1   = 0;
  273. 2650   4                                              break;
  274. 2651   4      
  275. 2652   4                                      case PAGEFact_ITEM_Spread:
  276. 2653   4                                              ShowValue(7,12, stGUD3.SPREAD, 0x13 );
  277. 2654   4                                              ucOSD_Item_Index1   = 0;
  278. 2655   4                                              break;
  279. 2656   4      
  280. 2657   4                                      case PAGEFact_ITEM_6500K:
  281. 2658   4      
  282. 2659   4                                              switch(ucOSD_Item_Index1)
  283. 2660   4                                              {
  284. 2661   5                                                      case 1:
  285. 2662   5                                                              OSD_Fact_Line( 8,  9, 3, 0x23, 2);
  286. 2663   5                                                              ucOSD_Item_Index2   = 1;
  287. 2664   5                                                              break;
  288. 2665   5                                                      case 2:
  289. 2666   5                                                              OSD_Fact_Line( 8,15, 3, 0x23, 2);
  290. 2667   5                                                              ucOSD_Item_Index2   = 1;
  291. 2668   5                                                              break;
  292. 2669   5                                                      case 3:
  293. 2670   5                                                              OSD_Fact_Line( 8,21, 3, 0x23, 2);
  294. 2671   5                                                              ucOSD_Item_Index2   = 1;
  295. 2672   5                                                              break;
  296. 2673   5                                                      case 4:
  297. 2674   5                                                              OSD_Fact_Line( 8,25, 4, 0x13, 2);
  298. 2675   5                                                              ucOSD_Item_Index1   = 0;
  299. 2676   5                                                              break;
  300. 2677   5                                              }
  301. 2678   4                                              break;
  302. 2679   4                              }
  303. 2680   3                      }
  304. 2681   2              }
  305. 2682   1              else            //into ucOSD_Item_Index1 = 1 ;
  306. 2683   1              {
  307. 2684   2                      switch (ucOSD_Item_Index0)
  308. 2685   2                      {
  309. 2686   3                              case PAGEFact_ITEM_Recall:
  310. 2687   3                                      Init_FACTORY();
  311. 2688   3                                      ShowValue( 5,12, stGUD0.CONTRAST, 0x13 );               //Contrast
  312. 2689   3                                      ShowValue( 6,12, stGUD0.BRIGHT, 0x13 );         //Brightness
  313. 2690   3                                      ShowValue( 8,  9, stGUD4.C2_R, 0x13 );                  //R-6500K
  314. 2691   3                                      ShowValue( 8,15, stGUD4.C2_G, 0x13 );                   //G-6500K
  315. 2692   3                                      ShowValue( 8,21, stGUD4.C2_B, 0x13 );                   //B-6500K
  316. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 45  
  317. 2693   3      
  318. 2694   3                                      stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xE7 ) | 0x08;  //6500 mode
  319. 2695   3                                      Set_Bright_Contrast();
  320. 2696   3                                      RTDOSDW(RecallOK);
  321. 2697   3                                      break;
  322. 2698   3      
  323. 2699   3                              case PAGEFact_ITEM_Auto_Color:
  324. 2700   3                                      Auto_Balance();
  325. 2701   3                                      RTDOSDW(AutoOK);
  326. 2702   3                                      break;
  327. 2703   3      
  328. 2704   3                              case PAGEFact_ITEM_Contrast:
  329. 2705   3                                      ShowValue(5,12, stGUD0.CONTRAST, 0x23 );
  330. 2706   3                                      ucOSD_Item_Index1   = 1;
  331. 2707   3                                      break;
  332. 2708   3      
  333. 2709   3                              case PAGEFact_ITEM_Brightness:
  334. 2710   3                                      ShowValue(6,12, stGUD0.BRIGHT, 0x23 );
  335. 2711   3                                      ucOSD_Item_Index1   = 1;
  336. 2712   3                                      break;
  337. 2713   3      
  338. 2714   3                              case PAGEFact_ITEM_Spread:
  339. 2715   3                                      ShowValue(7,12, stGUD3.SPREAD, 0x23 );
  340. 2716   3                                      ucOSD_Item_Index1   = 1;
  341. 2717   3                                      break;
  342. 2718   3      
  343. 2719   3                              case PAGEFact_ITEM_6500K:
  344. 2720   3                                      OSD_Fact_Line( 8, 7, 1, 0x23, 2);
  345. 2721   3                                      ucOSD_Item_Index1   = 1;
  346. 2722   3                                      break;
  347. 2723   3      
  348. 2724   3                              case PAGEFact_ITEM_EXIT:
  349. 2725   3                                      ucOSD_Page_Index         = 0;
  350. 2726   3                                      ucOSD_Item_Index0   = 0;
  351. 2727   3                                      ucOSD_Item_Index1   = 0;
  352. 2728   3                                      ucOSD_Item_Index2   = 0;
  353. 2729   3      
  354. 2730   3                                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  355. 2731   3                                      RTDOSDW(OSD_Reset);
  356. 2732   3                                      break;
  357. 2733   3                      }
  358. 2734   2              }
  359. 2735   1      }
  360. 2736          
  361. 2737          void PageFactory_Left_Right_Key(unsigned char Key)
  362. 2738          {
  363. 2739   1              if (ucOSD_Item_Index1)
  364. 2740   1              {
  365. 2741   2                      if (ucOSD_Item_Index2)
  366. 2742   2                      {
  367. 2743   3                              switch (ucOSD_Item_Index0)
  368. 2744   3                              {
  369. 2745   4                              //select 6500K value;
  370. 2746   4                                      case PAGEFact_ITEM_6500K:
  371. 2747   4      
  372. 2748   4                                              switch(ucOSD_Item_Index1)
  373. 2749   4                                              {
  374. 2750   5                                                      case 1:
  375. 2751   5                                                              Value_Adjust(&stGUD4.C2_R,Key,255,0);
  376. 2752   5                                                              ShowValue( 8,  9, stGUD4.C2_R, 0x23 );
  377. 2753   5                                                              break;
  378. 2754   5                                                      case 2:
  379. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 46  
  380. 2755   5                                                              Value_Adjust(&stGUD4.C2_G,Key,255,0);
  381. 2756   5                                                              ShowValue( 8,15, stGUD4.C2_G, 0x23 );
  382. 2757   5                                                              break;
  383. 2758   5                                                      case 3:
  384. 2759   5                                                              Value_Adjust(&stGUD4.C2_B,Key,255,0);
  385. 2760   5                                                              ShowValue( 8,21, stGUD4.C2_B, 0x23 );
  386. 2761   5                                                              break;
  387. 2762   5                                              }
  388. 2763   4                                              Set_Bright_Contrast();
  389. 2764   4                                              Save_GUD4();
  390. 2765   4                                              break;
  391. 2766   4      
  392. 2767   4                              }
  393. 2768   3                      }
  394. 2769   2                      else            //ucOSD_Item_Index1 = 1 , ucOSD_Item_Index2 = 0
  395. 2770   2                      {
  396. 2771   3                              switch (ucOSD_Item_Index0)
  397. 2772   3                              {
  398. 2773   4                                      if(NOTIFY_RIGHT_KEY == Key)
  399. 2774   4                                              ucOSD_Item_Index0 = (ucOSD_Item_Index0 == 1) ? 7 : ucOSD_Item_Index0 - 1;
  400. 2775   4                                      else
  401. 2776   4                                              ucOSD_Item_Index0 = (ucOSD_Item_Index0 == 7) ? 1 : ucOSD_Item_Index0 + 1;
  402. 2777   4      
  403. 2778   4                              //select Contrast value;
  404. 2779   4                                      case PAGEFact_ITEM_Contrast:
  405. 2780   4                                              Bright_Contrast_Adjust(&stGUD0.CONTRAST,Key);
  406. 2781   4                                              ShowValue(5,12, stGUD0.CONTRAST, 0x23 );
  407. 2782   4      
  408. 2783   4                                      #if(ANALOG_CONTRAST)
  409. 2784   4                                              if((stGUD1.INPUT_SOURCE & 0x07) == SOURCE_VGA)
  410. 2785   4                                                      SetADC_Gain();
  411. 2786   4                                              else
  412. 2787   4                                                      Set_Bright_Contrast();
  413. 2788   4                                      #else
  414.                                                               Set_Bright_Contrast();
  415.                                               #endif
  416. 2791   4      
  417. 2792   4                                              Save_GUD0();
  418. 2793   4                                              break;
  419. 2794   4      
  420. 2795   4                              //select Brightness value;
  421. 2796   4                                      case PAGEFact_ITEM_Brightness:
  422. 2797   4                                              Bright_Contrast_Adjust(&stGUD0.BRIGHT,Key);
  423. 2798   4                                              ShowValue(6,12, stGUD0.BRIGHT, 0x23 );
  424. 2799   4                                              Set_Bright_Contrast();
  425. 2800   4                                              Save_GUD0();
  426. 2801   4                                              break;
  427. 2802   4      
  428. 2803   4                                      case PAGEFact_ITEM_Spread:
  429. 2804   4                                              SPREAD_Adjust(&stGUD3.SPREAD,Key);
  430. 2805   4                                              ShowValue(7,12, stGUD3.SPREAD, 0x23 );
  431. 2806   4                                              Set_Spread();
  432. 2807   4                                              Save_GUD3();
  433. 2808   4                                              break;
  434. 2809   4      
  435. 2810   4                              //select 6500K R,G,B,Exit ;
  436. 2811   4                                      case PAGEFact_ITEM_6500K:
  437. 2812   4      
  438. 2813   4                                              if(NOTIFY_RIGHT_KEY == Key)
  439. 2814   4                                                      ucOSD_Item_Index1 = (ucOSD_Item_Index1 == 4) ? 1 : ucOSD_Item_Index1 + 1;
  440. 2815   4                                              else
  441. 2816   4                                                      ucOSD_Item_Index1 = (ucOSD_Item_Index1 == 1) ? 4 : ucOSD_Item_Index1 - 1;
  442. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 47  
  443. 2817   4      
  444. 2818   4                                                      switch(ucOSD_Item_Index1)
  445. 2819   4                                                      {
  446. 2820   5                                                              case 1:
  447. 2821   5                                                                      OSD_Fact_Line( 8,  7, 1, 0x23, 2);
  448. 2822   5                                                                      OSD_Fact_Line( 8,13, 1, 0x13, 2);
  449. 2823   5                                                                      OSD_Fact_Line( 8,25, 4, 0x13, 2);
  450. 2824   5                                                                      break;
  451. 2825   5                                                              case 2:
  452. 2826   5                                                                      OSD_Fact_Line( 8,  7, 1, 0x13, 2);
  453. 2827   5                                                                      OSD_Fact_Line( 8,13, 1, 0x23, 2);
  454. 2828   5                                                                      OSD_Fact_Line( 8,19, 1, 0x13, 2);
  455. 2829   5                                                                      break;
  456. 2830   5                                                              case 3:
  457. 2831   5                                                                      OSD_Fact_Line( 8,13, 1, 0x13, 2);
  458. 2832   5                                                                      OSD_Fact_Line( 8,19, 1, 0x23, 2);
  459. 2833   5                                                                      OSD_Fact_Line( 8,25, 4, 0x13, 2);
  460. 2834   5                                                                      break;
  461. 2835   5                                                              case 4:
  462. 2836   5                                                                      OSD_Fact_Line( 8,  7, 1, 0x13, 2);
  463. 2837   5                                                                      OSD_Fact_Line( 8,19, 1, 0x13, 2);
  464. 2838   5                                                                      OSD_Fact_Line( 8,25, 4, 0x23, 2);
  465. 2839   5                                                                      break;
  466. 2840   5                                                      }
  467. 2841   4                                              break;
  468. 2842   4                              }
  469. 2843   3                      }
  470. 2844   2              }
  471. 2845   1              else    //ucOSD_Item_Index1 = 0
  472. 2846   1              {
  473. 2847   2              //select Factory Main menu ;
  474. 2848   2                      if(NOTIFY_RIGHT_KEY == Key)
  475. 2849   2                              ucOSD_Item_Index0 = (ucOSD_Item_Index0 == 7) ? 1 : ucOSD_Item_Index0 + 1;
  476. 2850   2                      else
  477. 2851   2                              ucOSD_Item_Index0 = (ucOSD_Item_Index0 == 1) ? 7 : ucOSD_Item_Index0 - 1;
  478. 2852   2      
  479. 2853   2                      switch (ucOSD_Item_Index0)
  480. 2854   2                      {
  481. 2855   3                              case PAGEFact_ITEM_Recall:
  482. 2856   3                                      OSD_Fact_Line( 9, 1,  7, 0x10, 2);
  483. 2857   3                                      OSD_Fact_Line( 3, 1, 14, 0x20, 2);
  484. 2858   3                                      OSD_Fact_Line( 4, 1, 10, 0x10, 2);
  485. 2859   3                                      break;
  486. 2860   3      
  487. 2861   3                              case PAGEFact_ITEM_Auto_Color:
  488. 2862   3                                      OSD_Fact_Line( 3, 1, 14, 0x10, 2);
  489. 2863   3                                      OSD_Fact_Line( 4, 1, 10, 0x20, 2);
  490. 2864   3                                      OSD_Fact_Line( 5, 1, 10, 0x10, 2);
  491. 2865   3                                      break;
  492. 2866   3      
  493. 2867   3                              case PAGEFact_ITEM_Contrast:
  494. 2868   3                                      OSD_Fact_Line( 4, 1, 10, 0x10, 2);
  495. 2869   3                                      OSD_Fact_Line( 5, 1, 10, 0x20, 2);
  496. 2870   3                                      OSD_Fact_Line( 6, 1, 10, 0x10, 2);
  497. 2871   3                                      break;
  498. 2872   3      
  499. 2873   3                              case PAGEFact_ITEM_Brightness:
  500. 2874   3                                      OSD_Fact_Line( 5, 1, 10, 0x10, 2);
  501. 2875   3                                      OSD_Fact_Line( 6, 1, 10, 0x20, 2);
  502. 2876   3                                      OSD_Fact_Line( 7, 1, 10, 0x10, 2);
  503. 2877   3                                      break;
  504. 2878   3      
  505. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 48  
  506. 2879   3                              case PAGEFact_ITEM_Spread:
  507. 2880   3                                      OSD_Fact_Line( 6, 1, 10, 0x10, 2);
  508. 2881   3                                      OSD_Fact_Line( 7, 1, 10, 0x20, 2);
  509. 2882   3                                      OSD_Fact_Line( 8, 1,   5, 0x10, 2);
  510. 2883   3                                      break;
  511. 2884   3      
  512. 2885   3                              case PAGEFact_ITEM_6500K:
  513. 2886   3                                      OSD_Fact_Line( 7, 1,10, 0x10, 2);
  514. 2887   3                                      OSD_Fact_Line( 8, 1,  5, 0x20, 2);
  515. 2888   3                                      OSD_Fact_Line( 9, 1,  7, 0x10, 2);
  516. 2889   3                                      Set_Bright_Contrast();
  517. 2890   3                                      break;
  518. 2891   3      
  519. 2892   3                              case PAGEFact_ITEM_EXIT:
  520. 2893   3                                      OSD_Fact_Line( 8, 1,  5, 0x10, 2);
  521. 2894   3                                      OSD_Fact_Line( 9, 1,  7, 0x20, 2);
  522. 2895   3                                      OSD_Fact_Line( 3, 1,14, 0x10, 2);
  523. 2896   3                                      break;
  524. 2897   3                      }
  525. 2898   2              }
  526. 2899   1      }
  527. 2900          
  528. 2901          
  529. 2902          //////////////////////////////////////////////////////////////////////////////////
  530. 2903          //////////////////////////////////////////////////////////////////////////////////
  531. 2904          
  532. 2905          void PageADC_Left_Right_Key(unsigned char Key)
  533. 2906          {
  534. 2907   1              if (ucOSD_Item_Index1)
  535. 2908   1              {
  536. 2909   2                      switch (ucOSD_Item_Index0)
  537. 2910   2                      {
  538. 2911   3                              case PAGEH_ITEM_REDGAIN :
  539. 2912   3                                      if (NOTIFY_RIGHT_KEY == Key)
  540. 2913   3                                      {
  541. 2914   4                                              if (0xff == stGUD2.AD_R_GAIN)
  542. 2915   4                                                      return;
  543. 2916   4      
  544. 2917   4                                              stGUD2.AD_R_GAIN    += 1;
  545. 2918   4                                      }
  546. 2919   3                                      else
  547. 2920   3                                      {
  548. 2921   4                                              if (0x00 == stGUD2.AD_R_GAIN)
  549. 2922   4                                                      return;
  550. 2923   4      
  551. 2924   4                                              stGUD2.AD_R_GAIN    -= 1;
  552. 2925   4                                      }
  553. 2926   3      
  554. 2927   3                                      OSD_Slider(5, 36, 17, stGUD2.AD_R_GAIN, 0xff, 2, 14);
  555. 2928   3                                      SetADC_Gain();
  556. 2929   3                                      break;
  557. 2930   3                                      
  558. 2931   3                              case PAGEH_ITEM_GREENGAIN :
  559. 2932   3                                      if (NOTIFY_RIGHT_KEY == Key)
  560. 2933   3                                      {
  561. 2934   4                                              if (0xff == stGUD2.AD_G_GAIN)
  562. 2935   4                                                      return;
  563. 2936   4      
  564. 2937   4                                              stGUD2.AD_G_GAIN    += 1;
  565. 2938   4                                      }
  566. 2939   3                                      else
  567. 2940   3                                      {
  568. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 49  
  569. 2941   4                                              if (0x00 == stGUD2.AD_G_GAIN)
  570. 2942   4                                                      return;
  571. 2943   4      
  572. 2944   4                                              stGUD2.AD_G_GAIN    -= 1;
  573. 2945   4                                      }
  574. 2946   3      
  575. 2947   3                                      OSD_Slider(7, 36, 17, stGUD2.AD_R_GAIN, 0xff, 2, 14);
  576. 2948   3                                      SetADC_Gain();
  577. 2949   3                                      break;
  578. 2950   3                                              
  579. 2951   3                              case PAGEH_ITEM_BLUEGAIN :
  580. 2952   3                                      if (NOTIFY_RIGHT_KEY == Key)
  581. 2953   3                                      {
  582. 2954   4                                              if (0xff == stGUD2.AD_B_GAIN)
  583. 2955   4                                                      return;
  584. 2956   4      
  585. 2957   4                                              stGUD2.AD_B_GAIN    += 1;
  586. 2958   4                                      }
  587. 2959   3                                      else
  588. 2960   3                                      {
  589. 2961   4                                              if (0x00 == stGUD2.AD_B_GAIN)
  590. 2962   4                                                      return;
  591. 2963   4      
  592. 2964   4                                              stGUD2.AD_B_GAIN    -= 1;
  593. 2965   4                                      }
  594. 2966   3      
  595. 2967   3                                      OSD_Slider(9, 36, 17, stGUD2.AD_R_GAIN, 0xff, 2, 14);
  596. 2968   3                                      SetADC_Gain();
  597. 2969   3                                      break;
  598. 2970   3                                      
  599. 2971   3                              case PAGEH_ITEM_REDOFFSET :
  600. 2972   3                                      if (NOTIFY_RIGHT_KEY == Key)
  601. 2973   3                                      {
  602. 2974   4                                              if (0xff == stGUD2.AD_R_OFFSET)
  603. 2975   4                                                      return;
  604. 2976   4      
  605. 2977   4                                              stGUD2.AD_R_OFFSET  += 1;
  606. 2978   4                                      }
  607. 2979   3                                      else
  608. 2980   3                                      {
  609. 2981   4                                              if (0x00 == stGUD2.AD_R_OFFSET)
  610. 2982   4                                                      return;
  611. 2983   4      
  612. 2984   4                                              stGUD2.AD_R_OFFSET  -= 1;
  613. 2985   4                                      }
  614. 2986   3                                      
  615. 2987   3                                      OSD_Slider(11, 36, 17, stGUD2.AD_R_GAIN, 0xff, 2, 14);
  616. 2988   3                                      SetADC_Offset();
  617. 2989   3                                      break;
  618. 2990   3                                      
  619. 2991   3                              case PAGEH_ITEM_GREENOFFSET :
  620. 2992   3                                      if (NOTIFY_RIGHT_KEY == Key)
  621. 2993   3                                      {
  622. 2994   4                                              if (0xff == stGUD2.AD_G_OFFSET)
  623. 2995   4                                                      return;
  624. 2996   4      
  625. 2997   4                                              stGUD2.AD_G_OFFSET  += 1;
  626. 2998   4                                      }
  627. 2999   3                                      else
  628. 3000   3                                      {
  629. 3001   4                                              if (0x00 == stGUD2.AD_G_OFFSET)
  630. 3002   4                                                      return;
  631. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 50  
  632. 3003   4      
  633. 3004   4                                              stGUD2.AD_G_OFFSET  -= 1;
  634. 3005   4                                      }
  635. 3006   3      
  636. 3007   3                                      OSD_Slider(13, 36, 17, stGUD2.AD_R_GAIN, 0xff, 2, 14);
  637. 3008   3                                      SetADC_Offset();
  638. 3009   3                                      break;
  639. 3010   3                                      
  640. 3011   3                              case PAGEH_ITEM_BLUEOFFSET :
  641. 3012   3                                      if (NOTIFY_RIGHT_KEY == Key)
  642. 3013   3                                      {
  643. 3014   4                                              if (0xff == stGUD2.AD_B_OFFSET)
  644. 3015   4                                                      return;
  645. 3016   4      
  646. 3017   4                                              stGUD2.AD_B_OFFSET  += 1;
  647. 3018   4                                      }
  648. 3019   3                                      else
  649. 3020   3                                      {
  650. 3021   4                                              if (0x00 == stGUD2.AD_B_OFFSET)
  651. 3022   4                                                      return;
  652. 3023   4      
  653. 3024   4                                              stGUD2.AD_B_OFFSET  -= 1;
  654. 3025   4                                      }
  655. 3026   3                                      
  656. 3027   3                                      OSD_Slider(15, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  657. 3028   3                                      SetADC_Offset();
  658. 3029   3                                      break;
  659. 3030   3                                      
  660. 3031   3                      }
  661. 3032   2      
  662. 3033   2                      Save_GUD2();
  663. 3034   2              }
  664. 3035   1              else
  665. 3036   1              {
  666. 3037   2                      if (ucOSD_Item_Index0)
  667. 3038   2                      {
  668. 3039   3                              // Select and highlight the next/previous item
  669. 3040   3                              if (NOTIFY_RIGHT_KEY == Key)
  670. 3041   3                                      ucOSD_Item_Index0   = (PAGEH_ITEM_NUM == ucOSD_Item_Index0) ? 1 : (ucOSD_Item_Index0 + 1);
  671. 3042   3                              else
  672. 3043   3                                      ucOSD_Item_Index0   = (1 == ucOSD_Item_Index0) ? PAGEH_ITEM_NUM : (ucOSD_Item_Index0 - 1);
  673. 3044   3      
  674. 3045   3                              OSD_Window( 6, 0, 476, 0, 252, 4, 4, 0, 1, 231, 1, 113);
  675. 3046   3                      }
  676. 3047   2              }
  677. 3048   1      }
  678. 3049          
  679. 3050          void PageADC_Enter_Key(void)
  680. 3051          {
  681. 3052   1              if (0 == ucOSD_Item_Index0)
  682. 3053   1              {
  683. 3054   2                      // Select and highlight the first item
  684. 3055   2                      ucOSD_Item_Index0   = PAGEH_ITEM_REDGAIN;
  685. 3056   2                      ucOSD_Item_Index1   = 0;
  686. 3057   2                      OSD_Window( 6, 152, 282, 56, 86, 2, 2, 14, 251, 0, 1, 25);
  687. 3058   2              }
  688. 3059   1              else
  689. 3060   1              {
  690. 3061   2                      if (PAGEH_ITEM_EXIT == ucOSD_Item_Index0)
  691. 3062   2                      {                
  692. 3063   3                              ucOSD_Page_Index    = 0;        // Close OSD
  693. 3064   3                      }
  694. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 51  
  695. 3065   2                      else
  696. 3066   2                      {
  697. 3067   3                              if (ucOSD_Item_Index1)
  698. 3068   3                              {
  699. 3069   4                                      ucOSD_Item_Index1   = 0;    // Leave the item, Show Mode
  700. 3070   4                                      RTDOSDW(OSD_Version);
  701. 3071   4                              }
  702. 3072   3                              else
  703. 3073   3                              {
  704. 3074   4                                      ucOSD_Item_Index1   = 1;    // Enter the item, Show slider
  705. 3075   4      
  706. 3076   4                                      switch (ucOSD_Item_Index0)
  707. 3077   4                                      {
  708. 3078   5                                              case PAGEH_ITEM_REDGAIN :
  709. 3079   5                                                      OSD_Slider(5, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  710. 3080   5                                                      break;
  711. 3081   5                                                      
  712. 3082   5                                              case PAGEH_ITEM_GREENGAIN :
  713. 3083   5                                                      OSD_Slider(7, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  714. 3084   5                                                      break;
  715. 3085   5                                                      
  716. 3086   5                                              case PAGEH_ITEM_BLUEGAIN :
  717. 3087   5                                                      OSD_Slider(9, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  718. 3088   5                                                      break;
  719. 3089   5                                                      
  720. 3090   5                                              case PAGEH_ITEM_REDOFFSET :
  721. 3091   5                                                      OSD_Slider(11, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  722. 3092   5                                                      break;
  723. 3093   5                                                      
  724. 3094   5                                              case PAGEH_ITEM_GREENOFFSET :
  725. 3095   5                                                      OSD_Slider(13, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  726. 3096   5                                                      break;
  727. 3097   5                                                      
  728. 3098   5                                              case PAGEH_ITEM_BLUEOFFSET :
  729. 3099   5                                                      OSD_Slider(15, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 2, 14);
  730. 3100   5                                                      break;
  731. 3101   5                                                      
  732. 3102   5                                      }
  733. 3103   4                              }
  734. 3104   3                      }
  735. 3105   2              }
  736. 3106   1      }
  737. 3107          
  738. 3108          void PageADC_Show(void)
  739. 3109          {
  740. 3110   1              Init_Page(0);
  741. 3111   1      
  742. 3112   1              RTDOSDW(PageADC_Atb);
  743. 3113   1              RTDOSDW(PageADC_ENG);
  744. 3114   1      
  745. 3115   1              // Highlight the select item
  746. 3116   1              //OSD_Window( 5, 0, 476, 0, 252, 4, 4, 0, 1, 231, 1, 113);              //Set Window 5
  747. 3117   1      
  748. 3118   1              if (0 == ucOSD_Item_Index1)
  749. 3119   1              {
  750. 3120   2                      RTDOSDW(OSD_Version);
  751. 3121   2              }
  752. 3122   1              else
  753. 3123   1              {
  754. 3124   2                      switch (ucOSD_Item_Index0)
  755. 3125   2                      {
  756. 3126   3                              case PAGEH_ITEM_REDGAIN :
  757. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 52  
  758. 3127   3                                      OSD_Slider(5, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 4, 14);
  759. 3128   3                                      break;
  760. 3129   3                                      
  761. 3130   3                              case PAGEH_ITEM_GREENGAIN :
  762. 3131   3                                      OSD_Slider(7, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 4, 14);
  763. 3132   3                                      break;
  764. 3133   3                                      
  765. 3134   3                              case PAGEH_ITEM_BLUEGAIN :
  766. 3135   3                                      OSD_Slider(9, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 4, 14);
  767. 3136   3                                      break;
  768. 3137   3                                      
  769. 3138   3                              case PAGEH_ITEM_REDOFFSET :
  770. 3139   3                                      OSD_Slider(11, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 4, 14);
  771. 3140   3                                      break;
  772. 3141   3                                      
  773. 3142   3                              case PAGEH_ITEM_GREENOFFSET :
  774. 3143   3                                      OSD_Slider(13, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 4, 14);
  775. 3144   3                                      break;
  776. 3145   3                                      
  777. 3146   3                              case PAGEH_ITEM_BLUEOFFSET :
  778. 3147   3                                      OSD_Slider(15, 36, 17, stGUD2.AD_B_OFFSET, 0xff, 4, 14);
  779. 3148   3                                      break;
  780. 3149   3                                      
  781. 3150   3                      }
  782. 3151   2              }
  783. 3152   1      }
  784. 3153          
  785. 3154          
  786. 3155          
  787. 3156          
  788. 3157          
  789. 3158          unsigned char Page1_Goto_Subpage(unsigned char Key)
  790. 3159          {
  791. 3160   1              if (PAGE1_ITEM_RGBADJ == ucOSD_Item_Index0 && ucOSD_Item_Index1)
  792. 3161   1              {
  793. 3162   2                      if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)
  794. 3163   2                      {
  795. 3164   3                              ucOSD_Item_Index1   = 0;
  796. 3165   3                              ucOSD_Item_Index2   = 0;
  797. 3166   3                      }
  798. 3167   2                      else
  799. 3168   2                      {
  800. 3169   3                              // When RGB adjust sub-page is open, just re-direct the message to the sub-page process
  801. 3170   3                              OSD_Proc_B(Key);
  802. 3171   3                      }
  803. 3172   2      
  804. 3173   2                      if (ucOSD_Item_Index1)  
  805. 3174   2                              return  0;      // RGB adjust sub-Page still in work
  806. 3175   2      
  807. 3176   2                      ucOSD_Item_Index2   = 0;
  808. 3177   2      
  809. 3178   2                      //Key  = NOTIFY_SHOW;  // Redraw itself when returned from sub-page
  810. 3179   2                      return 1;
  811. 3180   2                      
  812. 3181   2              }
  813. 3182   1      
  814. 3183   1              return 2;
  815. 3184   1              
  816. 3185   1      }
  817. 3186          
  818. 3187          
  819. 3188          unsigned char Page4_Goto_Subpage(unsigned char Key)
  820. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 53  
  821. 3189          {
  822. 3190   1              if (PAGE4_ITEM_LANGUAGE == ucOSD_Item_Index0 && 0 != ucOSD_Item_Index1)
  823. 3191   1              {
  824. 3192   2                      if (NOTIFY_SHOW != Key)
  825. 3193   2                      {
  826. 3194   3                              // When language setting sub-page is open, just re-direct the message to the sub-page process
  827. 3195   3                              OSD_Proc_B(Key);
  828. 3196   3      
  829. 3197   3                              if (ucOSD_Item_Index1)  
  830. 3198   3                                      return 0;     // Language Setting Sub-Page still in work
  831. 3199   3      
  832. 3200   3                              //action  = NOTIFY_SHOW;              // Redraw itself when returned from sub-page
  833. 3201   3                              return 1;
  834. 3202   3                      }
  835. 3203   2                      else
  836. 3204   2                      {
  837. 3205   3                              // Quit language sub-page if signal changed.
  838. 3206   3                              ucOSD_Item_Index1   = 0;
  839. 3207   3                      }
  840. 3208   2              }
  841. 3209   1      
  842. 3210   1              return 2;
  843. 3211   1              
  844. 3212   1      }
  845. 3213          
  846. 3214          unsigned char Page5_Goto_Subpage(unsigned char Key)
  847. 3215          {
  848. 3216   1              if (PAGE5_ITEM_SOURCE == ucOSD_Item_Index0 && 0 != ucOSD_Item_Index1)
  849. 3217   1              {
  850. 3218   2                      if (NOTIFY_SHOW != Key)
  851. 3219   2                      {
  852. 3220   3                              // When source select sub-page is open, just re-direct the message to the sub-page process
  853. 3221   3                              OSD_Proc_B(Key);
  854. 3222   3      
  855. 3223   3                              if (ucOSD_Item_Index1)  return 0;     // Source select sub-Page still in work
  856. 3224   3      
  857. 3225   3                              //action  = NOTIFY_SHOW;              // Redraw itself when returned from sub-page
  858. 3226   3                              return 1;
  859. 3227   3                      }
  860. 3228   2                      else
  861. 3229   2                      {
  862. 3230   3                              // Quit source select sub-page if signal changed.
  863. 3231   3                              ucOSD_Item_Index1   = 0;
  864. 3232   3                      }
  865. 3233   2              }
  866. 3234   1      
  867. 3235   1              return 2;
  868. 3236   1      
  869. 3237   1      }
  870. 3238          
  871. 3239          #if(VIDEO_CHIP != VDC_NONE)
  872.               
  873.               void PageVDC_Enter_Key(void)
  874.               {
  875.                          if (0 == ucOSD_Item_Index0)
  876.                       {
  877.                           // Select and highlight the first item
  878.                           ucOSD_Item_Index0   = PAGEV_ITEM_CONTRAST;
  879.                           ucOSD_Item_Index1   = 0;
  880.                           //OSD_Window(1, (2 + ucOSD_Item_Index0), (2 + ucOSD_Item_Index0), 7, 23, 7, COLOR_CYAN);
  881.                           OSD_Window( 5, 10, 136, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  882.                       }
  883. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 54  
  884.                       else
  885.                       {
  886.                           if (PAGEV_ITEM_EXIT == ucOSD_Item_Index0)
  887.                           {                
  888.                               ucOSD_Page_Index    = 0;        // Close OSD
  889.                           }
  890.                           else
  891.                           {
  892.                               if (ucOSD_Item_Index1)
  893.                               {
  894.                                   ucOSD_Item_Index1   = 0;    // Leave the item, Show Mode
  895.                                   
  896.                                   RTDOSDW(OSD_Version);
  897.               
  898.                               }
  899.                               else    // if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
  900.                               {
  901.                                   ucOSD_Item_Index1   = 1;    // Enter the item, Show slider
  902.               
  903.                                   switch (ucOSD_Item_Index0)
  904.                                   {
  905.                                   case PAGEV_ITEM_CONTRAST :
  906.                                       //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST, 0xff, 0x61);
  907.                                       OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST, 0xff, 2, 14);
  908.                                       break;
  909.                                   case PAGEV_ITEM_BRIGHT :
  910.                                       //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT, 0xff, 0x61);
  911.                                       OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT, 0xff, 2, 14);
  912.                                       break;
  913.                                   case PAGEV_ITEM_HUE :
  914.                                       //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE, 0xff, 0x61);
  915.                                       OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE, 0xff, 2, 14);
  916.                                       break;
  917.                                   case PAGEV_ITEM_SATURATION :
  918.                                       //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION, 0xff, 0x61
  919.              -);
  920.                                       OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION, 0xff, 2, 14
  921.              -);
  922.                                       break;
  923.                                   }
  924.                               }
  925.                           }
  926.                       }
  927.               }
  928.               
  929.               void PageVDC_Left_Right_Key(unsigned char Key)
  930.               {
  931.                  if (ucOSD_Item_Index1)
  932.                       {
  933.                           switch (ucOSD_Item_Index0)
  934.                           {            
  935.                           case PAGEV_ITEM_CONTRAST :
  936.                               if (NOTIFY_RIGHT_KEY == Key)
  937.                               {
  938.                                   if (0xff == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST)   return;
  939.               
  940.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST    += 1;
  941.                               }
  942.                               else
  943.                               {
  944.                                   if (0x00 == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST)   return;
  945.               
  946. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 55  
  947.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST    -= 1;
  948.                               }
  949.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST, 0xff, 0x61);
  950.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST, 0xff, 2, 14);
  951.                               break;
  952.                           case PAGEV_ITEM_BRIGHT :
  953.                               if (NOTIFY_RIGHT_KEY == Key)
  954.                               {
  955.                                   if (0xff == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT)     return;
  956.               
  957.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT  += 1;
  958.                               }
  959.                               else
  960.                               {
  961.                                   if (0x00 == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT)     return;
  962.               
  963.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT  -= 1;
  964.                               }
  965.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT, 0xff, 0x61);
  966.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT, 0xff, 2, 14);
  967.                               break;
  968.                           case PAGEV_ITEM_HUE :
  969.                               if (NOTIFY_RIGHT_KEY == Key)
  970.                               {
  971.                                   if (0xff == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE)        return;
  972.               
  973.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE += 1;
  974.                               }
  975.                               else
  976.                               {
  977.                                   if (0x00 == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE)        return;
  978.               
  979.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE -= 1;
  980.                               }
  981.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE, 0xff, 0x61);
  982.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE, 0xff, 2, 14);
  983.                               break;
  984.                           case PAGEV_ITEM_SATURATION :
  985.                               if (NOTIFY_RIGHT_KEY == Key)
  986.                               {
  987.                                   if (0xff == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION)     return;
  988.               
  989.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION  += 1;
  990.                               }
  991.                               else
  992.                               {
  993.                                   if (0x00 == ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION)     return;
  994.               
  995.                                   ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION  -= 1;
  996.                               }
  997.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION, 0xff, 0x61);
  998.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION, 0xff, 2, 14);
  999.                               break;
  1000.                           }
  1001.                           SetVDC_Color();
  1002.                           Save_MUD(ucMode_Curr);
  1003.                       }
  1004.                       else
  1005.                       {
  1006.                           if (ucOSD_Item_Index0)
  1007.                           {
  1008.                               // Select and highlight the next/previous item
  1009. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 56  
  1010.                               if (NOTIFY_RIGHT_KEY == Key)
  1011.                                   ucOSD_Item_Index0   = (PAGEV_ITEM_NUM == ucOSD_Item_Index0) ? 1 : (ucOSD_Item_Index0 +
  1012.              - 1);
  1013.                               else
  1014.                                   ucOSD_Item_Index0   = (1 == ucOSD_Item_Index0) ? PAGEV_ITEM_NUM : (ucOSD_Item_Index0 -
  1015.              - 1);
  1016.               
  1017.                               //OSD_Window(1, (2 + ucOSD_Item_Index0), (2 + ucOSD_Item_Index0), 7, 23, 7, COLOR_CYAN);
  1018.                                 Osd_Change_Item(Key,PAGEV_ITEM_NUM);
  1019.                           }
  1020.                       }
  1021.               }
  1022.               
  1023.               void PageVDC_Show(void)
  1024.               {
  1025.                         Init_Page(0);
  1026.               
  1027.                       RTDOSDW(PageVDC_Atb);
  1028.                       RTDOSDW(PageVDC_ENG);
  1029.               
  1030.                       // Highlight the select item
  1031.                       //OSD_Window(1, (2 + ucOSD_Item_Index0), (2 + ucOSD_Item_Index0), 7, 23, (ucOSD_Item_Index0 ? 7 : 
  1032.              -3), COLOR_CYAN);
  1033.                       OSD_Window( 5, 10, 136, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1034.               
  1035.                       if (0 == ucOSD_Item_Index1)
  1036.                       {
  1037.                           RTDOSDW(OSD_Version);
  1038.               
  1039.                       }
  1040.                       else
  1041.                       {
  1042.                           switch (ucOSD_Item_Index0)
  1043.                           {
  1044.                           case PAGEV_ITEM_CONTRAST :
  1045.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST, 0xff, 0x61);
  1046.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VCONTRAST, 0xff, 2, 14);
  1047.                               break;
  1048.                           case PAGEV_ITEM_BRIGHT :
  1049.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT, 0xff, 0x61);
  1050.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VBRIGHT, 0xff, 2, 14);
  1051.                               break;
  1052.                           case PAGEV_ITEM_HUE :
  1053.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE, 0xff, 0x61);
  1054.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VHUE, 0xff, 2, 14);
  1055.                               break;
  1056.                           case PAGEV_ITEM_SATURATION :
  1057.                               //OSD_Slider(11, 2, 20, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION, 0xff, 0x61);
  1058.                               OSD_Slider(11, 36, 17, ((LP_VIDEO_MODE_USER_DATA)&stMUD)->VSATURATION, 0xff, 2, 14);
  1059.                               break;
  1060.                           }
  1061.                       }
  1062.               }
  1063.               #endif
  1064. 3424          
  1065. 3425          unsigned char Sub_Page_Process(unsigned char Key)
  1066. 3426          {
  1067. 3427   1              unsigned char ucTemp = 2;
  1068. 3428   1              
  1069. 3429   1              switch(ucOSD_Page_Index)
  1070. 3430   1              {
  1071. 3431   2                      case 1:
  1072. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 57  
  1073. 3432   2                              ucTemp = Page1_Goto_Subpage(Key); 
  1074. 3433   2                              break;
  1075. 3434   2                              
  1076. 3435   2      //              case 4:
  1077. 3436   2                      case 3:     
  1078. 3437   2                              ucTemp = Page4_Goto_Subpage(Key);
  1079. 3438   2                              break;
  1080. 3439   2      
  1081. 3440   2      //              case 5:                         
  1082. 3441   2                      case 4:
  1083. 3442   2                              ucTemp = Page5_Goto_Subpage(Key);
  1084. 3443   2                              break;
  1085. 3444   2                              
  1086. 3445   2                      default:
  1087. 3446   2                              break;
  1088. 3447   2              }
  1089. 3448   1      
  1090. 3449   1              return ucTemp;
  1091. 3450   1              
  1092. 3451   1      }
  1093. 3452          
  1094. 3453          ///////////////////////////////////////////////////////////////////////////////////////////
  1095. 3454          //anson
  1096. 3455          ///////////////////////////////////////////////////////////////////////////////////////////
  1097. 3456          void FACTORY_Key_Process(void)    //anson
  1098. 3457          {
  1099. 3458   1              switch(ucOSD_Page_Index)
  1100. 3459   1              {
  1101. 3460   2                      case 0:
  1102. 3461   2                              FACTORY_Key_Key();
  1103. 3462   2                              break;
  1104. 3463   2              }
  1105. 3464   1      }
  1106. 3465          
  1107. 3466          ///////////////////////////////////////////////////////////////////////////////////////////
  1108. 3467          ///////////////////////////////////////////////////////////////////////////////////////////
  1109. 3468          void Enter_Key_Process(void)
  1110. 3469          {
  1111. 3470   1              switch(ucOSD_Page_Index)
  1112. 3471   1              {
  1113. 3472   2                      case 0:
  1114. 3473   2                              Page0_Enter_Key();
  1115. 3474   2                              break;
  1116. 3475   2                              
  1117. 3476   2                      case 1:
  1118. 3477   2                              Page1_Enter_Key();
  1119. 3478   2                              break;
  1120. 3479   2                              
  1121. 3480   2                      case 2:
  1122. 3481   2                              Page2_Enter_Key();
  1123. 3482   2                              break;
  1124. 3483   2      /*                      
  1125. 3484   2                      case 3:
  1126. 3485   2                              if(Page3_Enter_Key())  
  1127. 3486   2                                      break;
  1128. 3487   2                              else
  1129. 3488   2                                      return;
  1130. 3489   2                              break;
  1131. 3490   2      */                      
  1132. 3491   2                      case 3:
  1133. 3492   2                              Page4_Enter_Key();
  1134. 3493   2                              break;
  1135. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 58  
  1136. 3494   2                              
  1137. 3495   2                      case 4:
  1138. 3496   2                              Page5_Enter_Key();
  1139. 3497   2                              break;
  1140. 3498   2                              
  1141. 3499   2                      case 5:
  1142. 3500   2                              // Just set ucOSD_Page_Index to 0 and wait for main program to clear screen
  1143. 3501   2                              ucOSD_Page_Index    = 0;
  1144. 3502   2                              break;
  1145. 3503   2                              
  1146. 3504   2                      case 8:
  1147. 3505   2                              if((stGUD1.INPUT_SOURCE & 0x07) == SOURCE_VGA)
  1148. 3506   2                                      PageADC_Enter_Key();
  1149. 3507   2      
  1150. 3508   2      #if(VIDEO_CHIP != VDC_NONE)
  1151.                                       else
  1152.                                               PageVDC_Enter_Key();
  1153.               #endif
  1154. 3512   2                              break;
  1155. 3513   2                              
  1156. 3514   2                      case PAGE_Factory:
  1157. 3515   2                              PageFactory_Enter_Key();
  1158. 3516   2                              break;
  1159. 3517   2                              
  1160. 3518   2              }
  1161. 3519   1      }
  1162. 3520          
  1163. 3521          void Enter_Key_B_Process(void)
  1164. 3522          {
  1165. 3523   1              switch(ucOSD_Page_Index)
  1166. 3524   1              {
  1167. 3525   2                      case 1:
  1168. 3526   2                              Page1B_Enter_Key();
  1169. 3527   2                              break;
  1170. 3528   2                              
  1171. 3529   2      //              case 4:
  1172. 3530   2                      case 3:     
  1173. 3531   2                              Page4B_Enter_Key();
  1174. 3532   2                              break;
  1175. 3533   2      
  1176. 3534   2                              
  1177. 3535   2      //              case 5:    
  1178. 3536   2              case 4:
  1179. 3537   2                              Page5B_Enter_Key();
  1180. 3538   2                              break;
  1181. 3539   2                              
  1182. 3540   2              }
  1183. 3541   1      }
  1184. 3542          void Left_Right_Key_Process(unsigned char Key)
  1185. 3543          {
  1186. 3544   1              switch(ucOSD_Page_Index)
  1187. 3545   1              {
  1188. 3546   2                      case 0:
  1189. 3547   2                              Page0_Left_Right_Key(Key);
  1190. 3548   2                              break;
  1191. 3549   2                              
  1192. 3550   2                      case 1:        
  1193. 3551   2                              Page1_Left_Right_Key(Key);
  1194. 3552   2                              break;
  1195. 3553   2                              
  1196. 3554   2                      case 2:        
  1197. 3555   2                              Page2_Left_Right_Key(Key);
  1198. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 59  
  1199. 3556   2                              break;
  1200. 3557   2      /*                      
  1201. 3558   2                      case 3:        
  1202. 3559   2                              Page3_Left_Right_Key(Key);
  1203. 3560   2                              break;
  1204. 3561   2      */                      
  1205. 3562   2                      case 3:        
  1206. 3563   2                              Page4_Left_Right_Key(Key);
  1207. 3564   2                              break;
  1208. 3565   2                              
  1209. 3566   2                      case 4:        
  1210. 3567   2                              Page5_Left_Right_Key(Key);
  1211. 3568   2                              break;
  1212. 3569   2                              
  1213. 3570   2                      case 5:        
  1214. 3571   2                              Page6_Left_Right_Key(Key);
  1215. 3572   2                              break;
  1216. 3573   2                              
  1217. 3574   2                      case 8:
  1218. 3575   2                              if((stGUD1.INPUT_SOURCE & 0x07) == SOURCE_VGA)
  1219. 3576   2                                      PageADC_Left_Right_Key(Key);
  1220. 3577   2      
  1221. 3578   2      #if(VIDEO_CHIP != VDC_NONE)
  1222.                                       else
  1223.                                               PageVDC_Left_Right_Key(Key);
  1224.               #endif
  1225. 3582   2                              break;
  1226. 3583   2      
  1227. 3584   2                      case PAGE_Factory:
  1228. 3585   2                              PageFactory_Left_Right_Key(Key);
  1229. 3586   2                              break;
  1230. 3587   2      
  1231. 3588   2              }
  1232. 3589   1      }
  1233. 3590          
  1234. 3591          void Left_Right_Key_B_Process(unsigned char Key)
  1235. 3592          {
  1236. 3593   1              switch(ucOSD_Page_Index)
  1237. 3594   1              {
  1238. 3595   2                      case 1:      
  1239. 3596   2                              Page1B_Left_Right_Key(Key);
  1240. 3597   2                              break;
  1241. 3598   2                              
  1242. 3599   2      //              case 4:      
  1243. 3600   2                      case 3:     
  1244. 3601   2                              Page4B_Left_Right_Key(Key);
  1245. 3602   2                              break;
  1246. 3603   2      
  1247. 3604   2      
  1248. 3605   2      //              case 5:      
  1249. 3606   2                      case 4:     
  1250. 3607   2                              Page5B_Left_Right_Key(Key);
  1251. 3608   2                              break;
  1252. 3609   2                              
  1253. 3610   2              }
  1254. 3611   1      }
  1255. 3612          
  1256. 3613          void Show_Process(void)
  1257. 3614          {
  1258. 3615   1              switch(ucOSD_Page_Index)
  1259. 3616   1              {
  1260. 3617   2                      case 1:      
  1261. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 60  
  1262. 3618   2                              Page1_Show();
  1263. 3619   2                              break;
  1264. 3620   2                              
  1265. 3621   2                      case 2:      
  1266. 3622   2                              Page2_Show();
  1267. 3623   2                              break;
  1268. 3624   2      /*                      
  1269. 3625   2                      case 3:      
  1270. 3626   2                              Page3_Show();
  1271. 3627   2                              break;
  1272. 3628   2      */                      
  1273. 3629   2                      case 3:      
  1274. 3630   2                              Page4_Show();
  1275. 3631   2                              break;
  1276. 3632   2                              
  1277. 3633   2                      case 4:      
  1278. 3634   2                              Page5_Show();
  1279. 3635   2                              break;
  1280. 3636   2                              
  1281. 3637   2                      case 5:      
  1282. 3638   2                              Page6_Show();
  1283. 3639   2                              break;
  1284. 3640   2                              
  1285. 3641   2                      case 8:
  1286. 3642   2                              if((stGUD1.INPUT_SOURCE & 0x07) == SOURCE_VGA)
  1287. 3643   2                                      PageADC_Show();
  1288. 3644   2      
  1289. 3645   2      #if(VIDEO_CHIP != VDC_NONE)
  1290.                                       else
  1291.                                               PageVDC_Show();
  1292.               #endif
  1293. 3649   2                              break;
  1294. 3650   2      
  1295. 3651   2                      case PAGE_Factory:
  1296. 3652   2                              PageFactory_Show();
  1297. 3653   2                              break;
  1298. 3654   2      
  1299. 3655   2              }
  1300. 3656   1      }
  1301. 3657          
  1302. 3658          void Show_B_Process(void)
  1303. 3659          {
  1304. 3660   1              switch(ucOSD_Page_Index)
  1305. 3661   1              {
  1306. 3662   2                      case 1:
  1307. 3663   2                              Page1B_Show();
  1308. 3664   2                              break;
  1309. 3665   2                              
  1310. 3666   2      //              case 4:     
  1311. 3667   2                      case 3:     
  1312. 3668   2                              Page4B_Show();
  1313. 3669   2                              break;
  1314. 3670   2                              
  1315. 3671   2      
  1316. 3672   2      //              case 5:     
  1317. 3673   2                      case 4:     
  1318. 3674   2                              Page5B_Show();
  1319. 3675   2                              break;
  1320. 3676   2                              
  1321. 3677   2              }
  1322. 3678   1      }
  1323. 3679          
  1324. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 61  
  1325. 3680          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1326.              -////
  1327. 3681          // OSD Process Routine
  1328. 3682          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1329.              -////
  1330. 3683          
  1331. 3684          // In all OSD main page process, you CANNOT call other main page process directly.
  1332. 3685          // You CAN only change ucOSD_Page_Index to indicate other main page.
  1333. 3686          // Main program will detect the change of ucOSD_Page_Index and send NOTIFY_SHOW to the new page.
  1334. 3687          // The only constraint is YOU CANNOT change ucOSD_Page_Index when receive NOTIFY_SHOW.
  1335. 3688          // p.s. You can call sub-page process directly.
  1336. 3689          
  1337. 3690          // OSD_Proc0 handles messages when there is no OSD window on screen (ucOSD_Page_Index = 0)
  1338. 3691          void OSD_Proc(unsigned char action)
  1339. 3692          {
  1340. 3693   1      
  1341. 3694   1      #if (TV_CHIP != TV_NONE)
  1342.                      if(ucOSD_Page_Index == 0)
  1343.                          {
  1344.                                 //if (SOURCE_TV == (stGUD1.INPUT_SOURCE & 0x07) && OSD_Proc[1][stGUD1.INPUT_SOURCE & 0x07])
  1345.                                 if (SOURCE_TV == (stGUD1.INPUT_SOURCE & 0x07))
  1346.                                 {
  1347.                                         // Change to OSD Main Page 1 and Main Program will show it
  1348.                                         ucOSD_Page_Index    = 1;
  1349.                                         ucOSD_Item_Index0   = 0;
  1350.                                         ucOSD_Item_Index1   = 0;
  1351.                                         ucOSD_Item_Index2   = 0;
  1352.               
  1353.                               b_rgb_VOLUME_STATUS = 0;
  1354.               
  1355.                                         return;
  1356.                                 }
  1357.                         }
  1358.               #endif
  1359. 3712   1      
  1360. 3713   1              Data[0] = Sub_Page_Process(action);
  1361. 3714   1      
  1362. 3715   1              if(Data[0] == 1)
  1363. 3716   1                      action = NOTIFY_SHOW;   // Redraw itself when returned from sub-page
  1364. 3717   1              else if(Data[0] == 0)
  1365. 3718   1                      return; // Source select sub-Page still in work
  1366. 3719   1             
  1367. 3720   1              if((MODE_NOSIGNAL != ucMode_Curr)&&(MODE_NOSUPPORT != ucMode_Curr))     //anson
  1368. 3721   1              {
  1369. 3722   2                      switch(action)
  1370. 3723   2                      {
  1371. 3724   3                              case NOTIFY_AUTO_KEY :
  1372. 3725   3                                      
  1373. 3726   3      //                              if ((b_rgb_VOLUME_STATUS)|(ucOSD_Page_Index)) //eric test
  1374. 3727   3      //                              {
  1375. 3728   3      //                                      ucOSD_Page_Index    = 0;
  1376. 3729   3      //                                      ucOSD_Item_Index0   = 0;
  1377. 3730   3      //                                      ucOSD_Item_Index1   = 0;
  1378. 3731   3      //                                      ucOSD_Item_Index2   = 0;
  1379. 3732   3                                              
  1380. 3733   3      //                                      b_rgb_VOLUME_STATUS = 0;
  1381. 3734   3      //                                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  1382. 3735   3      //                              
  1383. 3736   3      //                              }
  1384. 3737   3      //                              else
  1385. 3738   3      //                              {
  1386. 3739   3                                      if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07) && MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != uc
  1387. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 62  
  1388.              -Mode_Curr)
  1389. 3740   3                                      {
  1390. 3741   4                                              RTDOSDW(OSD_Reset);
  1391. 3742   4                                              OSD_Position(OSD_ENABLE);
  1392. 3743   4                                              RTDOSDW(OSD_AUTO);
  1393. 3744   4                                              RTDOSDW(strTabAuto_Atb[stGUD1.FUNCTION & 0x07]);                //anson
  1394. *** WARNING C214 IN LINE 3744 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  1395. 3745   4                                              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  1396. 3746   4                                              if (MODE_0640x0350x70HZ <= ucMode_Curr && MODE_0720x0400x70HZ >= ucMode_Curr)
  1397. 3747   4                                              {
  1398. 3748   5                                                      stMUD.CLOCK = 128;
  1399. 3749   5                                                      Set_H_Position();
  1400. 3750   5                                                      Set_Clock();
  1401. 3751   5                                                      Save_MUD(ucMode_Curr);
  1402. 3752   5                                                      if (ERROR_INPUT == Auto_Phase())
  1403. 3753   5                                                              ucMode_Curr = MODE_OSDFORCE;
  1404. 3754   5                                                      if (ERROR_INPUT == Auto_Position())
  1405. 3755   5                                                              ucMode_Curr = MODE_OSDFORCE;
  1406. 3756   5                                              }
  1407. 3757   4                                              else
  1408. 3758   4                                              {
  1409. 3759   5                                                      if (ERROR_INPUT == Auto_Config())   ucMode_Curr = MODE_OSDFORCE;
  1410. 3760   5                                                      //if (ERROR_INPUT == Auto_Phase())   ucMode_Curr = MODE_OSDFORCE;
  1411. 3761   5                                              }
  1412. 3762   4                                              b_rgb_VOLUME_STATUS = 0;
  1413. 3763   4                                              ucOSD_Page_Index    = 0;
  1414. 3764   4                                              RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up
  1415. 3765   4                                              // Although you can add ending animation here, I don't think it is necessary.
  1416. 3766   4                                              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  1417. 3767   4                                              RTDOSDW(OSD_Reset);            // Clear OSD
  1418. 3768   4      //                              }
  1419. 3769   4                                      
  1420. 3770   4                                      }
  1421. 3771   3                                      break;
  1422. 3772   3      
  1423. 3773   3                              case NOTIFY_ENTER_KEY:
  1424. 3774   3                                              b_rgb_VOLUME_STATUS = 0;
  1425. 3775   3                                              Enter_Key_Process();
  1426. 3776   3                                      break;
  1427. 3777   3                              
  1428. 3778   3                              case NOTIFY_RIGHT_KEY:
  1429. 3779   3                              case NOTIFY_LEFT_KEY:
  1430. 3780   3                                              Left_Right_Key_Process(action);
  1431. 3781   3                                      break;
  1432. 3782   3                              
  1433. 3783   3                              case NOTIFY_EXIT_KEY :
  1434. 3784   3                                              rgb_EXIT_KEY();
  1435. 3785   3                                      break;
  1436. 3786   3      
  1437. 3787   3                              case NOTIFY_SHOW:
  1438. 3788   3                                              Show_Process();
  1439. 3789   3                                      break;
  1440. 3790   3                              
  1441. 3791   3                              case NOTIFY_LR_KEY:
  1442. 3792   3                                              if(ucOSD_Page_Index == 0)
  1443. 3793   3                                                      Page0_LR_Key();
  1444. 3794   3                                      break;
  1445. 3795   3                              
  1446. 3796   3                              case NOTIFY_FACTORY_KEY:             //anson 
  1447. 3797   3                                      if((stGUD3.TV_SETTING & 0x08) == 0x08 )//Factory Mode           
  1448. 3798   3                                      {
  1449. 3799   4                                              FACTORY_Key_Process();
  1450. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 63  
  1451. 3800   4                                      }
  1452. 3801   3                                      break;
  1453. 3802   3      
  1454. 3803   3                              default:
  1455. 3804   3                                      break;
  1456. 3805   3                              
  1457. 3806   3                      }
  1458. 3807   2              }
  1459. 3808   1      }
  1460. 3809          
  1461. 3810          void OSD_Proc_B(unsigned char action)
  1462. 3811          {
  1463. 3812   1              switch(action)
  1464. 3813   1              {
  1465. 3814   2                      case NOTIFY_ENTER_KEY:
  1466. 3815   2                              Enter_Key_B_Process();
  1467. 3816   2                              break;
  1468. 3817   2                              
  1469. 3818   2                      case NOTIFY_RIGHT_KEY:
  1470. 3819   2                      case NOTIFY_LEFT_KEY:
  1471. 3820   2                              Left_Right_Key_B_Process(action);
  1472. 3821   2                              break;
  1473. 3822   2                              
  1474. 3823   2              case NOTIFY_EXIT_KEY :
  1475. 3824   2                 rgb_EXIT_KEY();
  1476. 3825   2                      case NOTIFY_SHOW:
  1477. 3826   2                              Show_B_Process();
  1478. 3827   2                              break;
  1479. 3828   2                              
  1480. 3829   2                      default:
  1481. 3830   2                              break;
  1482. 3831   2                              
  1483. 3832   2              }
  1484. 3833   1      }
  1485. 3834          
  1486. 3835          
  1487. 3836          #if (TV_NONE != TV_CHIP)
  1488.               
  1489.               
  1490.               void TV_AutoScan(void)
  1491.               {
  1492.                   unsigned char   ucTemp0, ucTemp1, ucTemp2;
  1493.               
  1494.                   RTDOSDW(OSD_Reset); 
  1495.                   RTDCodeW(FreeV);                        // FreeRun V registers & Background & disable
  1496.                   RTDSetBit(VGIP_CTRL_04, 0xfe, 0x00);    // Input Run Disable
  1497.               
  1498.                   RTDSetBit(VDIS_SIGINV_21, 0x0f, 0x10| DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP);
  1499.               
  1500.                   I2CWrite(AV_DETECT);
  1501.                   I2CWrite(TV_SOURCE_SEL);
  1502.                   I2CWrite(TV_SCAN_GAIN);
  1503.               
  1504.                   RTDCodeW(OSD_Enable);
  1505.               
  1506.                   ucTemp0 = 0;
  1507.                   ucTemp1 = 0;
  1508.                   ucTemp2 = stGUD3.CURR_CHANNEL;
  1509.               
  1510.                   stGUD3.CURR_CHANNEL = 1;
  1511.               
  1512.                   while (1)
  1513. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 64  
  1514.                   {
  1515.                       Set_TV_Channel();
  1516.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1517.               
  1518.                       if (0 == (ucTemp0 & 0x07))
  1519.                       {
  1520.                           I2CRead(ADDR_EROM1, 0xd0 + (ucTemp0 >> 3), 0x01);
  1521.                           ucTemp1 = Data[0];
  1522.                       }
  1523.                       
  1524.                       Data[1] = 12;
  1525.                       do
  1526.                       {
  1527.                           Delay_Xms(50);
  1528.                           I2CRead(ADDR_VIDEO, 0x1f, 0x01);
  1529.                           if (Data[0] & 0x40)     break;
  1530.                       }
  1531.                       while (--Data[1]);
  1532.                       
  1533.                       if (Data[1])
  1534.                       {
  1535.                           ucTemp1 &= 0xff - (1 << (7 - (ucTemp0 & 0x07)));
  1536.                       }
  1537.                       else
  1538.                       {
  1539.                           ucTemp1 |= 1 << (7 - (ucTemp0 & 0x07));
  1540.                       }      
  1541.                       
  1542.                       Data[0] = 4;
  1543.                       Data[1] = ADDR_EROM1;
  1544.                       Data[2] = 0xd0 + (ucTemp0 >> 3);
  1545.                       Data[3] = ucTemp1;
  1546.                       I2CWrite(Data);
  1547.               
  1548.                       if (stGUD3.TV_SETTING & 0x01)
  1549.                       {
  1550.                           if (MAX_CATV_NUM == stGUD3.CURR_CHANNEL)    break;
  1551.                       }
  1552.                       else
  1553.                       {
  1554.                           if (MAX_AIR_NUM == stGUD3.CURR_CHANNEL)     break;
  1555.                       }
  1556.               
  1557.                       stGUD3.CURR_CHANNEL += 1;
  1558.                       ucTemp0             += 1;
  1559.                   }        
  1560.                   stGUD3.CURR_CHANNEL = ucTemp2;
  1561.                   Set_TV_Channel();
  1562.                   Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1563.               
  1564.                   Delay_Xms(SET_2404_DELAY);
  1565.               }
  1566.               
  1567.               void Show_TV_Info(unsigned channel, unsigned char option)
  1568.               {
  1569.                   RTDSetBit(OVL_CTRL_6D, 0xfd, 0x00);     // Set the OSD become two times of original width (dual pixel)
  1570.               
  1571.                   if (2 < option)     option  = 2;
  1572.               
  1573.                   RTDOSDW(OSD_CHANNEL);
  1574.                   Show_TV_Number(channel, 1, 5 - option, option);
  1575.                       
  1576. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 65  
  1577.                   if (stGUD3.TV_SETTING & 0x02)
  1578.                   {
  1579.                       RTDOSDW(OSD_MUTE);
  1580.                   }
  1581.                   else
  1582.                   {
  1583.                       RTDOSDW((stGUD3.TV_SETTING & 0x04) ? OSD_SAP : OSD_STEREO);
  1584.                   }
  1585.               }
  1586.               
  1587.               void Show_TV_Number(unsigned char num, unsigned char row, unsigned char col, unsigned char option)
  1588.               {
  1589.                   RTDSetBit(OVL_CTRL_6D, 0xfd, 0x00);     // Set the OSD become two times of original width (dual pixel)
  1590.               
  1591.                   Data[0]     = 5;
  1592.                   Data[1]     = Y_INC;
  1593.                   Data[2]     = OSD_ROW_90;
  1594.                   Data[3]     = 0x80 | row;
  1595.                   Data[4]     = col;
  1596.               
  1597.                   Data[6]     = N_INC;
  1598.                   Data[7]     = OSD_DATA_92;
  1599.               
  1600.                   if (1 < option)
  1601.                   {
  1602.                       Data[5]     = 6;
  1603.                       Data[11]    = 0;
  1604.               
  1605.                       Data[8]     = num / 100;
  1606.               
  1607.                       num         = num - (Data[8] * 100);
  1608.               
  1609.                       Data[9]     = num / 10;
  1610.                       Data[10]    = num - (Data[9] * 10) + _0_;        
  1611.                       Data[8]     = Data[8] + _0_;
  1612.                       Data[9]     = Data[9] + _0_;
  1613.                   }
  1614.                   else if (1 == option)
  1615.                   {
  1616.                       Data[5]     = 5;
  1617.                       Data[10]    = 0;
  1618.               
  1619.                       Data[8]     = num / 10;
  1620.                       Data[9]     = num - (Data[8] * 10) + _0_;
  1621.                       Data[8]     = Data[8] + _0_;
  1622.                   }
  1623.                   else
  1624.                   {
  1625.                       Data[5]     = 4;
  1626.                       Data[9]     = 0;
  1627.               
  1628.                       Data[8]     = num + _0_;
  1629.                   }
  1630.                   RTDWrite(Data);
  1631.               }
  1632.               
  1633.               void OSD_TV_Proc(unsigned char action)
  1634.               {
  1635.                   switch (ucOSD_Item_Index0)
  1636.                   {
  1637.                   case 1 :
  1638.                       // ucOSD_Item_Index0 will be 1 when we are in TV control menu
  1639. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 66  
  1640.                       OSD_TV_Menu(action);
  1641.               
  1642.                       if (ucOSD_Item_Index0)  return;
  1643.               
  1644.                       ucOSD_Item_Index1   = 0;
  1645.                       ucOSD_Item_Index2   = 0;
  1646.               
  1647.                       if (NOTIFY_ENTER_KEY == action || NOTIFY_IR_MENU == action || NOTIFY_NONE == action)    action  = 
  1648.              -NOTIFY_SHOW;
  1649.               
  1650.                       OSD_Clear(0, 15, 0, 30);
  1651.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1652.                       break;
  1653.                   case 2 :
  1654.                       // ucOSD_Item_Index0 will be 2 when volume level is shown on screen.
  1655.                       if (ucOSD_Item_Index2)      ucOSD_Item_Index2   -= 1;
  1656.               
  1657.                       if (0 == ucOSD_Item_Index2 || (NOTIFY_NONE != action && NOTIFY_IR_VOLINC != action && NOTIFY_IR_VO
  1658.              -LDEC != action))
  1659.                       {
  1660.                           ucOSD_Item_Index0   = 0;
  1661.                           ucOSD_Item_Index1   = 0;
  1662.                           ucOSD_Item_Index2   = 0;
  1663.               
  1664.                           OSD_Clear(0, 15, 0, 30);
  1665.                           Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1666.                       }
  1667.                       break;
  1668.                   case 3 :
  1669.                       // ucOSD_Item_Index0 will be 3 when channel number is not shown on screen.
  1670.                       ucOSD_Item_Index1   = 0;
  1671.                       ucOSD_Item_Index2   = 0;
  1672.                       break;
  1673.               
  1674.                   default :
  1675.                       // ucOSD_Item_Index0 is 0xff~0xfd and ucOSD_Item_Index1 is non-zero when user inputs channel numbe
  1676.              -r.
  1677.                       // We will issue NOTIFY_IR_ENTER automatically to end input when channel no. is identified or key 
  1678.              -is timeout.
  1679.                       // We will abort if any other key is pressed.
  1680.                       if (0xfd < ucOSD_Item_Index0)
  1681.                       {
  1682.                           if (0 == ucOSD_Item_Index2)
  1683.                               ucOSD_Item_Index0   = 0xfd;
  1684.                           else
  1685.                               ucOSD_Item_Index2   = ucOSD_Item_Index2 - 1;
  1686.               
  1687.                           if (NOTIFY_NONE != action && NOTIFY_SHOW != action && 
  1688.                               NOTIFY_IR_ENTER != action && (NOTIFY_IR_NUM0 > action || NOTIFY_IR_NUM9 < action))
  1689.                           {
  1690.                               ucOSD_Item_Index0   = 0;
  1691.                               ucOSD_Item_Index1   = 0;
  1692.                               ucOSD_Item_Index2   = 0;
  1693.                               Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1694.                           }
  1695.                       }
  1696.               
  1697.                       if (0xfd == ucOSD_Item_Index0)
  1698.                       {
  1699.                           ucOSD_Item_Index2   = 0;
  1700.                           action              = NOTIFY_IR_ENTER;
  1701.                       }
  1702. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 67  
  1703.                       break;
  1704.                   }
  1705.               
  1706.                   switch (action)
  1707.                   {
  1708.                   case NOTIFY_SHOW :
  1709.                       OSD_Clear(0, 15, 0, 30);
  1710.               
  1711.                       if (0xfd > ucOSD_Item_Index0)
  1712.                       {
  1713.                           if (3 != ucOSD_Item_Index0)
  1714.                           {
  1715.                               ucOSD_Item_Index0   = 0;
  1716.                               ucOSD_Item_Index1   = 0;
  1717.                               ucOSD_Item_Index2   = 0;
  1718.                               Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1719.                           }
  1720.                       }
  1721.                       else
  1722.                       {
  1723.                           Show_TV_Info(ucOSD_Item_Index1, 0xff - ucOSD_Item_Index0);
  1724.                       }
  1725.                       break;
  1726.               
  1727.                   case NOTIFY_ENTER_KEY :
  1728.                   case NOTIFY_IR_MENU :
  1729.                       ucOSD_Item_Index0   = 1;
  1730.                       ucOSD_Item_Index1   = 1;
  1731.                       ucOSD_Item_Index2   = 0;
  1732.                       OSD_TV_Menu(NOTIFY_SHOW);
  1733.                       break;
  1734.               
  1735.                   case NOTIFY_RIGHT_KEY :
  1736.                   case NOTIFY_IR_CHINC :
  1737.                       // Increase the channel
  1738.                       Next_Channel();
  1739.                       Save_GUD3();
  1740.               
  1741.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1742.                       ucOSD_Item_Index0   = 0;
  1743.                       ucOSD_Item_Index1   = 0;
  1744.                       ucOSD_Item_Index2   = 0;
  1745.                       break;
  1746.               
  1747.                   case NOTIFY_LEFT_KEY :
  1748.                   case NOTIFY_IR_CHDEC :
  1749.                       // Decrease the channel
  1750.                       Prev_Channel();
  1751.                       Save_GUD3();
  1752.               
  1753.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1754.                       ucOSD_Item_Index0   = 0;
  1755.                       ucOSD_Item_Index1   = 0;
  1756.                       ucOSD_Item_Index2   = 0;
  1757.                       break;
  1758.               
  1759.                   case NOTIFY_IR_JUMP :
  1760.                       Data[0]             = stGUD3.CURR_CHANNEL;
  1761.                       stGUD3.CURR_CHANNEL = stGUD3.PREV_CHANNEL;
  1762.                       stGUD3.PREV_CHANNEL = Data[0];
  1763.                       Set_TV_Channel();
  1764.                       Save_GUD3();
  1765. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 68  
  1766.               
  1767.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1768.                       ucOSD_Item_Index0   = 0;
  1769.                       ucOSD_Item_Index1   = 0;
  1770.                       ucOSD_Item_Index2   = 0;
  1771.                       break;
  1772.               
  1773.                   case NOTIFY_IR_VOLINC :
  1774.                   case NOTIFY_IR_VOLDEC :
  1775.                       // Disable mute when changing volume
  1776.                       stGUD3.TV_SETTING   = stGUD3.TV_SETTING & 0xfd;
  1777.               
  1778.                       if (NOTIFY_IR_VOLINC == action)
  1779.                           stGUD3.VOLUME   = 31 > stGUD3.VOLUME ? stGUD3.VOLUME + 1 : 31;
  1780.                       else
  1781.                           stGUD3.VOLUME   = 0 < stGUD3.VOLUME ? stGUD3.VOLUME - 1 : 0;
  1782.               
  1783.                       SetVolume();
  1784.                       Save_GUD3();
  1785.               
  1786.                       RTDOSDW(OSD_VOLUME);    
  1787.                       Show_TV_Number(stGUD3.VOLUME, 2, 4, 1);
  1788.               
  1789.                       ucOSD_Item_Index0   = 2;
  1790.                       ucOSD_Item_Index1   = 0;
  1791.                       ucOSD_Item_Index2   = 50;   // For time-out counter
  1792.                       break;
  1793.               
  1794.                   case NOTIFY_IR_MUTE :
  1795.                       stGUD3.TV_SETTING   = stGUD3.TV_SETTING ^ 0x02;
  1796.                       SetVolume();
  1797.                       Save_GUD3();
  1798.               
  1799.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1800.                       ucOSD_Item_Index0   = 0;
  1801.                       ucOSD_Item_Index1   = 0;
  1802.                       ucOSD_Item_Index2   = 0;
  1803.                       break;
  1804.               
  1805.                   case NOTIFY_IR_ENTER :
  1806.                       if (ucOSD_Item_Index1)
  1807.                       {
  1808.                           ucOSD_Item_Index0   = 0;
  1809.               
  1810.                           if (stGUD3.TV_SETTING & 0x01)
  1811.                           {
  1812.                               if (MAX_CATV_NUM >= ucOSD_Item_Index1)
  1813.                               {
  1814.                                   stGUD3.PREV_CHANNEL = stGUD3.CURR_CHANNEL;
  1815.                                   stGUD3.CURR_CHANNEL = ucOSD_Item_Index1;
  1816.               
  1817.                                   ucOSD_Item_Index0   = 1;    // Valid channel
  1818.                               }
  1819.                           }
  1820.                           else
  1821.                           {
  1822.                               if (MAX_AIR_NUM >= ucOSD_Item_Index1)
  1823.                               {
  1824.                                   stGUD3.PREV_CHANNEL = stGUD3.CURR_CHANNEL;
  1825.                                   stGUD3.CURR_CHANNEL = ucOSD_Item_Index1;
  1826.               
  1827.                                   ucOSD_Item_Index0   = 1;    // Valid channel
  1828. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 69  
  1829.                               }
  1830.                           }
  1831.               
  1832.                           if (ucOSD_Item_Index0)
  1833.                           {
  1834.                               Set_TV_Channel();
  1835.               
  1836.                               if (stGUD3.PREV_CHANNEL != stGUD3.CURR_CHANNEL)
  1837.                               {
  1838.                                   // Disable mute when changing channel
  1839.                                   stGUD3.TV_SETTING   = stGUD3.TV_SETTING & 0xfd;
  1840.                                   SetVolume();
  1841.                               }
  1842.               
  1843.                               Save_GUD3();
  1844.                           }
  1845.                       }
  1846.                       ucOSD_Item_Index0   = 0;
  1847.                       ucOSD_Item_Index1   = 0;
  1848.                       ucOSD_Item_Index2   = 0;
  1849.                       Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1850.                       break;
  1851.               
  1852.                   case NOTIFY_IR_DISP :
  1853.                       ucOSD_Item_Index1   = 0;
  1854.                       ucOSD_Item_Index2   = 0;
  1855.                       OSD_Clear(0, 15, 0, 30);
  1856.               
  1857.                       if (ucOSD_Item_Index0)
  1858.                       {
  1859.                           ucOSD_Item_Index0   = 0;
  1860.                           Show_TV_Info(stGUD3.CURR_CHANNEL, 2);
  1861.                       }
  1862.                       else
  1863.                       {
  1864.                           ucOSD_Item_Index0   = 3;
  1865.                       }
  1866.                       break;
  1867.               
  1868.                   default :
  1869.                       // We handle IR messages
  1870.                       if (NOTIFY_IR_NUM0 <= action && NOTIFY_IR_NUM9 >= action)
  1871.                       {
  1872.                           if (0xfd > ucOSD_Item_Index0)
  1873.                           {
  1874.                               ucOSD_Item_Index0   = 0xff;
  1875.                               ucOSD_Item_Index1   = action - NOTIFY_IR_NUM0;
  1876.                           }
  1877.                           else
  1878.                           {
  1879.                               ucOSD_Item_Index0   = ucOSD_Item_Index0 - 1;
  1880.                               ucOSD_Item_Index1   = (ucOSD_Item_Index1 * 10) + (action - NOTIFY_IR_NUM0);
  1881.                           }
  1882.               
  1883.                           ucOSD_Item_Index2   = 80;   // For time-out counter
  1884.               
  1885.                           if (6 < ucOSD_Item_Index1)
  1886.                           {
  1887.               #if (TV_SYSTEM == TV_NTSC)
  1888.                               if (0 == (stGUD3.TV_SETTING & 0x01) || 12 < ucOSD_Item_Index1)
  1889.               #endif
  1890.                               {
  1891. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 70  
  1892.                                   ucOSD_Item_Index0   = 0xfd;
  1893.                               }
  1894.                           }
  1895.               
  1896.                           Show_TV_Info(ucOSD_Item_Index1, 0xff - ucOSD_Item_Index0);
  1897.                       }
  1898.                       break;
  1899.                   }
  1900.               }
  1901.               
  1902.               
  1903.               
  1904.               void Highlight_Item(unsigned char index1, unsigned char index2)
  1905.               {
  1906.                   switch (index1)
  1907.                   {
  1908.                   case PAGE_TV_ITEM_SYSTEM :
  1909.                       if (index2)
  1910.                           OSD_Window(1, 0, 0, 0x13, 0x18, 7, COLOR_CYAN);
  1911.                       else
  1912.                           OSD_Window(1, 0, 0, 0x0a, 0x0e, 7, COLOR_CYAN);
  1913.                       break;
  1914.                   case PAGE_TV_ITEM_CONTRAST :
  1915.                       OSD_Window(1, 2, 2, 0x0a, 0x0e, 7, COLOR_CYAN);
  1916.                       break;
  1917.                   case PAGE_TV_ITEM_BRIGHT :
  1918.                       OSD_Window(1, 4, 4, 0x0a, 0x0e, 7, COLOR_CYAN);
  1919.                       break;
  1920.                   case PAGE_TV_ITEM_SOUND :
  1921.                       if (index2)
  1922.                           OSD_Window(1, 6, 6, 0x13, 0x17, 7, COLOR_CYAN);
  1923.                       else
  1924.                           OSD_Window(1, 6, 6, 0x0a, 0x11, 7, COLOR_CYAN);
  1925.                       break;
  1926.                   case PAGE_TV_ITEM_CHANNEL :
  1927.                       OSD_Window(1, 8, 8, 0x0a, 0x0e, 7, COLOR_CYAN);
  1928.                       break;
  1929.                   case PAGE_TV_ITEM_VOLUME :
  1930.                       OSD_Window(1, 10, 10, 0x0a, 0x0d, 7, COLOR_CYAN);
  1931.                       break;
  1932.                   case PAGE_TV_ITEM_AUTOSCAN :
  1933.                       if (index2)
  1934.                           OSD_Window(1, 12, 12, 0x13, 0x17, 7, COLOR_CYAN);
  1935.                       else
  1936.                           OSD_Window(1, 12, 12, 0x0a, 0x0d, 7, COLOR_CYAN);
  1937.                       break;
  1938.                   case PAGE_TV_ITEM_EXIT :
  1939.                       OSD_Window(1, 14, 14, 0x00, 0x03, 7, COLOR_CYAN);
  1940.                       break;
  1941.                   }        
  1942.               }
  1943.               
  1944.               void OSD_TV_Menu(unsigned char action)
  1945.               {
  1946.                   switch (action)
  1947.                   {
  1948.                   case NOTIFY_ENTER_KEY :
  1949.                       switch (ucOSD_Item_Index1)
  1950.                       {
  1951.                       case PAGE_TV_ITEM_SYSTEM :
  1952.                           ucOSD_Item_Index1   = PAGE_TV_ITEM_CONTRAST;
  1953.                           break;
  1954. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 71  
  1955.                       case PAGE_TV_ITEM_CONTRAST :
  1956.                           ucOSD_Item_Index1   = PAGE_TV_ITEM_BRIGHT;
  1957.                           break;
  1958.                       case PAGE_TV_ITEM_BRIGHT :
  1959.                           ucOSD_Item_Index1   = PAGE_TV_ITEM_SOUND;
  1960.                           ucOSD_Item_Index2   = (stGUD3.TV_SETTING & 0x04) ? 1 : 0;
  1961.                           break;
  1962.                       case PAGE_TV_ITEM_SOUND :
  1963.                           ucOSD_Item_Index1   = PAGE_TV_ITEM_CHANNEL;
  1964.                           break;
  1965.                       case PAGE_TV_ITEM_CHANNEL :
  1966.                           ucOSD_Item_Index1   = PAGE_TV_ITEM_VOLUME;   
  1967.                           break;
  1968.                       case PAGE_TV_ITEM_VOLUME :
  1969.                           ucOSD_Item_Index1   = PAGE_TV_ITEM_AUTOSCAN;
  1970.                           ucOSD_Item_Index2   = 0;
  1971.                           break;
  1972.                       case PAGE_TV_ITEM_AUTOSCAN :
  1973.                           if (ucOSD_Item_Index2)
  1974.                           {
  1975.                               TV_AutoScan();
  1976.                               
  1977.                               ucMode_Curr = MODE_OSDFORCE;
  1978.               
  1979.                               return;                 // Return, not break
  1980.                           }
  1981.                           else
  1982.                           {
  1983.                               ucOSD_Item_Index1   = PAGE_TV_ITEM_EXIT;
  1984.                           }
  1985.                           break;
  1986.                       case PAGE_TV_ITEM_EXIT:
  1987.                           ucOSD_Item_Index0   = 0;
  1988.                           ucOSD_Item_Index1   = 0;
  1989.                           ucOSD_Item_Index2   = 0;
  1990.                           RTDOSDW(OSD_Reset);
  1991.                           RTDCodeW(OSD_Enable);
  1992.                           return;                     // Return, not break
  1993.                       }
  1994.                       // Hightlight next item if not returned
  1995.                       Highlight_Item(ucOSD_Item_Index1, ucOSD_Item_Index2);
  1996.                       break;
  1997.               
  1998.                   case NOTIFY_RIGHT_KEY :     // Right-key to Increase; Left-key to Decrease
  1999.                   case NOTIFY_LEFT_KEY :
  2000.                       switch (ucOSD_Item_Index1)
  2001.                       {
  2002.                       case PAGE_TV_ITEM_SYSTEM :
  2003.                           ucOSD_Item_Index2   = ucOSD_Item_Index2 ? 0 : 1;
  2004.                           stGUD3.TV_SETTING   = ucOSD_Item_Index2 ? (stGUD3.TV_SETTING | 0x01) : (stGUD3.TV_SETTING & 0x
  2005.              -fe);
  2006.                           Set_TV_Channel();
  2007.                           Save_GUD3();
  2008.                           break;
  2009.                       case PAGE_TV_ITEM_CONTRAST :
  2010.                           if (NOTIFY_RIGHT_KEY == action)
  2011.                           {
  2012.                               if (KEY_TURBO_ENABLE > ucKey_Issued)
  2013.                                   stGUD0.CONTRAST   = 100 > stGUD0.CONTRAST ? stGUD0.CONTRAST + 1 : 100;
  2014.                               else
  2015.                                   stGUD0.CONTRAST   = 99 > stGUD0.CONTRAST ? stGUD0.CONTRAST + 2 : 100;
  2016.                           }
  2017. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 72  
  2018.                           else
  2019.                           {
  2020.                               if (KEY_TURBO_ENABLE > ucKey_Issued)
  2021.                                   stGUD0.CONTRAST   = 0 < stGUD0.CONTRAST ? stGUD0.CONTRAST - 1 : 0;
  2022.                               else
  2023.                                   stGUD0.CONTRAST   = 1 < stGUD0.CONTRAST ? stGUD0.CONTRAST - 2 : 0;
  2024.                           }
  2025.                           Show_TV_Number(stGUD0.CONTRAST, 0x02, 0x0b, 0x02);
  2026.                           Set_Bright_Contrast();
  2027.                           Save_GUD0();
  2028.                           break;
  2029.                       case PAGE_TV_ITEM_BRIGHT :
  2030.                           if (NOTIFY_RIGHT_KEY == action)
  2031.                           {
  2032.                               if (KEY_TURBO_ENABLE > ucKey_Issued)
  2033.                                   stGUD0.BRIGHT   = 100 > stGUD0.BRIGHT ? stGUD0.BRIGHT + 1 : 100;
  2034.                               else
  2035.                                   stGUD0.BRIGHT   = 99 > stGUD0.BRIGHT ? stGUD0.BRIGHT + 2 : 100;
  2036.                           }
  2037.                           else
  2038.                           {
  2039.                               if (KEY_TURBO_ENABLE > ucKey_Issued)
  2040.                                   stGUD0.BRIGHT   = 0 < stGUD0.BRIGHT ? stGUD0.BRIGHT - 1 : 0;
  2041.                               else
  2042.                                   stGUD0.BRIGHT   = 1 < stGUD0.BRIGHT ? stGUD0.BRIGHT - 2 : 0;
  2043.                           }
  2044.                           Show_TV_Number(stGUD0.BRIGHT, 0x04, 0x0b, 0x02);
  2045.                           Set_Bright_Contrast();
  2046.                           Save_GUD0();
  2047.                           break;
  2048.                       case PAGE_TV_ITEM_SOUND :
  2049.                           ucOSD_Item_Index2   = ucOSD_Item_Index2 ? 0 : 1;
  2050.                           stGUD3.TV_SETTING   = ucOSD_Item_Index2 ? (stGUD3.TV_SETTING | 0x04) : (stGUD3.TV_SETTING & 0x
  2051.              -fb);
  2052.                           // Disable mute when changing TV sound mode
  2053.                           stGUD3.TV_SETTING   = stGUD3.TV_SETTING & 0xfd;
  2054.                           SetVolume();
  2055.                           Save_GUD3();
  2056.                           break;
  2057.                       case PAGE_TV_ITEM_CHANNEL :
  2058.                           if (NOTIFY_RIGHT_KEY == action)
  2059.                               Next_Channel();
  2060.                           else
  2061.                               Prev_Channel();
  2062.                           Show_TV_Number(stGUD3.CURR_CHANNEL, 0x08, 0x0b, 0x02);
  2063.                           Save_GUD3();
  2064.                           break;
  2065.               
  2066.                       case PAGE_TV_ITEM_VOLUME :
  2067.                           if (NOTIFY_RIGHT_KEY == action)
  2068.                               stGUD3.VOLUME   = (31 == stGUD3.VOLUME) ? 31 : stGUD3.VOLUME + 1;
  2069.                           else
  2070.                               stGUD3.VOLUME   = (0 == stGUD3.VOLUME) ? 0 : stGUD3.VOLUME - 1;
  2071.                           Show_TV_Number(stGUD3.VOLUME, 0x0a, 0x0b, 0x01);
  2072.                           SetVolume();
  2073.                           Save_GUD3();
  2074.                           break;
  2075.                       case PAGE_TV_ITEM_AUTOSCAN :
  2076.                           ucOSD_Item_Index2   = ucOSD_Item_Index2 ? 0 : 1;
  2077.                           break;
  2078.                       }       
  2079.                       Highlight_Item(ucOSD_Item_Index1, ucOSD_Item_Index2);
  2080. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 73  
  2081.                       break;
  2082.               
  2083.                   case NOTIFY_SHOW :
  2084.                       OSD_Clear(0, 15, 0, 30);
  2085.                       RTDSetBit(OVL_CTRL_6D, 0xfd, 0x00);     // Set the OSD become two times of original width (dual pi
  2086.              -xel)
  2087.               
  2088.                       RTDOSDW(OSD_PageTV);    
  2089.                       
  2090.                       switch (ucOSD_Item_Index1)
  2091.                       {
  2092.                       case PAGE_TV_ITEM_SYSTEM :
  2093.                           ucOSD_Item_Index2   = (stGUD3.TV_SETTING & 0x01) ? 1 : 0;
  2094.                           break;
  2095.                       case PAGE_TV_ITEM_SOUND :
  2096.                           ucOSD_Item_Index2   = (stGUD3.TV_SETTING & 0x04) ? 1 : 0;
  2097.                           break;
  2098.                       }        
  2099.                       Highlight_Item(ucOSD_Item_Index1, ucOSD_Item_Index2);
  2100.               
  2101.                       Show_TV_Number(stGUD0.CONTRAST, 0x02, 0x0b, 0x02);
  2102.                       Show_TV_Number(stGUD0.BRIGHT, 0x04, 0x0b, 0x02);
  2103.                       Show_TV_Number(stGUD3.CURR_CHANNEL, 0x08, 0x0b, 0x02);
  2104.                       Show_TV_Number(stGUD3.VOLUME, 0x0a, 0x0b, 0x01);
  2105.                       break;
  2106.               
  2107.                   default :
  2108.                       // We don't handle other messages
  2109.                       if (NOTIFY_NONE != action || (0 == usOSD_Timer && 0 != stGUD1.OSD_TIMEOUT))
  2110.                       {
  2111.                           ucOSD_Item_Index0   = 0;
  2112.                           ucOSD_Item_Index1   = 0;
  2113.                           ucOSD_Item_Index2   = 0;
  2114.                           RTDOSDW(OSD_Reset);
  2115.                           RTDCodeW(OSD_Enable);
  2116.                       }
  2117.                       break;
  2118.                   }
  2119.               }
  2120.               
  2121.               #endif
  2122. 4454          
  2123. 4455          
  2124. 4456          void OSD_Opening(void)
  2125. 4457          {
  2126. 4458   1              int idata num;
  2127. 4459   1      
  2128. 4460   1              //OSD_Position(OSD_ENABLE);
  2129. 4461   1      
  2130. 4462   1              OSD_Window( 7, 0 , 488, 0, 264,
  2131. 4463   1                       0, 0, 14, 251, 0, 1, 1);
  2132. 4464   1      
  2133. 4465   1              Delay_Xms(128);
  2134. 4466   1      
  2135. 4467   1              RTDCodeW(OSD_Enable);
  2136. 4468   1              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2137. 4469   1                                                      
  2138. 4470   1              for(num = 0;num < 112; num+=6)
  2139. 4471   1              {
  2140. 4472   2                      OSD_Window( 7, 0 + num*2, 488 - num*2 , 0 + num, 264 - num,
  2141. 4473   2                               0, 0, 14, 251, 0, 1, 1);
  2142. 4474   2              }
  2143. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 74  
  2144. 4475   1      
  2145. 4476   1              OSD_Window( 7, 0 + num*2, 488 - num*2 , 0 + num, 264 - num,
  2146. 4477   1                       0, 0, 14, 251, 0, 1, 0);
  2147. 4478   1      
  2148. 4479   1              
  2149. 4480   1      
  2150. 4481   1      /*
  2151. 4482   1      #if (1)
  2152. 4483   1      
  2153. 4484   1          RTDCodeW(OSD_Enable);
  2154. 4485   1      
  2155. 4486   1      #else
  2156. 4487   1      
  2157. 4488   1          // For OSD animetion
  2158. 4489   1      
  2159. 4490   1          RTDCodeW(Palette_Open);
  2160. 4491   1          RTDCodeW(Palette_1);
  2161. 4492   1      
  2162. 4493   1          RTDCodeW(OSD_Enable);
  2163. 4494   1          
  2164. 4495   1          Delay_Xms(16);
  2165. 4496   1          Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End                                    
  2166. 4497   1          RTDCodeW(Palette_2);
  2167. 4498   1      
  2168. 4499   1          Delay_Xms(16);
  2169. 4500   1          Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2170. 4501   1          RTDCodeW(Palette_3);
  2171. 4502   1          
  2172. 4503   1          Delay_Xms(28);
  2173. 4504   1          Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2174. 4505   1          RTDCodeW(Palette_4);
  2175. 4506   1          
  2176. 4507   1          Delay_Xms(28);
  2177. 4508   1          Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2178. 4509   1          RTDCodeW(Palette_5);
  2179. 4510   1      
  2180. 4511   1          Delay_Xms(28);
  2181. 4512   1          Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2182. 4513   1          RTDCodeW(Palette_6);
  2183. 4514   1      
  2184. 4515   1          Delay_Xms(28);
  2185. 4516   1          Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2186. 4517   1          RTDCodeW(Palette_7);
  2187. 4518   1      
  2188. 4519   1          RTDCodeW(Palette_Close);
  2189. 4520   1      
  2190. 4521   1      #endif
  2191. 4522   1      
  2192. 4523   1      */
  2193. 4524   1      }
  2194. 4525          
  2195. 4526          void OSD_Ending(void)
  2196. 4527          {
  2197. 4528   1              int idata num;
  2198. 4529   1      
  2199. 4530   1              for(num = 112;num > 0; num-=6)
  2200. 4531   1              {
  2201. 4532   2                      OSD_Window( 7, 0 + num*2, 488 - num*2 , 0 + num, 264 - num,
  2202. 4533   2                               0, 0, 14, 251, 0, 1, 1);
  2203. 4534   2              }
  2204. 4535   1      
  2205. 4536   1              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);     
  2206. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 75  
  2207. 4537   1              RTDOSDW(OSD_Reset);            // Clear OSD
  2208. 4538   1              //Delay_Xms(128);
  2209. 4539   1              OSD_Window( 7, 0 + num*2, 488 - num*2 , 0 + num, 264 - num,
  2210. 4540   1                       0, 0, 14, 251, 0, 1, 0);
  2211. 4541   1      
  2212. 4542   1      
  2213. 4543   1      #if (0)
  2214.               
  2215.                   // For OSD animetion
  2216.               
  2217.                   unsigned char ucTemp;
  2218.               
  2219.                   // First, clear debug information drawn by OSD_Show_Check()
  2220.                   OSD_Line(13, 2, 24, 0x00, 0);
  2221.                   OSD_Line(13, 2, 24, 0x00, 1);
  2222.               
  2223.                   // Close unused window
  2224.                   OSD_Window(0, 0, 0, 0, 0, 0, 0);
  2225.                   OSD_Window(1, 0, 0, 0, 0, 0, 0);
  2226.                   OSD_Window(2, 0, 0, 0, 0, 0, 0);
  2227.               
  2228.                   OSD_Line(11, 2, 24, 0x00, 0);
  2229.                   OSD_Line(11, 2, 24, 0x00, 1);
  2230.               
  2231.                   for (ucTemp = 0; ucTemp < 5; ucTemp ++)
  2232.                   {
  2233.                       OSD_Line(ucTemp, 2, 24, 0x00, 0);          // Attribute
  2234.                       OSD_Line(ucTemp, 2, 24, 0x00, 1);          // Display
  2235.                       OSD_Line(10 - ucTemp, 2, 24, 0x00, 0);     // Attribute
  2236.                       OSD_Line(10 - ucTemp, 2, 24, 0x00, 1);     // Display
  2237.                       OSD_Window(3, ucTemp + 1, 9 - ucTemp, 2, 25,
  2238.                           OSD_WINDOW_ENABLE | OSD_WINDOW_SHADOWING, COLOR_CYAN);  // Main OSD window
  2239.               
  2240.                       Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2241.                   }
  2242.               
  2243.                   OSD_Line(5, 2, 24, 0x00, 0);    // Attribute
  2244.                   OSD_Line(5, 2, 24, 0x00, 1);    // Display
  2245.               
  2246.                   for (ucTemp = 0; ucTemp < 12; ucTemp += 2)
  2247.                   {
  2248.                       OSD_Window(3, 5, 5, ucTemp + 3, 23 - ucTemp,
  2249.                           OSD_WINDOW_ENABLE | OSD_WINDOW_SHADOWING, COLOR_CYAN);
  2250.               
  2251.                       Wait_For_Event(EVENT_DEN_STOP);     // Wait for Frame End
  2252.                   }
  2253.               
  2254.               #endif
  2255. 4585   1      }
  2256. 4586          
  2257. 4587          
  2258. 4588          //Not modified yet
  2259. 4589          void Show_Note(void)
  2260. 4590          {
  2261. 4591   1              RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up
  2262. 4592   1              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  2263. 4593   1              //RTDCodeW(OSD_Reset);
  2264. 4594   1              OSD_Position(OSD_ENABLE);
  2265. 4595   1      
  2266. 4596   1      
  2267. 4597   1              // When input format changed, OSD will be cleared by Detect_VGA_Mode() and Detect_AV_Mode()
  2268. 4598   1              switch (stGUD1.INPUT_SOURCE & 0x07)
  2269. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 76  
  2270. 4599   1              {
  2271. 4600   2                      case SOURCE_VGA:
  2272. 4601   2      //#if (VIDEO_CHIP != VDC_NONE)
  2273. 4602   2                              RTDOSDW(OSD_RGB);  // OSD RGB note
  2274. 4603   2      //#endif
  2275. 4604   2                              break;
  2276. 4605   2                              
  2277. 4606   2                      case SOURCE_DVI:
  2278. 4607   2                              RTDOSDW(OSD_DVI);  // OSD DVI note
  2279. 4608   2                              break;
  2280. 4609   2                              
  2281. 4610   2                      case SOURCE_AV:
  2282. 4611   2                              RTDOSDW(OSD_AV);   // OSD AV note
  2283. 4612   2                              break;
  2284. 4613   2                              
  2285. 4614   2                      case SOURCE_SV:
  2286. 4615   2                              RTDOSDW(OSD_SV);   // OSD S-Video note
  2287. 4616   2                              break;
  2288. 4617   2                              
  2289. 4618   2                      case SOURCE_YUV:
  2290. 4619   2                              RTDOSDW(OSD_YUV);  // OSD YUV note
  2291. 4620   2                              break;
  2292. 4621   2                              
  2293. 4622   2                      case SOURCE_TV:
  2294. 4623   2                              RTDOSDW(OSD_TV);
  2295. 4624   2                              break;
  2296. 4625   2                              
  2297. 4626   2              }
  2298. 4627   1      
  2299. 4628   1              
  2300. 4629   1              RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2301. 4630   1              //RTDCodeW(OSD_Enable);
  2302. 4631   1              
  2303. 4632   1      }
  2304. 4633          
  2305. 4634          
  2306. 4635          //Not modified yet
  2307. 4636          void Show_Hint(void)
  2308. 4637          {
  2309. 4638   1              if (MODE_NOSIGNAL == ucMode_Curr)
  2310. 4639   1              {
  2311. 4640   2                      RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up
  2312. 4641   2                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  2313. 4642   2                      //RTDCodeW(OSD_Reset);
  2314. 4643   2      
  2315. 4644   2      #if(MCU_TYPE == MCU_WINBOND)
  2316. 4645   2                      if ((SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07)) && (VGA_ONLINE != bVGA_CONNECT))
  2317. 4646   2      #else
  2318.                               if ((SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07)) && (VGA_ONLINE != MCU_ReadVgaConnect()))
  2319.               #endif
  2320. 4649   2                      {
  2321. 4650   3                              RTDOSDW(OSD_HINT_TABLE[0][stGUD1.FUNCTION & 0x07]);
  2322. *** WARNING C214 IN LINE 4650 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  2323. 4651   3                      }
  2324. 4652   2                      else
  2325. 4653   2                      {
  2326. 4654   3                              RTDOSDW(OSD_Clean_All);
  2327. 4655   3                              RTDOSDW(OSD_HINT_TABLE[1][stGUD1.FUNCTION & 0x07]);
  2328. *** WARNING C214 IN LINE 4655 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  2329. 4656   3                      }
  2330. 4657   2      
  2331. 4658   2                      //RTDCodeW(OSD_Enable);
  2332. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 77  
  2333. 4659   2                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2334. 4660   2              }
  2335. 4661   1              else if ((MODE_NOSUPPORT == ucMode_Curr) || bOverSpec)
  2336. 4662   1              {
  2337. 4663   2                      RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up
  2338. 4664   2                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  2339. 4665   2                      //RTDCodeW(OSD_Reset);
  2340. 4666   2      
  2341. 4667   2                      RTDOSDW(OSD_HINT_TABLE[2][stGUD1.FUNCTION & 0x07]);
  2342. *** WARNING C214 IN LINE 4667 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  2343. 4668   2      
  2344. 4669   2                      //RTDCodeW(OSD_Enable);
  2345. 4670   2                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2346. 4671   2              }
  2347. 4672   1      }
  2348. 4673          
  2349. 4674          
  2350. 4675          #if (SHOW_CHECK)
  2351.               void OSD_Show_Check(void)
  2352.               {
  2353.                       OSD_Line(17, 2, 38, 0, 1);                       // Attribute
  2354.               
  2355.                       //OSD_Show_Num(0x02, ucOSD_Page_Index);                       // Status
  2356.                       //OSD_Show_Num(0x02, ucDebug_Value0);                       // Status
  2357.                       OSD_Show_Num(0x02, ucDebug_Value0);                       // Status
  2358.                       
  2359.                       OSD_Show_Num(0x05, ucDebug_Value1);                    // ucMode_Curr
  2360.                       //OSD_Show_Num(0x05, stMUD.V_POSITION);                    // ucMode_Curr
  2361.               
  2362.                       OSD_Show_Num(0x08, ucDebug_Value2);
  2363.                   //OSD_Show_Num(0x08, ucMode_Curr);
  2364.               
  2365.                       RTDRead(LAST_LINE_H_2C, 1, N_INC);                  // Last Line Length
  2366.                       Data[15]    = Data[0] & 0xf8;
  2367.                       OSD_Show_Num(0x0b, Data[15] >> 6);
  2368.                       RTDRead(LAST_LINE_L_26, 1, N_INC);
  2369.                       OSD_Show_Num(0x0d, (Data[15] << 2) | (Data[0] >> 3));
  2370.               
  2371.               #if (RTDDEBUG)
  2372.                       OSD_Show_Num(0x10, (unsigned char)(usPE_Sum >> 8));
  2373.                       OSD_Show_Num(0x12, (unsigned char)usPE_Sum);
  2374.                       OSD_Show_Num(0x17, (unsigned char)ucPE_Level);
  2375.               #else
  2376.                       OSD_Show_Num(0x10, (unsigned char)(usHsync >> 8));  // usHsync
  2377.                       OSD_Show_Num(0x12, (unsigned char)usHsync);
  2378.                       OSD_Show_Num(0x15, (unsigned char)(usVsync >> 8));  // usVsync
  2379.                       OSD_Show_Num(0x17, (unsigned char)usVsync);   
  2380.               
  2381.               #endif
  2382.               
  2383.               }
  2384.               
  2385.               void OSD_Show_Num(unsigned char column, unsigned char no)
  2386.               {
  2387.                       unsigned int idata usStart_Addr;
  2388.                       unsigned char idata ucTemp;
  2389.               
  2390.                       usStart_Addr = FONT_SELECT_ADDRESS;
  2391.               
  2392.                       //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
  2393.              -Row(n-1)_length
  2394.                       for(ucTemp = 1; ucTemp < 17+1; ucTemp ++)
  2395. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 78  
  2396.                               usStart_Addr += Row_Info[0][ucTemp];
  2397.               
  2398.                       Data[0]     = 5;
  2399.                       Data[1]     = Y_INC;
  2400.                       Data[2]     = OSD_ROW_90;
  2401.                       Data[3] = (unsigned char)( (((usStart_Addr + column)  & 0x0fff) >> 8 ) | 0x50);
  2402.                       Data[4] = (unsigned char)( (usStart_Addr + column) & 0x00ff);
  2403.                       Data[5]     = 0;                        
  2404.                       RTDWrite(Data);
  2405.               
  2406.                       column  = no / 16;              // Bit 7~4
  2407.                       no      = no - (column * 16);   // Bit 3~0
  2408.               
  2409.                       column  = (9 < column) ? (column + (0x20 - 10)) : (column + _0_);
  2410.                       no      = (9 < no) ? (no + (0x20 - 10)) : (no + _0_);
  2411.                   
  2412.                       Data[0] = 5;
  2413.                       Data[1] = N_INC;
  2414.                       Data[2] = OSD_DATA_92;
  2415.                       Data[3] = column;
  2416.                       Data[4] = no;
  2417.                       Data[5] = 0;
  2418.                       RTDWrite(Data);
  2419.               }
  2420.               #endif
  2421. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 79  
  2422. ASSEMBLY LISTING OF GENERATED OBJECT CODE
  2423.              ; FUNCTION Com03FF (BEGIN)
  2424. 0000         L?1024:
  2425. 0000         L?1025:
  2426. 0000 7800        R     MOV     R0,#LOW ucOSD_Item_Index1
  2427. 0002 E6                MOV     A,@R0
  2428. 0003 14                DEC     A
  2429. 0004 F9                MOV     R1,A
  2430. 0005 13                RRC     A
  2431. 0006 13                RRC     A
  2432. 0007 543F              ANL     A,#03FH
  2433. 0009 75F0AA            MOV     B,#0AAH
  2434. 000C A4                MUL     AB
  2435. 000D FF                MOV     R7,A
  2436. 000E AEF0              MOV     R6,B
  2437. 0010 2496              ADD     A,#096H
  2438. 0012 FD                MOV     R5,A
  2439. 0013 E4                CLR     A
  2440. 0014 3E                ADDC    A,R6
  2441. 0015 FC                MOV     R4,A
  2442. 0016 EF                MOV     A,R7
  2443. 0017 241A              ADD     A,#01AH
  2444. 0019 FB                MOV     R3,A
  2445. 001A EE                MOV     A,R6
  2446. 001B 3401              ADDC    A,#01H
  2447. 001D FA                MOV     R2,A
  2448. 001E E9                MOV     A,R1
  2449. 001F 5403              ANL     A,#03H
  2450. 0021 75F021            MOV     B,#021H
  2451. 0024 A4                MUL     AB
  2452. 0025 FF                MOV     R7,A
  2453. 0026 AEF0              MOV     R6,B
  2454. 0028 2436              ADD     A,#036H