TV Graphics/Bitmap Questions
DogP
Posts: 168
Hey,
I got my Propeller chip a couple days ago and got it hooked up and all working. I've been playing with a few of the demos and reading manuals/posts trying to learn all I can, but I've got a few questions.
First, let me describe what I'm wanting to do. I have a device that outputs 384x224 (2 bits/pixel) video. I want to take this data and output it to a TV. I think I should be able to read this data into memory and output the bitmap to the screen. I was able to create a 384x224 screen by modifying the graphics demo, so I'm glad to know I can output that resolution and still have it be recognizable [noparse]:)[/noparse] .
The first thing I'm confused about is tiles. Looking through the graphics and TV driver, it looks like it uses 16x16 tiles. How do they work, and do I have to use them? What I really want to do is output raw pixels to the display without doing a bunch of plot(x,y) (which of course won't give an acceptable speed). I need 4 shades including black (2bits), and the shades required is constant across an entire frame. I'd like to be able to change the shades between frames, but that's not a high priority.
Also, I was messing with the interlaced bit... when I set it, the screen draws 112 pixels each frame alternating from a 224 pixel map at 60Hz, correct? And when I set it to progressive, it draws only 112 pixels, except both interlaced frames are the same image (basically 30Hz)? It's not actually outputting a progressive 60Hz signal, correct?
Thanks,
Pat
I got my Propeller chip a couple days ago and got it hooked up and all working. I've been playing with a few of the demos and reading manuals/posts trying to learn all I can, but I've got a few questions.
First, let me describe what I'm wanting to do. I have a device that outputs 384x224 (2 bits/pixel) video. I want to take this data and output it to a TV. I think I should be able to read this data into memory and output the bitmap to the screen. I was able to create a 384x224 screen by modifying the graphics demo, so I'm glad to know I can output that resolution and still have it be recognizable [noparse]:)[/noparse] .
The first thing I'm confused about is tiles. Looking through the graphics and TV driver, it looks like it uses 16x16 tiles. How do they work, and do I have to use them? What I really want to do is output raw pixels to the display without doing a bunch of plot(x,y) (which of course won't give an acceptable speed). I need 4 shades including black (2bits), and the shades required is constant across an entire frame. I'd like to be able to change the shades between frames, but that's not a high priority.
Also, I was messing with the interlaced bit... when I set it, the screen draws 112 pixels each frame alternating from a 224 pixel map at 60Hz, correct? And when I set it to progressive, it draws only 112 pixels, except both interlaced frames are the same image (basically 30Hz)? It's not actually outputting a progressive 60Hz signal, correct?
Thanks,
Pat
Comments
You can cheat by setting the 'frame clocks' to 4 pixels, using %11_10_01_00 as your immediate for the pixels value and load 4 pixels into the palette. That would give you the ability to have a pixel display. You should consider that this requires you to generate the video in realtime since there is not enough memory for a full frame buffer. There are other tricks you can do, but this is by far the easiest. You can also hard code the palette if you want a 4 color screen (MUCH easier, and requires less processor time since it requires only one WAITVID). That method only requires (width * height / 16) longs of memory.
There is no maximum horizontal resolution persay on an NTSC signal, just an ammount of time you can display things. there are 188 full color bursts in a NTSC display frame, which is essentially the highest resolution you can use and garuntee that your chroma is going to be accurate. You can drive it higher if you use a high quality video encoder (since it uses true sinus output, rather than a square chroma signal). As far as how high you can drive it and the picture still be ledgable, ~256 horizontal pixels is decent (that uses about 11/16ths of a chroma).
224 is a perfectly resonable vertical resolution. 240~242 is about the highest you can drive it, but a lot of your lines will be cropped on certain TVs. (This is why they say that the NES has a vertical resolution of 224, even though the system ACTUALLY draws a full 240 vertical lines, the top 8 and bottom 8 are usually clipped by your television)
BTW, here's an example of an image I'm trying to display.
en.wikipedia.org/wiki/Image:Mario%27s_Tennis_screenshot.png
It's a display from the sorta VR system that Nintendo made back in 95 (Virtual Boy). I hope if I only do 384x112 interlaced I'll actually be able to capture both displays (4 bits/pixel) and show in 3D w/ red/blue glasses, but that's just a wishlist item right now.
Thanks,
Pat
A lot of drivers out already pull a lot more then that.
Here are some NTSC numbers...
You can output about 242.5 active lines per field (60 hertz) and about 485 lines per frame (30 hertz).
Non-interlaced display's a new video frame every field but only has half the vertical resolution. It flickers less due to the higher framerate from doubling up both even and odd fields.
Non-interlaced is what you would more then likely want to use since your target goal is only 112 lines vertically.
So what your thinking of doing is very "do-able".
Remember you can go up to about ~242 lines before you have to start interlacing. ^^
So there's a non-interlaced mode on the TV (regular, non-HD)? I thought the TV automatically interlaced, which is why I thought non-interlaced was just a trick the Prop did to just show double frames (at half the frequency).
I've been playing with rewriting the TV driver a little bit, so hopefully I'll be able to understand more of what's going on and ask more specific/intelligent questions [noparse];)[/noparse] .
Thanks,
Pat
As for the non-interlaced mode on the TV.
It's not really a mode. You just send the lines differently. In non-interlaced you just resend the whole screen each frame.
When you interlace you send only the odd lines of a picture on one field and the evan on the next. (Takes two full sweeps of the screen to generate the full image)
The television standard has a weird number of total lines and will start the next frame with a offset.
As you can see the second field (pink) started halfway in from the first field (blue) and thats how they interlace with eachother.
--Andrew Arsenault.