public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduardo <eduardo.sp@usa.net>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: linux-joystick@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: [PATCH] gamecon.c change for SNES controller
Date: Wed, 18 Jul 2001 16:25:31 -0300	[thread overview]
Message-ID: <3B55E2AB.5080608@usa.net> (raw)

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 ---


                 reply	other threads:[~2001-07-18 19:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B55E2AB.5080608@usa.net \
    --to=eduardo.sp@usa.net \
    --cc=linux-joystick@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox