PDA

View Full Version : VGA_Text for ImageCraft C



jazzed
04-29-2008, 03:15 PM
Here is a VGA_Text driver for ImageCraft C. It uses native VGA.spin code binary output defined as an array of longs, and provides C API for using the driver. I didn't bother to run doxygen on this, but the comments are marked up for it.

The only big problem that I can't seem to solve is setting colors for individual characters; maybe someone else can address it as I've kind of given up. Works in 0508 package.

BETA2 overcomes previously listed BETA1 issues.

04/29/08: Prepended vgaText_ to all public API.·C is not oop, so we need unique API function names. If you want the old names use #define ... i.e. "#define str(s) vgaText_str(s)"

04/29/08: Added libvgatext.a to attachments. Library created with cygwin's ar tool. To use this save in your "iccv7prop\lib" directory, and in Project->Options->Target->Additional Libraries text-box,·add "vgatext".

04/30/08: New package with fixes + libvgatext.a now included. Starting multiple cogs with cognewNative works fine.

05/08/08: Added VGA_Text_0508.zip for use with BETA2. Character palette works now.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed

Post Edited (jazzed) : 5/9/2008 1:35:46 AM GMT

simonl
04-29-2008, 04:29 PM
Hey, well done jazzed - this'll make ICC much more useful on the Prop' http://forums.parallax.com/images/smilies/yeah.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,

Simon
-------------------------------
www.norfolkhelicopterclub.co.uk (http://www.norfolkhelicopterclub.co.uk)
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style http://forums.parallax.com/images/smilies/smile.gif

ImageCraft
04-29-2008, 07:44 PM
Jazzed, can you send me test projects for the problem reports? Email me directly for details please.

Thanks for the good work, much appreciated.

// richard

jazzed
04-29-2008, 11:16 PM
I've updated the VGA_Text.zip package with prepended function names.
By the way, please don't forget to put a "while(1);" at the end of main otherwise your program will fail.
I keep forgetting :)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley (http://en.wikipedia.org/wiki/Silicon_Valley)

Traffic is slow at times, but Parallax orders·always get here fast 8)

Rayman
04-30-2008, 01:57 AM
This is great news... I'm starting to get interested in this C compiler now!

jazzed
04-30-2008, 02:57 AM
Added libvgatext.a to first post attachments. When next version of the ICCV7PROP arrives, I'll have to create a new library.

@Rayman, maybe you can look into the per character color problem? I looked at it for days with no luck.
Hopefully we can get custom tile graphics going at some point ... hint, hint (beg, beg) .... :)

@Richard, the enum problem I reported appears to be an array index math problem, enums work fine by themselves.
I've sent you emails on all problems except for the missing memcpy issue which is I'm sure trivial to fix.

I'm off to my next project for saving/running C generated code in my custom 1MB DRAM :)
Of course this won't work if I can't get more than one cog running native code. We'll see.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley (http://en.wikipedia.org/wiki/Silicon_Valley)

Traffic is slow at times, but Parallax orders·always get here fast 8)

Harrison.
04-30-2008, 04:02 AM
Nice work! I spent 6 hours trying to get my version to work (it probably never worked because of that array indexing problem). I was able to point the screen and color pointers to random places in memory to get funky tiles, but I could never get it to display more than 1 readable character....

Time to port the hires vga drivers!

jazzed
05-01-2008, 02:42 AM
Had a small foo-bar in the wordfill routine where a debug bit-toggle was left inside.
Caused me all kinds of pain this morning. Also libvgatext.a is now in the .zip package.

The cognewNative asm function has changed. The original suggested by Richard
did not set the "newcog" bit. I've been able to launch multiple cogs now from LMM :)

I also have DRAM and VGA both running happily in the same embedded application :)
Time to hack the kernel to make it run relocated code from DRAM now.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley (http://en.wikipedia.org/wiki/Silicon_Valley)

Traffic is slow at times, but Parallax orders·always get here fast 8)

ImageCraft
05-01-2008, 04:35 AM
Steve, thanks for your hardwork!!!

We fixed a number of the "mis-features" http://forums.parallax.com/images/smilies/smile.gif you reported. I have just finished a 6+ weeks of grueling multiple professional and personal obligations. Once I catch up with food and sleep, I will see getting code from the devteam and release BETA2 with some of these fixes soonest.

Be aware that the kernel has changed a little already as we optimize @FLOAD and @FSTORE just a little (same code size, but avoiding another trip out of the kernel space...) Swapping code from external device would be really cool. Ideally, you can get things working without new compiler directive, and I hope we won't have to add anything to support overlay, but if it's the best thing to do, email me and we can discuss it.

jazzed
05-09-2008, 09:14 AM
Added VGA_Text_0508.zip to top post. Previous version will be deleted in time. Color palette works now.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
jazzed

simonl
05-09-2008, 08:06 PM
I really must get some time on the Propeller!

Thanks for this jazzed - well done http://forums.parallax.com/images/smilies/smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,

Simon
-------------------------------
www.norfolkhelicopterclub.co.uk (http://www.norfolkhelicopterclub.co.uk)
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style http://forums.parallax.com/images/smilies/smile.gif