static char sccsid
[] = "@(#)open.c 4.1 (Berkeley) %G%";
* Displays plot files on a AED512 graphics terminal.
char dbuf
[BUFSIZ
]; /* Used to buffer display characters */
struct sgttyb sgttyb
; /* Used to save terminal control bits */
curx
, cury
; /* Current screen position */
int xbot
, ybot
; /* Coordinates of screen lower-left corner */
int scale
; /* The number of pixels per 2**12 units
* The following is the color map, containing reg, green, and blue
* values for color locations 0 and 1.
static int colors
[] = {200, 200, 200, 0, 0, 125, 125, 0, 0, 125, 0, 0};
/*---------------------------------------------------------
* Openpl initializes the graphics display and clears its screen.
* The display is re-initialized and the file is remembered for
* use in all subsequent calls to this module. The display's
* color map is reset. The display is put into raw mode, but
* the previous mode bits are saved.
*---------------------------------------------------------
/* First, grab up the display modes, then reset them to put it
* into cooked mode. Also, lock the terminal.
(void) gtty(fileno(stdout
), &sgttyb
);
sgttyb
.sg_flags
= (sgttyb
.sg_flags
& ~(RAW
| CBREAK
)) | EVENP
| ODDP
;
(void) stty(fileno(stdout
), &sgttyb
);
/* Save the file pointer around for later use, then output an
* initialization string to the display. The initialization
* string resets the terminal, sets formats, clears the display,
* initializes the read and write masks, and sets the color map.
fputs("\33\33G1HHHN[00LFFCFFMFFFFFFFF", stdout
);
fputs("^15060AL", stdout
);
curx
= cury
= xbot
= ybot
= 0;