gamecon.c change for SNES controller
PATCH 1/1 gamecon.c change for SNES controller
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:[email protected]
--- start of patch ---
char/joystick/gamecon.c Wed Jul 18 16:00:50 2001 renamed from char/joystick/gamecon.c.orig Sat Jul 14 19:03:12 2001 +2 -2
@@ -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 ---