Graphics Demo and VGA
Sam Schweighart
Posts: 5
In the comments section, it states that the graphics_demo code can be used on a VGA monitor (instead of TV). Which code should I use? I've tried vga.spin with limited success.
Thanks
Sam
Thanks
Sam
Comments
Post Edited (Sam Schweighart) : 2/23/2010 1:51:32 AM GMT
1) There's not enough memory for the bitmap.· You're talking about 3 bytes per pixel and a 640 x 320 bitmap already is over 200K bytes.· You could use external SRAM for a video buffer, but there's not enough I/O pins to run this through the Propeller.· You could make an external video generator that the Propeller just accesses occasionally to write into the buffer, but you'd probably be better off buying an old VGA video card and interfacing a Propeller to its bus.
2) The video hardware can produce 4 8-bit colors per 16-pixel line of a tile and each pixel within the 16-pixel area can be one of the four colors.· If you want more than that, you'd have to generate the video without the use of the specialized hardware and the Propeller isn't really fast enough to do that.
Think what you're asking - 24 bit color bitmapped VGA driver means 24 bits (3 bytes) per pixel. Even for a small VGA display (640x480) that means you need 640*480*3 bytes - about 900kb for a complete display.
The Propeller has 32kb available. That's why Prop drivers tend to be "tile drivers" instead of "bitmap drivers".
Ok, you can save some bytes by fiddling about a bit and "pretending" to support 24 bt colour but actually mapping through a colour palette instead (who ever uses all possible colour combinations on the screen at one time anyway?). But even if you support only 256 different simultaneous colours, that's still 640*480 bytes required - or 300kb.
I wrote a "virtual" bitmnapped driver that allowed you to pretend you had a bitmapped VGA displays up to 1152*864 - but you couldn't simultaneously use all the bits - if you kept writing to more bits without erasing others, eventually you ran out of bits and it just wouldn't draw any more. I use it to simulate vector graphics display - works a treat for some of the old Cinematronics type games.
Ross.
Edit: I see Mike beat me to it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
So, what is the best we will get out of the Prop without resorting to external video hardware? Also, what optional external video hardware has anybody used to really give us a high color style display? (I know the 4D systems can do it with their higher level language support, but are there any others?)
(EDIT: I should clarify, we're only looking at 320x240, like on the PSM and PSB LCDs.)
Bill
If your LCD takes NTSC 120 colors are possible at over 160 pixels. If you use artifacting, 400+ in-spec colors are possible, with double that being possible, if you use the over-saturated colors. Look at the wiki for a screen shot of that I did at 160x96 effective resolution. http://propeller.wikispaces.com/Colors
Some people have used modified video circuits to get more grey shades and or used PWM to do the same, and Eric Ball used all 4 pins in the reference video circuit to get 130 colors, with considerable improvement over the default sets.
Baggers has used external video encoders to get 16 and 24 bit color displays, at a rather high pin cost. Look for PropGFX related threads for info on that.
If your intent is to use a prop for graphics, the lower resolutions, 160 pixels or below horizontally, and either 100 or 200 pixels vertically, offer some nice color options, but will consume the entire Propeller HUB memory space, though not the compute power at all. At higher resolutions, an extra chip will deliver higher color spaces, but the Propeller itself really won't, due to the built in limitations. My NTSC trick relies on that signal format having some limits on color that can be exploited, but only at 160 pixels or lower horizontal.
A Prop dedicated to graphics can still do some compute and I/O, but not in a memory intensive way.
For anything over 160 pixels, with color, it's highly likely to require dynamic display techniques where a bitmap for the whole screen is not maintained. This makes good use of the many cogs to assemble a display right before the display draws it, keeping RAM to a minimum. For GUI / status / indicator / game type displays this actually can work very well. Baggers has a WOLF3D renderer, complete with textures running on the thing, but that's all it will do, besides take a little I/O to allow one to interact with it.
High speed serial memory devices might allow a hybrid display as well. We've not seen a completed project yet, but it's totally possible to contain higher color display elements in one of those serial memory devices, and spool it out as the beam is drawn for all static display elements, using the HUB memory for dynamic ones. If external circuits are used, getting a useful 320 pixel display is probable, given some planning on what gets spooled from the serial device, and what gets drawn from the HUB memory buffer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
But, I think Bill Henning may have a 24-bit driver with a 256 color table...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
What I do have available right now on Morpheus is:
1024x768 with 4 colors out of 256 per pixel, separate palette for each scan line
800x600 with 4 colors out of 256 per pixel, separate palette for each scan line
640x480 with 4 colors out of 256 per pixel, separate palette for each scan line
256x192 with 256 colors per pixel (using 1024x768 XGA timing)
I am planning to release the following drivers for Morpheus later this year:
320x240 with 256 colors per pixel (using 640x480 VGA timing)
400x300 with 256 colors per pixel (using 800x600 SVGA timing)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler Largos - upcoming nano operating system
I rewrote the GRAPHICS demo to output to TV and VGA simultaneously, just to see if I could,
with the idea that there are enough analog TVs and VGA monitors in the rubbish to be useful
with the Propeller at any time.
The limitations of my mod demo is that I did not go so far as to define similar colors for
both screens, so I had to choose the closest color values for similar results which is not
an easy task since the color codes work very differently for both kinds of display.
This is what I have done.
http://forums.parallax.com/showthread.php?p=872107