25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more...
Home   Projects   Up   Sitemap   Search   Blog   Forum+Chat   About Us   Privacy   Terms of Use   Feedback   FAQ   Images   Services   Payments   Humor   Music

Heathkit H-100 functions in DeSmet C using H-19 terminal escape codes for display management

The Heathkit H-89 and H-100 computers both control the video screen with Heathkit H-19 video terminal escape codes. 

On this page are several DeSmet C functions for the H-100 that use these terminal escape codes. 

/* ----------------------------------------------------------------------- */
/* H100 DISPLAY MANAGEMENT FUNCTIONS */
/* Copyright (C)1993 Steven Whitney.  Published under the */
/* GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY. */
/* The H100 uses the H19/H89 terminal escape codes. */
/* ----------------------------------------------------------------------- */
/*   CLS()     10-17-84  5-1-93 Clears H100 screen.      */
/* ----------------------------------------------------------------------- */
int cls() 
{
	puts("\033E");
	return 1;
}


/* -------------------------------------------------------------- */
/*	SETCOLOR()	5-29-93   10-12-93 */
/*	sets foreground and background color of displayed text */
/*	0=black 1=blue 2=red 3=magenta 4=green 5=cyan 6=yellow 7=white */
/* -------------------------------------------------------------- */
int setcolor(f,b)
int f, b;
{
	void printf();
	printf("\033m%d%d",f,b);
	return 1;
}


/* ----------------------------------------------------------------------- */
/*	LOCATE() (LINE,COLUMN)	6-4-87  2-13-94 */
/*	Emulates the Basic LOCATE command	*/
/*	returns FALSE and does nothing else if coordinates out of range */
/*	returns TRUE if ok */
/* ----------------------------------------------------------------------- */
#define TRUE	(1)
#define FALSE	(0)
int locate(line,column)
int line,column;
{
if((line < 1) || (line > 25) || (column < 1) || (column > 80))
	return(FALSE);
if(line == 25)			/* automatically enable line 25 if requested */
	puts("\033x1");
puts("\033Y");
putchar(line + 31);
putchar(column + 31);
return(TRUE);
}

/* -------------------------------------------------------------- */
/*	ERASE25TH()  6-7-93   12-22-93 */
/* clear text from line 25 & position at start of line */
/* -------------------------------------------------------------- */
int erase25th()
{										
	locate(25,1); puts("\033E"); return 1;
}


/* ----------------------------------------------------------------------- */
/*	PUT25TH()	6-7-93   10-12-93 */
/*	Copyright (C)1993 Steven Whitney.  Published under the */
/*	GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY. */
/*	restore line 25 graphics contents previously saved with save25th() */
/*	restores last 9 scan lines of all 3 planes   */
/* ----------------------------------------------------------------------- */
int put25th(buf)			
char *buf;
{
	int i;
	unsigned dseg, _showds();
	char *offset, *buftwo;
	void _lmove();

	dseg = _showds();
	buftwo = buf;

	for(i = 384 ; i <= 392 ; i++)
	{
		offset = (char *)(i * 128);
		_lmove(80,buftwo,dseg,offset,0xC000); buftwo += 80;
		_lmove(80,buftwo,dseg,offset,0xD000); buftwo += 80;
		_lmove(80,buftwo,dseg,offset,0xE000); buftwo += 80;
	}
	return 1;
}


/* ----------------------------------------------------------------------- */
/*	SAVE25TH()	6-7-93  10-12-93 */
/*	Copyright (C)1993 Steven Whitney.  Published under the */
/*	GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY. */
/*	save graphics contents of line 25 to buffer so line can be used for text */
/*	saves last 9 scan lines of all 3 planes   */
/* ----------------------------------------------------------------------- */
int save25th(buf)
char *buf;						/* requires 2160-byte char array */
{								/* provided by user */
	int i;									/* counter */
	unsigned dseg;							/* data segment of memory */
	unsigned _showds();
	char *offset;
	char *buftwo;
	void _lmove();

	dseg = _showds();						/* learn data segment */
	buftwo = buf;							/* set secondary buf pointer */

	for(i = 384 ; i <= 392 ; i++)			/* physical last 9 scan lines */
	{										/* address of each line */
		offset = (char *)(i * 128);			/* is physical line x 128 */
		_lmove(80,offset,0xC000,buftwo,dseg); buftwo += 80;
		_lmove(80,offset,0xD000,buftwo,dseg); buftwo += 80;
		_lmove(80,offset,0xE000,buftwo,dseg); buftwo += 80;
	}
	return 1;
}

/* ----------------------------------------------------------------------- */
/*	H100 FUNCTION TURNING SCREEN WRAP-AROUND ON */
/*	10-12-93  */
/* ----------------------------------------------------------------------- */
int wrapon()
{
	putchar(27);
	putchar('v');
	return 1;
}
/* ----------------------------------------------------------------------- */
/*	H100 FUNCTION TURNING SCREEN WRAP-AROUND OFF */
/*	10-12-93  */
/* ----------------------------------------------------------------------- */
int wrapoff()
{
	putchar(27);
	putchar('w');
	return 1;
}

 


 

Valid HTML 4.01 Transitional Valid CSS
Yahoo! Search
Search the web Search this site
View content labeling at ICRA.