[8496] in Athena Bugs

home help back first fref pref prev next nref lref last post

[daemon@ATHENA.MIT.EDU : VS2 Console Patches. You've been waiting for these for so long...]

daemon@ATHENA.MIT.EDU (Calvin Clark)
Mon Oct 28 23:35:34 1991

Date: Mon, 28 Oct 91 23:35:18 -0500
From: Calvin Clark <ckclark@Athena.MIT.EDU>
To: bugs@Athena.MIT.EDU
Cc: eichin@Athena.MIT.EDU
Reply-To: ckclark@mit.edu
In-Reply-To: [8472]

eichin>	The identical patch should be applied to sm.c, with qv changed
eichin> to sm and some shift of line numbers. I have not done testing on the
eichin> sm, but the existing driver code is identical (and probably ought to
eichin> be combined with ifdef's anyway) so testing on the VS2 should probably
eichin> count towards the VS2000.

Actually, sm.c is different enough that I had to make the patch by hand.
Some other changes were necessary, as well.  In addition to the
instructions included in Mark's original posting [8472], note that the
line:

#define META 0xb1 

should be added to the end of smreg.h, (and qvreg.h, as mentioned in
[8476] and [8486] in bugs.)

I have tested this out on the VS2000. 

-Calvin

*** /source/bsd-4.3/common/sys/machineio.vax_bsd43/sm.c	Sat Oct 28 06:56:06 1989
--- sm.c	Mon Oct 28 21:17:23 1991
***************
*** 216,221 ****
--- 216,222 ----
  	int cntrl;
  	int lock;
  	int hold;
+ 	int meta;
  	char last;			/* last character	*/
  } sm_keyboard;
  
***************
*** 992,1002 ****
  	    case CNTRL:
  			sm_keyboard.cntrl ^= 0xffff;
  			return;
! 
! 	    case ALLUP:
! 			sm_keyboard.cntrl = sm_keyboard.shift = 0;
  			return;
- 
  	    case REPEAT:
  			c = sm_keyboard.last;
  			break;
--- 993,1004 ----
  	    case CNTRL:
  			sm_keyboard.cntrl ^= 0xffff;
  			return;
! 	    case META:
!  			sm_keyboard.meta  ^= 0xffff;
!  			return;
!   	    case ALLUP:
! 			sm_keyboard.cntrl = sm_keyboard.meta = sm_keyboard.shift = 0;
  			return;
  	    case REPEAT:
  			c = sm_keyboard.last;
  			break;
***************
*** 1049,1064 ****
   * Check for special function keys
   */
  	    if( c & 0x80 ) {
! 
! 		register char *string;
! 
! 		string = q_special[ c & 0x7f ];
! 		while( *string )
! 		    (*linesw[tp->t_line].l_rint)(*string++, tp);
! 	    } else
! 		    (*linesw[tp->t_line].l_rint)(c, tp);
! 	    if (sm_keyboard.hold &&((tp->t_state & TS_TTSTOP) == 0)) {
! 		    sm_key_out( LK_LED_DISABLE );
  		    sm_key_out( LED_4 );
  		    sm_keyboard.hold = 0;
  	    }
--- 1051,1072 ----
   * Check for special function keys
   */
  	    if( c & 0x80 ) {
! 			register char *string;
! 			string = q_special[ c & 0x7f ];
! 			while( *string )
! 			(*linesw[tp->t_line].l_rint)(*string++, tp);
! 		} else {
! 			if( sm_keyboard.meta )
! #ifdef META_8BIT
! 				c |= 0x80;
! #else
! 			(*linesw[tp->t_line].l_rint)(0x1b, tp);
! #endif
! 			(*linesw[tp->t_line].l_rint)(c, tp);
! 		}
! 	} else {
! 		if (sm_keyboard.hold &&((tp->t_state & TS_TTSTOP) == 0)) {
! 		  sm_key_out( LK_LED_DISABLE );
  		    sm_key_out( LED_4 );
  		    sm_keyboard.hold = 0;
  	    }
***************
*** 1399,1404 ****
--- 1407,1419 ----
   **                                                              **
   ******************************************************************/
  
+ /*
+  * Values for character attribute bit mask
+  */
+ #define CHAR_NONE      0
+ #define CHAR_REVERSE   1
+ #define CHAR_UNDERLINE 2
+ 
  sm_blitc( c )
  register char c;
  {
***************
*** 1411,1416 ****
--- 1426,1432 ----
      NORM = 0, ESC, ESCBRAK,
    } state = NORM;
    static int num_row=0, num_col=0, cur_num=0;
+   static char_attr=0;
  	
    c &= 0x7f;
    switch (state) {
***************
*** 1477,1497 ****
  
  	/* inline expansion for speed */
  
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
! 	*b_row = *f_row++; b_row += ote;
  	/* the following is so that ansi marginning works... */
  	if( ++qp->col >=  qp->max_col ) {
  	  qp->col = 0 ;
--- 1493,1518 ----
  
  	/* inline expansion for speed */
  
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  	*b_row = (char_attr & CHAR_UNDERLINE)?((char_attr & CHAR_REVERSE)?0:0xff):
!                  ((char_attr & CHAR_REVERSE)?(*f_row ^ 0xff):(*f_row)); f_row++; b_row += ote;
!  	*b_row = (char_attr & CHAR_REVERSE)?(*f_row++ ^ 0xff):(*f_row++); b_row += ote;
!  			    
  	/* the following is so that ansi marginning works... */
  	if( ++qp->col >=  qp->max_col ) {
  	  qp->col = 0 ;
***************
*** 1587,1598 ****
  	bzero( b_row, 2048 );
        state = NORM;
        return(0);
!       
      default:
        state = NORM;
        return(0);
      }
      break;
    default:
      state = NORM;
      return(0);
--- 1608,1645 ----
  	bzero( b_row, 2048 );
        state = NORM;
        return(0);
! 
!     case 'm':
!        /* \E[7m = reverse video
!         * \E[m  = disable modes
!         * \E[16m = bitrot characters
!         */
!        
!       switch(cur_num) {
!       case 0:
!       /* clear modes */
!       char_attr = CHAR_NONE;
!       break;
!       case 4:
!       /* set reverse video */
!       char_attr |= CHAR_UNDERLINE;
!       break;
!       case 7:
!       /* set reverse video */
!       char_attr |= CHAR_REVERSE;
!       break;
!       }
!  
!       cur_num = 0;
!       state = NORM;
!       return(0);
!        
      default:
        state = NORM;
        return(0);
      }
      break;
+ 
    default:
      state = NORM;
      return(0);
***************
*** 1609,1614 ****
--- 1656,1668 ----
   **                                                                **
   ********************************************************************/
  
+ /*
+  * Values for character attribute bit mask
+  */
+ #define CHAR_NONE      0
+ #define CHAR_REVERSE   1
+ #define CHAR_UNDERLINE 2
+ 
  smputc( c )
  register char c;
  {
***************
*** 1962,1967 ****
--- 2016,2023 ----
  	register int i;
  
  	sm_key_out(LK_DEFAULTS);
+         for( i=1 ; i < 15 ; i++ )
+                 sm_key_out( sm_divdefaults[i] | (i<<3));
  	for (i = 0; i < KBD_INIT_LENGTH; i++)
  	    sm_key_out(sm_kbdinitstring[i]);
  }

home help back first fref pref prev next nref lref last post