https://github.com/mahuti/set49modeI 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.