[fa.info-vlsi] Magic on AED767s

info-vlsi@ucbvax.ARPA (07/02/85)

From: kelem@aero2

Here are context diffs on files in ~cad/src/magic/graphics that will
allow magic to be run on an AED767 with a Summagraphics bitpad.
Use the "patch" program to install them.  The fixes allow the 767 to work
most (90%) of the time.  Occasionally garbage characters will be read from the
bitpad and you have to use ":reset" to get magic to read the bitpad again.
UCB reports getting the same symptoms, but hasn't figured that one out yet.

Good luck,
Steve
----------------------------------

*** grAed1.c	Mon Jul  1 13:40:53 1985
--------- /tmp/d06952	Mon Jul  1 13:40:59 1985
***************
*** 22,28
  
  
  #ifndef lint
! static char sccsid[] = "@(#)grAed1.c	3.17 MAGIC (Berkeley) 3/3/85";
  #endif  not lint
  
  

--------- 22,28 -----
  
  
  #ifndef lint
! static char sccsid[] = "@(#)grAed1.c	3.17.1.1 MAGIC (Berkeley) 6/12/85";
  #endif  not lint
  
  
***************
*** 31,37
  extern Void AedEnableTablet(), AedDisableTablet(), AedSetTrackingRect();
  extern Void AedSetCMap(), aedPutText(), aedDefineCursor();
  extern Void AedSetCursor(), AedTextSize(), AedDrawGlyph();
! extern Void AedBitBlt(), aed1024BitBlt();
  extern int AedReadPixel();
  extern Void aedDrawLine(), aedSetLineStyle(), aedSetCharSize();
  extern Void aedSetWMandC(), aedFillRect();

--------- 31,37 -----
  extern Void AedEnableTablet(), AedDisableTablet(), AedSetTrackingRect();
  extern Void AedSetCMap(), aedPutText(), aedDefineCursor();
  extern Void AedSetCursor(), AedTextSize(), AedDrawGlyph();
! extern Void AedBitBlt(), aed1024BitBlt(), Aed767BitBlt();
  extern int AedReadPixel();
  extern Void aedDrawLine(), aedSetLineStyle(), aedSetCharSize();
  extern Void aedSetWMandC(), aedFillRect();
***************
*** 468,473
  	aedOffPoint.p_x = 512 - 14;
  	aedOffPoint.p_y = aedCursorRow;
  	aedHasProgCursor = TRUE;
  	aedButtonOrder = BUT248;
      } else if (strcmp(dispType,"AED1024") == 0) {
  	GrScreenRect.r_xtop = 1023;

--------- 468,483 -----
  	aedOffPoint.p_x = 512 - 14;
  	aedOffPoint.p_y = aedCursorRow;
  	aedHasProgCursor = TRUE;
+ 	aedButtonOrder = BUT248;
+     } else if (strcmp(dispType,"AED767") == 0) {
+ 	GrScreenRect.r_xtop = 767;
+ 	GrScreenRect.r_ytop = 574;
+ 	aedDSP = "+!";	/* DSP:  code for define stipple pattern */
+ 	aedCursorRow = 575;
+ 	aedOffPoint.p_x = 512 - 14;
+ 	aedOffPoint.p_y = aedCursorRow;
+ 	aedHasProgCursor = FALSE;
+ 	GrBitBltPtr = Aed767BitBlt;
  	aedButtonOrder = BUT248;
      } else if (str = 512 - 14;
+ 	aedOffPoint.p_y = aedCursorRow;
+ 	aedHasProgCursor = FALSE;
+ 	GrBitBltPtr = Aed767BitBlt;
  	aedButtonOrder = BUT248;
      } else if (strcmp(dispType,"AED1024") == 0) {
  	GrScreenRect.r_xtop = 1023;
*** grAed3.c	Mon Jul  1 13:41:23 1985
--------- /tmp/d06961	Mon Jul  1 13:41:27 1985
***************
*** 9,15
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)grAed3.c	3.19 MAGIC (Berkeley) 3/3/85";
  #endif  not lint
  
  #include <stdio.h>

--------- 9,15 -----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)grAed3.c	3.19.1.1 MAGIC (Berkeley) 6/12/85";
  #endif  not lint
  
  #include <stdio.h>
***************
*** 338,343
      /* restore write mask */
      putc('L', grAedOutput);
      putc(aedWMask&0377, grAedOutput);
  }
  
  

--------- 338,366 -----
      /* restore write mask */
      putc('L', grAedOutput);
      putc(aedWMask&0377, grAedOutput);
+ }
+ 
+ /*
+  * ----------------------------------------------------------------------------
+  * Aed767BitBlt --
+  *
+  *	Don't copy information from one part of the screen to the other
+  *	if the Aed can't handle the BitBlt.
+  *	Do not call 'Aed767BitBlt' directly, call 'GrBitBlt' instead.
+  *
+  * Results:
+  *	None.
+  *
+  * Side effects:
+  *	None.
+  * ----------------------------------------------------------------------------
+  */
+ 
+ Void
+ Aed767BitBlt(r, p)
+     Rect *r;
+     Point *p;
+ {
  }
  
  
