Home | History | Annotate | Line # | Download | only in src
      1 /*
      2  * Integrated TV out support based on the GATOS code by
      3  * Federico Ulivi <fulivi (at) lycos.com>
      4  */
      5 
      6 
      7 /*
      8  * Limits of h/v positions (hPos & vPos)
      9  */
     10 #define MAX_H_POSITION 5 /* Range: [-5..5], negative is on the left, 0 is default, positive is on the right */
     11 #define MAX_V_POSITION 5 /* Range: [-5..5], negative is up, 0 is default, positive is down */
     12 
     13 /*
     14  * Unit for hPos (in TV clock periods)
     15  */
     16 #define H_POS_UNIT 10
     17 
     18 /*
     19  * Indexes in h. code timing table for horizontal line position adjustment
     20  */
     21 #define H_TABLE_POS1 6
     22 #define H_TABLE_POS2 8
     23 
     24 /*
     25  * Limits of hor. size (hSize)
     26  */
     27 #define MAX_H_SIZE 5 /* Range: [-5..5], negative is smaller, positive is larger */
     28 
     29 /* tv standard constants */
     30 #define NTSC_TV_CLOCK_T 233
     31 #define NTSC_TV_VFTOTAL 1
     32 #define NTSC_TV_LINES_PER_FRAME 525
     33 #define NTSC_TV_ZERO_H_SIZE 479166
     34 #define NTSC_TV_H_SIZE_UNIT 9478
     35 
     36 #define PAL_TV_CLOCK_T 188
     37 #define PAL_TV_VFTOTAL 3
     38 #define PAL_TV_LINES_PER_FRAME 625
     39 #define PAL_TV_ZERO_H_SIZE 473200
     40 #define PAL_TV_H_SIZE_UNIT 9360
     41 
     42 /* tv pll setting for 27 mhz ref clk */
     43 #define NTSC_TV_PLL_M_27 22
     44 #define NTSC_TV_PLL_N_27 175
     45 #define NTSC_TV_PLL_P_27 5
     46 
     47 #define PAL_TV_PLL_M_27 113
     48 #define PAL_TV_PLL_N_27 668
     49 #define PAL_TV_PLL_P_27 3
     50 
     51 /* tv pll setting for 14 mhz ref clk */
     52 #define NTSC_TV_PLL_M_14 33
     53 #define NTSC_TV_PLL_N_14 693
     54 #define NTSC_TV_PLL_P_14 7
     55 
     56 #define PAL_TV_PLL_M_14 19
     57 #define PAL_TV_PLL_N_14 353
     58 #define PAL_TV_PLL_P_14 5
     59 
     60 #define VERT_LEAD_IN_LINES 2
     61 #define FRAC_BITS 0xe
     62 #define FRAC_MASK 0x3fff
     63