/* vt220-rops,v 1.2 1994/05/26 21:02:41 me Exp */

/*
 * This file is part of the Emu system.
 *
 * Copyright 1990 by PCS Computer Systeme, GmbH. Munich, West Germany.
 * 
 * Copyright 1994 by Jordan K. Hubbard and Michael W. Elbel
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL PCS, THE AUTHORS, OR THEIR HOUSEPETS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SO DON'T SUE US.
 * THANK YOU.
 */

/*
 * Reverse operation definitions for the emu "vt220" terminal.
 *
 * Author: Michael Elbel, Jordan Hubbard and Tom Bagli
 * Date: June 28th, 1990
 * Description: Various things a vt220 might be expected to output
 *		plus the rops for initializing the canvas and tty for
 *		a vt220.
 *
 * Revision History:
 *
 * vt220-rops,v
 * Revision 1.2  1994/05/26  21:02:41  me
 * New copyright
 *
 * Revision 1.1.1.1  1994/05/22  11:22:42  me
 * Initial import into CVS
 *
 * Revision 1.4  93/08/09  17:06:59  me
 * Color changes by Avishai Yacobi
 * 
 * Revision 1.3  92/10/16  16:59:22  me
 * More fixes by Steve Crooks
 */

*term.vt220-rops:							\
ROP_INSERT_CHAR		<%gA%c>						\
ROP_SCREEN_SIZE		<\\E[%gy%d;%gx%dS>				\
ROP_CURSOR_POS		<\\E[%{gy,1,+,d};%{gx,1,+,d}R>			\
ROP_PRIMARY_DA		<\\E[?62;1c>					\
/* ROP_SECONDARY_DA	<\\E[\\>1;9;0c>	*/				\
/* Kludge alert: \\> doesn't work, we get a stack underflow */		\
/* I thik it's interpreted as greater comparison. */			\
/* Jordan gotta fix this */						\
ROP_SECONDARY_DA	<\\E[%{62 c}1;9;0c>				\
ROP_ANSWERBACK		<Hello, world! -%{62 c}->			\
ROP_TERM_STATUS		<\\E[0n>					\
ROP_PRINTER_STATUS	<\\E[?13n>					\
ROP_UDK_STATUS		<\\E[?20n>					\
ROP_KEYBOARD_STATUS	<\\E[?27;0n>					\
									\
/* Setup stuff */							\
									\
/* Request to initialize the emulation				*/	\
/* Initialize the tty to get the state from the caller		*/	\
/*								*/	\
/* Initialize the canvas:					*/	\
/* Preset G0 to be ASCII, G1 to be Graphics,			*/	\
/* G2 to be DEC Supplementary and G3 to be UK national;		*/	\
/* Add Translations 2 (Numeric Keypad), 4 (Normal Cursor Keys),	*/	\
/*     5 (Function Keys), 6 (misc Function Keys)		*/	\
/*     7 Umlaute and 8 (the Compose Key stuff);			*/	\
/* Set the FLUT to contain ASCII in the lower half 		*/	\
/*     and DEC supplementary characters in the upper half	*/	\
/* Set the restore cursor (DECRC) state in case a DECSC isn't   */	\
/*     done before it's used					*/	\
/*								*/	\
/* IF we have more than 2 colors				*/	\
/* Initialize colors 1 to 8 to be 				*/	\
/*       1 black						*/	\
/*       2 red							*/	\
/*       3 green						*/	\
/*       4 yellow						*/	\
/*       5 blue							*/	\
/*       6 magenta						*/	\
/*       7 cyan							*/	\
/*	 8 white						*/	\
/* both on background and foreground				*/	\
/*								*/	\
ROP_INIT_CANVAS		<%{						\
			"ascii" p0 "graphics" p1			\
			"supplemental" p2 "uk" p3			\
			0 p5, 2 p6					\
			"numKeypad" pa OP_OVERRIDE_TRANSLATIONS C	\
			"normCKeys" pa OP_OVERRIDE_TRANSLATIONS C	\
			"fkeys" pa OP_OVERRIDE_TRANSLATIONS C		\
			"miscFkeys" pa OP_OVERRIDE_TRANSLATIONS C	\
			"composeKeys" pa OP_OVERRIDE_TRANSLATIONS C	\
			"multiKeys" pa OP_OVERRIDE_TRANSLATIONS C	\
			"ascii" pa  32 pb OP_CHANGE_FLUT C		\
			"supplemental" pa 160 pb OP_CHANGE_FLUT C	\
			g5 g6 pm pn					\
			g0 g1 g2 g3 po pp pq pr				\
			0 ps 0 pt 0 pu 					\
			0 pF						\
			OP_CANVAS_DISPLAY_CELLS C ga 2 = ! ?		\
                           1 pa "black" D pb pc OP_SET_CIT_CELL C	\
                           2 pa "red" D pb pc OP_SET_CIT_CELL C		\
                           3 pa "green" D pb pc OP_SET_CIT_CELL C	\
                           4 pa "yellow" D pb pc OP_SET_CIT_CELL C	\
                           5 pa "blue" D pb pc OP_SET_CIT_CELL C	\
                           6 pa "magenta" D pb pc OP_SET_CIT_CELL C	\
                           7 pa "cyan" D pb pc OP_SET_CIT_CELL C	\
			   8 pa "white" D pb pc OP_SET_CIT_CELL C	\
			;						\
			}>
