laamaa / m8c

Cross-platform M8 tracker headless client
Other
377 stars 80 forks source link

New gamecontrollerdb.txt causes button presses to do nothing on Anbernic RG351v #118

Closed joedski closed 1 year ago

joedski commented 1 year ago

Issue: on the latest revision, m8c will launch, connect to the headless Teensy, and show the UI; but button presses will do nothing.

Other discovery: The update to gamecontrollerdb.txt in commit c16e507cbccc207373997181781754e73465fb0d seems to be what cause button presses to do nothing. However, I haven't done any work on figuring out what line or lines in that file caused this issue.

Workaround: Checking out the old version of gamecontrollerdb.txt fixes the issue, and copying that older version into the m8c SDL config dir at ~/.local/shared/m8c/ means subsequent updates to that file won't break things.

Not sure how much we want to care about this here, but I figured I'd at least put in an issue so it's captured somewhere.

laamaa commented 1 year ago

I seemed to mess up updating the DB previously as the file contained HTML characters. It should be the correct file now.

joedski commented 1 year ago

Finally got around to seeing if the new controllerdb works on my RG351v and unfortunately it does not. This time through the magic of "actually reading stderr" I noticed that m8c didn't find a controller on the new db file, but it did in the older one.

From stderr when using the old file:

INFO: Trying to open game controller database from /home/ark/.local/share/m8c/gamecontrollerdb.txt
INFO: Found 180 game controller mappings
INFO: Controller 1: OpenSimHardware OSH PB Controller
INFO: Enabling and resetting M8 display
(...)

And from the new one:

INFO: Trying to open game controller database from /roms/ports/M8/_m8c/gamecontrollerdb.txt
INFO: Found 369 game controller mappings
(... note that no controller name is printed this time)
INFO: Enabling and resetting M8 display
(...)

Looking at the diff, the controller named OpenSimHardware OSH PB Controller was indeed removed, and can be readded trivially:

cat >> gamecontrollerdb.txt <<END
#RG351M, RG351P, and RG351V
03000000091200000031000011010000,OpenSimHardware OSH PB Controller,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0~,lefty:a1~,guide:b12,leftstick:b8,lefttrigger:b10,rightstick:b9,back:b7,start:b6,rightx:a2,righty:a3,righttrigger:b11,platform:Linux,
END

I'm not sure why whoever updated the controller DB removed those controllers (among many others) from it but at least Anbernic users can just checkout the old file and leave it at that, rather than rooting around for their specific config to copy it forth to the new one.

# from in the m8c repo
git checkout c16e507cbccc207373997181781754e73465fb0d^ -- gamecontrollerdb.txt
# make the old one our default
cp gamecontrollerdb.txt ~/.local/shared/m8c/