Package Documentation | "GRAPHICS" package info (3D graph on Plus4!) Version: 2.1
by S\_/S of Plus/4 [FIRE] crew svs.fire@gmail.com
This package was not coded by me. I only "discovered" it after many years and now I'm reverse-engineering it, because it doesn't have any info or instructions. Any contributions from you are welcome!
Files of the package:
graphics.ldr | first loader | gloader1.ldr | relocator and object loader | graphics.obj | code |
Coordinates system
The screen is viewed as a 320*200 (HiRes). When in Multicolor mode, the resolution is half, being each point two pixel long, but coordinates data must be supplied as 320*200.
Contrary to standard O.S., the numbers of coordinates go from -160 to +160 (HiRes) on horizontal, and from -100 to +100 in vertical. This means that point 0,0 is situated in the center of screen.
Positive values are right side in horizontal, and top side in vertical. Thus the bottom right point will be +160,-100.
Being a 3D package, there is of course the 3rd dimension coordinate. It goes from 0 (no depth) to 32767 ($7FFF). Values over 3000 could be not visible (too far, then too small).
Memory
Available user RAM memory is half of normal, about 30Kb. BASIC lines will be located from $8000 and up. Memory under $8000 is not available.
Keywords (for BASIC lines)
Each new command has the arrow symbol as the first character. This is necessary because some new keywords have the same name as standard keywords. New keywords do not work in immediate mode, only in running mode.
Colors
When it is allowed to specify one of the 16 base-colors (0-15), its bright is always set to 7 (lightest).
Keyword | Parameters | Operation | Notes | <-CIRCLE | x,y,z,hr,vr | Draws an ellipse (or a circle) | x,y,z = coordinates of center | hr = horizontal radius | vr = vertical radius | <-COLOR | c | Sets foreground color for next operation | c = color number (0...3) | | | <-CLEAR | | Erases the graphic screen | Graphic area still remain set | | | <-GRAF | b,f | Goes to HiRes screen | b = background color (0...15) | f = foreground color (0...15) | | <-INV | m | Sets invert mode (when overwriting a previous draw /character, color is inverted) (XOR) | m = 0 or even then cancels invert mode
m = 1 or odd then starts invert mode | | | <-DRAW | x,y,z,x1,y1,z1 | Draws a line | x,y,z = start coordinates | x1,y1,z1 = end coordinates | $ instead of any parameter = assumes current position | <-PLOT | x,y,z, | Draws a point | x,y,z = coordinates | | | <-TEXT | b,f | Goes to text screen | b = background color (0...15) | f = foreground color (0...15) | | <-MGRAF | b,c1,c2,c3 | Goes to Multicolor screen | b = background color (0...15) | c1 = 1st color
c2 = 2nd color
c3 = 3rd color | | <-VISTA | x,y | Set the Point of View for 3D graphics (source point of graphic projection) | x,y = start coordinates | | | <-VISTA | no parameter | ??? | | | | <-VISTA
[math function] | (n) | Retrieves result of <-VISTA function | n = | 0 : horizontal
1 : vertical | | <-ARC | x,y,z,hr,vr, sa, ea, sn | Draws a polygon | x,y,z = center coordinates | hr = horizontal radius length
vr = vertical radius length | sa, ea = start/end angle of the arc sector (*) [2*P/360*x] (x = degree). x negative stands for (clockwise angle) sa = 2*P/x (x specifies the number of sides of the polygon) If x=20 you obtain the same resolution than <-CIRCLE | <-GRDUMP | a, b | Prints the graphics screen | a must be 0 or 1 b must be 0-40 | | | <-GRMERGE | ??? | ??? | | | | <-VCHAR | x,y,rf,ts | Prints vertical text on graphic screen | x,y = coordinates (of 40x25 grid);
st = text string | rf = reverse /charset flag: | 0 = set#1 normal
1 = set#1 reverse
2 = set#2 normal
3 = set#2 reverse |
(*) Angle origin coordinates for arc sectors start from a point nn pixels right from the center, when nn is the lengths of horizontal radius), in the same vertical coordinate.
For example: <-ARC 20,30,Z,100,50... arc sector starts from 120,30 (20+100,30), except if you set a different start angle (as "sa" parameter). |
|