VGA_HiRes_Text has me stumped
Electrodude
Posts: 1,665
I'm trying to modify VGA_HiRes_Text so that I can control the color of every character individually instead of being stuck with one color per line. I'm making a codewars game involving Funge-98 and the tile drivers can't fit enough characters on the screen. I need 128x32 characters (half the screen), which this driver can already do. However, I need to be able to have at least five different background colors for each character: no-man's land, blue territory, yellow territory, blue IP, and yellow IP. I got the driver to change color every four lines instead of every 12, but I can't get it to do the colors how I need it to. I'm also considering just using a tile driver and making the tiles smaller. I wouldn't mind using two more cogs for the VGA_HiRes_Text driver, but I would mind using a normal tile driver because they don't have enough tiles and usually use too many cogs. Am I wasting my time or is it possible?
Thanks,
Electrodude
Thanks,
Electrodude
Comments
BTW did you download and read AN004-GUI-StartVGA-v1.0_0 ?
http://forums.parallax.com/showthread.php?122305-VGA-colour-and-VT100-objects
have you tried this already?
I don't know if it's able to do 128x32 as well, but it should support attribute per single char.
To do what you are asking the cog would have to read both character and color information to build the waitvid instructions for the next line. I'm pretty sure that would take more than one scan line to do, so you'd need more than 2 cogs. I did some work on VGA drivers earlier this year (and made a 3-cog driver that does 18 rows of 40 columns using the ROM font, with individual character colors and user defined expansion characters. For the character and color density you're seeking I suspect you would need 4 cogs using a HiRes_ style scheme with each cog writing the code to generate its next scan line.
What I can tell you is that the first thing the PASM program does is to relocate itself to the highest area of the cog ram and then writes a group of "waitvid x,scanbuff+0" and "shr scanbuff+0,#8" instructions to the low memory addresses of the cog. The number of instructions is the same as the number of columns. The two cogs are synchronized. While one is creating the next scan line the other one is displaying the scan line it already created. I am not sure it would be possible to synchronize cogs so that one could produce the first half of a scan line and the other one the last half of the scan line. I have a feeling you would end up with an artifact down the center of the display.