Enclosed is some example code to help you get started with VP applications, or maybe provide a few enhancements to some of you who are already seasoned.

New version changes at the end of this file.

de.inc and de.asm are like a library code module. They contain routines to set up the AVE and application window, manage events and cycling processes, embed 16-bit compressed graphics, and draw graphics and text. Though I believe all of these routines are correct and reasonably optimized for size, I should point out that this is my first VP code (after two DE games that were written in C). Please let me know if you find any errors, improvements, or suggested additions.

Contents:
readme.txt - this file
de.inc - equates and structures
de.asm - system code modules
test.asm - example program using the de system code
test.00 - executable test program
testimg.inc - compressed bitmap data created with cnv16
heart.png - image used to produce testimg.inc
build.bat - DOS batch file to compile the example program. Call from your editor, or DOS prompt.
run.bat - DOS batch file to run the example program.
start.asm - skeleton/template starting file for new apps

showfonts.asm - another example program, which shows the fonts resident in intent
showfonts.00 - executable

cnv16.c - C source to the cnv16 tool
cnv16.scr - intent batch to compile and install cnv16 (type "source cnv16.scr" from the test directory)

Permission is granted to use this code in your own applications, commercial or otherwise. Please consider releasing any enhancements or useful routines of your own back into the Amiga community so that we may all benefit.

Improvements/fixes since first version (Thanks Marko):

Sound support added for playing simple sound effects.

AppOpen, AppClose, and GetEvent were converted to register passing rather than [gp] use.  Register passing overhead in VP is not as significant as I originally thought, and in many cases just keeping some pointers around in registers will be more efficient than having to access memory through [gp] to get them.  I am not exactly sure where this tradeoff occurs, but making the change saved memory in the example programs included in the archive, and the decision on what to store in [gp] memory versus what to pass through the rest of the application by registers is now left to the programmer.  Feel free to allocate and store any such pointers in [gp] space yourself if you find that more convenient or more efficient.

The Text... routines can now be used in one of two ways, depending upon the value of the conditional flag FONT_POINTERS in de.inc.  When clear [default], the de.asm code maintains the current 'active' font in the [gp] record, and the application does not need to deal with any font object pointers.  However, if your app uses multiple fonts simultaneously, or you just find it preferable to control the font pointers yourself, that is now supported by setting FONT_POINTERS=1.

"start.asm" file added.  This is a basic skeleton app, which doesn't do anything but serve as a starting template.

Showfonts contained forgotten kludges to use TextPrint without having opened fonts with TextFont, and as such was a poor example.  The offending code was replaced with standard AVE calls since the application doesn't really fit the usage of the Text... library code.  (It would be rare to open sequential fonts like this in a real world application though).

John Harris
john@pulsarinteractive.com
