Build Your Own Arcade Controls Forum
Main => Raspberry Pi & Dev Board => Topic started by: mahuti on July 06, 2020, 02:01:00 am
-
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. set49mode 5
Or to run 49-way set49mode 1
Or to do 8-way set49mode 3
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.
-
You could easily modify my perl script to wrap your program and get the desired effect.
Just remove the code here:
# 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");
with a simple line
set49mode $modes{$gpwizmode}
And also remove the unnecessary line (if you are using your code):
use gpwiz49;
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
-
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.
Hah hah. Oh yeah, it'll get there in time. Thank you for the suggestions, I'll be looking into all of it.
-
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.
-
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.
-
By the way, the work I was doing on this has been incorporated into LEDSpicer
https://github.com/meduzapat/LEDSpicer
LEDSpicer supports multiple players