.\" ENVIRONMENTS:  TOS
.TH "screen control" "" "" "Technical information"
.PC
.PP
The Atari ST uses the following
escape sequences to control the terminal screen.
These can be passed by the function
.BR Cconout ,
as well as by numerous other output routines,
to manipulate the Atari ST's screen;
\fB<esc>\fR represents the escape character, ASCII 033:
.sp \n(pDu
.nf
.ta 0.4i 1.2i
	\fB<esc>A\fR	Cursor up
	\fB<esc>B\fR	Cursor down
	\fB<esc>C\fR	Cursor forward
	\fB<esc>D\fR	Cursor backward
	\fB<esc>E\fR	Clear screen, home cursor
	\fB<esc>H\fR	Home cursor
	\fB<esc>I\fR	Return to same position on previous line
	\fB<esc>J\fR	Erase to the end of the page
	\fB<esc>K\fR	Clear to the end of the line
	\fB<esc>L\fR	Insert line
	\fB<esc>M\fR	Delete line
	\fB<esc>Y\fR \fIrow col\fR
		Position cursor at \fIrow\fR, \fIcol\fR, which are
		row/column numbers plus 040 (space character)
	\fB<esc>b\fR\fIc\fR	Set foreground color to \fIc\fR
	\fB<esc>c\fR\fIc\fR	Set background color to \fIc\fR
	\fB<esc>d\fR	Erase beginning of display
	\fB<esc>e\fR	Make cursor visible
	\fB<esc>f\fR	Make cursor invisible
	\fB<esc>j\fR	Save cursor position
	\fB<esc>k\fR	Restore cursor position
	\fB<esc>l\fR	Erase a line
	\fB<esc>o\fR	Erase from beginning of line to cursor
	\fB<esc>p\fR	Enter reverse video mode
	\fB<esc>q\fR	Exit reverse video mode
	\fB<esc>v\fR	Wrap text at end of line
	\fB<esc>w\fR	Discard text at end of line
.fi
.sp \n(pDu
For the sequences
.B <esc>b
and
.BR <esc>c ,
the variable
.I c
is the color index plus 040.
In monochrome mode, the color index can be zero or one.
In
medium resolution, it can be zero through three.
In low resolution, it can be one through 15.
.SH Example
The following example
clears the screen and homes the cursor,
then moves the cursor to row 12, column 6 on the screen.
.DM
#include <stdio.h>
.DE
.DM
main()
{
	char row = 12+'\e040';
	char column = 6+'\e040';
.DE
.DM
	printf("\e033E");
	printf("\e033Y%c%c", row, column);
.DE
.DM
	return(EXIT_SUCCESS);
}
.DE
.SH "See Also"
.B
Cconout, gemdos, technical information
.R
