1 |
greg |
1.1 |
#ifndef lint |
2 |
greg |
1.4 |
static const char RCSid[] = "$Id: subr.c,v 1.3 2004/03/28 20:33:13 schorsch Exp $"; |
3 |
greg |
1.1 |
#endif |
4 |
|
|
|
5 |
|
|
#include <stdio.h> |
6 |
schorsch |
1.2 |
|
7 |
|
|
#include "local4014.h" |
8 |
|
|
#include "lib4014.h" |
9 |
|
|
|
10 |
greg |
1.1 |
float obotx = 0.; |
11 |
|
|
float oboty = 0.; |
12 |
|
|
float botx = 0.; |
13 |
|
|
float boty = 0.; |
14 |
|
|
float scalex = 1.; |
15 |
|
|
float scaley = 1.; |
16 |
|
|
int scaleflag; |
17 |
|
|
|
18 |
|
|
int oloy = -1; |
19 |
|
|
int ohiy = -1; |
20 |
|
|
int ohix = -1; |
21 |
|
|
int oextra = -1; |
22 |
schorsch |
1.2 |
|
23 |
|
|
extern void |
24 |
|
|
cont( |
25 |
|
|
int x, |
26 |
|
|
int y |
27 |
|
|
) |
28 |
|
|
{ |
29 |
greg |
1.1 |
int hix,hiy,lox,loy,extra; |
30 |
|
|
int n; |
31 |
|
|
x = (x-obotx)*scalex + botx; |
32 |
|
|
y = (y-oboty)*scaley + boty; |
33 |
|
|
hix=(x>>7) & 037; |
34 |
|
|
hiy=(y>>7) & 037; |
35 |
|
|
lox = (x>>2)&037; |
36 |
|
|
loy=(y>>2)&037; |
37 |
schorsch |
1.3 |
extra=x&(03+(y<<2))&014; |
38 |
greg |
1.1 |
n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; |
39 |
|
|
if(hiy != ohiy){ |
40 |
|
|
putch(hiy|040); |
41 |
|
|
ohiy=hiy; |
42 |
|
|
} |
43 |
|
|
if(hix != ohix){ |
44 |
|
|
if(extra != oextra){ |
45 |
|
|
putch(extra|0140); |
46 |
|
|
oextra=extra; |
47 |
|
|
} |
48 |
|
|
putch(loy|0140); |
49 |
|
|
putch(hix|040); |
50 |
|
|
ohix=hix; |
51 |
|
|
oloy=loy; |
52 |
|
|
} |
53 |
|
|
else{ |
54 |
|
|
if(extra != oextra){ |
55 |
|
|
putch(extra|0140); |
56 |
|
|
putch(loy|0140); |
57 |
|
|
oextra=extra; |
58 |
|
|
oloy=loy; |
59 |
|
|
} |
60 |
|
|
else if(loy != oloy){ |
61 |
|
|
putch(loy|0140); |
62 |
|
|
oloy=loy; |
63 |
|
|
} |
64 |
|
|
} |
65 |
|
|
putch(lox|0100); |
66 |
|
|
while(n--) |
67 |
|
|
putch(0); |
68 |
|
|
} |
69 |
|
|
|
70 |
schorsch |
1.2 |
extern void |
71 |
|
|
putch( |
72 |
|
|
int c |
73 |
|
|
) |
74 |
|
|
{ |
75 |
greg |
1.1 |
putc(c,stdout); |
76 |
|
|
} |
77 |
schorsch |
1.2 |
|