🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #21042

bug in text drawing in MicroEmacs 3.8 code

#21042
From: Earle R. Horton
Date: Sat, 31 Oct 1987 22:17
73 lines
2566 bytes
There is a bug in some of the source code disks for microemacs 3.8 which
I have sent out, due to an error in the definition of StdText in the
Phone Book edition of Inside Macintosh (and due perhaps to my failure to
look it up in the latest edition!)  This bug results in text drawn on a
Mac II screen being zero pixels high.  If I had a Mac II, I probably would
have noticed it, sooner or later, myself!

Earle

/*
 * Replace the function TTY_WPutText() in TTY_Windows.c with this.
 */
/*
 * TTY_WPutText()	- 	Put a character to the given TTY_Window at the 
 *				current cursor location, advance the cursor. 
 *
 *	ttywPtr 	-	TTY_WindowPtr to be drawn in.
 *	arow, acol	-	position of first character to draw.
 *	n		-	number of characters to draw.
 *	buf		-	ptr to buffer containing the characters.
 */
 
VOID TTY_WPutText(ttywPtr, arow, acol, n, buf)
	TTY_WindowPtr	ttywPtr;
	int16			arow, acol, n;
	char			*buf;
{
	Point 	oldpen_pt;
	register TTY_WindowPeek	ttywPeek;
	GrafPtr	oldPort;

	if(n <= 0) return;
	
	GetPort(&oldPort);
	SetTTY_WPort(ttywPtr);
	
	ttywPeek = (TTY_WindowPeek) ttywPtr;
	
	if(IS_64K_ROM) {
		TTY_WMoveCursAbs(ttywPtr, arow, acol); 
		TTY_WEraseEOL(ttywPtr);
	}

	/* save pen position and move to new point */
	GetPen(&oldpen_pt);
	
	SetPt(&ttywPeek->pen_pt, 
		ttywPeek->left_offset+(acol*ttywPeek->curs_width), 
		ttywPeek->top_offset+ttywPeek->char_ascent+
			(arow*ttywPeek->curs_height));
	MoveTo(ttywPeek->pen_pt.h, ttywPeek->pen_pt.v);
	
	TTY_WBlinkCurs(ttywPeek, CURS_INVIS);

	/* Oops! */
/*	StdText(n-1,buf,0x0101,0x0101);	*/

	StdText(n-1,buf,0x00010001,0x00010001);

	/* Original Inside Macintosh said these were integers. */
	
	/* restore pen position */
	MoveTo(oldpen_pt.h, oldpen_pt.v);
	GetPen(&ttywPeek->pen_pt);
	
	SetPort(oldPort);
}


-- 
*********************************************************************
*Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755   *
*********************************************************************
Technical Details
Message-ID: <7533@dartvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!dartvax!earleh

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!dartvax!earleh
From: earleh@dartvax.UUCP (Earle R. Horton)
Newsgroups: comp.sys.mac
Subject: bug in text drawing in MicroEmacs 3.8 code
Message-ID: <7533@dartvax.UUCP>
Date: Sat, 31-Oct-87 17:17:56 EST
Article-I.D.: dartvax.7533
Posted: Sat Oct 31 17:17:56 1987
Date-Received: Thu, 5-Nov-87 06:45:46 EST
Organization: disorganized
Lines: 73
Keywords: stdtext, Point