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

C/C++

  1. ///////////////////////////////////////////////////////////////////
  2. // Definitions for Display Port
  3. #define SINGLE_PORT         0x00    // Single port (Single pixel output)
  4. #define DOUBLE_PORT         0x04    // Double port (Double pixel output)
  5. #define DISPLAY_PORT        DOUBLE_PORT
  6. ///////////////////////////////////////////////////////////////////
  7. // Definitions for Display Color
  8. #define DISP_18BIT          0x10    // 18-bit RGB output
  9. #define DISP_24BIT          0x00    // 24-bit RGB output 
  10. #define DISP_BIT            DISP_24BIT
  11. ///////////////////////////////////////////////////////////////////
  12. // Definitions for Display Timing Feature
  13. #define MASK_FIRST_DHS      0x80    // Mask 1st DHS
  14. #define NO_MASKING          0x00    // No masking 
  15. #define DHS_MASK            NO_MASKING    
  16. ///////////////////////////////////////////////////////////////////
  17. // Definitions for Display Signal
  18. #define DISP_INV 0x0C    // DVS : neg , DHS : neg , DEN : pos
  19. #define DCLK_INV 0x08    // DCLK : pos
  20. #define DCLK_DELAY 0x01    // 1.0ns delay for DCLK 
  21. ///////////////////////////////////////////////////////////////////
  22. // Definitions for Display Settings
  23. #define MAX_DCLK            138     // Maximum display clock(MHz) that panel can support
  24. #define MAX_RATE            76      // Maximum display refresh rate in Hz that panel can support
  25. #define DH_ACT_STA_POS      0x0020  // DH_ACT_STA_POS should be as small as possible !!!
  26. #define DH_ACT_END_POS      0x0520
  27. #define DV_ACT_STA_POS      0x000c  // DV_ACT_STA_POS should be as small as possible !!!
  28. #define DV_ACT_END_POS      0x040c
  29. #define DISP_WID            (DH_ACT_END_POS - DH_ACT_STA_POS)   // 0x0500 = 1280 pixels
  30. #define DISP_LEN            (DV_ACT_END_POS - DV_ACT_STA_POS)   // 0x0400 = 1024 lines
  31. #define STD_DH_TOTAL        0x0580  // Standard display clock number in one display horizontal line
  32. #define STD_DV_TOTAL        0x0480  // Standard display horizontal line in one display frame
  33. #define STD_HSYNC_WIDTH     0x10    // Display HSYNC clock width
  34. #define STD_VSYNC_LENGTH    0x03    // Display VSYNC line length
  35. #define MIN_DV_TOTAL        0x0410  // Minimum VSYNC that panel can support
  36. #define FIX_LAST_DHT        0//0x1f4
  37. #define MIN_LAST_DHT        0       // Must set to 0 if you don't care last-line length
  38. #define MAX_LAST_DHT        0       // Set it to 0 if you don't care the maximum last-line length
  39. #define VIDEO_ML_DHT        0       // Minimum last-line length for video
  40. #define USER_MODE_NCODE     16      // NEVER change this setting !!!
  41. #define DISP_ALIGN          0       // 0-Left alignment, 1-Right alignment
  42. #define AUTO_SWITCH        0x60      // Auto Switch to freerun mode
  43. #define DISP_EO_SWAP       0x00//0x80      // Display Even/Odd Data Swap
  44. #define DISP_RB_SWAP       0x00//0x40      // Display Red/Blue Data Swap
  45. #define DISP_ML_SWAP       0x00//0x20      // Display MSB/LSB Data Swap
  46. /*
  47. ///////////////////////////////////////////////////////////////////
  48. // Definitions for RTD3001
  49. #define All_LINE_BUF        0x02    // Turn on all line buffers
  50. #define REQ_DELAY           0x40    // 0.5ns delay for request
  51. #define V_MAC_DELAY         0x10    // 0.5ns delay for Vertical MAC
  52. #define H_MAC_DELAY         0x04    // 0.5ns delay for Horizontal MAC
  53. #define DCLK_DELAY          0x01    // 1.0ns delay for DCLK
  54. #define HINIT_COEFF         0x00    // Horizontal initial coefficient = 0xc000
  55. #define REQMODE_00B         0x00    // Imporved mode 1 : REG[28]-bit3 = 0
  56. #define REQMODE_01B         0x80    // Imporved mode 1 : REG[31]-bit7 = 1
  57. #define ODDCTRL_VGA         0x38    // REG[31]-bit5  : Odd signal for V inital toggle. (0 : inverse)
  58.                                     // REG[31]-bit4  : Odd signal to control FS_DELAY_FINE_TUNING. (0 : enable)
  59.                                     // REG[31]-bit3  : Odd signal to enable FS_DELAY_FINE_TUNING. (1 : inverse)
  60. #define ODDCTRL_VIDEO       0x28
  61. */
  62. //---------------------------------- 1280x1024 ---------------------------------
  63. ///////////////////////////////////////////////////////////////////////////
  64. #ifdef __MAIN__
  65. unsigned char code RTD_PWUP_INI[]   =
  66.     5,      Y_INC,  HOSTCTRL_02,        0x42,0x00,
  67.     4,      N_INC,  TC_ADDR_PORT_95,    0x00,
  68.     8,      N_INC,  TC_DATA_PORT_96,    0x42,0x10,0x11,0x80,0xf8, //anson  MTV 512
  69. //    8,      N_INC,  TC_DATA_PORT_96,    0x04,0x10,0x11,0x80,0xfc, //anson  TP2804
  70.     9,      Y_INC,  GP1_ODOCTRL_F6,     0x00,0x00,0x00,0x00,0x00,0x00,
  71.     6,      Y_INC,  IRQ_CTRL1_0E,       0x00,0x80,0x00,
  72.     4,      N_INC,  INT_FLD_DETECT_14,  0x00,
  73.     25, Y_INC, DH_TOTAL_22, 0x08,0x00,0x02,0x04,0x00,0x04,0x00,0x06,0x00,0x06,0x00,
  74. 0x06,0x00,0x01,0x02,0x00,0x02,0x00,0x04,0x00,0x04,0x00,
  75.     6,      Y_INC,  YUV2RGB_39,         0x00,0x00,0x00,
  76.     
  77.     5,      Y_INC,  DUTY_FINE_TUNE_3E,  0xc0,0x0e,          // For improving display speed
  78.     
  79.     4,      N_INC,  MEAS_HS_LATCH_4E,   0x00,
  80.     5,      Y_INC,  CLAMP_55,           0x04,0x10,
  81.     4,      N_INC,  COLOR_CTRL_5D,      0x03,
  82.     4,      N_INC,  OP_CRC_CTRL_68,     0x88,               // For improving display speed
  83.     6,      Y_INC,  PATTERN_GEN_6C,     0x00,0x83,0x00,
  84.     4,      N_INC,  SD_CTRL_70,         0x00,
  85. 4,      N_INC,  FX_LST_LEN_H_5A,     0x00,              // Disable fix last line function
  86.     6,      Y_INC,  IVS_DELAY_8C,       0x00,0x00,0x00,
  87.     7,      Y_INC,  PLL_DIV_CTRL0_C8,   0x04,0x00,0x20,0x18,
  88.     4,      N_INC,  HS_SCHMITT_TRIG_ED, 0xe3,                       //Set the Schmitt Trigger threshold voltage from 1.0 ~ 1.6V
  89.     4,      N_INC,  SPREAD_SPECTRUM_99, 0x00,                       //Disable Spread Spectrum
  90.     7,      Y_INC,  DPLL_CTRL_D0,       0x28,0x37,0x35,0x04,        //DCLK = 100MHz
  91.     13,     Y_INC,  PLL1_CTRL_D6,       0xf2,0x11,0x00,0x7f,0x30,0x0a,0x04,0x3f,0xff,0x81,
  92.     //4,      N_INC,  ADC_CTRL_E6,        0xb0,
  93.     4,      N_INC,  ADC_CTRL_E6,        0x40,
  94.     4,      N_INC,  DV_BKGD_STA_31,     0x60,
  95.     4,      N_INC,  ADC_FRAME_MODULE_EB, 0x06,
  96.     4,      N_INC,  TMDS_CORRECTION_FF, 0x00,
  97.     9,      Y_INC,  TMDS_OUTPUT_ENA_A0, 0x0f, 0xef,0x8b,0x26,0x35,0x2f,
  98.     0
  99. };
  100. unsigned char code RTD_DDC_TABLE[]  =
  101. {
  102.     5,      Y_INC,  DDC_ENABLE_FC,      0x00,0x00,  // Disable the DDC channel of VGA
  103.     131,    N_INC,  DDC_ACCESS_P_FE,    0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
  104.                                         0x4a,0x8b,0x00,0x00,0x01,0x01,0x01,0x01,
  105.                                         0x1e,0x0c,0x01,0x01,0x0e,0x24,0x1b,0x78,
  106.                                         0xe8,0x8a,0x01,0x9a,0x58,0x52,0x8b,0x28,
  107.                                         0x1e,0x50,0x54,0xff,0xff,0x80,0x61,0x40,
  108.                                         0x61,0x4f,0x61,0x59,0x71,0x4f,0x81,0x40,
  109.                                         0x81,0x59,0x81,0x99,0xa9,0x40,0x00,0x00,
  110.                                         0x00,0xfc,0x00,0x31,0x37,0x27,0x27,0x20,
  111.                                         0x4c,0x43,0x44,0x0a,0x20,0x20,0x20,0x20,
  112.                                         0x00,0x00,0x00,0xfc,0x00,0x4d,0x6f,0x6e,
  113.                                         0x69,0x74,0x6f,0x72,0x0a,0x20,0x20,0x20,
  114.                                         0x20,0x20,0x00,0x00,0x00,0xfd,0x00,0x2b,
  115.                                         0x55,0x14,0x5c,0x0e,0x00,0x0a,0x20,0x20,
  116.                                         0x20,0x20,0x20,0x20,0x00,0x00,0x00,0xff,
  117.                                         0x00,0x30,0x30,0x30,0x30,0x30,0x31,0x0a,
  118.                                         0x20,0x20,0x20,0x20,0x20,0x20,0x00,0xbd,
  119.     4,  N_INC,  DDC_ENABLE_FC,          0x05,       // Enable the DDC channel of VGA
  120.     
  121. #if(TMDS_ENABLE)
  122.     5,      Y_INC,  DDC_ENABLE_BC,      0x00,0x00,  // Disable the DDC channel  of DVI
  123.     131,    N_INC,  DDC_ACCESS_PORT_BE, 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
  124.                                         0x26,0xCD,0x68,0x46,0x00,0x00,0x00,0x00,
  125.                                         0x23,0x0c,0x01,0x03,0x81,0x24,0x1D,0x78,
  126.                                         0xeF,0x0D,0xC2,0xa0,0x57,0x47,0x98,0x27,                                        
  127.                                         0x12,0x48,0x4F,0xBF,0xEF,0x00,0x81,0x80,
  128.                                         0x81,0x8F,0x61,0x40,0x61,0x59,0x45,0x40,
  129.                                         0x45,0x59,0x31,0x40,0x31,0x59,0xBC,0x34,
  130.                                         0x00,0x98,0x51,0x00,0x2A,0x40,0x10,0x90,
  131.                                         0x13,0x00,0x68,0x22,0x11,0x00,0x00,0x1e,
  132.                                         0x00,0x00,0x00,0xFF,0x00,0x30,0x0A,0x20,
  133.                                         0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  134.                                         0x20,0x20,0x00,0x00,0x00,0xFC,0x00,0x41,
  135.                                         0x53,0x34,0x36,0x33,0x37,0x20,0x20,0x20,
  136.                                         0x20,0x20,0x20,0x20,0x00,0x00,0x00,0xFD,
  137.                                         0x00,0x38,0x55,0x18,0x50,0x0E,0x00,0x0A,
  138.    0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x06,
  139.     4,  N_INC,  DDC_ENABLE_BC,          0x05,       // Enable the DDC channel of DVI
  140. #endif
  141.     0
  142. };
  143. unsigned char code RTD_IO_INI[]  =
  144. {
  145.     4,      N_INC,  TC_ADDR_PORT_95,    0x00,
  146. #if(OUTPUT_BUS == LVDS_TYPE)
  147. #if(BOARD_TYPE == DEMO1_PCB)
  148.     8,      N_INC,  TC_DATA_PORT_96,    0x42,0x10,0x11,0x80,0xfc, //anson  MTV 512
  149. //    8,      N_INC,  TC_DATA_PORT_96,    0x04,0x10,0x11,0x80,0xfc, //anson  TP2804
  150. #else
  151.     7,      N_INC,  TC_DATA_PORT_96,    0x04,0x10,0x11,0x80,
  152. #endif
  153. //    7,      N_INC,  TC_DATA_PORT_96,    0x40,0x10,0x11,0x08,
  154. #endif
  155. #if(OUTPUT_BUS == LVDS_TYPE)
  156. #if(LVDS_MAP1 == LVDS_MAP)
  157.    9,      Y_INC,  LVDS_CTRL0_C0,      0x00,0xa3,0x22,0x80,0x80,0x68,
  158. #else
  159.    9,      Y_INC,  LVDS_CTRL0_C0,      0x00,0xa3,0x23,0x80,0x80,0x68,
  160. #endif
  161. #endif
  162.     0
  163. };
  164. // Be Careful !!
  165. // Display window setting in FreeV[] MUST follow the definition of
  166. // 1. DISP_WID and DISP_LEN
  167. // 2. DH_ACT_STA_POS and DH_ACT_END_POS
  168. // 3. DV_ACT_STA_POS and DV_ACT_END_POS
  169. // 4. Background window must be the same as active window.
  170. unsigned char code FreeV[]  =
  171. {
  172.     27, Y_INC,  VDIS_CTRL_20,       0x20 | DISP_BIT | DISPLAY_PORT,                 // Disable display timing
  173.                                     DISP_INV | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP,
  174.                                     (STD_DH_TOTAL & 0xff), (STD_DH_TOTAL >> 8),     // DH_TOTAL
  175.                                     STD_HSYNC_WIDTH,                                // DH_HS_END
  176.                                     (DH_ACT_STA_POS & 0xff), (DH_ACT_STA_POS >> 8), // DH_BKGD_STA
  177.                                     (DH_ACT_STA_POS & 0xff), (DH_ACT_STA_POS >> 8), // DH_ACT_STA
  178.                                     (DH_ACT_END_POS & 0xff), (DH_ACT_END_POS >> 8), // DH_ACT_END
  179.                                     (DH_ACT_END_POS & 0xff), (DH_ACT_END_POS >> 8), // DH_BKGD_END
  180.                                     (STD_DV_TOTAL & 0xff), (STD_DV_TOTAL >> 8),     // DV_TOTAL
  181.                                     STD_VSYNC_LENGTH,                               // DV_VS_END
  182.                                     (DV_ACT_STA_POS & 0xff), (DV_ACT_STA_POS >> 8) | AUTO_SWITCH, // DV_BKGD_STA
  183.                                     (DV_ACT_STA_POS & 0xff), (DV_ACT_STA_POS >> 8), // DV_ACT_STA
  184.                                     (DV_ACT_END_POS & 0xff), (DV_ACT_END_POS >> 8), // DV_ACT_END
  185.                                     (DV_ACT_END_POS & 0xff), (DV_ACT_END_POS >> 8), // DV_BKGD_END
  186.     4,  N_INC,  VDIS_CTRL_20,       0x23 | DISP_BIT | DISPLAY_PORT,                 // Enable free-run background
  187.     // Force display timing start
  188.     6,  Y_INC,  YUV2RGB_39,         0x00, 0x20 | DCLK_DELAY, 0x04 | DCLK_INV,
  189.     4,  N_INC,  DIS_TIMING0_3A,     0x00 | DCLK_DELAY,
  190.     4,  N_INC,  INT_FLD_DETECT_14,  0x00,
  191.     5,  Y_INC,  IVS_DELAY_8C,       0x00, 0x00,
  192. 4,  N_INC,  SCALE_CTRL_15,      0x00,
  193.     4,  N_INC,  FILTER_CTRL0_1B,    0xc4,
  194.     7,      Y_INC,  DPLL_CTRL_D0,       0x28,0x37,0x33,0x04,        //DCLK = 100MHz //anson
  195.     0
  196. };
  197. unsigned char code OSD_PWUP_INI[]   =
  198. {
  199.     5,  Y_INC,  OSD_ADDR_MSB_90, 0xc0,0x02,
  200. 6,  N_INC,  OSD_DATA_92,     0x03,0x08,0x00,
  201.     0
  202. };
  203. ///////////////////////////////////////////////////////////////////////////
  204. //VGA mode detect range
  205. unsigned int code VGA_Mode[][6] =
  206. {
  207. //      HF_min, HF_max, VL_min, VL_max, HF_std, VS+1
  208.     {   0,      0,      0,      0,      0,      0       }, //00:No Signal
  209.     {   764,    806,    620,    636,    781,    2+1     }, //01:VGA [640/720]*350*50Hz
  210.     {   764,    806,    620,    636,    781,    2+1     }, //02:VGA [640/720]*400*50Hz
  211.     {   764,    806,    516,    532,    781,    2+1     }, //03:VGA [640/720]*350*60Hz
  212.     {   764,    806,    516,    532,    781,    2+1     }, //04:VGA [640/720]*400*60Hz
  213.     {   969,    1021,   431,    447,    990,    8+1     }, //05:640*400*56hz
  214.     {   768,    810,    440,    456,    785,    2+1     }, //06:640*350*70hz
  215.     {   764,    806,    440,    456,    781,    2+1     }, //07:720*350*70hz
  216.     {   764,    806,    440,    456,    781,    2+1     }, //08:640*400*70hz
  217.     {   764,    806,    440,    456,    781,    2+1     }, //09:700*400*70hz
  218.     {   635,    670,    436,    452,    649,    3+1     }, //10:640*350*85hz
  219.     {   635,    670,    436,    452,    649,    3+1     }, //11:640*400*85hz
  220.     {   634,    669,    437,    453,    648,    3+1     }, //12:720*400*85hz
  221.     {   764,    806,    620,    636,    781,    2+1     }, //13:640*480*50hz
  222.     {   764,    806,    516,    532,    781,    2+1     }, //14:640*480*60hz
  223.     {   687,    724,    516,    532,    702,    3+1     }, //15:640*480*66hz
  224.     {   635,    670,    511,    527,    649,    3+1     }, //16:640*480*72hz
  225.     {   641,    676,    495,    507,    655,    3+1     }, //17:640*480*75hz
  226.     {   556,    586,    500,    516,    568,    3+1     }, //18:640*480*85hz
  227.     {   684,    721,    616,    632,    699,    2+1     }, //19:800*600*56hz
  228.     {   635,    670,    619,    635,    649,    4+1     }, //20:800*600*60hz
  229.     {   492,    519,    721,    737,    503,    6+1     }, //21:800*600*66hz
  230.     {   500,    527,    657,    673,    511,    6+1     }, //22:800*600*72hz
  231.     {   513,    541,    616,    632,    524,    3+1     }, //23:800*600*75hz
  232.     {   448,    473,    622,    638,    458,    3+1     }, //24:800*600*85hz
  233.     {   483,    510,    658,    674,    494,    3+1     }, //25:832*624*75hz
  234.     {   497,    524,    797,    813,    508,    6+1     }, //26:1024*768*60hz
  235.     {   493,    520,    810,    826,    504,    6+1     }, //27:1024*768*59hz
  236.     {   445,    470,    807,    823,    455,    4+1     }, //28:1024*768*66hz
  237.     {   428,    449,    797,    813,    435,    6+1     }, //29:1024*768*70hz
  238. //      HF_min, HF_max, VL_min, VL_max, HF_std, VS+1
  239.     {   414,    436,    798,    814,    423,    3+1     }, //30:1024*768*72hz //anson 05_0321 add
  240.     {   399,    421,    795,    811,    408,    3+1     }, //31:1024*768*74hz
  241. //      HF_min, HF_max, VL_min, VL_max, HF_std, VS+1
  242.     {   400,    422,    791,    807,    409,    3+1     }, //32:1024*768*75hz
  243.     {   350,    370,    799,    815,    358,    3+1     }, //33:1024*768*85hz
  244.     {   339,    358,    834,    850,    347,    8+1     }, //34:1024*800*84hz
  245.     {   356,    376,    891,    907,    364,    3+1     }, //35:1152*864*75hz
  246.     {   350,    370,    906,    922,    358,    3+1     }, //36:1152*870*75hz
  247.     {   389,    411,    928,    944,    398,    4+1     }, //37:1152*900*66hz
  248.     {   335,    354,    934,    950,    343,    8+1     }, //38:1152*900*76hz
  249.     {   401,    423,    991,    1007,   410,    3+1     }, //39:1280*960*60hz
  250.     {   280,    295,    1002,   1018,   286,    3+1     }, //40:1280*960*85hz
  251.     {   376,    396,    1057,   1073,   384,    3+1     }, //41:1280*1024*60hz
  252.     {   312,    329,    1060,   1076,   319,    3+1     }, //42:1280*1024*72hz
  253.     {   296,    313,    1057,   1073,   303,    8+1     }, //43:1280*1024*76hz
  254.     {   300,    317,    1057,   1073,   307,    3+1     }, //44:1280*1024*75hz
  255.     {   264,    279,    1063,   1079,   270,    3+1     }, //45:1280*1024*85hz
  256.     {   321,    339,    1241,   1257,   328,    3+1     }, //46:1600*1200*60hz
  257.     {   0,      0,      0,      0,      0,      0       }, //47:Mode reserved 00
  258.     {   0,      0,      0,      0,      0,      0       }, //48:Mode reserved 01
  259.     {   0,      0,      0,      0,      0,      0       }, //49:Mode reserved 02
  260.     {   0,      0,      0,      0,      0,      0       }, //50:Mode reserved 03
  261.     {   642,    1230,   418,    497,    0,      2+1     }, //51:NewMode720x400
  262.     {   535,    1025,   498,    637,    0,      2+1     }, //52:NewMode640x480
  263.     {   428,    820,    618,    785,    0,      2+1     }, //53:NewMode800x600
  264.     {   334,    641,    786,    881,    0,      2+1     }, //54:NewMode1024x768
  265.     {   297,    570,    882,    917,    0,      2+1     }, //55:NewMode1152x864
  266.     {   285,    547,    918,    977,    0,      2+1     }, //56:NewMode1152x900
  267.     {   267,    513,    978,    1041,   0,      2+1     }, //57:NewMode1280x960
  268.     {   251,    481,    1042,   1217,   0,      2+1     }, //58:NewMode1280x1024
  269.     {   292,    559,    1218,   1328,   0,      2+1     }, //59:NewMode1600x1200
  270. };
  271. unsigned int code Mode_Preset[][5]   =
  272. {
  273.     //  DH_TOTAL    DH_ACT_WID  DV_ACT_LEN      DCLK_M/N    IVS_DELAY
  274.     {   1408,       1280,       1024,           0,          0       }, //00:No Signal
  275.     //  VGA confused mode
  276.     {   1408,       1280,       1024,           0,          63      }, //01:VGA [640/720]*350*50Hz
  277.     {   1408,       1280,       1024,           0,          31      }, //02:VGA [640/720]*400*50Hz
  278.     {   1408,       1280,       1024,           0,          63      }, //03:VGA [640/720]*350*60Hz
  279.     {   1408,       1280,       1024,           0,          31      }, //04:VGA [640/720]*400*60Hz
  280.     //  Standard mode
  281.     {   1568,       1280,       1024,           0,          7       }, //05:640*400*56hz
  282.     {   1408,       1280,       1024,           0,          7       }, //06:640*350*70hz
  283.     {   1408,       1280,       1024,           0,          7       }, //07:720*350*70hz
  284.     {   1408,       1280,       1024,           0,          7       }, //08:640*400*70hz
  285.     {   1408,       1280,       1024,           0,          7       }, //09:700*400*70hz
  286.     {   1408,       1280,        896,            0,          7       }, //10:640*350*85hz
  287.     {   1408,       1280,       1024,           0,          7       }, //11:640*400*85hz
  288.     {   1376,       1280,       1024,           0,          7       }, //12:720*400*85hz
  289.     {   1408,       1280,       1024,           0,          31      }, //13:640*480*50hz
  290.     {   1408,       1280,       1024,           0,          7       }, //14:640*480*60hz
  291.     {   1504,       1280,       1024,           0,          7       }, //15:640*480*66hz
  292.     {   1456,       1280,       1024,           0,          7       }, //16:640*480*72hz
  293.     {   1472,       1280,       1024,           0,          3       }, //17:640*480*75hz
  294.     {   1408,       1280,       1024,           0,          7       }, //18:640*480*85hz
  295.     {   1632,       1280,       1024,           0,          3       }, //19:800*600*56hz
  296.     {   1640,       1280,       1024,           0,          7       }, //20:800*600*60hz
  297.     {   1408,       1280,       1024,           0,          7       }, //21:800*600*66hz
  298.     {   1408,       1280,       1024,           0,          7       }, //22:800*600*72hz
  299.     {   1408,       1280,       1024,           0,          3       }, //23:800*600*75hz
  300.     {   1408,       1280,       1024,           0,          7       }, //24:800*600*85hz
  301.     {   1568,       1280,       1024,           0,          7       }, //25:832*624*75hz
  302.     {   1408,       1280,       1024,           0,          7       }, //26:1024*768*60hz
  303.     {   1408,       1280,       1024,           0,          7       }, //27:1024*768*59hz
  304.     {   1408,       1280,       1024,           0,          7       }, //28:1024*768*66hz
  305.     {   1632,       1280,       1024,           0,          7       }, //29:1024*768*70hz
  306.     //  DH_TOTAL    DH_ACT_WID  DV_ACT_LEN      DCLK_M/N    IVS_DELAY
  307.     {   1408,       1280,       1024,           0,          7       }, //30:1024*768*72hz //anson 05_0321 add
  308.     {   1408,       1280,       1024,           0,          7       }, //31:1024*768*74hz
  309.     //  DH_TOTAL    DH_ACT_WID  DV_ACT_LEN      DCLK_M/N    IVS_DELAY
  310.     {   1408,       1280,       1024,           0,          7       }, //32:1024*768*75hz
  311.     {   1408,       1280,       1024,           0,          7       }, //33:1024*768*85hz
  312.     {   1408,       1280,       1024,           0,          7       }, //34:1024*800*84hz
  313.     {   1408,       1280,       1024,           0,          7       }, //35:1152*864*75hz
  314.     {   1408,       1280,       1024,           0,          7       }, //36:1152*870*75hz
  315.     {   1408,       1280,       1024,           0,          7       }, //37:1152*900*66hz
  316.     {   1408,       1280,       1024,           0,          7       }, //38:1152*900*76hz
  317.     {   1408,       1280,       1024,           0,          7       }, //39:1280*960*60hz
  318.     {   1408,       1280,       1024,           0,          7       }, //40:1280*960*85hz
  319.     {   1408,       1280,       1024,           0,          7       }, //41:1280*1024*60hz
  320.     {   1408,       1280,       1024,           0,          7       }, //42:1280*1024*72hz
  321.     {   1408,       1280,       1024,           0,          7       }, //43:1280*1024*76hz
  322.     {   1408,       1280,       1024,           0,          7       }, //44:1280*1024*75hz
  323.     {   1408,       1280,       1024,           0,          7       }, //45:1280*1024*85hz
  324.     {   1408,       1280,       1024,           0,          7       }, //46:1600*1200*60hz
  325.     //  Reserved mode
  326.     {   1408,       1280,       1024,           0,          0       }, //47:Mode reserved 00
  327.     {   1408,       1280,       1024,           0,          0       }, //48:Mode reserved 01
  328.     {   1408,       1280,       1024,           0,          0       }, //49:Mode reserved 02
  329.     {   1408,       1280,       1024,           0,          0       }, //50:Mode reserved 03
  330.     //  Unknown user mode
  331.     {   1408,       1280,       1024,           0,          3       }, //51:NewMode720x400
  332.     {   1408,       1280,       1024,           0,          3       }, //52:NewMode640x480
  333.     {   1408,       1280,       1024,           0,          3       }, //53:NewMode800x600
  334.     {   1408,       1280,       1024,           0,          3       }, //54:NewMode1024x768
  335.     {   1408,       1280,       1024,           0,          3       }, //55:NewMode1152x864
  336.     {   1408,       1280,       1024,           0,          3       }, //56:NewMode1152x900
  337.     {   1408,       1280,       1024,           0,          3       }, //57:NewMode1280x960
  338.     {   1408,       1280,       1024,           0,          3       }, //58:NewMode1280x1024
  339.     {   1408,       1280,       1024,           0,          3       }, //59:NewMode1600x1200
  340.     
  341.     //  Safe display mode
  342.     {   1408,       1280,       1024,           0,          3       }, //60:Undefined SU mode
  343.     {   1408,       1280,       1024,           0,          3       }, //61:Undefined SD mode
  344. };
  345. ///////////////////////////////////////////////////////////////////////////////
  346. //Video Setting
  347. #if (VIDEO_CHIP == VDC_NONE)
  348. // No Video Decoder
  349. unsigned char code RTD_VIDEO_60[]   = { 0 };
  350. unsigned char code RTD_VIDEO_50[]   = { 0 };
  351. #else
  352. #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
  353. #define H_60    0x91//0x70    // For SAA7114/7118
  354. #define H_50    0x97//0x7c    // For SAA7114/7118
  355. #else
  356. #define H_60    0x56    // For SAA7111A
  357. #define H_50    0x5e    // For SAA7111A
  358. #endif
  359. unsigned char code RTD_VIDEO_60[]   =
  360. {
  361.     11, Y_INC,  IPH_ACT_STA_06,     H_60, 0x00, 0xb8, 0x02,
  362.                                     0x14, 0x00, 0xed, 0x00,
  363.     10, Y_INC,  INT_FLD_DETECT_14,  0x14, 0x03, 0x33, 0x8b, 0x40, 0x3b, 0x00,
  364.     4,  N_INC,  FS_FT_DELAY_1E,     0x0f,//0x1a,
  365.     
  366.     7,  Y_INC,  DRW_BSU_40,         0xb8, 0x02, 0xed, 0x00,
  367.     4,  N_INC,  OP_CRC_CTRL_68,     0x48,
  368.     4,  N_INC,  SD_CTRL_70,         0x00 | VIDEO_ICLK_DELAY,
  369.     5,  Y_INC,  IVS_DELAY_8C,       0x00, 0x00,
  370.     29, Y_INC,  VDIS_CTRL_20,       0x28 | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  371.                                     DISP_INV | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP,
  372.  
  373.                                     0x7e, 0x05,
  374.                                     0x10,
  375.                                     0x20, 0x00,
  376.                                     0x20, 0x00,
  377.                                     0x20, 0x05,
  378.                                     0x20, 0x05,
  379.                                     0x80, 0x04,
  380.                                     0x03,
  381.                                     0x0f, 0x00,
  382.                                     0x0f, 0x00,
  383.                                     0x0f, 0x04,
  384.                                     0x0f, 0x04,
  385.                                     0x13, 0x20,
  386. 7,  Y_INC,  DPLL_CTRL_D0,       0x18, 0x62, 0x3a,0x07,
  387. 5,  Y_INC, DCLK_OFFSET_LSB_9A,  0x70, 0x29,
  388. 4,  N_INC, FX_LST_LEN_H_5A,     0x08,
  389.     4,  N_INC,  VDIS_CTRL_20,       0x2b | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  390.     5,  Y_INC,  VGIP_CTRL_04,       0x0d, 0x00 | VIDEO_LATCH,
  391.     0
  392. };
  393. unsigned char code RTD_VIDEO_50[]=
  394. {
  395.     11, Y_INC,  IPH_ACT_STA_06,     H_50, 0x00, 0xb8, 0x02,
  396.                                     0x18, 0x00, 0x1a, 0x01,
  397.     10, Y_INC,  INT_FLD_DETECT_14,  0x14, 0x03, 0x33, 0x8b, 0x80, 0x46, 0x00,
  398.     4,  N_INC,  FS_FT_DELAY_1E,     0x13,
  399.     
  400.     7,  Y_INC,  DRW_BSU_40,         0xb8, 0x02, 0x1a, 0x01,
  401.     4,  N_INC,  OP_CRC_CTRL_68,     0x48,
  402.     4,  N_INC,  SD_CTRL_70,         0x00 | VIDEO_ICLK_DELAY,
  403.     5,  Y_INC,  IVS_DELAY_8C,       0x00, 0x00,
  404. //  6,  Y_INC,  DPLL_CTRL_D0,       0x11, 0x75, 0x07,
  405.     29, Y_INC,  VDIS_CTRL_20,       0x28 | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  406.                                     DISP_INV | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP,
  407.                                     0x7e, 0x05,
  408.                                     0x10,
  409.                                     0x20, 0x00,
  410.                                     0x20, 0x00,
  411.                                     0x20, 0x05,
  412.                                     0x20, 0x05,
  413.                                     0x80, 0x04,
  414.                                     0x03,
  415.                                     0x0d, 0x00,
  416.                                     0x0d, 0x00,
  417.                                     0x0d, 0x04,
  418.                                     0x0d, 0x04,
  419.                                     0x17, 0x20,
  420. 7,  Y_INC,  DPLL_CTRL_D0,       0x10, 0x52, 0x3a,0x07,
  421. 5,  Y_INC, DCLK_OFFSET_LSB_9A,  0xc2, 0x29,
  422. 4,  N_INC, FX_LST_LEN_H_5A,     0x08,
  423.     4,  N_INC,  VDIS_CTRL_20,       0x2b | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  424.     5,  Y_INC,  VGIP_CTRL_04,       0x0d, 0x00 | VIDEO_LATCH,
  425.     0
  426. };
  427. #endif
  428. #else 
  429. extern unsigned char code RTD_PWUP_INI[];
  430. extern unsigned char code RTD_DDC_TABLE[];
  431. extern unsigned char code RTD_IO_INI[];
  432. extern unsigned char code FreeV[];
  433. extern unsigned char code OSD_PWUP_INI[];
  434. extern unsigned int code VGA_Mode[][6];
  435. extern unsigned int code Mode_Preset[][5];
  436. extern unsigned char code RTD_VIDEO_60[];
  437. extern unsigned char code RTD_VIDEO_50[];
  438. #endif