Shop OBEX P1 Docs P2 Docs Learn Events
Playing with the video parameters for the propeller TV object — Parallax Forums

Playing with the video parameters for the propeller TV object

edited 2007-11-12 02:45 in Propeller 1
I am using the graphics.spin object and the tv.spin objects to draw some graphics on a small TFT.

Trouble is, the video parameters (x position, y position, x scale, y scale, are not optimized for the screen, and there is a border of unused pixels that I cannot draw to. essentially, I need to adjust the scaling to "zoom in" further on the image.

I have tried messing with these parameters in the DAT section:

tvparams long 0 'status
long 1 'enable
tvparams_pins long %001_0101 'pins
long %0000 '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 also tried adding tiles but that screws up my image.

Has anyone had any success with modifying these parameters? should i just buy a hydra and use the hydra code in my propeller application?

-Ryan

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-11 22:35
    Basically, you're wanting to increase the horizontal and vertical dimensions of the display which is set up for 16 x 12 tiles which are each 16 x 32 bits.
    Unfortunately, you're partly facing the limitations of the TV signal format. You could try changing the horizontal expansion (hx) factor slightly and the horizontal and vertical offset values (ho and vo which can be negative). Make sure to read the comments at the end of TV.spin which discuss these
    various parameters and their interrelations.
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-11 23:00
    I have worked a lot with 320x240 displays and optimized my drivers... Have a look into the MPE_TEXT_013 I posted once or twice, you will see how TV is parametrized..
  • edited 2007-11-11 23:09
    How about colors? right now I can use the graphics.color() function to switch between :

    0: black
    1: rainbow
    2: white
    3: blue
    4: black
    5: rainbow
    etc.

    however, I see a palate of 64 colors being created in the variable array long colors[noparse][[/noparse]64].

    can I access those colors individually and draw lines and boxes with more color choices?

    -ryan
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-11 23:16
    There is a fundamental limit in the video hardware. There are two tile densities. One is a 32 pixel horizontal tile with each pixel providing one of two colors. The other is a 16 pixel horizontal tile with each pixel providing one of four colors. Each tile may have a different color palette although the video drivers are written to select them (on a tile by tile basis) from an array of 32 bit palette values. The colors themselves are 8 bit values whose layout depend on whether the display is TV or VGA. For TV, the number of unique colors depends on the limitations of the NTSC or PAL signal format. See the description of the video instructions in the Propeller Manual for more details. The Hydra Manual also discusses this thoroughly.
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-11 23:21
    To add:
    GRAPHICS usesd two bits per pixel, so you can select one of four (logical) colours per grafic element drawn. How this colour looks like depends on the palette associated with the corresponding tile
  • edited 2007-11-11 23:44
    How does the Hydra get all of its colors? Does it group pixels using the 2 bit color system to generate the various colors? Or does it expand the the memory capacity to allow each pixel to be stored with 8-bit colors?

    Does it allow dynamic variability in the definition of colors?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-12 00:29
    Those questions have complicated answers that have been discussed before.
    Have a look at various threads in the Hydra forum, particularly this one:
    http://forums.parallax.com/showthread.php?p=654928.
  • RaymanRayman Posts: 14,350
    edited 2007-11-12 02:45
Sign In or Register to comment.