[parisc-linux] basic sti cursor patch

Xavier Debacker xavier.debacker@esiee.net
Thu, 15 Feb 2001 23:44:36 +0100


Il s'agit d'un message multivolet au format MIME.
--------------D691CC0C99CB3804EC0D4D0C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Helge,

Here is a patch to get the cursor working on STI..
Of course it's not perfect, but already quite useful as is.
As you can see, this basic cursor is the character on the screen,
with some color attribute (black fg, white bg).

Now we can use vi & emacs, knowing where we are :-)

Xavier.
ESIEE Team.
http://www.esiee.fr/puffin

--------------D691CC0C99CB3804EC0D4D0C
Content-Type: text/plain; charset=us-ascii;
 name="cursor.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cursor.patch"

diff -rNu linux-cvs/drivers/video/sti/sticon.c linux-cursor/drivers/video/sti/sticon.c
--- linux-cvs/drivers/video/sti/sticon.c	Fri Feb  9 02:42:28 2001
+++ linux-cursor/drivers/video/sti/sticon.c	Thu Feb 15 23:27:53 2001
@@ -94,7 +94,26 @@
 
 static void sticon_cursor(struct vc_data *conp, int mode)
 {
-}
+	unsigned short car1;
+	car1 = conp->vc_screenbuf[conp->vc_x+conp->vc_y*conp->vc_cols];
+	switch (mode) {
+		case CM_ERASE:
+			sti_putc(&default_sti,car1,conp->vc_y,conp->vc_x);
+			break;
+		case CM_MOVE:
+		case CM_DRAW:
+			switch (conp->vc_cursor_type & 0x0f) {
+				case CUR_UNDERLINE:
+				case CUR_LOWER_THIRD:
+				case CUR_LOWER_HALF:
+				case CUR_TWO_THIRDS: 
+				case CUR_BLOCK: 
+					sti_putc(&default_sti,(car1&255)+(0<<8)+(7<<11),conp->vc_y,conp->vc_x);
+					break;
+			}
+			break;
+	}
+}       
 
 static int sticon_scroll(struct vc_data *conp, int t, int b, int dir,
 			int count)

--------------D691CC0C99CB3804EC0D4D0C--