The tile structure is the same in both TV.spin and VGA.spin Configure a VGA.spin display with X tiles and Y tiles. Once you've done that, simply use graphics.spin the same way you would for the TV.spin driver. Graphics.spin just wants to know where the screen is and how many tiles it has. (gr.setup)
From there, it's just going to draw pixels to the HUB.
You will want to assign VGA colors to the palettes instead of the TV colors.
**If you have trouble making that work, post here and I'll go dig up my sample code when I am home.
There isn't enough hub RAM for a large bitmapped screen buffer. The biggest is about 512 x 384 which is why you find 512 x 384 pixel graphics objects / drivers in the ObEx. Mikronauts has a modified VGA graphics driver that uses external parallel SRAM for a larger screen buffer.
That's pretty slick! I found the stretch one direction, just not the other.. What's the other scaling factor setting?
vgaparams long 0 'status
long 1 'enable
long %010_111 'pins
long %0011 'mode
long 0 'videobase
long 0 'colorbase
long x_tiles 'hc
long y_tiles 'vc
long 2'1 'hx
long 1 'vx
long 0 'ho
long 0 'vo
long 512 'hd
long 32'16 'hf
long 96 'hs
long 48 'hb
long 380 'vd
long 11 'vf
long 2 'vs
long 31 'vb
long 20_000_000 'rate
If nobody posts it, I'll take a whack at stretching it to fill the screen tomorrow...
I've done this for the 3.5" touchscreen driver (based on the VGA driver) already to make graphics fill the screen...
The VGA demo from the link above does not work with my picky VGA monitor, so I modified it with my prefered VGA settings.
To get a full screen I reduced the Y tiles to 10 and increased vx to 3, so the monitor sees 640x480 pixels with 60Hz. The real resolution of the bitmap in memory is 256 x 160 with 4 colors per tile, so each bitmap buffer needs only 10kBytes.
I had a little sync trouble too, but I got it to run on 2 different monitors at full screen by playing with vd and vb: Graphics_Demo_VGA.spin
I had forgotten that the VGA driver doesn't run at 640x480, but a special resolution...
This might work better to use one of the other drivers that does real 640x480 output...
Andy, I tried yours at it also works on both of my monitors although top and bottom look cut off.
If people tell me this version works, I'll take a stab at fixing up the colors.
Doesn't look like any attempt was made to pick the right colors.
It's not going to look as good as the TV version due to reduced palette, but it can be a whole lot better than this one...
Yes, my version cuts a bit of the graphic at top and bottom, because it has only 160 pixels Y resolution instead of 192. This can be adjusted by moving and scaling the graphics content, but I think Bean does not want the graphics demo, he needs an example of how to use the graphics driver with VGA, so I don't put any work in scaling and color changes.
Thanks Andy and Rayman.
Both version look good.
I need to use the vector fonts on a VGA monitor and it looks like both version will work for that.
I assume Andy's version uses less memory since it only has 160 lines.
Comments
The tile structure is the same in both TV.spin and VGA.spin Configure a VGA.spin display with X tiles and Y tiles. Once you've done that, simply use graphics.spin the same way you would for the TV.spin driver. Graphics.spin just wants to know where the screen is and how many tiles it has. (gr.setup)
From there, it's just going to draw pixels to the HUB.
You will want to assign VGA colors to the palettes instead of the TV colors.
**If you have trouble making that work, post here and I'll go dig up my sample code when I am home.
Does anyone know of any code that uses "graphics" with VGA ?
Something I could borrow from...
Bean
http://forums.parallax.com/showthread.php?114646-Alert-All-Propellerheads-without-TV-ports-Graphics.spin-with-a-VGA-monitor!
This was the code I had archived at home.
But it is a starting point...
Thanks
Bean
Jeff
I've done this for the 3.5" touchscreen driver (based on the VGA driver) already to make graphics fill the screen...
Jeff
To get a full screen I reduced the Y tiles to 10 and increased vx to 3, so the monitor sees 640x480 pixels with 60Hz. The real resolution of the bitmap in memory is 256 x 160 with 4 colors per tile, so each bitmap buffer needs only 10kBytes.
Andy
Graphics_Demo_VGA.spin
I had forgotten that the VGA driver doesn't run at 640x480, but a special resolution...
This might work better to use one of the other drivers that does real 640x480 output...
Andy, I tried yours at it also works on both of my monitors although top and bottom look cut off.
If people tell me this version works, I'll take a stab at fixing up the colors.
Doesn't look like any attempt was made to pick the right colors.
It's not going to look as good as the TV version due to reduced palette, but it can be a whole lot better than this one...
Yes, I saw the same issue on Andy's.
Jeff
Andy
Both version look good.
I need to use the vector fonts on a VGA monitor and it looks like both version will work for that.
I assume Andy's version uses less memory since it only has 160 lines.
Thanks again guys, you're the best.
Bean