113356Ssam #ifndef lint 2*31862Smckusick static char sccsid[] = "@(#)subr.c 4.2 (Berkeley) 07/15/87"; 313356Ssam #endif 413356Ssam 513356Ssam #include <stdio.h> 613356Ssam float obotx = 0.; 713356Ssam float oboty = 0.; 813356Ssam float botx = 0.; 913356Ssam float boty = 0.; 1013356Ssam float scalex = 1.; 1113356Ssam float scaley = 1.; 1213356Ssam int scaleflag; 1313356Ssam 1413356Ssam int oloy = -1; 1513356Ssam int ohiy = -1; 1613356Ssam int ohix = -1; 1713356Ssam int oextra = -1; 1813356Ssam cont(x,y){ 1913356Ssam int hix,hiy,lox,loy,extra; 2013356Ssam int n; 2113356Ssam x = (x-obotx)*scalex + botx; 2213356Ssam y = (y-oboty)*scaley + boty; 2313356Ssam hix=(x>>7) & 037; 2413356Ssam hiy=(y>>7) & 037; 2513356Ssam lox = (x>>2)&037; 2613356Ssam loy=(y>>2)&037; 27*31862Smckusick extra=(x&03)+((y<<2)&014); 2813356Ssam n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; 2913356Ssam if(hiy != ohiy){ 3013356Ssam putch(hiy|040); 3113356Ssam ohiy=hiy; 3213356Ssam } 3313356Ssam if(hix != ohix){ 3413356Ssam if(extra != oextra){ 3513356Ssam putch(extra|0140); 3613356Ssam oextra=extra; 3713356Ssam } 3813356Ssam putch(loy|0140); 3913356Ssam putch(hix|040); 4013356Ssam ohix=hix; 4113356Ssam oloy=loy; 4213356Ssam } 4313356Ssam else{ 4413356Ssam if(extra != oextra){ 4513356Ssam putch(extra|0140); 4613356Ssam putch(loy|0140); 4713356Ssam oextra=extra; 4813356Ssam oloy=loy; 4913356Ssam } 5013356Ssam else if(loy != oloy){ 5113356Ssam putch(loy|0140); 5213356Ssam oloy=loy; 5313356Ssam } 5413356Ssam } 5513356Ssam putch(lox|0100); 5613356Ssam while(n--) 5713356Ssam putch(0); 5813356Ssam } 5913356Ssam 6013356Ssam putch(c){ 6113356Ssam putc(c,stdout); 6213356Ssam } 63