*** grMain.c	Mon Jul  1 13:41:51 1985
--------- /tmp/d06972	Mon Jul  1 13:41:56 1985
***************
*** 10,16
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)grMain.c	3.22 MAGIC (Berkeley) 2/14/85";
  #endif  not lint
  
  /*

--------- 10,16 -----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)grMain.c	3.22.1.1 MAGIC (Berkeley) 6/12/85";
  #endif  not lint
  
  /*
***************
*** 28,33
   *			Sun optical mouse.  Also works on some old Sun1s with
   *			the 'Sun2 brain transplant'.
   *
   *	AED1024		An AED1024 with a SummaGraphics Mouse and rev. D roms.
   *			Because of a lack of features in this device,
   *			programable cursors do not work.  Many thanks to 

--------- 28,35 -----
   *			Sun optical mouse.  Also works on some old Sun1s with
   *			the 'Sun2 brain transplant'.
   *
+  *	AED767		An AED767 with a SummaGraphics tablet
+  *
   *	AED1024		An AED1024 with a SummaGraphics Mouse and rev. D roms.
   *			Because of a lack of features in this device,
   *			programable cursors do not work.  Many thanks to 
***************
*** 66,71
      "SUN120",
  #endif
      "UCB512",
      "AED1024",
      "NULL",
      NULL};

--------- 68,74 -----
      "SUN120",
  #endif
      "UCB512",
+     "AED767",
      "AED1024",
      "NULL",
      NULL};
***************
*** 79,85
      sunSetDisplay,
      sunSetDisplay,
  #endif
!     aedSetDisplay,	/* Handles both UCB512s and AED1024s */
      aedSetDisplay,
      nullSetDisplay,
      NULL};

--------- 82,89 -----
      sunSetDisplay,
      sunSetDisplay,
  #endif
!     aedSetDisplay,	/* Handles UCB512s, AED767s and AED1024s */
!     aedSetDisplay,
      aedSetDisplay,
      nullSetDisplay,
      NULL};
*** grText.c	Mon Jul  1 13:42:06 1985
--------- /tmp/d06978	Mon Jul  1 13:42:08 1985
***************
*** 8,14
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)grText.c	3.10 MAGIC (Berkeley) 1/23/85";
  #endif  not lint
  
  #include <stdio.h>

--------- 8,14 -----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)grText.c	3.10.1.1 MAGIC (Berkeley) 6/12/85";
  #endif  not lint
  
  #include <stdio.h>
***************
*** 78,85
  
      /* don't let the clip area be off screen */
      ASSERT( (** 78,85
  
      /* don't let the clip area be off screen */
      ASSERT( (clip->r_xbot >= 0) && (clip->r_ybot >= 0), "GrPutText");
!     ASSERT( (clip->r_xtop <= GrScreenRect.r_xtop) && \
! 	    (clip->r_ytop <= GrScreenRect.r_ytop), "GrPutText");
  
      /* The following loop sees if the text will fit in the clipping
       * area.  If not, and shrinking is allowed, we try again and

--------- 78,84 -----
  
      /* don't let the clip area be off screen */
      ASSERT( (clip->r_xbot >= 0) && (clip->r_ybot >= 0), "GrPutText");
!     ASSERT( (clip->r_xtop <= GrScreenRect.r_xtop) && (clip->r_ytop <= GrScreenRect.r_ytop), "GrPutText");
  
      /* The following loop sees if the text will fit in the clipping
       * area.  If not, and shrinking is allowed, we try again and

elh@edison.UUCP (10/15/85)

Could you please forward this to kelem@aero2 or perhaps attempt
an answer yourself.

Many thanks.

We (at Villanova University) are trying to port magic (using AED767s) to
a Pyramid 90X.  We are having the following problem:

The buttons on the 4 button puck (on a Summagraphics Bit-Pad One) do not
appear to be working correctly.  They appear to function in close to a normal
fashion if the top button is pressed and held while pressing the other buttons.

Some code added to "aedReadTablet" (in grAed4.c) seems to indicate that the
right codes are being seen by the system when the buttons are pressed.

Code added to "grAedMouseDevice" (also in grAed4.c) seems to indicate that
the appropriate codes are being received by it.

The difference (between having the top (yellow) button down always or not)
is that grAedMouseDevice is called *only* when a button is pressed when
the top button is not being held down, and is called on both transitions
when the top button is being held down.

I haven't been able to find where the differences occur; the bitpads work
fine with caesar and kic, so we assume that they are appropriately set up.

Any help would be much appreciated!!!

Thanks, 

Ed Hepler

at Full Time Job (GE Space Center, Valley Forge, Pa.)
..!houxm!edison!elh
(215)354-1775
or at part time teaching job (Villanova Univ., Villanova, Pa.)
..!houxm!packard!topaz!pyrnj!vu-vlsi-1!elh

PS: We *have* applied the AED767 bug fix of July 1, 1985 by kelem@aero2
which concerned magic on AED767s (even though a few lines of our
transmission seemed garbled)