Gratc - a library for C. This library is in directory panoslib, and can be linked with no path name. E.g. "link myprog gratc,c,pas". The routines simulate the usual BASIC instructions available on the I/O processor; however, the coprocessor communicates with the I/O processor by means of files, so at the end close the file with cgrat(). The available functions are: cgrat(); close the graphics file; this must be done last thing. clg(); clear graphics window to background graphics colour. If no window has been set, the whole screen is cleared. cls(); clear text window to background text colour. If no window has been set, the whole screen is cleared. colour(col) set logical text colour to col. If col > 127, the text int col; background colour is set. draw(x,y) draw a line from the current graphics cursor point to the new int x,y; point (x,y). (See "move" below). gcol(a,b) set the graphics colour to b, and the mode of plotting to a. int a,b; Look at the BBC BASIC book for explanations. graorg(x,y) set the graphics origin to (x,y). The origin is at the bottom int x,y; left corner of the screen and is originally (0,0) The normal ranges of coordinates are 0-1279 in x and 0-1023 in y. grawin(x1,y1, x2,y2) set the graphics window. The lower left corner is int x1,y1,x2,y2; at (x1,y1), and the upper right is at (x2,y2). The normal ranges of coordinates are 0-1279 in x and 0-1023 in y. line(x1,y1, x2,y2) draw line from (x1,y1) to (x2,y2) int x1,y1,x2,y2; mode(m) set the screen mode to m (like BASIC "MODE M"). int m; move(x,y) move the graphics cursor to (x,y) int x,y; plot(n,x,y) do the BASIC graphics command PLOTn,x,y. This allows plotting int n,x,y; of a variety of lines, circles parallelograms etc. rectan(x1,y1, x2,y2) plot filled rectangle with opposite corners at int x1,y1,x2,y2; (x1,y1) and (x2,y2). tabs(x,y) move the text cursor to (x,y). Text origin is a the top left int x,y; and y is downwards in lines; x is to the right in characters. trian(x1,y1, x2,y2, x3,y3) draw a filled triangle between the points int x1,y1,x2,y2,x3,y3; (x1,y1), (x2,y2) and (x3,y3). txtwin(x1,y1, x2,y2) define text window; (x1,y1) is the bottom left; int x1,y1,x2,y2; (x2,y2) is the top right. Because y is measured downwards y1 > y2, whereas x2 > x1. vdu(n) BASIC VDU function. Useful values for n are: int n; 4 print characters at the text cursor 5 print characters at the graphics cursor 7 "Bell" sound 8 backspace 9 forward space 10 line feed 11 reverse line feed 13 carriage return 14 page mode on 15 page mode off 20 restore logical colours (see vdu19 below) 26 remove windows 30 move text cursor to home position vdu19(l,p) set logical colour l to physical colour p int l,p; vdu23(n1,n2,...n9) various function depending on n1. if n1 > 31 it int n1,n2,n3,n4,n5; redefines the character n1. E.g. int n6,n7,n8,n9; vdu23(255,60,126,255,255,255,255,126,60) will make character 255 appear as a disc.