Subject: Re: mfb patches?
To: None <jonathan@DSG.Stanford.EDU>
From: maximum entropy <entropy@zippy.bernstein.com>
List: port-pmax
Date: 04/10/1997 03:39:00
>From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
>
>maximum entropy <entropy@zippy.bernstein.com> writes:
>
>>I'll try the patch as soon as I get home, but I don't think it's going
>>to work.  The raster calculations seem to use the fb_width and not the
>>fi_linebytes data.  But I'll stop speculating for the moment and go
>>build a kernel.
>
>grepping for either fi_linebytes or fb_width in /sys/dev/rcons
>suggests otherwise, but whatever actually works...
>

Ok, your patch actually does work, contrary to my expectations.  There
was a small problem with the code in the cursor positioning code,
which prevents it from compiling.  Here's a fixed patch:

--- /usr/src/sys/arch/pmax/dev/mfb.c-orig	Thu Jan 23 07:21:09 1997
+++ /usr/src/sys/arch/pmax/dev/mfb.c	Wed Apr  9 22:57:51 1997
@@ -308,13 +308,13 @@
 	fi->fi_base = (caddr_t)(mfbaddr + MFB_OFFSET_BT431);
 	fi->fi_vdac = (caddr_t)(mfbaddr + MFB_OFFSET_BT455);
 	fi->fi_size = (fi->fi_pixels + MFB_FB_SIZE) - fi->fi_base;
-	fi->fi_linebytes = 1280;
+	fi->fi_linebytes = 2048;	/* tell rcons width of lines */
 	fi->fi_driver = &mfb_driver;
 	fi->fi_blanked = 0;
 
 	/* Fill in Frame Buffer Type struct. */
 	fi->fi_type.fb_boardtype = PMAX_FBTYPE_MFB;
-	fi->fi_type.fb_width = 1280;
+	fi->fi_type.fb_width = 1280;	/* screen pixel dimensions? */
 	fi->fi_type.fb_height = 1024;
 	fi->fi_type.fb_depth = 8;
 	fi->fi_type.fb_cmsize = 0;
@@ -479,6 +479,7 @@
 {
 	bt431_regmap_t *regs = (bt431_regmap_t *)(fi -> fi_base);
 
+#ifdef MELLON
 	if (y < 0)
 	  y = 0;
 	else if (y > fi -> fi_type.fb_width - fi -> fi_cursor.width - 1)
@@ -488,6 +489,13 @@
 	else if (x > fi -> fi_type.fb_height - fi -> fi_cursor.height - 1)
 	  x = fi -> fi_type.fb_height - fi -> fi_cursor.height - 1;
 
+#else /* old-style pmax glass tty */
+ 	if (y < fi->fi_fbu->scrInfo.min_cur_y || y > fi->fi_fbu->scrInfo.max_cur_y)
+		y = fi->fi_fbu->scrInfo.max_cur_y;
+	if (x < fi->fi_fbu->scrInfo.min_cur_x || x > fi->fi_fbu->scrInfo.max_cur_x)
+		x = fi->fi_fbu->scrInfo.max_cur_x;
+#endif
+
 	fi -> fi_cursor.x = x;
 	fi -> fi_cursor.y = y;
 
@@ -520,6 +528,8 @@
 {
 	u_char rgb [3];
 	register int i;
+
+	blackpix = 1; /* XXX XXX XXX defeat screensave bug? */
 
 	if (blackpix)
 		rgb [0] = rgb [1] = rgb [2] = 0xff;

Happy committing...
entropy

--
entropy -- it's not just a good idea, it's the second law.