From: James S. <jsi...@tr...> - 2001-07-25 02:56:07
|
Patch for the SNES controller attached to a parallel port. I don't have this hardware so please test it. >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). --- 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 maj...@vg... More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |