[PATCH] gamecon.c change for SNES controller

From: Eduardo (eduardo.sp@usa.net)
Date: Wed Jul 18 2001 - 14:25:31 EST


Pavlik -

I've had to applie the following change to make the SNES controller work
at the parallel port. It have been applied to two computers. The old
code was giving the same values when you pressed right or left or when
you pressed up or down. The new code have been done to not use expensive
codification (i.e. multiplication).

It have been applied to kernel 2.4.6, and compiled with gcc 3.0.

See ya,

Eng. Eduardo Bortoluzzi Junior
mailto:eduardo.sp@usa.net

--- start of patch ---

--- drivers/char/joystick/gamecon.c.orig Sat Jul 14 19:03:12 2001
+++ drivers/char/joystick/gamecon.c Wed Jul 18 16:00:50 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[6]) + !!(s & data[7]));
+ input_report_abs(dev + i, ABS_Y, - !!(s
& data[4]) + !!(s & data[5]));
                        }
 
                        if (s & gc->pads[GC_NES])

--- end of patch ---

-
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 : Mon Jul 23 2001 - 21:00:11 EST