* [PATCH] gamecon.c change for SNES controller
@ 2001-07-18 19:25 Eduardo
0 siblings, 0 replies; only message in thread
From: Eduardo @ 2001-07-18 19:25 UTC (permalink / raw)
To: Vojtech Pavlik; +Cc: linux-joystick, linux-kernel
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 ---
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-18 19:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-18 19:25 [PATCH] gamecon.c change for SNES controller Eduardo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox