Shop OBEX P1 Docs P2 Docs Learn Events
Composite Video to PAL vs NTSC — Parallax Forums

Composite Video to PAL vs NTSC

Richard MorrisonRichard Morrison Posts: 8
edited 2009-02-07 12:01 in Propeller 1
Has someone out there home-brewed the Propeller chip to send composite video to a PAL-based TV monitor as would be the case in Europe and also here in Australia·?· The HW interface would be the usual 3 bit DAC.·
I am interested to know what parameters TV.spin should be·passed to do this successfully.· It requires passing in a parameter table of 14 longs - one of these contains a mode bit (bit 0 selects NTSC/PAL) and of course the pin group and nibble would also need to be correctly selected but I'm wondering if there is anything else I need be aware of.

Comments

  • cgraceycgracey Posts: 14,253
    edited 2006-04-17 12:59
    Nope. smile.gif
    Richard Morrison said...
    ...I'm wondering if there is anything else I need be aware of.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • propwellpropwell Posts: 87
    edited 2009-02-06 13:33
    hm i'm dealing with the same problem as well at the moment.
    tvparams                long    0               'status
                            long    1               'enable
                            long    %001_0101       'pins
                            long    %0001           'mode
                            long    0               'screen
                            long    0               'colors
                            long    x_tiles         'hc
                            long    y_tiles         'vc
                            long    10              'hx
                            long    1               'vx
                            long    0               'ho
                            long    0               'vo
                            long    0               'broadcast
                            long    0               'auralcog
    



    i've got the mode-long set to 0001, my DVD-Recorder is now able to display the signal (PAL), but the image my TV display is to small. It looks like it is scaled at ~50%.
    I tryed to change the hx and vx-params but i got many problems with this.

    Can someone help me with this?

    thanks very much!
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 14:00
    Richard, use the table that Propwell included above, except change the hx value of 10 to 12 [noparse]:D[/noparse]

    Propwell, if you're using PAL, I usually add 2 to an ntsc's HX value, to get roughly the same size [noparse]:)[/noparse] ie, try using 12 for a PAL hx value [noparse]:D[/noparse]

    Hope this helps.

    Baggers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • propwellpropwell Posts: 87
    edited 2009-02-06 14:19
    hmm when i use 12 for hx, the x-size looks pretty good, but can't i change the vx-value to 2 (because i imagine that the image gets scaled in vertical direction) it doesn't work any more. So how can i scale the image vertically?
    And is this the highes resolution and imagequality i can get for PAL-TV?
  • propwellpropwell Posts: 87
    edited 2009-02-06 14:31
    and another question:

    do i understand it right: at the %0000 in de DAT-Block, the
    first bit is for "chroma" (0/1)
    second bit is for "interlace" (0/1)
    third bit is for ntsc/pal (0=NTSC, 1=Pal)
    and the fourth bit is for "swap" ?

    Or did i missunderstand the whole thing?
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 14:38
    propwell, to scale the image vertically, it is only in 1x or 2x scale, so whatever your Y scale is changing vx to 2 will double the scanline count, unlike horizontal scaling, as it has to re-draw the same line again when making it bigger, and thus can't be fractionally scalled, unless you do some mods in the TV code, to go back to the same line every so may frames [noparse]:D[/noparse] which will mess up any tv driver code, as this uses lineinc to increment over 16 pixels ( eg the depth of a tile ) the reason it looks smaller in the Y is because PAL has 286 lines visible and NTSC has 243 lines visible. which is quite a few less, which is why it looks shrunk in PAL.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 14:47
    Propwell, mode bits

    %0000 ' mapped to bits %3210

    bit 0 = PAL = %0001 /NTSC = %0000
    bit 1 = Interlace = %0010 /Non-interlace = %0000
    bit 2 = Strip Chroma from broadcase = %0100, / Don't strip Chroma = %0000 ' I've never used this option, [noparse]:D[/noparse]
    bit 3 = Strip Chroma from baseband = %1000, / Don't strip Chroma = %0000 ' I've never used this option either [noparse]:)[/noparse]

    so for example
    NTSC = %0000 + %0000 '( or just simply = %0000 ' or 0 )
    PAL = %0001 + %0000 '( or just simply = %0001 ' or 1)
    NTSC_with_Interlace = %0000 + %0010 '( or just simply = %0010 ' or 2)
    PAL_with_Interlace = %0001 + %0010 '( or just simply = %0011 ' or 3)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • propwellpropwell Posts: 87
    edited 2009-02-06 14:50
    ah ok thanks, thats how i thought about it.

    but is there no way to view the Propeller-Image on the whole TV-Screen? At the moment it looks like this (see the attachment)

    And thanks a lot for your great help!!!
    840 x 525 - 13K
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 14:58
    have you tried increasing the y_tiles [noparse]:D[/noparse] it'll start filling the screen adding one at a time, til it no longer works, or goes over the top and/or bottom edge of the screen.

    as for the help, no worries ;D

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • propwellpropwell Posts: 87
    edited 2009-02-06 15:02
    hm when i increase the y-tiles from 12 to 13, it already goes over the top, it shifts several columns, and the image doesn't make sense any more. So 12 is the maximum i can use... [noparse]:([/noparse] [noparse]:([/noparse]
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 15:58
    you'll also need to change the graphics initialisation from
      gr.setup(16, 12, 128, 96, bitmap_base)
    
    


    to
    to
      gr.setup(x_tiles, y_tiles, x_tiles<<3, y_tiles<<3, bitmap_base)
    
    


    which is shorter than
      gr.setup(x_tiles, y_tiles, x_tiles*16/2, y_tiles*16/2, bitmap_base)
    
    


    [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • propwellpropwell Posts: 87
    edited 2009-02-06 16:21
    ah ok, i forgot that... but .. hmm i doesnt really work
    here me actual code:

    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
      _stack = ($3000 + $3000 + 100) >> 2   'accomodate display memory and stack
    
      x_tiles = 17
      y_tiles = 13
    
    
      paramcount = 14       
      bitmap_base = $2000
      display_base = $5000
    
      lines = 5
      thickness = 2
    
    


    PUB start | i, j, k, kk, dx, dy, pp, pq, rr, numx, numchr
    
      'start tv
      longmove(@tv_status, @tvparams, paramcount)
      tv_screen := @screen
      tv_colors := @colors
      tv.start(@tv_status)
    
      'init colors
      repeat i from 0 to 63
        colors[noparse][[/noparse] i ] := $00001010 * (i+4) & $F + $2B060C02
    
      'init tile screen
      repeat dx from 0 to tv_hc - 1
        repeat dy from 0 to tv_vc - 1
          screen[noparse][[/noparse]dy * tv_hc + dx] := display_base >> 6 + dy + dx * tv_vc + ((dy & $3F) << 10)
    
      'init bouncing lines
      i := 1001
      j := 123123
      k := 8776434
      repeat i from 0 to lines - 1
        x[noparse][[/noparse] i ] := ?j // 64
        y[noparse][[/noparse] i ] := k? // 48
        repeat until xs[noparse][[/noparse] i ] := k? ~> 29
        repeat until ys[noparse][[/noparse] i ] := ?j ~> 29
    
      'start and setup graphics
      gr.start
      gr.setup(x_tiles, y_tiles, x_tiles<<3 , y_tiles<<3 , bitmap_base)
    
    
    


    DAT
    
    tvparams                long    0               'status
                            long    1               'enable
                            long    %001_0101       'pins
                            long    %0001           'mode
                            long    0               'screen
                            long    0               'colors
                            long    x_tiles         'hc
                            long    y_tiles         'vc
                            long    12              'hx
                            long    1               'vx
                            long    0               'ho
                            long    0               'vo
                            long    0               'broadcast
                            long    0               'auralcog
    
    



    hm but it shifts the colums anyway
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 16:40
    where's tv_vc and tv_hc defined?

    as this bit defines the layout of tiles on screen to point to their part of the bitmap

      'init tile screen
      repeat dx from 0 to tv_hc - 1
        repeat dy from 0 to tv_vc - 1
          screen[noparse][[/noparse]dy * tv_hc + dx] := display_base >> 6 + dy + dx * tv_vc + ((dy & $3F) << 10)
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • JetfireJetfire Posts: 34
    edited 2009-02-06 18:33
    Keep in mind that if you make the buffer bigger the start addresses and the space reserved are no longer correct.

    Each buffer is now $3740 not $3000, so you want to update _stack. This uses about 28K of ram.

    and change bitmap_base and display_base to:

    bitmap_base = $1180
    display_base = $48C0

    tv_vc and tv_hc are set in the longmove. To avoid confusion, I would recommend not using them and use x_tiles and y_tiles.
  • BaggersBaggers Posts: 3,019
    edited 2009-02-06 23:26
    exactly, good point there also Jetfire [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • propwellpropwell Posts: 87
    edited 2009-02-07 12:01
    whow ok, that's very much information for me now [noparse];)[/noparse] thank you for you great answers!
    I understood it like this:
    - change bitmap_base and display_base
    - do i have to change the stack like this:
    _stack = ($3000 + $3000 + 100) >> 2   'accomodate display memory and stack 
    
    to
    
    _stack = ($3740 + $3740 + 100) >> 2   'accomodate display memory and stack 
    
    


    and if so, what is the reason for exactly?

    I'm really sorry for annoying you with these stupid questions, but i really don't know how to deal with that problem [noparse]:([/noparse]
Sign In or Register to comment.