Shop OBEX P1 Docs P2 Docs Learn Events
Now I have a video question — Parallax Forums

Now I have a video question

AleAle Posts: 2,363
edited 2008-09-11 07:19 in Propeller 1
I want to do a tiled driver for VGA, 512x384 (because it works) with 8x8 or 4x4 tiles.

Question: It is possible to have 16 consecutive pixels with more than 4 different colors ? From what I see waitvid (if I understood correctly) only has place for 4 colors... How do you do it ?

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2008-09-09 14:27
    You do frames of 4 pixels and use waitvid like this:

    
    :draw_pixels            rdlong  B, A    'get four pixels from hub
    
                         
                            
                            waitvid B, #%%3210  'draw them to screen
                            add     A, #4    'point to next pixel group
                            djnz    r1, #:draw_pixels
    
    
    



    Basically then it ends up being one byte per pixel. This wastes some bits because the Prop does not have 256 colors. Also you have to watch for sync signals and such. 00 does not equal black, but sync.

    On the wiki, there is a discussion about color, and some color map tables and screenie I put together to help in color selection and just to know what values are what. That is for TV graphics, but will give you an idea of how it's gonna work out on VGA.

    Waitvid only does 1 bit per pixel, or 2 bits per pixel, when working with 16 pixel or 32 pixel frames otherwise.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net

    Post Edited (potatohead) : 9/9/2008 2:33:58 PM GMT
  • AleAle Posts: 2,363
    edited 2008-09-09 15:26
    Now I see what you mean. You set VSCL to 4 times the pixel clock, so it will terminate earlier without outputting the whole 32 bits (only 8). Interesting, I'll test it and come back, thanks !
  • potatoheadpotatohead Posts: 10,261
    edited 2008-09-09 18:24
    Yep. That's it exactly. Partial frames work just fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • AleAle Posts: 2,363
    edited 2008-09-10 13:25
    (Using Bill Hennings 640x240 modification to the 512x384 bitmap mode)
    As a start, i reduced the number of waitvids to a half and increased the number of clocks per pixel to the double, I suppose I'D be getting half the horizontal resolution... the picture does not sync. What is going on ? any ideas ?
  • potatoheadpotatohead Posts: 10,261
    edited 2008-09-11 01:21
    Did you only change those waitvids that are drawing pixels and not sync signals?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • AleAle Posts: 2,363
    edited 2008-09-11 07:19
    The problem was... the image does not sync...

    The horiz sync pulses were 28 us apart (more or less) in the 640x240, but only 17.12us in my 320x240 version. Why ?

    Original:
    :yexpand                mov     x,#xtiles               'set x tiles
    ...
    vscl_pixel              long    1 << 12 + 32            '1 pixel per clock and 32 pixels per set
    
    




    Modified
    :yexpand                mov     x,#10'xtiles               'set x tiles
    ...
    vscl_pixel              long    2 << 12 + 64            '2 pixel per clock and 64 *clocks* per set
    
    



    My problem was that the number of clocks per frame was set to 32 as the original and not 32 times the number of pixel clocks. So I was still using 32 clocks total instead of 32. Nothing like measuring the horizontal sync freq.

    Now I have to correct the jitter.
Sign In or Register to comment.