PORTFOLIO GRAPHICS ------------------ It's now 2 AM and you have just downloaded this thing called Portfolio Graphics, and you ask yourself the age old question; Just what the heek is the all this stuff? In a nutshell this is a demo program of a graphics driver for the Portfolio. This program allows other programs to do graphics on the Portfolio's LCD display. Program calls can be either from PBASIC or other programming languages. The program allows for lines, circles, boxes, and painting of areas. It is my hope that this will become a standard for graphics, as PGSHOW has become for graphic screens. TERMS ----- (Sorry but this must be done) This version is placed in the Public Domain for your personnel use, but you should feel guilty and get the registered version. Commercial use is prohibited without permission of the author. Feel free to bundle the driver together with this Document with any programs that you may create. Registration Fees ----------------- 5.00 $ Current Version of program, much less memory taken. Driver is faster and uses about 1K of ram. Floppy disk sent, specify size, and PC or MAC type. 15.00 $ Upgraded version of program, more features including filled boxes and circles, multiple filling patterns, etc. Get a disk (see above) and a printed manual. 49.95 $ Professional version, above features plus text on the LCD graphic screen and source code. DISCLAIMER ---------- (once I have to do this) The author assumes no responsibility for any use of this program, and is not responsible for any damages which occur from its use. Files ----- GRDEMO1.EXE A demo of some of the graphic function used. GRDEMO2.EXE Another demo, runs forever. GRDEMO1.PAS Source code. GRDEMO2.PAS More source code. GRDEMO1.BAS Pbasic demo. GRDEMO2.BAS Another Pbasic demo. PORTGR.EXE Graphics driver. P_GR_PC.EXE Graphic which works on PC's, use for development work. Will work on the PORT also, but slower. PORTGR.DOC This document. Good Stuff ---------- We finally get to the heart of the stuff, how to use this program. You should have at least 80k of free ram to use this with PBASIC. The driver will take up about 8K of ram( this a demo version you know). The program has an internal 3K stack which used when painting areas. All calls to the program are done thru Interrupt $5F (95 in decimal), with all values passed thru the registers. All values passed are the same for all calls. The screen coordinates are X= 1 - 240 Y= 1 - 64. Points outside of this region are truncated to the maximum or minimum allowed. Register Value -------- ----- AH Function Call AL Color value, 1= solid pixel 0=blank pixel BH X1 BL Y1 CH X2 CL Y2 DL Radius of circle Results are returned in AL or AX, with BX having any error codes. Error codes: 0= okay 1= Stack overflow during painting - operation not fully carried out Note: if an area being filled has many separate small islands of graphics this error may occur, mainly it means that the program found to many small areas to fill, this should be a rare error Function Comments -------- -------- 0 Version Number - AH= major digit AL= minor digit 1 Graphic Mode - Place screen in Graphic mode 2 Text Mode - Place screen into text mode 3 Plot Point - Set pixel at X1,Y1 to color value 4 Point - AX= color value of pixel at X1,Y1 5 Line - Draw a line from X1,Y1 to X2,Y2 6 Hline - Draw a horizontal line from X1 to X2 on the Y1 position 7 Vline - Draw a vertical line from Y1 to Y2 on the X1 position 8 Box - Draw a box from X1,Y1 to X2,Y2 9 Circle - Draw a circle with center at X1,Y1 with Radius 10 Paint - Fill area with specified color starting at X1,Y1 254 Keypressed - AX= result 0- no keypressed 1- keystroke found 255 Read Key - AL= key pressed AH= scan code Money, bug reports, comments, critics, hate mail, etc. ------------------------------------------------------ Software Done Right the First Time (SDRFT) Mark Reeves 501 Glaive Dr. Durham, NC 27703 919-596-4999 (5-9 PM EST only please) CIS 73677,601 Revision History ---------------- 1.2 Driver with Plot, Point, and line - see DESIGN.ZIP for sample of this 1.3 Circle function added 1.4 Flood fill added 1.5 Flood fill algorithm changed, the program required a large stack just to fill a small area 1.6 Changed flood fill algorithm again, less efficient, but less stack needed. 1.7 Changed flood fill again, placed internal stack checking that will cause the function to abort if stack exceeds 2500 bytes, this allows for about 200 levels of recursion, it will fill most areas, except for some really weird ones. 1.8 Keypress and Readkey added, don't ask why, but they are included. 1.9 Current version, fixed some parameter passing problems.