skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.11k stars 346 forks source link

reicast-joyconfig.py bugs #1921

Closed danboid closed 4 years ago

danboid commented 4 years ago

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

Platform Branch Hash CIDL
Installed OS and version Raspian Buster armhf / 32 bit Branch - Buster / Debian Stable Hashtag git as of 23rd August 2020 Downloaded from build site?

Raspian (Debian 10) Buster 32 bit / Ubuntu 18.04 amd64

Description of the Issue

AFAIK reicast-joyconfig.py is still the only way to configure input devices for reicast under Linux. Ideally, this script would replaced by a HUD menu in reicast similar to the one in MAME that you could show or hide by pushing TAB or something and configure input devices but until then it would be nice to have reicast-joyconfig.py working properly.

There are at least 2 bugs I'm aware of:

Debugging Steps Tested

Tried to create a working reicast joypad config using reicast-joyconfig.py

Logs Gathered

Here is the config for my pad as auto-generated by reicast git under ~/.config/reicast/mappings/evdev_USB Gamepad .cfg . This doesn't work:

[compat]
axis_trigger_left_inverted = no
axis_trigger_right_inverted = no
axis_x_inverted = no
axis_y_inverted = no

[dreamcast]
axis_trigger_left = 65536
axis_trigger_right = 65537
axis_x = 131072
axis_y = 131073
btn_a = 4
btn_b = 2
btn_c = 1
btn_d = 2048
btn_dpad1_down = 32
btn_dpad1_left = 64
btn_dpad1_right = 128
btn_dpad1_up = 16
btn_dpad2_down = 8192
btn_dpad2_left = 16384
btn_dpad2_right = 32768
btn_dpad2_up = 4096
btn_start = 8
btn_x = 1024
btn_y = 512
btn_z = 256

Here is the config for my pad as generated by reicast-joyconfig.py. This doesn't fully work:

[emulator]
mapping_name = USB Gamepad 

[dreamcast]
btn_a = 290
btn_b = 289
btn_x = 291
btn_y = 288
btn_start = 297
axis_x = 0
axis_y = 1

[compat]
axis_dpad1_x = 0
axis_dpad1_x_inverted = no
axis_dpad1_y = 1
axis_dpad1_y_inverted = no
axis_x_inverted = no
axis_y_inverted = no

Here is the fully working config, achieved by tweaking the output of reicast-joyconfig.py:

[emulator]
mapping_name = USB Gamepad 

[dreamcast]
btn_a = 290
btn_b = 289
btn_x = 291
btn_y = 288
btn_start = 297
axis_x = 0
axis_y = 1

[compat]
axis_dpad1_x = 16
axis_dpad1_x_inverted = no
axis_dpad1_y = 17
axis_dpad1_y_inverted = no
btn_trigger_left = 294
btn_trigger_right = 295
axis_x_inverted = no
axis_y_inverted = no

See https://github.com/reicast/reicast-emulator/issues/1187 for how the working config values were found.

Screenshots

N/A

danboid commented 4 years ago

I've just realised reicast now has GUI with a menu for configuring controllers but it isn't fully working for me yet so I'll have to continue to use the method decribed above and maybe open another ticket.

My new issue is that I cannot remap any controller action that has an existing value, in this case Linux evdev joypads. I click on 'MAP' but it just times out, despite me trying to map something by pushing it. I can map unassigned controls on my joypad OK.

reicast-joyconfig should prob get removed from the repo if this is actually working properly. How do I unmap controls under Linux using the UI?

danboid commented 4 years ago

OK, got it working.

Maybe the python script should be removed tho?