1 /* Graficke funkcie pre vdt52s */
14 #define PAR(x) ((x) | (128-parity_table[(x) & 0x7f]))
16 #define HIGH_Y(n) (PAR(0x20|(n)))
17 #define LOW_Y(n) (PAR(0x60|(n)))
18 #define HIGH_X(n) (PAR(0x20|(n)))
19 #define LOW_X(n) (PAR(0x40|(n)))
22 unsigned long bytes_sent
= 0;
24 void gflush( t_kanal
*k
)
26 write(1,k
->outbuf
,k
->pos
);
30 void gputc( t_kanal
*k
, char c
)
32 k
->outbuf
[(k
->pos
)++]=c
;
36 #define gputcesc(k,c) {gputc((k),ESC);gputc((k),(c));}
38 void greset( t_kanal
*k
)
43 void gcls( t_kanal
*k
)
50 void gset_scaling( t_kanal
*k
, int xfactor
, int yfactor
)
55 gputc(k
,PAR(0x40|xfactor
));
56 gputc(k
,PAR(0x40|yfactor
));
59 void gset_attrib( t_kanal
*k
, int attrib
)
63 else if( attrib
&GA_XOR
)
67 if( attrib
&GA_PATTERN
)
71 void gsetpos( t_kanal
*k
, int x
, int y
)
74 gputc(k
,HIGH_Y((y
>>5)));
75 gputc(k
,LOW_Y((y
&0x1f)));
76 gputc(k
,HIGH_X((x
>>5)));
77 gputc(k
,LOW_X((x
&0x1f)));
80 void gline( t_kanal
*k
,int x1
,int y1
, int x2
, int y2
)
83 gputc(k
,HIGH_Y((y1
>>5)));
84 gputc(k
,LOW_Y((y1
&0x1f)));
85 gputc(k
,HIGH_X((x1
>>5)));
86 gputc(k
,LOW_X((x1
&0x1f)));
87 gputc(k
,HIGH_Y((y2
>>5)));
88 gputc(k
,LOW_Y((y2
&0x1f)));
89 gputc(k
,HIGH_X((x2
>>5)));
90 gputc(k
,LOW_X((x2
&0x1f)));
93 void gdrawto( t_kanal
*k
,int x
,int y
)
97 gputc(k
,HIGH_Y((y
>>5)));
98 gputc(k
,LOW_Y((y
&0x1f)));
99 gputc(k
,HIGH_X((x
>>5)));
100 gputc(k
,LOW_X((x
&0x1f)));
103 void gplot( t_kanal
*k
,int x
,int y
)
106 gputc(k
,HIGH_Y((y
>>5)));
107 gputc(k
,LOW_Y((y
&0x1f)));
108 gputc(k
,HIGH_X((x
>>5)));
109 gputc(k
,LOW_X((x
&0x1f)));
110 gputc(k
,LOW_X((x
&0x1f)));
113 void gpline( t_kanal
*k
, t_pos
*pos
, int num
)
117 { gputc(k
,HIGH_Y(((pos
[i
].y
)>>5)));
118 gputc(k
,LOW_Y(((pos
[i
].y
)&0x1f)));
119 gputc(k
,HIGH_X(((pos
[i
].x
)>>5)));
120 gputc(k
,LOW_X(((pos
[i
].x
)&0x1f)));
124 unsigned long get_stat(void)
126 unsigned long tmp
= bytes_sent
;