Seriously improved 8x8 NTSC text driver (80 Column Color Top Post!)
potatohead
Posts: 10,261
UPDATE: Rev 1.0 is in the OBEX.
I'm going to release the text only driver. It's solid, and is feature complete for text. Other things are on my mind, and that's a growing problem!
@ 80 Mhz, it will do 64 characters color text, 80 characters monochrome text
@96 Mhz, 80 columns in both color and monochrome.
The core functions needed to output text to it have been ported from various places. AiGeneric, TV_Text, and some I wrote just for the driver, given how it does color. Enough core things are there to make other ports easy, and I'll leave that to users to do for their own specific needs.
Mouse will be 2.0, when I circle around back to this in the future. I tend to do that with text. The low level graphics allow for this, and if you feel somehow compelled to work on it, do let me know.
Up late today finishing that stuff up, and decided to run it on the HDTV, composite. When using moderate intensity colors, it works well right up to 80 columns on black background. When there is a significant angular difference between foreground and background, it's pretty ratty at 80, but serviceable at 40.
The two brightest intensities, coupled with the out of spec hi-saturation colors do not render well at 80 either. Watch out for those. I included them in the color space, because they are fine at 32 and below characters per line. Smaller displays and games make use of these resolutions and colors, so why not?
Horizontal resolutions are 8, 16, 32, 40, 64, 80 characters per line. Rows are fixed at 25. Display may be interlaced or not.
obex.parallax.com/objects/550/ Linked as I could find no combination of file name that would permit upload. ?!?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 12/13/2009 11:46:15 AM GMT
I'm going to release the text only driver. It's solid, and is feature complete for text. Other things are on my mind, and that's a growing problem!
@ 80 Mhz, it will do 64 characters color text, 80 characters monochrome text
@96 Mhz, 80 columns in both color and monochrome.
The core functions needed to output text to it have been ported from various places. AiGeneric, TV_Text, and some I wrote just for the driver, given how it does color. Enough core things are there to make other ports easy, and I'll leave that to users to do for their own specific needs.
Mouse will be 2.0, when I circle around back to this in the future. I tend to do that with text. The low level graphics allow for this, and if you feel somehow compelled to work on it, do let me know.
Up late today finishing that stuff up, and decided to run it on the HDTV, composite. When using moderate intensity colors, it works well right up to 80 columns on black background. When there is a significant angular difference between foreground and background, it's pretty ratty at 80, but serviceable at 40.
The two brightest intensities, coupled with the out of spec hi-saturation colors do not render well at 80 either. Watch out for those. I included them in the color space, because they are fine at 32 and below characters per line. Smaller displays and games make use of these resolutions and colors, so why not?
Horizontal resolutions are 8, 16, 32, 40, 64, 80 characters per line. Rows are fixed at 25. Display may be interlaced or not.
obex.parallax.com/objects/550/ Linked as I could find no combination of file name that would permit upload. ?!?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 12/13/2009 11:46:15 AM GMT
Comments
Yup.. Will be spending time here... [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
[noparse][[/noparse]potato_text_36.spin] This post no longer needed. Left for history only.
Driver works out characters per line based on number of waitvids. Two characters per waitvid. Each waitvid is 16 4 color pixels. 40 waitvids would be 80 characters, for example.
Say the desired resolution is 40 characters per line.
40 characters * 8 pixels = 320 horizontal pixels.
320 pixels / 16 = 20 waitvids per line. (2 characters per waitvid)
2560 PLLA cycles per line / 320 pixels = 8 PLLA / Pixel (this is the per pixel value in VCSL)
8 PLLA * 16 pixels = 128 PLLA per waitvid. (this is the per frame value in VCSL)
The settings in the code section are for 64 pixels. Easy enough to do the math and plug in the right values. The only tricky part is vsclactv. Number of PLLA per pixel is '5' in the example code above. Multiply by 16 to get PLLA / waitvid, which is '80' above.
For the display to work, there needs to be an even number of PLLA / pixel, meaning 2560 needs to be evenly divided by whatever your PLLA / pixel value is.
If you want to, the 2560 number can be changed by subtracting from both vsclbp & vsclfp. The total PLLA / scanline needs to be 3192 in any case.
The color buffer isn't used right now. Your display buffer size for text is defined in the screen variable above.
You can set the colors for the text for the entire screen by changing the 'testcolors' long shown in tx_17.spin Only the first and last byte are meaningful right now. White on dark blue is shown. Change 0b to 02 for white on black.
If you uncomment this jmp instruction in 35.spin, you will get a non-interlaced display. Color resolution goes down, largely because the proper phase cycling isn't working in this video driver. I'll get to that one, but I have to study where Eric ended up with his template to sort out where to deal with this. Should still be usable in this mode up to 40 chars however.
Back in potato_text_36.spin, the hardware detect looks like this:
If you need different video pins or clocks, this is where you adjust that, or eliminate the case statement and just code for your board. Set ivcfg, ifrqa, idira to match your pin configuration and or clock speed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 10/11/2009 11:02:15 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/14/2009 1:51:57 AM GMT
A must for me to look at when I have the time !
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Nicely done! The demo looks very clean and readable on my mini LCD TV.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Where am I? Where am I going? Why am I in a handbasket?"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
And a personal SUCCESS!! 80 characters runs great at 96 Mhz. Getting over 64 has been a PITA. Pixel table and character alignment issues fixed now too. Everything displays as it should. Now to work through the features above.
Since this is a 4 color mode driver, I decided what to do with the colors. Waitvid is running at 16 pixels to keep HUB access to a minimum. This means 2 character color cells at anything over 40 characters per line. Right now, it's two characters no matter what. I might not change that depending on feedback over time. Let me know if that's a make or break thing. Below 40, it can be single character cells for color, above is probably not gonna happen.
So then, for each two character cell, the colors will be 00=background, 01=mouse pointer / cursor, 02=even character foreground color, 03=odd character foreground color. Right now, there are three screen colors. Now that the character issues are sorted, I can move on to the color portion of the driver.
This is good right now for a nice 80 column monochrome or two color screen.
Here's an 80 column set of screenies, mono and color @ 96 Mhz. This is standard composite video. No S-video yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/17/2009 7:26:20 AM GMT
I'll give this a checkout ASAP.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Here's a much easier to configure archive, with the fixes mentioned above. You will probably need to locate and encode an 8x8 CP/M compatible font. The Atari one only defines 128 characters. I like it because it saves on HUB memory. No big deal to do the full 256 though. You can set characters per line in the main driver program. Just be sure it's a multiple of 16. No calcs required now.
You set colors in the tx cog, as detailed above. Three colors per screen right now. Background, and one each for the even and odd characters. The color cog will deal with this and the mouse pointer soon.
Because of how the cog workload is shaking out, I plan to let this driver run as either two cogs, mono or two color as shown here, or three cog with 16 color palette and mouse pointer. Just FYI. There will be a mode long that deals with things. Set a few bits, and it will do it's thing.
If anyone has those old Apple ][noparse][[/noparse] style monochrome NTSC screens, now is the time to use them! The modern day alternative is to run the composite on a good TV, or run S-video (requires driver config, I think --I've not done it), or feed the composite into the luma on an S-video display, for monochrome display. My SONY WEGA displays the 80 nicely enough. Displays the monochrome S-video luma bit excellent. I don't have many TV's to test on. A small 7" Zenith from the 80's won't quite render the 80 in either monochrome or color. It lacks newer comb filters...
Somebody has to have a old C= monitor. Let me know what that looks like. I suspect it will be near perfect.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 10:39:34 PM GMT
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The memory map will be as follows:
1. Font Table -- 8bits x 8 bytes per character, up to 256 characters.
2. Mouse pointer table, probably 8x8 as well, though this could be different.
3. Hardware cursor emulation table, same as mouse.
4. Screen memory. One byte per character displayed. This will be up to 80x50 characters, interlaced.
5. Color memory. One byte per two characters displayed. 40x50 max. I may incorporate an alternative code loop that does one character color cells, if the driver is operating at 40 or less characters.
6. Parameter block. Probably 20 longs or so.
Init code can be overwritten by the screen, once the display is up and running. I need to know best practice for doing this at some point.
Max HUB memory foot print will be: 8K Minimum foot print can be perhaps 2K, with a 20x25 display and 128 character font. Average will be about 4K for the display captures shown.
The various bits of HUB memory will be relocatable on a byte level, but for the parameter block. It's long aligned.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 12:49:43 AM GMT
From there, it's PAL, then maybe VGA.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/17/2009 5:16:50 PM GMT
Sorry I haven't had a chance to look at your code, RL is time consuming.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: Forum
NTSC & PAL driver templates: ObEx Forum
OnePinTVText driver: ObEx Forum
learning some cool things studying your code!
- H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
@CounterRotatingProps: Having eeked out a game in this driver's predecessor/relatives (AIGeneric), I would say that unless you are going for a retro game, or are interested in learning from the 'ground up,' you might want to look at the specialized game drivers posted in the Hydra forum, or at least Graphics.spin, and build/change one of those to suit your needs.
Certianly would be exiting to have VGA support! Keep up the great work!
Post Edited (trodoss) : 9/18/2009 3:56:34 AM GMT
(when you do get a moment, I would like to talk about color phase cycling in non-interlaced mode. I'll be tinkering with this in the interim.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
I'll attach a WIP testing archive shortly. Just cleaning up names, comments and such. Attached.
Here's a coupla screenies attached. Some color combos are better than others. Picking a better palette needs to happen. S-video display will significantly improve this. When I get a cable made, I'll upload one of those for comparison. I went ahead and picked better color values for the screen capture.
So, I've got a coupla things I could use some advice on. One is the overall speed and order of operations in the TX COG and Color COG. I'm working on this, and even a little bit of speed up might make either single character color cells possible, or 80 characters @ 80Mhz possible. Any and all suggestions welcome.
My thoughts on that were to get it going, then start to squeeze it. What I really need to know is whether or not the color cell size is going to be useful to people. Deal breaker or not? You guys tell me, and that determines how much re-hacking has to be done.
Right now, I'm going to set the code up so that it operates on run time HUB parameters. That means you init the display driver, then be free to change color palette entries, number of characters per display line, screen memory, and color memory on the fly. These will update during the VBLANK, making for smooth transitions, double buffered text, and color cycling / changes as needed.
This is a 16 color driver. The color memory is one byte per character with the lower nibble being the background color, upper nibble being the character color. One color byte per 2 characters displayed. The actual screen color comes from a palette table to be located in the HUB.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 12/13/2009 11:47:12 AM GMT
One color per 2 characters is not so useful but much better than none. Would be really nice per character, even if the palette were smaller, though I don't think that is the issue. I will try and get some time to look at your cog code.
I presume it is still just NTSC. BTW many (most of the recent 5-10yrs probably can???) of the sets in Australia can do both here even though we use PAL. So is this the same elsewhere?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
(and reduce the glimmer effect?)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
PAL is on the table with this one, as is other things. At the base of this is a simple scan line driver. My intent was to get all the harder stuff sorted, then go back and do, or let others do, scan line drivers for various display devices. I don't think it's a big stretch, given Eric worked through the two templates he did. Not much needs to be done at that layer, which is good.
As far as I know, many PAL regions will also display NTSC. Here, where we have NTSC, almost nothing does PAL [noparse]:([/noparse]
My capture device does PAL though. Good enough to vet the scan line driver.
A bit later today, I'll go back and test the scan line driver to see whether or not it will do 80 waitvids per scanline @ 96mhz. When I originally started down this road, I thought 80 characters at 80 Mhz was going to be possible. I don't think it is. So that's where the two character color cell came from. That cut the waitvids down to 40 per line. That's really the issue. 80 waitvids, with one hub fetch for pixels and one for colors.
Maybe it's a non-issue [noparse]:)[/noparse] I might have built in my own problem here!
I suppose it might run faster IBM style too, where a word per character gets it done. One byte for character value, one for it's colors. Never liked that because then printing simple strings to the screen kind of sucks. At least with the color attribute memory model, string printing and the like are dead simple, and it's easy enough to just ignore the colors and do a two color screen, if HUB memory is tight. I'm leaning toward forgetting the IBM style here.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Baggers would probably know better than I, but I would forget PAL until all else is done.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Perfect! Rock Solid.
Curious, How far can I push non-interlaced mode with a 96mhz or 100mhz?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
The two character color cell has gotta go. [noparse]:)[/noparse]
(With three freaking COG's this must be possible)
The direction I'll go then is two COG driver, two color text only. Three COG text + color attributes and mouse pointer. Anything over 40 characters / line is a bonus @ 80Mhz, and 80 characters / line target @ 96.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
-some display devices do interlace very well. This includes newer non-CRT televisions, and older high-persistence monitors. Also, when running S-video the added vertical resolution should permit 50 characters. I've not coded that yet, but it looks promising. So, where that works, it works very well. My capture device works excellent with it.
-I think some lower resolution devices, like LCD's, might have trouble with that. Non-interlaced is an option for these.
-If somebody ends up doing fast moving text, or does graphics with the fonts, non-interlaced delivers 60Hz display updates for NTSC and 50Hz updates in PAL. Interlaced is half that, and probably unacceptable for those tasks.
I found my large CRT SONY really shows the shimmer. The newer Plasma TV largely eliminates it, due to it's video processing. (cool) My older Zenith lacks comb filters and interlace actually ended up rendering nice 40 character text on that one, which is usually rather smudgy.
There is no difference in the scan line processing in either mode (yet).
Edit: And as Eric pointed out, one can always run mono, non-interlaced and get a very nice display on most screens, shimmer free. 5 text intensities plus inverse, makes for a nice screen. If the color burst is left on, a little bit of color for cursors and such is no big deal either.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/20/2009 1:21:01 PM GMT
Very nice coding
Here is a couple of suggestions for shaving a couple of instructions from·building the scanline tx_22.spin ·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm