Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AltL-J key to swap (real) joystick in sdl port doesn't do anything #156

Closed
TauPan opened this issue Jan 16, 2022 · 4 comments · Fixed by #200
Closed

AltL-J key to swap (real) joystick in sdl port doesn't do anything #156

TauPan opened this issue Jan 16, 2022 · 4 comments · Fixed by #200

Comments

@TauPan
Copy link
Contributor

TauPan commented Jan 16, 2022

With recent atari800 from github 52af3c6 Nov. 6, compiled on a DevTerm (raspberry pi with arm64) via fakeroot debian/rules binary start ballblazer in atari800, with internal gamepad as /dev/input/js0 and speedlink competition pro extra usb as /dev/input/js1, moving the axis on the first joystick will always move the top player and the other one the lower player, no matter how desperate I press AltL-J.

(Instead of ballblazer 10 print stick(0), stick(1): goto 10 in basic. I guess most people will have ballblazer...)

(The use-case is of course to play boulder dash with the competition pro instead of the d-pad.)

Or is that only valid for the keybboard joystick?

@gagern
Copy link
Contributor

gagern commented Nov 19, 2023

During my work on #197 I noticed that indeed the swapping of joysticks only applies to the keyboard-emulated ones. Looking for example at the code around

if (swap_joysticks) {

you see that the keyboard input comes before, but the SDL input comes after the swap.

I have some ideas how physical joysticks could get swapped as well, and I personally believe that would make sense and shouldn't do any harm. But as #197 entails some significant code changes I'd like to see that merged first. Also I can't promise that I'll find the time to write code for this.

@mikrosk
Copy link
Member

mikrosk commented Nov 23, 2023

@gagern feel free to go ahead with this one. :-)

gagern added a commit to gagern/atari800 that referenced this issue Nov 23, 2023
This swaps all physical devices connected to the first two emulated
joysticks: the keyboard keys, the SDL devices, and the LPT devices.

After the swap the real joystick / hat setting in the UI will appear swapped
as well, but the keyboard setting won't.  Changing that would require one
more indirection.

Fixes atari800#156.
mikrosk pushed a commit that referenced this issue Nov 24, 2023
This swaps all physical devices connected to the first two emulated
joysticks: the keyboard keys, the SDL devices, and the LPT devices.

After the swap the real joystick / hat setting in the UI will appear swapped
as well, but the keyboard setting won't.  Changing that would require one
more indirection.

Fixes #156.
@joysfera
Copy link
Member

Alt-J was supposed to switch keyboard joysticks only, because physical joysticks can be simply handed over, no need to switch them in software.

@TauPan
Copy link
Contributor Author

TauPan commented Nov 25, 2023

Switching physical joysticks is hard on my devterm which has a built in d-pad but I'd prefer to use the competition pro as primary joystick. Doing so requires shenanigans with the udev devices which I failed to automate so far.

Sorry for not stating the use-case more specifically.

Edit: I guess devices running Linux with built in controllers like these did not exist or were very rare when that feature was introduced. I think now it makes a lot of sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants