Tinkering with baseband video scaling.
potatohead
Posts: 10,261
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.
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
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:
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
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...
www.parallax.com/dl/docs/prod/prop/Hydra-Ch16Sample-v1.0.pdf
--
Michael