REM ************************************************************
REM *********  C C P M S C R N . D E F  Ver  1.0   *************
REM *********        M2CBASIC TM    Ver 1.4        *************
REM *********        For IBM PC with CCP/M         *************
REM *********        ALL RIGHTS RESERVED           *************
REM *********             07-21-84                 *************
REM ************************************************************

REM These functions may be included during compile time to control
REM video attributes. With minor exceptions, the escape sequences 
REM are a superset of those required by a DEC model VT-52 CRT.
REM If your system video attributes are different than the IBM
REM simply replace the ASCII codes with the ones recomended by
REM your hardware manufacture. If you are going to compile
REM you program for PC-DOS enviroment you should use the
REM PCSCRN.DEF  and the  PCSCRN.L86  files supplied by DRI
REM with the CBASIC Compiler Ver 2.1 for DOS.
REM To implement this system put at the top of your file
REM %INCLUDE CCPMSCRN.DEF to include these functions
REM in your program. If you have a common statment in your
REM program you should put the %INCLUDE after that statment.
REM An example of clearing the screen would be    CALL CLS
REM An example of cursor addressing would be   CALL SETCUR(10,10)


\	******************************************
\	*  SET CURSOR TO POSITION - ROW, COLUMN  *
\	*  ROW and COLUMN are relative to ZERO   *
\	******************************************

    def SETCUR (ROW%, COL%)
	integer SETCUR, ROW%, COL% 
        row% = row% + 32
        col% = col% + 32
        print chr$(27) + "Y" ; CHR$(row%) ; CHR$(col%);
	fend


\	**************************************
\	*  HOME CURSOR TO UPPER LEFT CORNER  *
\	**************************************

    def HOME 
	integer HOME
        print chr$(27) + "H";
	fend


\	*************************
\	*  CLEAR ENTIRE SCREEN  *
\	*************************

    def CLS 
	integer CLS
        print chr$(27) + "E";
	fend


\	*****************************
\	*  MOVE CURSOR UP ONE LINE  *
\	*****************************

    def UPCUR 
	integer UPCUR
        print chr$(27) + "A";
	fend


\	*******************************
\	*  MOVE CURSOR DOWN ONE LINE  *
\	*******************************

    def DWNCUR 
	integer DWNCUR
        print chr$(27) + "B";
	fend


\	**********************************
\	*  MOVE CURSOR RIGHT ONE COLUMN  *
\	**********************************

    def CUR.RT 
	integer CUR.RT
        print chr$(27) + "C";
	fend


\	*********************************
\	*  MOVE CURSOR LEFT ONE COLUMN  *
\	*********************************

    def CUR.LT 
	integer CUR.LT
        print chr$(27) + "D";
	fend


\	********************************************
\	*  INSERT NEW LINE AND SCROLL SCREEN DOWN  *
\	********************************************

    def ADDLINE 
	integer ADDLINE
        print chr$(27) + "L";
	fend


\	*******************************************************
\	*  ERASE FROM CURRENT CURSOR POSITION TO END OF LINE  *
\	*******************************************************

    def ERAEOL 
	integer ERAEOL
        print chr$(27) + "K";
	fend


\	*******************************************
\	*  ERASE FROM NEXT LINE TO END OF SCREEN  *
\	*******************************************

    def ERAEOS 
	integer ERAEOS
        print chr$(27) + "J";
	fend


\	*******************************
\	*  ERASE TO BEGINNING OF LINE *
\	*******************************

    def ERABOL 
	integer ERABOL
        print chr$(27) + "o";
	fend


\	****************
\	*  DELETE LINE *
\	****************

    def DELLIN 
	integer DELLIN
        print chr$(27) + "M";
	fend


\	*********************
\	*  DELETE CHARACTER *
\	*********************

    def DELCHR
	integer DELCHR
        print chr$(27) + "N";
	fend


\	******************
\	*  ENABLE CURSOR *
\	******************

    def ENCUR
	integer ENCUR
        print chr$(27) + "e";
	fend


\	*******************
\	*  DISABLE CURSOR *
\	*******************

    def DISCUR
	integer DISCUR
        print chr$(27) + "f";
	fend


\	*******************
\	*  SET MODE COLOR *
\	*******************

    def SETCOL
	integer SETCOL
        print chr$(27) + "x";
	fend


\	*******************
\	*  SET MODE B & W *
\	*******************

    def SETBW
	integer SETBW
        print chr$(27) + "y";
	fend


\	*************************
\	*  ENTER INTENSIFY MODE *
\	*************************

    def BRIGHT
	integer BRIGHT
        print chr$(27) + "r";
	fend


\	************************
\	*  EXIT INTENSIFY MODE *
\	************************

    def DARK
	integer DARK
        print chr$(27) + "u";
	fend


\	****************************************
\	*  PRINT STRING IN REVERSE VIDEO MODE  *
\	****************************************

    def PRTREV (S$) 
	integer PRTREV
        print chr$(27) + "p";
        print s$;
        print chr$(27) + "q";
	fend


\	*****************************************
\	*  PRINT STRING IN BLINKING VIDEO MODE  *
\	*****************************************

    def PRTBLNK (S$) 
	integer PRTBLNK
        print chr$(27) + "s";
        print s$;
        print chr$(27) + "t";
	fend

