xref: /csrg-svn/old/lib2648/sync.c (revision 11494)
1*11494Sralph /*	sync.c	4.1	83/03/09	*/
2*11494Sralph /*
3*11494Sralph  * Make the screen & screen mode look like what it's supposed to.
4*11494Sralph  *
5*11494Sralph  * There are two basic things to do here, put the _pen
6*11494Sralph  * in the right place, and make the line drawing mode be right.
7*11494Sralph  * We don't sync the cursor here, only when there's user input & it's on.
8*11494Sralph  */
9*11494Sralph 
10*11494Sralph #include "2648.h"
11*11494Sralph 
12*11494Sralph sync()
13*11494Sralph {
14*11494Sralph 	if (_supx != _penx || _supy != _peny) {
15*11494Sralph 		escseq(ESCP);
16*11494Sralph 		outchar('a');
17*11494Sralph 		motion(_supx, _supy);
18*11494Sralph 	}
19*11494Sralph 	if (_supsmode != _actsmode) {
20*11494Sralph 		escseq(ESCM);
21*11494Sralph 		switch (_actsmode = _supsmode) {
22*11494Sralph 		case MX:
23*11494Sralph 			outchar('3');
24*11494Sralph 			break;
25*11494Sralph 		case MC:
26*11494Sralph 			outchar('1');
27*11494Sralph 			break;
28*11494Sralph 		case MS:
29*11494Sralph 			outchar('2');
30*11494Sralph 			break;
31*11494Sralph 		}
32*11494Sralph 		outchar('a');
33*11494Sralph 	}
34*11494Sralph }
35