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

Re: [MiNT] FreeMiNT initial key stuck



And the following crappy patch fixes the problem :-)

However it works only with TOS >= 2, so we must find another clean solution.

--
Vincent Rivière
diff -aurN freemint-CVS-20090912.orig/sys/arch/init_intr.c freemint-CVS-20090912/sys/arch/init_intr.c
--- freemint-CVS-20090912.orig/sys/arch/init_intr.c	2009-09-12 13:35:31.828125000 +0200
+++ freemint-CVS-20090912/sys/arch/init_intr.c	2009-09-12 13:44:05.015625000 +0200
@@ -96,6 +96,19 @@
 
 # ifndef NO_AKP_KEYBOARD
 	{
+		/* Send a key release to the TOS 2.x keyboard handler
+		 * to disable its key repetition routine
+		 * if a key is hold at startup.
+		 */
+		__asm__ volatile
+		(
+			"move.l	%0,a0\n\t"
+			"move.w	#0x80,d0\n\t"
+			"jsr	(a0)"
+		:					/* outputs */
+		: "g"(*(((long*)syskey)-1))		/* inputs  */
+		: "d0", "d1", "d2", "a0", "a1", "a2"    /* clobbered regs */
+		);
 #ifndef MILAN
 		savesr = splhigh();
 		syskey->ikbdsys = (long)ikbdsys_handler;