148523Sbostic /*- 2*61406Sbostic * Copyright (c) 1985, 1993 3*61406Sbostic * The Regents of the University of California. All rights reserved. 448523Sbostic * 548523Sbostic * %sccs.include.proprietary.c% 622626Sdist */ 722626Sdist 817623Sjak #ifndef lint 9*61406Sbostic static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 06/04/93"; 1048523Sbostic #endif /* not lint */ 1117623Sjak 1217623Sjak #include <stdio.h> 1317623Sjak float obotx = 0.; 1417623Sjak float oboty = 0.; 1517623Sjak float botx = 0.; 1617623Sjak float boty = 0.; 1717623Sjak float scalex = 1.; 1817623Sjak float scaley = 1.; 1917623Sjak int scaleflag; 2017623Sjak 2117623Sjak int oloy = -1; 2217623Sjak int ohiy = -1; 2317623Sjak int ohix = -1; cont(x,y)2417623Sjakcont(x,y){ 2517623Sjak int hix,hiy,lox,loy; 2617623Sjak int n; 2717623Sjak x = (x-obotx)*scalex + botx; 2817623Sjak y = (y-oboty)*scaley + boty; 2917623Sjak hix=(x>>5) & 037; 3017623Sjak hiy=(y>>5) & 037; 3117623Sjak lox = x & 037; 3217623Sjak loy = y & 037; 3317623Sjak n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; 3417623Sjak if(hiy != ohiy){ 3517623Sjak putch(hiy|040); 3617623Sjak ohiy=hiy; 3717623Sjak } 3817623Sjak if(hix != ohix){ 3917623Sjak putch(loy|0140); 4017623Sjak putch(hix|040); 4117623Sjak ohix=hix; 4217623Sjak oloy=loy; 4317623Sjak } 4417623Sjak else if(loy != oloy){ 4517623Sjak putch(loy|0140); 4617623Sjak oloy=loy; 4717623Sjak } 4817623Sjak putch(lox|0100); 4917623Sjak while(n--) 5017623Sjak putch(0); 5117623Sjak } 5217623Sjak putch(c)5317623Sjakputch(c){ 5417623Sjak putc(c,stdout); 5517623Sjak } 56