Main > Raspberry Pi & Dev Board

Set49Mode utility for GPWiz49 on Raspberry Pi

(1/2) > >>

mahuti:
https://github.com/mahuti/set49mode

I made a utility to use GroovyGameGear's GPWiz49 with a 49-way stick on a raspberry pi.

Please read the readme, as there are a few things to point out that I make clear in the doc

1. The GPWiz49 encoder requires a HID quirk to be registered or it's useless as a joystick (by default the deadzone in the joystick's center will have a non-zero value until the hid quirk is added)

2. You'll need to add a UDEV rule if you don't want to run the script as root

3. Please note, this was mostly based on the work of RGBCommander, Mark Alston and others.

Once installed, it can be called like so to run 4-way diagonals.
--- Code: ---set49mode 5
--- End code ---

Or to run 49-way
--- Code: ---set49mode 1
--- End code ---

Or to do 8-way
--- Code: ---set49mode 3
--- End code ---

All of the modes are noted in the Readme.

I haven't written any utility to automatically pick the joystick mode however, so you'll need to pass a value through runcommand or via some other method to make use of this utility. Mark Alston wrote a Perl script that does dynamically set the mode, but I haven't tried it. I suspect it won't work on Retropie though, since it tries reload USBHID which the Pi complains about. I also wrote a version of this app in Python, so, if anyone wants the source for that let me know and I'll put it up on github.

beernut:
You could easily modify my perl script to wrap your program and get the desired effect.

Just remove the code here:

--- Code: ---# Try to set all the joysticks.
# Don't know of any games where the joysticks are set differently.
#
#0x0007 Joystick 1
#0x0008 Joystick 2
#0x0009 Joystick 3
#0x000a Joystick 4 - I think, I am guessing on this one.
# Add all the joysticks you have to the array below.

my @joysticks = (0x0007, 0x0008, 0x0009, 0x000a);
foreach (@joysticks) {
    my $gpwiz = gpwiz49->new($_);
    if ($gpwiz ne -1) {
$gpwiz->set_mode($modes{$gpwizmode},$jstype);
    }
}
system("/sbin/modprobe -r usbhid");
system("/sbin/modprobe usbhid");

--- End code ---

with a simple line

--- Code: ---set49mode $modes{$gpwizmode}

--- End code ---
And also remove the unnecessary line (if you are using your code):

--- Code: ---use gpwiz49;

--- End code ---
At the top.

Then you can use your code but use the rest of my scripts to automate all the choosing of modes.

However, it looks like your code only handles one joystick/gpwiz49.  It would be trivial to extend it to multiple by just adding the other product id's. 

Mark Alston

mahuti:

--- Code: ---However, it looks like your code only handles one joystick/gpwiz49.  It would be trivial to extend it to multiple by just adding the other product id's. 
--- End code ---

Hah hah. Oh yeah, it'll get there in time. Thank you for the suggestions, I'll be looking into all of it.

beernut:
How are your 49ways working out btw?  I'd recommend picking up some spares as I have had two boards fail where they the joystick would only register one direction.  Serious pain in the ass.  Fortunately swapping out the board is fairly easy and spare sticks are not too expensive right now on ebay.  I imagine as they are all NOS that will change over time though.

Apparently it is the logic chip that fails so no easy fix sadly.

mahuti:
I have one happs and one williams. Both work fine still. But they've sat dormant for MANY years, so that probably helps. I haven't used either since probably about 2010.

FYI, I managed to get the GPWiz40 + Roto-X working on the Pi as well today. I'm fine tuning the Rotary speed stuff right now... trying to find a good default speed, but it's nearly there. The joystick needs a hid quirk, but after that it's fine.

Navigation

[0] Message Index

[#] Next page

Go to full version