Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » comp.sys.amiga » VT100 V2.3 Possible Bug and Possible Fix
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: VT100 V2.3 Possible Bug and Possible Fix [message #293937 is a reply to message #293816] Thu, 11 December 1986 11:11 Go to previous messageGo to previous message
chas is currently offline  chas
Messages: 6
Registered: May 2013
Karma:
Junior Member
Article-I.D.: gtss.162
Posted: Thu Dec 11 11:11:28 1986
Date-Received: Sat, 13-Dec-86 22:54:08 EST
References: <3711@vax4.tc.fluke.COM> <1986Dec9.102147.14725@utcs.uucp>
Reply-To: chas@gtss.UUCP (Charles Cleveland)
Organization: Georgia Tech Surface Studies
Lines: 250

In article <1986Dec9.102147.14725@utcs.uucp> wagner@utcs.UUCP (Michael Wagner) writes:
 > 
 > There are really two modes on a VT100.  There is keypad application mode, and
 > another one (whose name escapes me at present).  Keypad application mode is
			.
			.
			.
 > However, this other mode (whose name escaped) is supposed to effect the
 > cursor keys.  I suspect that IBM 7171s use this mode.  I hardcoded and
 > recompiled with both sequences, and neither would make the 7171 happy.
 > I wish someone would pull out a VT100 manual and set us all straight here.
 > It seems we're still confused.

mjp@spice.cs.cmu.edu (Michael Portuesi) did in October, though I didn't
pay any attention to his article until today when I found it covered in
dust in a corner of one of my directories.

I did.  I just posted diffs.  Maybe they didn't make it out alive.  It's
fairly short so I'll repost it here.  Would someone (decide who among
yourselves) let me know if this gets out?  My news/mail feed and I have been 
having some problems lately which is why I'm worried about the last posting.

I would especially be interested to know if this works or not on the 7171
or any other system where someone using a genuine vt100 can verify that it
ought to work.  I just did what the manual said.  It works for me on machines
that want normal cursor keys and ones that want application cursor keys,
and which set the terminal to the mode of their choice.  Someday I may add
a menu item to toggle keypad app. mode and one for cursor app. mode so I
can set them myself -- but this is trivial.

These are context diffs.  It you don't know what that is, just look at it
and you will probably find it easy to interpret.  There's much less to
change that the number of lines remaining in this posting might lead you
to think -- most of them are context.

----------------------------------------
diff -c remote.c remote.c.fixed
*** remote.c		Mon Nov 24 19:00:56 1986
--- remote.c.fixed	Mon Dec  8 21:15:59 1986
***************
*** 88,94
  
        case 'c':				/* Reset */
  	top = MINY; bot = MAXY; savx = MINX; savy = MINY;
! 	curmode = FS_NORMAL; keyapp = FALSE;
  	inesc = -1;
  	a[0] = 0; a[1] = 0; sa[0] = 0; sa[1] = 0;
  	emit(12);

--- 88,94 -----
  
        case 'c':				/* Reset */
  	top = MINY; bot = MAXY; savx = MINX; savy = MINY;
! 	curmode = FS_NORMAL; keyapp = FALSE; curapp = FALSE;
  	inesc = -1;
  	a[0] = 0; a[1] = 0; sa[0] = 0; sa[1] = 0;
  	emit(12);
***************
*** 267,273
  
        case 'h':				/* Set parameter */
  	if (private == 0 && p[0] == 20)		nlmode = 1;
! 	else if (private == '?' && p[0] == 7)	p_wrap = 1;
  	return;
  
        case 'l':				/* Reset parameter */

--- 267,276 -----
  
        case 'h':				/* Set parameter */
  	if (private == 0 && p[0] == 20)		nlmode = 1;
! 	else if (private == '?'){
! 		if( p[0] == 7)	p_wrap = 1;
! 		else if( p[0] == 1)	curapp = 1;
! 	}
  	return;
  
        case 'l':				/* Reset parameter */
***************
*** 272,278
  
        case 'l':				/* Reset parameter */
  	if (private == 0 && p[0] == 20)		nlmode = 0;
! 	else if (private == '?' && p[0] == 7)	p_wrap = 0;
  	return;
  
        case 'x':

--- 275,284 -----
  
        case 'l':				/* Reset parameter */
  	if (private == 0 && p[0] == 20)		nlmode = 0;
! 	else if (private == '?'){
! 		if(p[0] == 7)	p_wrap = 0;
! 		else if( p[0] == 1)	curapp = 0;
! 	}
  	return;
  
        case 'x':
diff -c vt100.c vt100.c.fixed
*** vt100.c		Mon Nov 24 19:00:24 1986
--- vt100.c.fixed	Mon Dec  8 21:12:01 1986
***************
*** 61,66
      y	      =	    MINY; 
      curmode   =	    FS_NORMAL;
      keyapp    =	    0;
      script_on =     FALSE;
      script_wait=    TRUE;
      SetAPen(mywindow->RPort,1L);

--- 61,67 -----
      y	      =	    MINY; 
      curmode   =	    FS_NORMAL;
      keyapp    =	    0;
+     curapp    =	    0;
      script_on =     FALSE;
      script_wait=    TRUE;
      SetAPen(mywindow->RPort,1L);
