Closed usergithub64 closed 2 years ago
Have you used the key mapper to map the joystick buttons? What happens when you try to do so?
In the mapper, the assigned joystick buttons are saved (they are highlighted in white), but when you press them on the joystick, nothing happens (they do not blink in the mapper).
My Logitech Dual Action Gamepad does work with the key mapper however. When I press some button on the joystick that is saved it will blink in the mapper. I have only one joystick to test at this time though. Perhaps you have more than one joysticks?
No, just one joystick.
I don’t have XBox 360 Controller Wireless to test myself, so I cannot say what exactly happened. Either it is unsupported in some way, or there is something wrong in the system configuration.
I have a wired XBox 360 controller, and here on Linux it seems to work just fine, except for some reason SDL1 is mapping LT as one of the axises of the second analog joystick.
I don't quite have an XBox 360 Controller Wireless. I have a Sony Dualshock 3 connected via Bluetooth to a PC via program SCP Server, it works like an XBox 360 Controller in XInput mode. All games under Windows 10 x64 work fine. Also it works fine in DOSBox-Staging v0.75.0, DOSBox ECE r4356, DOSBox SVN-Daum, 86Box.
By the way, in the game Paratrooper (1982), if you play with a joystick, then the muzzle of the cannon does not turn completely to the right. This is observed in DOSBox-Staging v0.75.0, DOSBox ECE r4356, DOSBox SVN-Daum, 86Box, both on Sony Dualshock 3 and on the original XBox 360 Controller Wireless. I used to have the original XBox 360 Controller Wireless. Also in the game Digger (1983), if played with a joystick, then Digger also does not go to the right. Is it something to do with joystick calibration or is there a problem in emulating DOSBox or 86Box joysticks?
@maximus105 Try setting the timed= setting under the joystick section to true or false and see if that helps.
Hello,
I have the same problem with an XBOX360 controller which is connected via USB. I also tried both timed settings in the joystick section, but it doesn't work. In the previous version (DOSBox-X 0.83.3 x64 SDL1) the controller was recognized and worked without problems.
Environment:
Windows 10 Home x64 Version 1909 DOSBox-X 0.83.4 x64 SDL1
@Condor-2-4-2 I cannot think of any changes between 0.83.3 and 0.83.4 that may be related to joystick handling at this time. And the joystick I have works fine even with the latest code. If possible, can you check since which commit (between 0.83.3 and 0.83.4) that your controller becomes unrecognized?
Are there binary packages of versions between 0.83.3 and 0.83.4? I cannot compile from source code by myself.
I have tested DOSBox-X 0.83.4 x64 SDL2 just now with my controller and here it works. The input of the buttons and sticks are also shown in the mapper.
Have you tested DOSBox-X 0.83.4 x64 SDL1 with your wired XBOX360 controller also under Windows 10?
So your issue is more related to SDL1 vs SDL2 I think. For me both SDL1 and SDL2 builds of DOSBox-X 0.83.4 work for my Logitech gamepad under Windows 10. On the other hand, there are no binary packages of versions between 0.83.3 and 0.83.4 at this time (which need to be compiled manually), and I really don't think there are changes between 0.83.3 and 0.83.4 that are directly related to joystick handling.
@maximus105 Try setting the timed= setting under the joystick section to true or false and see if that helps.
No, it didn't help. When set to timed = false, the cannon muzzle does not turn completely to the right, and when timed = true, it does not turn completely to the left.
I checked the joystick again. In DOSBox-X v0.83.3, the joystick works in both SDL1 and SDL2. In DOSBox-X v0.83.4 the joystick works in SDL2, but in SDL1 it does not work at all. And in SDL2 in the mapper on AXIS 3/4, "X-" the the strip is completely full is always lit with bright white.
@maximus105 I think I see the problem with SDL1. I believe you are using a non-US keyboard layout, and with "usescancodes" set to "auto" (the new default) in such case the joystick did not work in SDL1 build. Try setting "usescancodes" to "false" and see if it makes a difference. I did not use a non-US keyboard layout and that is why it worked for me in both SDL1 and SDL2 builds.
@Wengier I have set usescancodes = true. The joystick now works in SDL1. Also the joystick works in SDL1 with usescancodes = false. And in SDL2 in the mapper on AXIS 3/4, "X-" the the strip is completely full is always lit with bright white.
@maximus105 The setting "usescancodes=auto" does dynamic switching between "true" and "false" at run-time (instead of only at start), but it should be an easy fix for joystick. As for the issue with SDL2, I will check that.
@maximus105 I just tried the mapper in SDL2 build, and "X-" on AXIS 3/4 looks fine here. Perhaps it is related to some setting on your computer.
I have already fixed the said issue in SDL1 build as part of my latest pull request.
Can you test Paratrooper (1982) and Digger (1983) games on your controller? I never managed to get the joystick to work properly in these games. I've tried changing the value of timed = true / false. No, it didn't help. When set to timed = false, the cannon muzzle does not turn completely to the right, and when timed = true, it does not turn completely to the left. In Digger, moving the joystick to the right does not work either. Although in Shamus the joystick works correctly with the default settings for joystick in the .conf file.
I just tried it on Linux myself.
When I connect a PS4 controller (via USB, did not try Bluetooth), I can see the controller listed with lsusb.
Bus 003 Device 008: ID 054c:09cc Sony Corp. DualShock 4 [CUH-ZCT2x]
When I then start DOSBox-X, I see the following in the log:
LOG: One joystick reported, initializing with 4axis
LOG: Using joystick Sony Interactive Entertainment Wireless Controller with 6 axes, 13 buttons and 1 hat(s)
And starting a game with joystick support, it works fine.
However, when I instead connect a xbox360 wireless controller (again over USB), I can see the controller listed with lsusb.
Bus 003 Device 007: ID 045e:028f Microsoft Corp. Xbox360 Wireless Controller
But when I start DOSBox-X, there is no mention that a joystick is found. When I plug both the PS4 and xbox360 controller in at the same time, it only reports the PS4 controller.
Running the Mapper Editor, I can map keys to the PS4 controller, but not to the xbox360 controller.
I compiled https://gitlab.com/sdl-jstest/sdl-jstest
and running sdl-jstest --list
and sdl2-jstest --list
also only finds the PS4 controller.
After some more googling, I found the reason. The xbox360 wireless controller does not work when plugged in over USB. The USB cable is for charging only, even though it identifies itself. To use a xbox360 wireless controller on a PC (Linux or Windows) you must use the proprietary Xbox 360 Gaming Receiver USB dongle. The xbox360 wired controller will instead work just fine.
I have started creating a draft wiki page for Joystick support, in case there are any suggestions on things to add/change... https://github.com/Wengier/dosbox-x-wiki/wiki/Guide%3ASetting-up-joysticks-in-DOSBox%E2%80%90X
I connected a Dualshock 4 gamepad via bluetooth to my PC using DS4WINDOWS software. The gamepad works like an XBox 360 Controller. And checked in DOSBox-X v0.83.5 games Paratrooper (1982), Digger (1983), Buck Rogers Planet Of Zoom (1984), Shamus (1984). Only Shamus game works fine on a gamepad. Can you test the games Paratrooper (1982), Digger (1983), Buck Rogers Planet Of Zoom (1984) on your controller? I have not been able to get the joystick to work properly in these games. I've tried changing the value of timed = true / false. No, it didn't help. When timed = false, the muzzle of the cannon does not rotate fully to the right, and when timed = true, it does not rotate fully to the left. In Digger, you can't move the joystick to the right either. In Buck Rogers, the spaceship goes constantly to the left. Although in Shamus the joystick works correctly with the default joystick settings in the .conf file.
I just tried Paratrooper with a wireless DS4 controller on Linux. A few things I immediately noticed.
I then disconnected the controller, and connected it directly via USB and restarted DOSBox-X and the game. It behaved exactly the same. And as another test, I tried a DS3 controller, and again the game behaved the same.
I then changed joysticktype=
from auto to 2axis, and that solved the auto-start issue. But the other issue remained.
I did not notice any barrel rotation range issue, compared to the keyboard.
Compared to the keyboard, the joystick is much easier and more convenient to play in Paratrooper, since you can hold down the fire key and just move the gun muzzle left / right. And you can't do that on the keyboard, why, when firing, the muzzle of the gun stops immediately. The whole point boils down to playing on the joystick. But because of these problems with turning the gun barrel not completely to the right, it is impossible to play on the joystick. I remember that the joystick worked fine in Paratrooper only on a real 8088 XT 4.77 MHz machine, when I still had this machine.
Some more testing with Paratrooper
timed=true
(default), I have the issue that the controller drifts all the way to the right, requiring counter steering. But I have the full range.timed=false
, the drift issue is gone, but I have the range issue on the right, where I cannot turn the gun barrel all the way. But when you let go of the controls, it also does not centre the gun barrel properly, it is rotated one 'unit' to the left, and I think these 2 issues are related.I have added some more text on the draft wiki page to hopefully explain the different options better: https://github.com/Wengier/dosbox-x-wiki/wiki/Guide%3ASetting-up-joysticks-in-DOSBox%E2%80%90X
Paratrooper with joystick_type=2axis
and timed=false
Max range left
Max range right
auto centred
As you mentioned, the cannon range right is less then left. And the cannon does not centre properly when you let go of the stick.
Running JOYCHECK.EXE inside DOSBox-X also shows that the calibration is off. You can perform calibration inside JOYCHECK (just press "j" and "i"), but that is not retained when you exit the program. It also seems like the calibration problem that JOYCHECK is showing is contrary to that experienced by Paratrooper (unless it is being mirrored)
TMSCOPE.EXE instead seems to show perfect calibration.
Since Paratrooper is a very old DOS game, meant for the XT, I thought that perhaps its joystick routines may have some timing issue when run too fast. So I tried setting cycles=245
(and also tried core=normal
), but it made no difference.
I found that Paratrooper also auto-starts the game if 2 joysticks are attached, and it's running in 2axis mode. So for game-specific config files it would be nice if you could specifically disable one of the joysticks.
I had a look at J-Bird, a slightly later game from the same developer (and publisher). It adds a joystick calibration option to the menu, and with timed=false
and using the calibration option, the game works (no need for joystick_type=2axis
). So I'm guessing the Paratrooper game is just a bit buggy with regards to the Joystick, and the developer fixed the problems with his next game.
I also tried "PC-Man", which is another 1982 game from the same developer. It also has serious joystick problems. with the default timed=true
you suffer major drift to the right (just like Paratrooper), with timed=false
that issue is solved, but you can no longer go right. Setting joystick_type=
seems to have no effect.
If we assume that only the developer of these games has problems with the joystick, then why then the games: Digger (1983), Rollo And The Brush Bros (1984), Buck Rogers Planet Of Zoom (1984) also have problems with the joystick. These are games from another developers.
Are there resident programs to calibrate the joystick so that they can be applied in DOSBox-X and 86Box? Where can I download them? With preservation of the calibration state in MS-DOS. For example, the Digger game works very poorly with a joystick. I would like to try to calibrate the joystick and see if that helps.
@maximus105 Can you try the joystick test programs linked below? They are DOS programs that run in DOSBox-X, and you are also able to calibrate the joystick with them, although they are not resident programs.
If both of these changes are accepted then OOBE will be better for XInput devices:
Otherwise, to fix the triggers being mapped to right stick and have both joysticks each mapped to a thumbstick (which makes way more sense IMO), do the following:
SDL1:
[joystick]
joy1axis2=3
joy1axis3=2
SDL2:
[joystick]
joy1axis2=4
joy1axis4=2
I have a USB converter from NGC to USB and it has a PC switch and WiiU/Switch. In it I have I can play old PC 95/98/XP games played natively on the PC (Windows 11) without a virtual machine without problems as if it were a period control, but DOSBOX is impossible
Describe the bug Joystick (XBox 360 Controller Wireless) does not work at all in DOSBox-X with standard configuration, while in DOSBox-Staging v0.75.0, DOSBox ECE r4356, DOSBox SVN-Daum everything works fine.
Environment (please complete the following information):