[PATCH] gamecon.c: Fix for SNES controllers

From: Michael Gold (mgold@scs.carleton.ca)
Date: Thu Jul 05 2001 - 20:49:08 EST


In kernel 2.4.4, a change was made to gamecon.c that causes problems
with Super Nintendo controllers. The directional pad no longer works
correctly - only the up and left directions work. The following patch
fixes the problem by reversing the change. It applies cleanly to
kernels 2.4.4, 2.4.5, and 2.4.6.

--- linux-2.4.4-orig/drivers/char/joystick/gamecon.c Wed Apr 11 22:02:30 2001
+++ linux-2.4.4/drivers/char/joystick/gamecon.c Sat May 26 03:57:13 2001
@@ -345,8 +345,8 @@
                         s = gc_status_bit[i];
 
                         if (s & (gc->pads[GC_NES] | gc->pads[GC_SNES])) {
- input_report_abs(dev + i, ABS_X, ! - !(s & data[6]) - !(s & data[7]));
- input_report_abs(dev + i, ABS_Y, ! - !(s & data[4]) - !(s & data[5]));
+ input_report_abs(dev + i, ABS_X, !!(s & data[7]) - !!(s & data[6]));
+ input_report_abs(dev + i, ABS_Y, !!(s & data[5]) - !!(s & data[4]));
                         }
 
                         if (s & gc->pads[GC_NES])



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 07 2001 - 21:00:17 EST