mupen64plus / mupen64plus-input-sdl

Input plugin for Mupen64Plus v2.0 project using SDL. This is derived from the original Mupen64 blight_input plugin.
GNU General Public License v2.0
43 stars 70 forks source link

m64py crashes when saving input-config #40

Closed Sur3 closed 7 years ago

Sur3 commented 7 years ago

Hello i've got an "Unhandled Python exception" when saving the input config with my Msonic Gamepad as input device set. Saving a Mouse/Keyboad config works, and when selecting my Gamepad i can even set the keys, but when trying to exit the input plugin it crashes, probably due to an error saving the config, probably it has problems with the device's name? Because other emulators list it as "Microntek USB Joystick " but mupen64-input-sdl lists it as Joystick 0 (b'Microntek USB Joystick ') or what's the b after the bracket standing for?

Greets sur3

PS: I'm using version 2.5.

richard42 commented 7 years ago

Apparently the "b" means that it's a 7-bit ASCII string:

stackoverflow

Sur3 commented 7 years ago

"Apparently the "b" means that it's a 7-bit ASCII string" Ah so it's normal the gui of the input plugin shows that as the devices name?!? Shouldn't it just be an internal representation hidden from the actual user? I think there is something wrong with the representation of the devices name when it shows internal representation-things to the user, so I suppose that could be the reason it crashes during save, because it cant handle the devices name, or do you think the error occurs somewhere else?!?

PS: My workaround for the time being is using antimicro ( https://github.com/AntiMicro/antimicro ) to map my gamepad-keys to a virtual keyboard mapping, but that way the analog controls are really digital, so i hope the issue can be resolved somehow.

richard42 commented 7 years ago

Actually this is not the input plugin's fault, it contains no python code. This does seem to be a defect in the m64py front-end GUI application. You should file the bug there.

Sur3 commented 7 years ago

Can i confirm it's really only the frontend, by using mupen64 with the input plugin from the terminal to verify it works then somehow?

Sur3 commented 7 years ago

Ok after manually adding the following to the InputAutoCfg.ini I can play with the controller:

[Microntek              USB Joystick          ]
plugged = True
plugin = 5
mouse = False
AnalogDeadzone = 2048,2048
AnalogPeak = 32768,32768
DPad R = hat(0 Right)
DPad L = hat(0 Left)
DPad D = hat(0 Down)
DPad U = hat(0 Up)
Start = button(9)
Z Trig = button(5)
B Button = button(3)
A Button = button(2)
C Button R = axis(2+)
C Button L = axis(2-)
C Button D = axis(3+)
C Button U = axis(3-)
R Trig = button(7)
L Trig = button(6)
Mempak switch = key(44)
Rumblepak switch = key(46)
X Axis = axis(0-,0+)
Y Axis = axis(1-,1+)

I didn't optimize the AnalogDeadzone or -Peak though yet and I also had to manually modify the mupen64plus.cfg. So that bug seemes to be really gui-related.