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