Shop OBEX P1 Docs P2 Docs Learn Events
Tinkering with baseband video scaling. — Parallax Forums

Tinkering with baseband video scaling.

potatoheadpotatohead Posts: 10,254
edited 2006-11-20 16:42 in Propeller 1
First off, this is pretty darn cool. I'm working on graphics right now, just getting my feet wet. One of the things I wanted to try was getting a lower resolution NTSC bitmap, say 160 x 96, with a higher color depth.

Step one, of course, was to get the horizontal color clocks and tiles all matched up for that resolution. Using the parallax drivers, this ended up being a piece of cake. The scaling is nifty in that it handles the lower level dithering and pixel size issues, leaving the rest up to you. Didn't take but a short while to tweak a few parameters and I'm looking at the right resolution.

So far, I've tried horizontal resolutions of 256, 128, 96 and 64 pixels with no significant issues.

I found it easier to just declare the right number of tiles, then tweak the scaling register until there are no color clock artifacts than work the other way around.

I'm using the Parallax supplied graphics demo, stripped down to a few commands that display bar graphs, a moving object and some pixel grids.

Comments

  • potatoheadpotatohead Posts: 10,254
    edited 2006-11-19 03:10
    I'm trying to track down the source of my problem with the vertical scaling.

    Decided to start with the parallax graphics demo for TV. That way we've a common set of code to examine.

    Let's say I want to run this demo at ~96 pixels of vertical resolution. So I edit the number of vertical tiles to be 6 instad of 12, and set the vertical scaling parameter to 2 instead of 1.

    y_tiles = 6
    long 2 'vx

    I don't have an NTSC capture device at the moment. I'm running the version 1.0 prop tool, and the driver code that came with it.

    The pixel size is right, in that it's two non-interlaced scanlines per pixel. But the memory mapping for the tile bitmap is all hosed up. I've not been able to get the screen pointer mapping set up right yet! Was hoping the information in the sample chapter Andre provided would help, but I'm still confused.

    If you do the above, the image is broken into vertical strips, with every other column being correct.

    I made the following two edits:

     'poke some values into the screen manually
      screen[noparse][[/noparse]0] := $5000
      screen := $5000  <--- There is an index on that, but it would not post for some reason!  it's a '1'
    
    


    Now, I know those two are wrong because they need to be bit shifted, but they proved useful to contrast that area of the screen with the rest of the on screen moving graphics. This appeared to work as it should in that I saw the same graphical image in both tiles. So far so good, but that seemed to contrast with the data Andre posted... What I saw was two tiles side by side with the same image, aligned horizontally. According to the info contained in chapter 16, I should have seen two tiles aligned vertically...

    MM instead of:

    M
    M

    Iterating through the first few words of screen[noparse]/noparse, I get: MMMMMM (Where 'M' is the same tile image.) I should have gotten:
    M
    M
    M
    M
    M
    .
    .
    .




    The behavior of the driver does not seem to match the chapter 16 info, when the scaling is invoked. Anyone know more?

    Post Edited (potatohead) : 11/19/2006 3:16:37 AM GMT
  • potatoheadpotatohead Posts: 10,254
    edited 2006-11-19 20:38
    Ok, did some testing this morning. Sometimes it helps to just step away.

    IMHO, the information presented in the chapter 16 sample is incorrect, regardless of vertical scaling issues. I fired up the Parallax graphics_demo.spin file, and keyed in some screen values. Unless I'm missing something, we have a documentation bug!

    The screen array, when filled in sequential order, changes the tile addressing and color set information, starting at the upper left, filling horizontally, line by line, finally ending up at lower right. This is the current behavior of the Parallax graphics driver for tv. TV.spin

    Figure 16:4 has it rotated 90 degrees, with sequential addresses starting at the upper left corner, filling vertically, line by line, eventually reaching the lower right.

    Now I am sure of what the Parallax TV driver is doing, and it's behavior does not change on vertical scale or interlaced modes.

    I'm still having trouble setting up a bitmap that works with the graphics commands though. If vertical scaling is set to a 1, everything works as is should. A bitmap can be setup at basically any resolution and horizontal scale and it all just works.

    The behavior of the graphics object changes when vertical scaling is set to a one though. Gonna dig into that today as that is really what caused my confusion yesterday.

    In case my terminology is not clear, I mean commands like gr.plot, etc...
  • DaveFDaveF Posts: 62
    edited 2006-11-20 16:23
    What are you reading that has 16+ chapters??
  • sonex293sonex293 Posts: 9
    edited 2006-11-20 16:27
    I'm sure he's referring to the sample Chapter 16 from the just released Hydra book....

    www.parallax.com/dl/docs/prod/prop/Hydra-Ch16Sample-v1.0.pdf

    --
    Michael
  • DaveFDaveF Posts: 62
    edited 2006-11-20 16:29
    yes, just figured that out. Thanks!
  • potatoheadpotatohead Posts: 10,254
    edited 2006-11-20 16:42
    Yep, it's the excellent sample provided here a few days ago.
Sign In or Register to comment.