Hard-Coded VGA_text Demo, Tiny + Educational
localroger
Posts: 3,452
I recently needed to convert a TV driver I wrote some time back to VGA. I tried using VGA_Learn as a template but it wouldn't always sync my monitor, and small changes would cause it to quit working for reasons I didn't understand. And all the weird calculations at the end of the Parallax VGA.spin left me scratching my head.
So what is attached is a version of the VGA_text_demo which eliminates all those calculations and is entirely hard coded for 640x480 with all default options. This makes it over 600 bytes smaller and much simpler both to interface and understand. I created this by adding debug code to Chip's version which reported the results of all those calculations to a separate display (nice that demoboards have both TV and VGA outputs) and replaced the calculations with hard settings to those values. Then I optimized what was left a bit.
I have more work to do to get the driver I really need, but as-is this is both very small for limited RAM situations and a nice template for understanding how a robust VGA driver actually works, so I thought someone might find it useful.
So what is attached is a version of the VGA_text_demo which eliminates all those calculations and is entirely hard coded for 640x480 with all default options. This makes it over 600 bytes smaller and much simpler both to interface and understand. I created this by adding debug code to Chip's version which reported the results of all those calculations to a separate display (nice that demoboards have both TV and VGA outputs) and replaced the calculations with hard settings to those values. Then I optimized what was left a bit.
I have more work to do to get the driver I really need, but as-is this is both very small for limited RAM situations and a nice template for understanding how a robust VGA driver actually works, so I thought someone might find it useful.
Comments
Have You tested this even with 6.25MHz crystal?
If You give that try. Build one for 6.25 and one for 14.318.180MHz PLLx8.
Most of VGA drivers I used needed some adjustments to Blanking timings.