Menu

#543 Defining a second gamepad controls with no second gamepad, crashes dosbox.

0.74
open
nobody
None
1
2021-01-29
2021-01-27
NLS
No

DOSBox (and various downstream implementations) seems to have a problem starting, when a mapper defines a second controller but the (second) controller is not present.

It does not have the same issue when a single controller is defined, but that single controller is not present.

Example:

key_esc "stick_0 button 7" "key 27"
...works with zero or one controller.

key_esc "stick_0 button 7" "stick_1 button 7" "key 27"
....crashes with zero or one controller.

Extraneous definitions should just be ignored, I believe.

Discussion

  • Pipmick

    Pipmick - 2021-01-27

    This is a workaround but I believe you cannot map the D-Pad to P2 controller, but mapping the D-Pad to P1 is fine. Games boot then (regardless of how many controllers are connected).

     
  • Qbix

    Qbix - 2021-01-28

    Is it fixed by 4346 ? or are you using the latest code already ?

    I am not 100% with what you mean with mapping the d-pad to p2 controller. So I prefer to to "stick" to the non-working mapper lines.

     
  • Qbix

    Qbix - 2021-01-28

    I can't really reproduce the problem.
    What is the setting of the joysticktype ?
    I created a mapper file and replaced the esc key with that line that crashes according to you and started dosbox with one joystick attached.

    Which version of DOSBox (svn or 0.74-3 ?)

     
  • Pipmick

    Pipmick - 2021-01-28

    Here's how to reproduce the issue (it makes no difference in the dosbox.conf which joystick type is selected or even if left alone as auto/default joystick):

    1. Map some keyboard keys to P1 controller buttons, including some being mapped to P1's d-pad in the control mapper (CTRL+F1);
    2. Map some keyboard keys to P2 controller buttons, including some being mapped to P2's d-pad (same as above);
    3. Boot the game with no pads connected or turned on / connected = game will not boot
    4. Boot the game with only 1 joypad turned on / connected = game will not boot
    5. Boot the game with both pads turned on / connected = game DOES boot
    6. Now delete only the keys mapped to P2's d-pad in the control mapper - don't delete anything else
    7. Reboot game with 0 pads connected = game boots fine
    8. Reboot game with 1 pad connected only = game boots this time
    9. Reboot game with 2 pads connected = game boots this time

    I can work with it now I know this issue but can it be fixed more thoroughly than this workaround? As far as I know, they are the latest versions used in DOSBox 0.74r3, ECE, SVN_ECE, but I could be wrong on that.

    Cheers for the help,

    Pipmick

     

    Last edit: Pipmick 2021-01-29
  • Qbix

    Qbix - 2021-01-29

    Thank you for the steps.
    I was able to get it to crash.
    I found the problem, but I discovered some other problems as well.

     
  • Pipmick

    Pipmick - 2021-01-29

    Well, I suppose that's a good thing so they can be fixed or amended to work properly. :)

     

Log in to post a comment.