NTSC 8bpp bitmap display driver
For everyone who just wants a display simple all-points addressable bitmap on their TV (NTSC only, PAL in progress) - here's an answer.
The NTSC8bpp TV driver displays a i_width x i_height image on a TV using standard 3pin TV DAC. The bitmap is padded horizontally and scaled vertically to i_lines (non-integral vertical scaling supported). Pixels (TV coding) are stored in display order (left to right, top to bottom).
I have also tried to put in as many comments as possible for those interested in developing their own TV driver (either based on NTSC8bpp or from scratch).
I'll upload to ObEx once I finish the PAL version.
The NTSC8bpp TV driver displays a i_width x i_height image on a TV using standard 3pin TV DAC. The bitmap is padded horizontally and scaled vertically to i_lines (non-integral vertical scaling supported). Pixels (TV coding) are stored in display order (left to right, top to bottom).
I have also tried to put in as many comments as possible for those interested in developing their own TV driver (either based on NTSC8bpp or from scratch).
I'll upload to ObEx once I finish the PAL version.
zip

13K
Comments
One thing I found writing the 256x224 driver was that when I displayed alternate lines there were some interference effects on the display with dark/light bands every 30 lines or so. This is probably an artifact of interference between the actual number of pixels on the display and the number being displayed. The driver I was using only has vertical lines in multiples of 16, so having the ability to have n lines could be very useful as one could experiment with the number that gives the least artifacts.
See the VAR section:
Have You possibility to make even PAL version?
I have used your GreyTV with my "Stupid Video Capture" project and have great success. I have a newer version I am using with 108Mhz clock. The display has been boosted to 80x240 pixels. Now I am trying to use your 8ppp driver.
I can capture pseudo colored videos with this setup even up to 60 fps.
I now have a platform to actually try to capture the color signals.
Could it be possible to combine the GreyTV and the 8bpp driver into a combo, call it a 2pin video driver? The GreyTV processes pixels by the byte but the bpp does that by the long....
Perry
I'm trying to understand your requirements.
GreyTV uses a counter in DUTY mode to generate the video signal using a single pin. It can generate more levels of grey than normal TV objects (although fewer than the 8bpp would suggest) but at fairly low resolution. It uses WAITCNT instead of WAITVID for timing. NTSC8bpp uses the Propeller video generator and 3 pins.
I'm hoping that NTSC8bpp requires the bytes to be long aligned isn't a serious issue, but you're more interested in something which does color TV using only 2 pins.
It's possible to use NTSC8bpp with only 2 pins:
1. The DIRA & VCFG masks will have to be changed to not output on the LSB pin.
2. DUTY will have to be used on the MSB to push the colorburst up ($2DB6DB6D) and establish the blanking level ($6DB6DB6D).
3. You will only get [strike]4[/strike] 3 levels of grey. (I did the calculations and there isn't much difference between the two greys.)
To get more levels of grey will require combining GreyTV with NTSC8bpp. There's two ways of doing it I can see:
1. Use WAITVID to generate chroma (probably on one pin using S-Video mode) and DUTY for luma. The problem is the horizontal resolution will drop to even less than GreyTV because the WAITVID means the RDBYTE is no longer synchronized.
2. Use two cogs - one doing NTSC8bpp for chroma using S-Video mode, the other GreyTV using DUTY for luma. The trick will be synchronizing the pixels closely enough. Each driver will also need a separate bitmap (which may be an advantage for your use).
PS I have the PAL driver mostly working, but I'm running into chroma problems.
Can you say somehting about the palette? I've seen you do a few different things...
Is this the same as regular Parallax TV Palette?
Your driver has me thinking again about a "universal" GUI for TV, VGA, and 3.5" LCD... Thinking about 320x240x8bpp
This is the problem with bitmaps - they are memory hungry.
Eric. Thanks for the suggestions
I have been trying to do something like this with your drivers. I like your Number 1 option, my horizontal resolution is low enough to manipulate the pixels on the fly. I tried first with the GreyTV driver but forgot about the color-burst ( will look at it again to-night).
Also I wonder if a different summing network would be needed. What about the PWM on pin 15 and a capacitor to the reference circuit to pick up the color ?
Ray,
Eric's demo produces a great palette display, with legend!. very useful for color selection
Perry
ericball
Inspired by propGFX, I have been experimenting with external memory. As eric says, if hub is all used up for video ram there is not much left for code. If you accept that will always be the case for a decent video driver, then may as well accept that you need two propellers - one for code and one for video. In a way, that is not so unusual - I think even back in the olden days there were Z80 computers that had a Z80 also running the screen. So I think it is 'allowed' to use two propellers.
And then you can think about the best options for a 'video' propeller. prop plus external ram. two or more props etc.
I haven't pushed the 256x224 driver to its limits yet. I know it can go to about 336 wide before color artifacts get too bad, but I am not sure about the timing. I'd like to go to 298 if possible because that gives a 4:3 ratio without needing prescaling.
Only problem is that at 256x224 with half the video buffer in hub and half in ram, there is not much code space left. Some can be reclaimed by rewriting the serial driver object and the video object I'm using as they use code that needs a bit of the hub ram to stay constant after the cog has loaded, and so these could be rewritten so the all the hub can be reclaimed afterwards.
That technique could be relevant here too because then you can write pretty much everything in pasm with only a few lines of spin to launch things, and put all the cog code into the video buffer at startup. Then you could get up to almost 32k of hub ram for a video buffer.
256x224 is 57344 bytes, half in hub and half in external ram. With a 512k ram chip that leaves a lot of ram free - and I have ideas of using that ram as a place to store sprites, partial screen captures and fonts. There is plenty of time to move things around at the end of each frame - I did an experiment with a delay loop and there are 53000 pasm instructions one can run at the end of each frame so that is lots of time to copy a font onto the screen buffer etc.
So yes, I think a universal GUI is entirely possible.
BTW: I found an old 4x8 pixel font on the web that might be nice for 80 column display...