gsplus icon indicating copy to clipboard operation
gsplus copied to clipboard

Joystick button's don't register on some platforms

Open AaronBPaden opened this issue 9 years ago • 4 comments

For the SDL and Linux joystick drivers, the button detection code is in joystick_update rather than joystick_update_buttons. At least on my machine, this results in buttons not actually working.

I didn't look too deeply into why that's the case because I saw the empty functions and just assumed that they hadn't been implemented yet. Throwing the SDL code at the top so it has precedence over the Linux code and implementing joystick_update_buttons fixed the issue for me.

For the SDL driver, you can just cut and paste the button code from joystick_update to get the same effect. Looking at the code, it doesn't look like multiple joysticks are supported in the Linux driver, and I wonder if there's any reason to keep it over the SDL driver?

Actually, it looks like supporting two gamepads in the SDL driver would be trivial, but I don't actually have a second gamepad to test. At that point, all that platform-specific code could be dropped, unless I'm missing something.

AaronBPaden avatar Jan 03 '17 16:01 AaronBPaden

Thanks for reporting this.

Yes, the joystick support just needs a little attention to be a lot better.

Current idea is to do the following: Fix multiple joystick support and simultaneously add configuration for your SDL input devices Also add support for the new 4Play joystick adapter

The empty functions and many other things need to be resolved. I'll look into what's happening on Linux ASAP, because it sounds like I've done something quite dumb/sloppy there. I would like very much to deprecate all the platform specific stuff, and eventually I will.

I'm just now getting back to this project and will try to have some updates shortly.

Thanks again for reporting this.

digarok avatar Jan 20 '17 05:01 digarok

i had this happen on a Pi SDL build. took a different tack, added joystick checks in the SDL event loop that call joystick_update(). will put it on a branch after it's verified some more. ultimately i want to see joysticks work in RetroPie.

rhaleblian avatar Sep 04 '21 17:09 rhaleblian

this fix will only be for SDL, i'm ignoring the non-SDL win32 and linux codepaths.

rhaleblian avatar Sep 04 '21 17:09 rhaleblian

what i did feel wrong, as it bypasses IO emulation. i'll try writing to 0x070 and let moremem.read_io() service the event...

hanging this here, it refers a leetle bit to ports and pinouts. http://www.applelogic.org/files/IIE2IIGS.pdf

rhaleblian avatar Sep 04 '21 19:09 rhaleblian