Flexible VGA Bitmap Driver! 2 Color Version Done! 4 Color Version Done!
Kye
Posts: 2,200
Hey guys,
I've finished the flexible 2 and 4·color vga·bitmap drivers I was talking about.
The drivers·pretty much give all·you·need to being to build a display driver library. Included with it are also·functional (slow) spin examples on how to draw characters on screen and how to draw pixels.
I've also managed to make the drivers have a flexible display resolution so that you can expand or shrink the size of the display very·easily.·There are 144-192 different resolutions·ready to choose from. You can have a display that is the size of one long if you want with only 32-16 pixels. Or if you need more space 320 x 240 is a great resolution that takes up only·1/4th-1/2th of the internal memory.
The drivers keeps things simple with only 2-4 colors for the whole screen at once. While this is limited you can use this driver for graphing or ploting stuff very easily.
I also optimized the vertical refresh timing in the asm code so that you can get the driver to do other stuff while it is vertical refreshing. So if you want the display drivers to also make some sprites on screen you have plently of time during the vertical refresh to get it to do so.
Anyway, enjoy the included demo! And play arround with the character scaling feature.
This code will also be up in obex.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 11/2/2009 1:29:32 PM GMT
I've finished the flexible 2 and 4·color vga·bitmap drivers I was talking about.
The drivers·pretty much give all·you·need to being to build a display driver library. Included with it are also·functional (slow) spin examples on how to draw characters on screen and how to draw pixels.
I've also managed to make the drivers have a flexible display resolution so that you can expand or shrink the size of the display very·easily.·There are 144-192 different resolutions·ready to choose from. You can have a display that is the size of one long if you want with only 32-16 pixels. Or if you need more space 320 x 240 is a great resolution that takes up only·1/4th-1/2th of the internal memory.
The drivers keeps things simple with only 2-4 colors for the whole screen at once. While this is limited you can use this driver for graphing or ploting stuff very easily.
I also optimized the vertical refresh timing in the asm code so that you can get the driver to do other stuff while it is vertical refreshing. So if you want the display drivers to also make some sprites on screen you have plently of time during the vertical refresh to get it to do so.
Anyway, enjoy the included demo! And play arround with the character scaling feature.
This code will also be up in obex.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 11/2/2009 1:29:32 PM GMT
spin
61K
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
This is nicely commented and organized code. Thanks for sharing!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
For the color constants in the engine, I'm curious about why you call the bit combination $FC = %11_11_11_00 (w/the last 2 bits as·"don't care")·by the name·"Light_Grey" as opposed to "white."· Is that because it's not fully white?· That is, thought of in a 24-bit RGB context (which it's not, of course), perhaps·it's·kind of analogous to %11000000_11000000_11000000·rather than·%11111111_11111111_11111111.· Of course the actual VGA circuit only combines 2 bits per color channel.· I don't have any real idea how the standard circuit for the VGA resistor network converts a %11 for a particular color channel.· Perhaps it doesn't fully "saturate" things in terms of voltage.
Anyway, perhaps the short answer will be, "I called it 'Light_Grey' because that's how it looked on my monitor," which is fine if that's the case.· In my case, however, that particular color choice ($FC)·causes my ViewSonic monitor to "freakout" (give out-of-range warnings, etc.) so I can't actually view that color.· That is, while perhaps it's off-white on yours, perhaps it's too "hot" for my monitor.· Maybe the voltage is too high (or "oversaturated," though that's probably an NTSC TV word).· Incidentally, I did use 1% resistors when making the VGA network.· At any rate, the other colors work fine, so that hasn't stopped me from learning and having fun.· Thanks for your hard work and contribution to the forum.· --Jim
Post Edited (JRetSapDoog) : 11/3/2009 10:04:51 PM GMT
Hah! If the color is giving your monitor out of range warnings then it is definately your hardware.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
I doubt that. I suspect his monitor is just complaining that you are ramming _way_ out of spec signals down its throat. Remember that VGA colour signals are designed for 0-0.7v from black to full saturation. Jamming 3.3v into them from a propeller pin is driving them somewhat past their designed limit.
So it's not the fault of your driver, but it's likely related to the way most people seem to hook VGA monitors up to the propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
@Peter, try character scaling with the value of zero. You then·get characters that·are 4 pixels by 2 pixels. I find that character scaling with values of 3 works great since it produces text that are 8 pixels by 16 pixels.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (JRetSapDoog) : 11/4/2009 4:17:24 PM GMT
I wrote this driver actually so I could dump raw data from a camera onto the screen, and view signals like on a scope.
Using double buffering most of this stuff should be doable in spin at arround 15FPS which is pretty good. Since you can change the size of the display buffer very easily it is very possible to double buffer with a small display and still have some ram.
...
And if you like the driver give it a review so everyone else knows! 5 Stars please .
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Your little code packages just seem to get better and better. I was wondering, do you have a website or a location where you could package them all up for download. I have this idea that some time in the future I'll think; 'I need to do x, I'll bet Kye has some code to do that'. Rather than search through the forum...
Cheers, James Moxham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/build
But no website for now.
Oh, I'll be making a high speed serial driver soon for 2MBs full duplex communication. It will use one cog to receive and one to transmit and I'll make it compatible with my current serial driver.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,