diff -c vt100.h vt100.h.fixed
*** vt100.h		Mon Nov 24 19:00:19 1986
--- vt100.h.fixed	Mon Dec  8 21:23:37 1986
***************
*** 159,165
  UBYTE  *BeepWave;
  UBYTE  Audio_AllocMap[4] = { 1, 8, 2, 4 };
  int want_message;
! int x,y,curmode,keyapp;
  int MINX	= 0;
  int MAXX	= 632;
  int MINY	= 14;

--- 159,165 -----
  UBYTE  *BeepWave;
  UBYTE  Audio_AllocMap[4] = { 1, 8, 2, 4 };
  int want_message;
! int x,y,curmode,keyapp,curapp;
  int MINX	= 0;
  int MAXX	= 632;
  int MINY	= 14;
***************
*** 254,260
  extern char *rs_in;
  extern struct IOExtSer *Write_Request;
  extern char rs_out[2];
! extern int x,y,curmode,keyapp;
  extern int MINX,MAXX,MINY,MAXY,top,bot,savx,savy;
  extern int savmode,nlmode,alt,savalt,a[2],sa[2];
  extern int inesc,inctrl,private,badseq,maxcol;

--- 254,260 -----
  extern char *rs_in;
  extern struct IOExtSer *Write_Request;
  extern char rs_out[2];
! extern int x,y,curmode,keyapp,curapp;
  extern int MINX,MAXX,MINY,MAXY,top,bot,savx,savy;
  extern int savmode,nlmode,alt,savalt,a[2],sa[2];
  extern int inesc,inctrl,private,badseq,maxcol;
diff -c window.c window.c.fixed
*** window.c		Mon Nov 24 19:01:00 1986
--- window.c.fixed	Mon Dec  8 21:07:41 1986
***************
*** 310,316
  	case 0x4d: 
  	case 0x4e: 
  	case 0x4f: sendchar(27);            /* cursor keys */
! 		   if (keyapp) sendchar('O');
  		   else sendchar('[');
  		   sendchar(code - 11);
  		   break;

--- 310,316 -----
  	case 0x4d: 
  	case 0x4e: 
  	case 0x4f: sendchar(27);            /* cursor keys */
! 		   if (curapp) sendchar('O');
  		   else sendchar('[');
  		   sendchar(code - 11);
  		   break;
----------------------------------------
end of patches
----------------------------------------
From gatech!seismo!rochester!pt.cs.cmu.edu!spice.cs.cmu.edu!mjp Thu Oct 23 12:58:34 EDT 1986
Article 1516 of net.micro.amiga:
Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gtss.UUCP
Path: gtss!gatech!seismo!rochester!pt.cs.cmu.edu!spice.cs.cmu.edu!mjp

Newsgroups: net.micro.amiga
Subject: VT100 cursor keys
Message-ID: <1084@spice.cs.cmu.edu>
Date: 21 Oct 86 18:48:24 GMT
Date-Received: 23 Oct 86 02:40:37 GMT
Reply-To: mjp@spice.cs.cmu.edu (Michael Portuesi)
Distribution: net
Organization: Carnegie-Mellon University, CS/RI
Lines: 43
Keywords:

 >  Description:
 >  Cursor keys send wrong sequence when the keypad is in application mode
 >  
 >  Suggested Fix:
 >  in window.c, remove the checking for 'keyapp' in the cursor key code.
 >  always send the sequence currently in the 'else' logic.

A real VT100 has two distinct application modes, Keypad Application
Mode and Cursor Key Mode.  Keypad Application mode applies only to
the keypad; Cursor Key Mode applies only to the cursor keys.  Thus
the suggested fix above is correct.  One should not tamper with the
cursor keys when Keypad Application Mode is selected.  From the VT100
User Guide:

Cursor Key	VT52	ANSI Mode and Cursor	ANSI Mode and Cursor
(Arrow)		Mode	Key Mode Reset		Key Mode Set
------------------------------------------------------------------------
Up		ESC A	ESC [ A			ESC O A
Down		ESC B	ESC [ B			ESC O B
Left		ESC C	ESC [ C			ESC O C
Right		ESC D	ESC [ D			ESC O D

The following control sequences enter/exit Cursor Key Mode and Keypad
Application Mode:

Name			Set			Reset
------------------------------------------------------------------------
Cursor Key Mode		ESC [ ? 1 h		ESC [ ? 1 l
Keypad Application Mode ESC =			ESC >

 >  Michael Wagner (wagner@utcs)
-- 

+----------------------------------------------------------------------------+
| Mike Portuesi								     |
| Carnegie-Mellon University Computer Science Department		     |
|									     |
| ARPA: mjp@spice.cs.cmu.edu						     |
| UUCP: {harvard | seismo | ucbvax | decwrl}!spice.cs.cmu.edu!mjp	     |
|									     |
| "Talking about music is like dancing about architecture"		     |
|			--Laurie Anderson, "Home of the Brave"		     |
+----------------------------------------------------------------------------+


-- 
Charles Cleveland			chas@ss.physics.gatech.edu
Georgia Tech School of Physics
Atlanta, GA 30332			Georgia Tech Surface Studies

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp,rlgvax,sb1,
	uf-cgrl,unmvax,ut-sally}!gatech!gtss!chas
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: makeboth.arc: KickBench kit
Next Topic: Educational discounts (was Re: The trouble with the Amiga)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 01:17:36 EDT 2024

Total time taken to generate the page: 0.00320 seconds