VGA Font
I have the Propeller program for my mill switched from TV to VGA and everything is working great.· However, sometimes it is necessary to display quite a bit of data on the monitor, especially when Autorunning, and the screen gets a bit crowded.· Is there an easy way to reduce the font size to perhaps 75 or 50 percent of its present size?· I can live with the present size but it would be nice to be able to avaid the "wrap arounds" I sometimes get.
Thanks
Sid
Thanks
Sid
Comments
I ran into that as well while working on my mp3 player screens. I ended up switching to the VGA_Hires_Text driver, which gave me the option of 3 different res's.
Maybe, if you have space, you can use that driver, and switch between the different modes as needed. You would have to reserve enough space for the biggest res you select, but, after that, it's a matter of changing the prams, stopping and restarting the video driver.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd
·
text.start(16,800,600,%%0020_3300,%10)
and it seemed to accept that OK, but then the program was looking for a different expression instead of text.out and text.str.
Thanks
Sid
First off, you need to·copy the following lines from the demo into your·CON section.
Next, you need to make sure the program is running fast enough.· The demo lines uses the following, so if what you have is slower, you should update it.· This also goes into the CON section:
Next, you should use a var for the screen buffer, this way it's not hard coded (you have 800 as the pointer to the screen buffer.· The demo uses the following line, and it does work, and also requires these additional lines in the VAR section:
Now that setup is complete, you can init the driver.· As a best method suggestion, use the VARS and not hard coded values.· Once this line is excuting, the vga driver should be up and running, and now it's time to insert some code to put stuff on the screen!· This code goes into your main starting routine:
You should note, I change the obj name to text, which is what you have in your code.· You should have noticed by now there are no routines called .out or .string or anything!· This is blank driver.· You (or someone else or I for that matter), have to supply the methods needed to get from here to there.· In my app, I included the color init code, (Ya, I don't like green, but I haven't had the gumpshion to figureout how to change the colors to something neat like the default colors on the vga_text demo of blue back with white letter.. (anyone... wink, wink, poke, poke , knudge, knudge, hint, hint, clue, clue).· I included this code right after the start line.
·Now this is where it gets fun and interesting.· The video buffer, the var screen, holds the array that represents the display.· Your current configuration of the vga_hires_text will determin the size screen you have, and at that, the X & Y dimensions of the screen.· This information is ready for your methods to use.· If I were to do it again, I'd put the methods in the vga_hires_text file and not my application, but you have the option of either.· TO·put a byte onto the display, you only need to calculate it's byte offset from Screen[noparse][[/noparse]0], then set that byte to the charactor you want to disply.· For example, to put a "A" on the display·at the 3·row down, 5th col across, would use the following:
At this point, you can see how it would be easy to create a method for outputting a string of chars to the X & Y cords you want:
You would call the above method with:
You can see how this was taken directly from the vga_text demo, and applied here.· The above code does NOT take into accout screen wraps or new lines.· And I should also note, I did all of this from memory, at the office, while still trying my first cup of coffee.· That means you may need to do some editing here!· This is just one code segment.· THere are quite a few other you could incorptate into the driver, simulating the same code layout and functionality·as·in the vga_text driver.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd
Post Edited (Kaos Kidd) : 7/21/2006 4:34:35 PM GMT