[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] [PATCH] Stairs effect on MiNT console



On 11/01/2013 16:56, Vincent Rivière wrote:
First, I will add support for that in FreeMiNT.

After investigation, it appears that the ONLCR flag is used only by the user-mode tcsetattr(). Since XaAES directly hacks the kernel internal flags without using tcsetattr(), adding support for ONLCR is not strictly required. This could be added later, if stty support was useful for someone.

The solution proposed here is very simple.
First, when T_RAW and T_CRMOD are both specified, on output T_CRMOD takes precedence and enables the LF to CR+LF conversion.
Second, XaAES uses T_CRMOD in addition to T_RAW.

This works perfectly, and I can't imagine any bad side effect.
Please commit.

tty.patch
In tty_write(), T_CRMOD is honored even when combined to T_RAW. Contributed by Vincent Riviere.

stairs.patch
Avoid stairs effect on Console. Contributed by Vincent Riviere.

--
Vincent Rivière
--- freemint.orig/sys/tty.c	2012-04-11 22:58:19.593750000 +0200
+++ freemint/sys/tty.c	2013-01-11 21:01:55.921875000 +0100
@@ -467,10 +467,7 @@
 	/*
 	 * "mode" can now be reduced to just T_CRMODE or not
 	 */
-	if ((get_curproc()->domain == DOM_MINT) && (mode & T_CRMOD) && !(mode & T_RAW))
-		mode = T_CRMOD;
-	else
-		mode = 0;
+	mode &= ~T_CRMOD;
 	
 	if (nbytes == 0)
 		return bytes_written;
--- freemint.orig/xaaes/src.km/k_main.c	2013-01-05 17:28:29.316374900 +0100
+++ freemint/xaaes/src.km/k_main.c	2013-01-11 20:45:36.109375000 +0100
@@ -1523,7 +1523,10 @@
 	sg = KBD_dev_sg;
 	sg.sg_flags &= TF_FLAGS;
 	if( md == RAW )
+	{
 		sg.sg_flags |= T_RAW;
+		sg.sg_flags |= T_CRMOD; /* Avoid stairs effect on Console */
+	}
 	else
 	{
 		sg.sg_flags &= ~T_RAW;