ControlBlock Joystick configuration
-
When you run jstest, do the values for UP, DOWN, RIGHT, LEFT change when you move the joystick?
-
@petrockblog Yes.
Also, the joysticks(s) with MAME works perfectly.
The problem is when using it for emulators/games that uses the joystick directly, such as Daphne, ScummVM, Prince of Persia Port... -
Did a change switching the axis and one axis in ControlBlock driver: https://github.com/petrockblog/ControlBlockService2/pull/15
This fixed the issue.
-
Thanks for the pull request. These are always most welcome :-)
-
I just re-installed the binarys and the service, which fixed another issue (the "3 minute shutdown bug").
Unfortunately the joystick axis is still messed up in Daphne:Up is Right
Down is Left
Right is Up
Left is DownThe Joystick works perfectly in every other Retroarch emulator.
Any ideas? -
Can/should I edit the ArcadeGamepad.cpp like darkav did and re-compile the driver?
I'm not sure that would help, since darkav stated that in his case "left was up and so on".
But in my case left is down.I'm really stumped with this one...
-
You might want to try and revert the changes from the changes https://github.com/petrockblog/ControlBlockService2/pull/15/files. There, the X and Y axes were essentially flipped.
You can re-compile and re-install the driver with
make
,sudo make install
, andsudo make install service
then. Note that the config file at/etc/controlblockconfig.cfg
is reset with the installation. -
@petrockblog
It worked! This fixed my issue!
Now I have to remember to never, ever do a driver update... ;)
Thank you! -
Glad to hear!
-
I wondered why did you exchanged the axes configuration?
Before the changes - all directions were matching the description on the ControlBlock board and the atari800 emulator was working fine.
Now I updated the ControlBlock software and the axes are swapped and atari800 does not work anymore. -
I have just checked that atari800 uses (in a correct way) the SDL library to get joystick position.
I also assume that SDL has a correct implementation (proven in many project):
https://www.libsdl.org/release/SDL-1.2.15/docs/html/sdljoystickgetaxis.html
https://www.libsdl.org/release/SDL-1.2.15/docs/html/guideinput.html
This means that your change was breaking compatibility not only with atari800 but with all games using the SDL library!
Sorry guys, but a proper place to fix your problem was your buggy Daphne emulator... -
Thanks for pointing to the SDL reference documentation. I was not aware of that and I agree that SDL compatibility is more important. Daphne should fix this in the emulator. I have just merged your pull request.
-
@montezuma nps. I will keep my fork with the changes :D Just pointing out that the "issue" was not only on Daphne (I remember also scummvm, some ports having exaclty the same issue) so not sure now where exactly is the problem....
-
@darkav
Sure you can keep the "Daphne" specific fork of the ControlBlock driver. This is the advantage of open source software and github.
But again - the driver is a wrong place to make an emulator specific fix!If you don't believe the SDL documentation, you can just run a test, which I run 5 minutes ago:
- Quit the emulation station (F4)
- List input devices (ls /dev/input) - you should see js0 and js1 (Controlblock joysticks)
- Connect any USB gamepad to the Raspberry Pi (fox example USB versions of the NES/SNES gamepads)
- List input devices again (ls /dev/input) - this time you will see a new device: js2
- run jstest to see how the original Linux driver works:
jstest /dev/input/js2 - You will see the following:
LEFT - AXIS 0: -32767
RIGHT - AXIS 0: 32767
UP - AXIS 1: -32767
DOWN - AXIS 1: -32767
This is exaclty the same that the ControlBlock driver does now and should do!
I hope this finally convinced everybody.
-
@darkav
When I look at your first post again, I think you wiring may be wrong... -
I looked at Daphne source code. It uses SDL correctly.
input.cpp
void process_joystick_motion(SDL_Event *event)Now it is obvious for me that darkav issues are related to his setup (most probably wrong wiring). It is a pity that instead of double checking the hardware, he spoiled the driver, causing problems for all other users...
-
@montezuma said in ControlBlock Joystick configuration:
I looked at Daphne source code. It uses SDL correctly.
input.cpp
void process_joystick_motion(SDL_Event *event)Now it is obvious for me that darkav issues are related to his setup (most probably wrong wiring). It is a pity that instead of double checking the hardware, he spoiled the driver, causing problems for all other users...
Wiring is correct. It's a pity you assumed I didn't double check the hardware.
Next step (even if unlikely the problem is on it) is to check the board.Also, I did a PR which has been reviewed and merged by the author of the driver ...it's very unpolite to say that "I spoiled the driver".
-
Thanks to all for providing more insights into this issue. I hope that we have a better understanding of it now and can use the driver as it is now :-)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.